Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrew Lunn and committed by
Wolfram Sang
237b5f66 809445d4

+5 -1
+4 -1
drivers/i2c/busses/i2c-ocores.c
··· 628 628 i2c->reg_shift = pdata->reg_shift; 629 629 i2c->reg_io_width = pdata->reg_io_width; 630 630 i2c->ip_clock_khz = pdata->clock_khz; 631 - i2c->bus_clock_khz = 100; 631 + if (pdata->bus_khz) 632 + i2c->bus_clock_khz = pdata->bus_khz; 633 + else 634 + i2c->bus_clock_khz = 100; 632 635 } else { 633 636 ret = ocores_i2c_of_probe(pdev, i2c); 634 637 if (ret)
+1
include/linux/platform_data/i2c-ocores.h
··· 12 12 u32 reg_shift; /* register offset shift value */ 13 13 u32 reg_io_width; /* register io read/write width */ 14 14 u32 clock_khz; /* input clock in kHz */ 15 + u32 bus_khz; /* bus clock in kHz */ 15 16 bool big_endian; /* registers are big endian */ 16 17 u8 num_devices; /* number of devices in the devices list */ 17 18 struct i2c_board_info const *devices; /* devices connected to the bus */