Re: [PATCH v9 3/4] i2c: tegra: Add support for SW mutex register

Akhil R
2025-10-28T12:55:11Z

On Fri, 24 Oct 2025 16:42:06 +0100, Jon Hunter wrote:
> On 01/10/2025 07:47, Kartik Rajput wrote:
>> static void tegra_i2c_mask_irq(struct tegra_i2c_dev *i2c_dev, u32 mask)
>> {
>> u32 int_mask;
>> @@ -1432,6 +1512,10 @@ static int tegra_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],
>> return ret;
>> }
>>
>> + ret = tegra_i2c_mutex_lock(i2c_dev);
>> + if (ret)
>> + return ret;
>> +
>>
>> I wonder if it would be better to have a wrapper function around
>> tegra_i2c_xfer() called tegra264_i2c_xfer() that is only used for
>> Tegra264 platforms and invokes these sw-mutex functions?

Wouldn't this only add another 'if' condition to tegra_i2c_xfer()?
And probably making it more complex? Or am I missing something?

Regards,
Akhil