Commit b53232fd authored by Kartik Rajput's avatar Kartik Rajput Committed by Wolfram Sang
Browse files

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: default avatarKartik Rajput <kkartik@nvidia.com>
Reviewed-by: default avatarJon Hunter <jonathanh@nvidia.com>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent f8f9c1f4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -449,6 +449,11 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev)
	if (IS_VI(i2c_dev))
		return 0;

	if (!of_property_present(i2c_dev->dev->of_node, "dmas")) {
		dev_dbg(i2c_dev->dev, "DMA not available, falling back to PIO\n");
		return 0;
	}

	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");