[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251028130820.52188-1-akhilrajeev@nvidia.com>
Date: Tue, 28 Oct 2025 18:38:20 +0530
From: Akhil R <akhilrajeev@...dia.com>
To: <jonathanh@...dia.com>
CC: <akhilrajeev@...dia.com>, <andi.shyti@...nel.org>, <conor+dt@...nel.org>,
<devicetree@...r.kernel.org>, <digetx@...il.com>, <kkartik@...dia.com>,
<krzk+dt@...nel.org>, <ldewangan@...dia.com>, <linux-i2c@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-tegra@...r.kernel.org>,
<robh@...nel.org>, <thierry.reding@...il.com>
Subject: Re: [PATCH v9 1/4] i2c: tegra: Do not configure DMA if not supported
On Tue, 28 Oct 2025 10:41:54 +0000 Jon Hunter wrote:
> On 28/10/2025 10:00, Akhil R wrote:
>> On Fri, 24 Oct 2025 16:20:09 +0100, Jon Hunter wrote:
>>> On 01/10/2025 07:47, Kartik Rajput wrote:
...
>>>> diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
>>>> index e533460bccc3..aa7c0d8c0941 100644
>>>> --- a/drivers/i2c/busses/i2c-tegra.c
>>>> +++ b/drivers/i2c/busses/i2c-tegra.c
>>>> @@ -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");
>>>
>>> What about ACPI based devices?
>>
>> The of_ function returns false if using ACPI. Since these DMA drivers does
>> not support ACPI enumeration currently, we would not require to proceed
>> further anyway. But if required we can add an additional check with
>> acpi_dma_supported() or similar. Do you suggest adding a check for ACPI?
>
> I was just wondering if it is better to use fwnode_property_present()
> instead.
I think ACPI does not use 'dmas' property to connect a DMA resource.
It uses FixedDMA or something similar. It may not be helpful to use
fwnode_*() or device_*() check here in that case.
Regards,
Akhil
Powered by blists - more mailing lists