usb: typec: port-mapper: Convert to the component framework
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Thu, 23 Dec 2021 08:24:22 +0000 (11:24 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Dec 2021 11:13:04 +0000 (12:13 +0100)
commit730b49aac426e1e8016d3c2dd6b407e500423821
treed9e2aca8b78d0c928a05f8f7d98415fb31131907
parent8c67d06f3fd9639c44d8147483fb1c132d71388f
usb: typec: port-mapper: Convert to the component framework

Instead of trying to keep track of the connections to the
USB Type-C connectors separately, letting the component
framework take care of that.

From now on every USB Type-C connector will register itself
as "aggregate" - component master - and anything that can be
connected to it inside the system can then simply register
itself as a generic component.

The matching of the components and the connector shall rely
on ACPI _PLD initially. Before registering itself as the
aggregate, the connector will find all other ACPI devices
that have matching _PLD crc hash with it (matching value in
the pld_crc member of struct acpi_device), and add a
component match entry for each one of them. Because only
ACPI is supported for now, the driver shall only be build
when ACPI is supported.

This removes the need for the custom API that the driver
exposed. The components and the connector can therefore
exist completely independently of each other. The order in
which they are registered, as well as are they modules or
not, is now irrelevant.

Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20211223082422.45637-1-heikki.krogerus@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/Makefile
drivers/usb/typec/class.c
drivers/usb/typec/class.h
drivers/usb/typec/port-mapper.c
include/linux/usb/typec.h