OSDN Git Service

i2c: mux: mlxcpld: Convert driver to platform driver
authorVadim Pasternak <vadimp@nvidia.com>
Mon, 8 Feb 2021 20:16:01 +0000 (22:16 +0200)
committerWolfram Sang <wsa@kernel.org>
Tue, 9 Feb 2021 10:35:19 +0000 (11:35 +0100)
commit84af1b168c5015fca0761cf9cce4add31e354dce
treec981126489d14af41494107cd2a36144cac8b291
parent05ae60bc24f765d0db6b7c6e5acabf22718b823d
i2c: mux: mlxcpld: Convert driver to platform driver

Convert driver from 'i2c' to 'platform'.
The motivation is to avoid I2C addressing conflict between
‘i2c-mux-cpld’ driver, providing mux selection and deselection through
CPLD ‘mux control’ register, and CPLD host driver. The CPLD is I2C
device and is multi-functional device performing logic for different
components, like LED, ‘hwmon’, interrupt control, watchdog etcetera.
For such configuration CPLD should be host I2C device, connected to the
relevant I2C bus with the relevant I2C address and all others component
drivers are supposed to be its children.
The hierarchy in such case will be like in the below example:
ls /sys/bus/i2c/devices/44-0032
i2c-mux-mlxcpld.44  leds-mlxreg.44  mlxreg-io.44
ls /sys/bus/i2c/devices/44-0032/i2c-mux-mlxcpld.44
channel-0, …,  channel-X

Currently this driver is not activated by any kernel driver,
so this conversion doesn’t affect any user.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Acked-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/muxes/i2c-mux-mlxcpld.c