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>
This commit is contained in:
Andrew Lunn
2019-02-14 04:24:50 +01:00
committed by Wolfram Sang
parent 809445d4b7
commit 237b5f66e1
2 changed files with 5 additions and 1 deletions

View File

@@ -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)