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

Commit 237b5f66 authored by Andrew Lunn's avatar Andrew Lunn Committed by Wolfram Sang
Browse files

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: default avatarAndrew Lunn <andrew@lunn.ch>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent 809445d4
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -628,6 +628,9 @@ 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;
		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);
+1 −0
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@ struct ocores_i2c_platform_data {
	u32 reg_shift; /* register offset shift value */
	u32 reg_io_width; /* register io read/write width */
	u32 clock_khz; /* input clock in kHz */
	u32 bus_khz; /* bus clock in kHz */
	bool big_endian; /* registers are big endian */
	u8 num_devices; /* number of devices in the devices list */
	struct i2c_board_info const *devices; /* devices connected to the bus */