diff options
author | Piyush Malgujar <pmalgujar@marvell.com> | 2024-04-23 00:46:08 -0700 |
---|---|---|
committer | Andi Shyti <andi.shyti@kernel.org> | 2024-05-06 00:56:41 +0200 |
commit | 53e3d528ba723c8fd5bf968f517c9bc6a369f3ea (patch) | |
tree | 00a1e2dcb54a04a065ec70d6131d021bd6df9c91 /drivers/i2c | |
parent | b9960b902f42c80ef436bf172666f20acbda32ac (diff) |
i2c: thunderx: Adding ioclk support
Read the ioclk property as reference clock if sclk not present in acpi
table to make it SOC agnostic.
In case, it's not populated from dts/acpi table, use the default clock
of 800 MHz which is optimal in either case of sclk/ioclk.
Signed-off-by: Piyush Malgujar <pmalgujar@marvell.com>
Acked-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-thunderx-pcidrv.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/i2c/busses/i2c-thunderx-pcidrv.c b/drivers/i2c/busses/i2c-thunderx-pcidrv.c index 31f11b77ab66..32d0e3930b67 100644 --- a/drivers/i2c/busses/i2c-thunderx-pcidrv.c +++ b/drivers/i2c/busses/i2c-thunderx-pcidrv.c @@ -27,7 +27,7 @@ #define PCI_DEVICE_ID_THUNDER_TWSI 0xa012 -#define SYS_FREQ_DEFAULT 700000000 +#define SYS_FREQ_DEFAULT 800000000 #define OTX2_REF_FREQ_DEFAULT 100000000 #define TWSI_INT_ENA_W1C 0x1028 @@ -100,7 +100,8 @@ static void thunder_i2c_clock_enable(struct device *dev, struct octeon_i2c *i2c) i2c->sys_freq = clk_get_rate(i2c->clk); } else { /* ACPI */ - device_property_read_u32(dev, "sclk", &i2c->sys_freq); + if (device_property_read_u32(dev, "sclk", &i2c->sys_freq)) + device_property_read_u32(dev, "ioclk", &i2c->sys_freq); } skip: |