Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: tegra: Add GPCDMA support

Enable support for GPCDMA, which is used in I2C controllers
in Tegra 186 and above. The chips before that used APB DMA.
This change works under the presumption that all chips apart from
those supporting APB DMA is using GPCDMA.

Signed-off-by: Akhil R <akhilrajeev@nvidia.com>
Reviewed-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>

authored by

Akhil R and committed by
Wolfram Sang
48cb6356 03d4287a

+8 -3
+8 -3
drivers/i2c/busses/i2c-tegra.c
··· 443 443 u32 *dma_buf; 444 444 int err; 445 445 446 - if (!i2c_dev->hw->has_apb_dma || i2c_dev->is_vi) 446 + if (i2c_dev->is_vi) 447 447 return 0; 448 448 449 - if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) { 450 - dev_dbg(i2c_dev->dev, "DMA support not enabled\n"); 449 + if (!i2c_dev->hw->has_apb_dma) { 450 + if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) { 451 + dev_dbg(i2c_dev->dev, "APB DMA support not enabled\n"); 452 + return 0; 453 + } 454 + } else if (!IS_ENABLED(CONFIG_TEGRA186_GPC_DMA)) { 455 + dev_dbg(i2c_dev->dev, "GPC DMA support not enabled\n"); 451 456 return 0; 452 457 } 453 458