usb: typec: Factor out non-PD fwnode properties
authorSamuel Holland <samuel@sholland.org>
Mon, 14 Feb 2022 05:01:16 +0000 (23:01 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:14:28 +0000 (13:14 +0100)
commit05aa8ff22d4a08a903f39b09f5e821c6761d09f4
tree59d7520b9ab540111e7bd4e408908aa2f07dca40
parent31e9c2751035e82117d9d8a0eb876b184e3a5e97
usb: typec: Factor out non-PD fwnode properties

[ Upstream commit 2e7dfb0e9cacad0f1adbc4b97f0b96ba35027f24 ]

Basic programmable non-PD Type-C port controllers do not need the full
TCPM library, but they share the same devicetree binding and the same
typec_capability structure. Factor out a helper for parsing those
properties which map to fields in struct typec_capability, so the code
can be shared between TCPM and basic non-TCPM drivers.

Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Link: https://lore.kernel.org/r/20220214050118.61015-4-samuel@sholland.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Stable-dep-of: 581c848b610d ("extcon: usbc-tusb320: Update state on probe even if no IRQ pending")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/usb/typec/class.c
drivers/usb/typec/tcpm/tcpm.c
include/linux/usb/typec.h