Skip to content

Commit b53232f

Browse files
Kartik RajputWolfram Sang
authored andcommitted
i2c: tegra: Do not configure DMA if not supported
On Tegra264, not all I2C controllers have the necessary interface to GPC DMA, this causes failures when function tegra_i2c_init_dma() is called. Ensure that "dmas" device-tree property is present before initializing DMA in function tegra_i2c_init_dma(). Signed-off-by: Kartik Rajput <kkartik@nvidia.com> Reviewed-by: Jon Hunter <jonathanh@nvidia.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
1 parent f8f9c1f commit b53232f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

drivers/i2c/busses/i2c-tegra.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,11 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
449449
if (IS_VI(i2c_dev))
450450
return 0;
451451

452+
if (!of_property_present(i2c_dev->dev->of_node, "dmas")) {
453+
dev_dbg(i2c_dev->dev, "DMA not available, falling back to PIO\n");
454+
return 0;
455+
}
456+
452457
if (i2c_dev->hw->has_apb_dma) {
453458
if (!IS_ENABLED(CONFIG_TEGRA20_APB_DMA)) {
454459
dev_dbg(i2c_dev->dev, "APB DMA support not enabled\n");

0 commit comments

Comments
 (0)