Skip to content

Commit

Permalink
i2c: tegra: Add GPCDMA support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Akhil R authored and wsakernel committed Sep 16, 2022
1 parent 03d4287 commit 48cb635
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/i2c/busses/i2c-tegra.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,11 +443,16 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
u32 *dma_buf;
int err;

if (!i2c_dev->hw->has_apb_dma || i2c_dev->is_vi)
if (i2c_dev->is_vi)
return 0;

if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) {
dev_dbg(i2c_dev->dev, "DMA support not enabled\n");
if (!i2c_dev->hw->has_apb_dma) {
if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) {
dev_dbg(i2c_dev->dev, "APB DMA support not enabled\n");
return 0;
}
} else if (!IS_ENABLED(CONFIG_TEGRA186_GPC_DMA)) {
dev_dbg(i2c_dev->dev, "GPC DMA support not enabled\n");
return 0;
}

Expand Down

0 comments on commit 48cb635

Please sign in to comment.