]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
usb: typec: hd3ss3220: support configuring port type
authorOliver Facklam <oliver.facklam@zuehlke.com>
Wed, 11 Dec 2024 16:32:46 +0000 (17:32 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Dec 2024 07:56:04 +0000 (08:56 +0100)
commit5d2c32d506d89a4f657b44b74c61b8f74ba1a23a
tree20d95bd3d52c8611a21660b94ad597dd835a07bc
parent14ba185d2f3e806d7e28c6cf9fbbbccddfdd608e
usb: typec: hd3ss3220: support configuring port type

The TI HD3SS3220 Type-C controller supports configuring the port type
it will operate as through the MODE_SELECT field of the General
Control Register.

Configure the port type based on the fwnode property "power-role"
during probe, if present. If the property is absent, leave the
operation mode at the default, which is defined by the PORT pin
of the chip.
Support configuring the port type through the port_type_set
typec_operation as well.

The MODE_SELECT field can only be changed when the controller is in
unattached state, so follow the sequence recommended by the datasheet to:
1. disable termination on CC pins to disable the controller
2. change the mode
3. re-enable termination

This will effectively cause a connected device to disconnect
for the duration of the mode change.

Signed-off-by: Oliver Facklam <oliver.facklam@zuehlke.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20241211-usb-typec-controller-enhancements-v3-2-e4bc1b6e1441@zuehlke.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/hd3ss3220.c