diff options
author | Kunal Agrawal <kunala@nvidia.com> | 2013-04-08 18:22:25 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:23:41 -0700 |
commit | 588074b93087ab4917e0b2a05779e6f2c7c1c113 (patch) | |
tree | 08c9f3685e5026de7107650df3cb26a90f36f0f7 /drivers/dma | |
parent | 54bf0aa19bfd46e145391503329565fbc57c65f3 (diff) |
dma: tegra: support registration of device through board file
Bug 1260656
Change-Id: I7cbe98fd7587874e79f4de00d46a3a206891753d
Signed-off-by: Kunal Agrawal <kunala@nvidia.com>
Reviewed-on: http://git-master/r/217370
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: Manoj Gangwal <mgangwal@nvidia.com>
Diffstat (limited to 'drivers/dma')
-rw-r--r-- | drivers/dma/tegra20-apb-dma.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/drivers/dma/tegra20-apb-dma.c b/drivers/dma/tegra20-apb-dma.c index f1a2dba11a64..c5e8939d427b 100644 --- a/drivers/dma/tegra20-apb-dma.c +++ b/drivers/dma/tegra20-apb-dma.c @@ -1283,9 +1283,19 @@ static const struct tegra_dma_chip_data tegra148_dma_chip_data = { .support_separate_wcount_reg = true, }; +static const struct tegra_dma_chip_data tegra124_dma_chip_data = { + .nr_channels = 32, + .channel_reg_size = 0x40, + .max_dma_count = 1024UL * 64, + .support_channel_pause = true, + .support_separate_wcount_reg = true, +}; static const struct of_device_id tegra_dma_of_match[] = { { + .compatible = "nvidia,tegra124-apbdma", + .data = &tegra124_dma_chip_data, + }, { .compatible = "nvidia,tegra148-apbdma", .data = &tegra148_dma_chip_data, }, { @@ -1303,6 +1313,29 @@ static const struct of_device_id tegra_dma_of_match[] = { MODULE_DEVICE_TABLE(of, tegra_dma_of_match); #endif +static struct platform_device_id tegra_dma_devtype[] = { + { + .name = "tegra20-apbdma", + .driver_data = (unsigned long)&tegra20_dma_chip_data, + }, + { + .name = "tegra30-apbdma", + .driver_data = (unsigned long)&tegra30_dma_chip_data, + }, + { + .name = "tegra114-apbdma", + .driver_data = (unsigned long)&tegra114_dma_chip_data, + }, + { + .name = "tegra148-apbdma", + .driver_data = (unsigned long)&tegra148_dma_chip_data, + }, + { + .name = "tegra124-apbdma", + .driver_data = (unsigned long)&tegra124_dma_chip_data, + }, +}; + static int tegra_dma_probe(struct platform_device *pdev) { struct resource *res; @@ -1322,7 +1355,7 @@ static int tegra_dma_probe(struct platform_device *pdev) cdata = match->data; } else { /* If no device tree then fallback to tegra20 */ - cdata = &tegra20_dma_chip_data; + cdata = (struct tegra_dma_chip_data *)pdev->id_entry->driver_data; } tdma = devm_kzalloc(&pdev->dev, sizeof(*tdma) + cdata->nr_channels * @@ -1586,6 +1619,7 @@ static struct platform_driver tegra_dmac_driver = { }, .probe = tegra_dma_probe, .remove = tegra_dma_remove, + .id_table = tegra_dma_devtype, }; module_platform_driver(tegra_dmac_driver); |