Some hardware need some time to switch from a bus to another. This can cause the first transfers following the selection of a bus to fail. There is no way to configure this kind of waiting time in the driver. Add support for the 'settle-time-us' device-tree property. When set, the i2c_mux_gpio_select() applies a delay before returning, leaving enough time to the hardware to switch to the new bus.
Showing the changes to include/linux/platform_data (1 of 2 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ · 18 unmodified lines | |||
| 19 | * position | 19 | * position |
| 20 | * @n_values: Number of multiplexer positions (busses to instantiate) | 20 | * @n_values: Number of multiplexer positions (busses to instantiate) |
| 21 | * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used | 21 | * @idle: Bitmask to write to MUX when idle or GPIO_I2CMUX_NO_IDLE if not used |
| 22 | * @settle_time: Delay to wait when a new bus is selected | ||
| 22 | */ | 23 | */ |
| 23 | struct i2c_mux_gpio_platform_data { | 24 | struct i2c_mux_gpio_platform_data { |
| 24 | int parent; | 25 | int parent; |
| @@ -26,6 +27,7 @@ struct i2c_mux_gpio_platform_data { · 1 unmodified line | |||
| 26 | const unsigned *values; | 27 | const unsigned *values; |
| 27 | int n_values; | 28 | int n_values; |
| 28 | unsigned idle; | 29 | unsigned idle; |
| 30 | u32 settle_time; | ||
| 29 | }; | 31 | }; |
| 30 | 32 | ||
| 31 | #endif /* _LINUX_I2C_MUX_GPIO_H */ | 33 | #endif /* _LINUX_I2C_MUX_GPIO_H */ |