platform/mellanox: mlxreg-hotplug: Extend logic for hotplug devices operations
authorVadim Pasternak <vadimp@nvidia.com>
Sat, 2 Oct 2021 09:32:32 +0000 (12:32 +0300)
committerHans de Goede <hdegoede@redhat.com>
Tue, 19 Oct 2021 08:41:55 +0000 (10:41 +0200)
commitbb1023b6da379985ff888dcd7bc601735d02267a
tree7aaba1ce2cf1f23e299bb6fb462c6b40511e8f3a
parenta5d8f57edfb44a3f036152258d844c21c0436382
platform/mellanox: mlxreg-hotplug: Extend logic for hotplug devices operations

Extend the structure 'mlxreg_hotplug_device" with platform device field
to allow transition of the register map and system interrupt line number
to underlying hotplug devices, sharing the same register map and
same interrupt line with 'mlxreg-hotplug' driver.

Extend logic for hotplug devices creation and removing according to
the action associated with the hotplug device description. Previously
hotplug driver was capable to attach / de-attach upon hotplug events
only I2C devices handled by simple I2C drivers. Now it should be able
to attach also devices handled by the platform drivers.

The motivation is to allow transition of platform data like:
- system interrupt line number, sharing with 'mlxreg-hotplug' to
  underlying hotplug devices.
- shared register map of programmable devices on main board to
  underlying hotplug devices.

Additioanlly the number of 'sysfs' attributes is increased, since
modular system defines more 'sysfs' attributes.

Signed-off-by: Vadim Pasternak <vadimp@nvidia.com>
Reviewed-by: Michael Shych <michaelsh@nvidia.com>
Link: https://lore.kernel.org/r/20211002093238.3771419-4-vadimp@nvidia.com
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/mellanox/mlxreg-hotplug.c
include/linux/platform_data/mlxreg.h