Skip to content

Commit 53e3d52

Browse files
pmalgujar-mrvlAndi Shyti
authored andcommitted
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>
1 parent b9960b9 commit 53e3d52

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

drivers/i2c/busses/i2c-thunderx-pcidrv.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#define PCI_DEVICE_ID_THUNDER_TWSI 0xa012
2929

30-
#define SYS_FREQ_DEFAULT 700000000
30+
#define SYS_FREQ_DEFAULT 800000000
3131
#define OTX2_REF_FREQ_DEFAULT 100000000
3232

3333
#define TWSI_INT_ENA_W1C 0x1028
@@ -100,7 +100,8 @@ static void thunder_i2c_clock_enable(struct device *dev, struct octeon_i2c *i2c)
100100
i2c->sys_freq = clk_get_rate(i2c->clk);
101101
} else {
102102
/* ACPI */
103-
device_property_read_u32(dev, "sclk", &i2c->sys_freq);
103+
if (device_property_read_u32(dev, "sclk", &i2c->sys_freq))
104+
device_property_read_u32(dev, "ioclk", &i2c->sys_freq);
104105
}
105106

106107
skip:

0 commit comments

Comments
 (0)