Unverified Commit dd0422eb authored by Abdurrahman Hussain's avatar Abdurrahman Hussain Committed by Andi Shyti
Browse files

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: default avatarAbdurrahman Hussain <abdurrahman@nexthop.ai>
Signed-off-by: default avatarAndi Shyti <andi.shyti@kernel.org>
Link: https://lore.kernel.org/r/20260223-i2c-xiic-v12-7-b6c9ce4e4f3c@nexthop.ai
parent 91430a8e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -1464,10 +1464,12 @@ static int xiic_i2c_probe(struct platform_device *pdev)

	spin_lock_init(&i2c->atomic_lock);

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

	i2c->dev = dev;