diff options
author | Andrew Lunn <andrew@lunn.ch> | 2019-02-14 04:24:50 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-02-14 17:58:23 +0100 |
commit | 237b5f66e1ed8a58662f29bcd04442953cdb8b55 (patch) | |
tree | 679525cdc0db3850ad72cb3098dba563e9dd73fb /drivers/i2c | |
parent | i2c: ocores: Add support for IO mapper registers. (diff) | |
download | linux-237b5f66e1ed8a58662f29bcd04442953cdb8b55.tar.xz linux-237b5f66e1ed8a58662f29bcd04442953cdb8b55.zip |
i2c: ocores: Add support for bus clock via platform data
Add the I2C bus clock speed to the platform data structure.
If not set, default to 100KHz as before.
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-ocores.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-ocores.c b/drivers/i2c/busses/i2c-ocores.c index 0d90a82a2c03..4eea18689e99 100644 --- a/drivers/i2c/busses/i2c-ocores.c +++ b/drivers/i2c/busses/i2c-ocores.c @@ -628,7 +628,10 @@ static int ocores_i2c_probe(struct platform_device *pdev) i2c->reg_shift = pdata->reg_shift; i2c->reg_io_width = pdata->reg_io_width; i2c->ip_clock_khz = pdata->clock_khz; - i2c->bus_clock_khz = 100; + if (pdata->bus_khz) + i2c->bus_clock_khz = pdata->bus_khz; + else + i2c->bus_clock_khz = 100; } else { ret = ocores_i2c_of_probe(pdev, i2c); if (ret) |