Skip to content

Commit dd0422e

Browse files
abdurrahman-nexthopAndi Shyti
authored andcommitted
i2c: xiic: skip input clock setup on non-OF systems
Currently Linux does not implement ACPI ClockInput() resource to describe clocks, unlike DT. However the xiic driver is happy if something magically enables the clock before the driver probes, and does not turn it off again. The clock should always be considered optional for ACPI. Signed-off-by: Abdurrahman Hussain <abdurrahman@nexthop.ai> Signed-off-by: Andi Shyti <andi.shyti@kernel.org> Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-7-b6c9ce4e4f3c@nexthop.ai
1 parent 91430a8 commit dd0422e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

drivers/i2c/busses/i2c-xiic.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,10 +1464,12 @@ static int xiic_i2c_probe(struct platform_device *pdev)
14641464

14651465
spin_lock_init(&i2c->atomic_lock);
14661466

1467-
i2c->clk = devm_clk_get_enabled(&pdev->dev, NULL);
1468-
if (IS_ERR(i2c->clk))
1469-
return dev_err_probe(&pdev->dev, PTR_ERR(i2c->clk),
1470-
"failed to enable input clock.\n");
1467+
if (is_of_node(fwnode)) {
1468+
i2c->clk = devm_clk_get_enabled(dev, NULL);
1469+
if (IS_ERR(i2c->clk))
1470+
return dev_err_probe(dev, PTR_ERR(i2c->clk),
1471+
"failed to enable input clock.\n");
1472+
}
14711473

14721474
i2c->dev = dev;
14731475

0 commit comments

Comments
 (0)