platform/x86: mlx-platform: Add physical bus number auto detection
authorVadim Pasternak <vadimp@mellanox.com>
Tue, 13 Feb 2018 22:09:36 +0000 (22:09 +0000)
committerDarren Hart (VMware) <dvhart@infradead.org>
Fri, 23 Mar 2018 23:14:29 +0000 (16:14 -0700)
commitef0f62264b2a9e6fc73476ed22ade1ff1f3ad7f3
tree2cf6987205b838ec7bf503d90ebe89b91198e61c
parentf709e1bfb0c643a866b909d101442c7a7f425655
platform/x86: mlx-platform: Add physical bus number auto detection

mlx-platform does not provide a bus number to i2c-mlxcpld, assuming it
is always one. On some x86 systems, other i2c drivers may probe before
i2c-mlxcpld, causing bus one to be busy.

Make mlx-platform determine which adapter number is free prior to
activating i2c-mlxpld, adjusting the mux base numbers accordingly.
Update the mlxreg-hotplug pdata similarly.

This adds an explicit mlx-platform build dependency on I2C, update the
Kconfig accordingly. Add the missing REGMAP dependency while we're at
it.

Signed-off-by: Vadim Pasternak <vadimp@mellanox.com>
[dvhart: Rewrite commit message more concisely]
[dvhart: Add build dependencies]
Signed-off-by: Darren Hart (VMware) <dvhart@infradead.org>
drivers/platform/mellanox/mlxreg-hotplug.c
drivers/platform/x86/Kconfig
drivers/platform/x86/mlx-platform.c
include/linux/platform_data/mlxreg.h