Re: [patch 2/2] i2c: mux: mellanox: add driver
From: Peter Rosin <hidden>
Date: 2016-09-06 15:32:17
Also in:
lkml
On 2016-08-29 19:36, vadimp@mellanox.com wrote:
From: Vadim Pasternak <redacted>
This driver allows I2C routing controlled through CPLD select registers on
wide range of Mellanox systems (CPLD Lattice device).
MUX selection is provided by digital and analog HW. Analog part is not
under SW control.
Digital part is under CPLD control (channel selection/de-selection).
Connectivity schema.
i2c-mlxcpld Digital Analog
driver
*--------* * -> mux1 (virt bus2) -> mux ->|
| I2CLPC | i2c physical * -> mux2 (virt bus3) -> mux ->|
| bridge | bus 1 *---------* |
| logic |---------------------> * mux reg * |
| in CPLD| *---------* |
*--------* i2c-mux-mlxpcld ^ * -> muxn (virt busn) -> mux ->|
| driver | |
| *---------------* | Devices
| * CPLD (LPC bus)* select |
| * registers for *--------*
| * mux selection * deselect
| *---------------*
| |
<--------> <----------->
i2c cntrl Board cntrl reg
reg space space (mux select,
| IO, LED, WD, info)
| | *-----* *-----*
*------------- LPC bus --------------| PCH |---| CPU |
*-----* *-----*
i2c-mux-mlxpcld does not necessary required i2c-mlxcpld. It can be use
along with another bus driver, and still control i2c routing through CPLD
mux selection, in case the system is equipped with CPLD capable of mux
selection control.
The Kconfig currently controlling compilation of this code is:
drivers/i2c/muxes/Kconfig:config I2C_MUX_MLXCPLD
Signed-off-by: Michael Shych <redacted>
Signed-off-by: Vadim Pasternak <redacted>
Reviewed-by: Jiri Pirko <redacted>BTW, it just occurred to me that you could perhaps use (and extend if needed) the i2c_mux_reg driver for the lpc_access cases. Have you explored that option? It looks like a nice fit, and limiting this new driver to i2c_access would make it significantly simpler with only one device (mux module) and one access method (i2c) to support. Cheers, Peter