[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXMxVK5nGjeO1wGX@smile.fi.intel.com>
Date: Fri, 23 Jan 2026 10:29:08 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: abdurrahman@...thop.ai
Cc: Michal Simek <michal.simek@....com>, Andi Shyti <andi.shyti@...nel.org>,
linux-arm-kernel@...ts.infradead.org, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 1/5] i2c: xiic: make the clock optional
On Fri, Jan 23, 2026 at 08:02:44AM +0000, Abdurrahman Hussain via B4 Relay wrote:
> The xiic driver is designed to operate without explicit clock configuration
> when clocks are not specified in the firmware. This functionality is
> already implemented in xiic_setclk(), which performs an early return when
> either i2c_clk or input_clk are zero:
>
> This condition is satisfied when clocks are missing, as clk_get_rate(NULL)
> returns zero, allowing the driver to rely on hardware-configured timing.
...
> mutex_init(&i2c->lock);
> spin_lock_init(&i2c->atomic_lock);
>
> - i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
> + i2c->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
You also need to have
struct device *dev = &pdev->dev;
in *this* patch.
> if (IS_ERR(i2c->clk))
> return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
> "failed to enable input clock.\n");
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists