platform/x86: serial-multi-instantiate: Add SPI support
authorStefan Binding <sbinding@opensource.cirrus.com>
Fri, 21 Jan 2022 17:24:29 +0000 (17:24 +0000)
committerHans de Goede <hdegoede@redhat.com>
Wed, 2 Feb 2022 17:10:02 +0000 (18:10 +0100)
commit68f201f9061c000d7a4a9f359f021b1cd535d62b
tree61b0c265da14974de51905cddb778bf65737a9bd
parent35a36cbb7b1ce7596fc03962f7ce261b2e908d1f
platform/x86: serial-multi-instantiate: Add SPI support

Add support for spi bus in serial-multi-instantiate driver

Some peripherals can have either a I2C or a SPI connection
to the host (but not both) but use the same HID for both
types. So it is not possible to use the HID to determine
whether it is I2C or SPI. The driver must check the node
to see if it contains I2cSerialBus or SpiSerialBus entries.

For backwards-compatibility with the existing nodes I2C is
checked first and if such entries are found ONLY I2C devices
are created. Since some existing nodes that were already
handled by this driver could also contain unrelated
SpiSerialBus nodes that were previously ignored, and this
preserves that behavior. If there is ever a need to handle
a node where both I2C and SPI devices must be instantiated
this can be added in future.

Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220121172431.6876-8-sbinding@opensource.cirrus.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/Kconfig
drivers/platform/x86/serial-multi-instantiate.c