Thread (20 messages) 20 messages, 3 authors, 2025-11-06

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

From: Jon Hunter <jonathanh@nvidia.com>
Date: 2025-10-28 16:14:21
Also in: linux-i2c, linux-tegra, lkml

On 28/10/2025 12:54, Akhil R wrote:
On Fri, 24 Oct 2025 16:42:06 +0100, Jon Hunter wrote:
quoted
On 01/10/2025 07:47, Kartik Rajput wrote:
quoted
   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?
I was thinking we could define a tegra264_i2c_algo but I guess we need 
another if condition at some point some where. So let's leave as-is for now.

Jon

-- 
nvpublic
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help