Thread (6 messages) 6 messages, 4 authors, 2026-01-21

Re: [PATCH] i2c: xiic: add ACPI support

From: Andy Shevchenko <hidden>
Date: 2026-01-21 08:36:12
Also in: linux-i2c, lkml

On Thu, Jan 15, 2026 at 12:28:46AM +0000, Abdurrahman Hussain wrote:
Use generic device property accessors.
Make the clock optional assuming it's managed by firmware.
The generalisation parts are okay in a sense for prototyping, for ACPI-based
platforms, we want to see the proper _HID allocated by a platform vendor
(and maybe accompanied _CID allocated by the IP vendor).

Also you need to reshuffle header inclusions (removing of* and adding proper
headers following IWYU principle).

...

Add

	struct device *dev = &pdev->dev;

to the top of the function and use it everywhere.
 	i2c->adap.dev.of_node = pdev->dev.of_node;
+	ACPI_COMPANION_SET(&i2c->adap.dev, ACPI_COMPANION(&pdev->dev));
Instead of two lines, switch to

	device_set_node(...);

...
-	i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
+	i2c->clk = devm_clk_get_optional_enabled(&pdev->dev, NULL);
 	if (IS_ERR(i2c->clk))
 		return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
 				     "failed to enable input clock.\n");
This needs to be in the separate change explaining why this is okay to go with.

-- 
With Best Regards,
Andy Shevchenko


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