Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 346e400c authored by Jan Glauber's avatar Jan Glauber Committed by Wolfram Sang
Browse files

i2c: thunderx: ACPI support for clock settings



Add support for reading the system clock and the TWSI clock
frequency from ACPI DSDT.

TWSI clock was already covered by using device_property_read().

Signed-off-by: default avatarJan Glauber <jglauber@cavium.com>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 4165bd4b
Loading
Loading
Loading
Loading
+15 −9
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ static void thunder_i2c_clock_enable(struct device *dev, struct octeon_i2c *i2c)
{
	int ret;

	if (acpi_disabled) {
		/* DT */
		i2c->clk = clk_get(dev, NULL);
		if (IS_ERR(i2c->clk)) {
			i2c->clk = NULL;
@@ -95,6 +97,10 @@ static void thunder_i2c_clock_enable(struct device *dev, struct octeon_i2c *i2c)
		if (ret)
			goto skip;
		i2c->sys_freq = clk_get_rate(i2c->clk);
	} else {
		/* ACPI */
		device_property_read_u32(dev, "sclk", &i2c->sys_freq);
	}

skip:
	if (!i2c->sys_freq)