]> git.baikalelectronics.ru Git - kernel.git/commit
usb: typec: fusb302: Resolve fixed power role contract setup
authorAdam Thomson <Adam.Thomson.Opensource@diasemi.com>
Wed, 26 Sep 2018 15:23:52 +0000 (16:23 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:08:09 +0000 (15:08 +0200)
commitbc0fc036e56335a729f361e50433a5d0e506ee82
tree871df18f9f4c81f2ba3c0e0bdef14744b43998c6
parent6d2faeb001fb57748bb4609509f3527cb54bf9e4
usb: typec: fusb302: Resolve fixed power role contract setup

When the controller is configured for a fixed power role (Source
only or Sink only), attach does not proceed within the TCPM state
machine as there is no CC event generated by this driver to update
the CC line status.

To rectify this, when CC is configured as Source or Sink we now
make use of the hardware's automatic fixed Source or Sink
toggling mechanism, which detects attaches in the same way as for
DRP toggling. In this way the result of toggling is handled in the
same way by the 'fusb302_handle_togdone()' function, and CC events
are generated as expected for TCPM allowing a contract to be
established.

Signed-off-by: Adam Thomson <Adam.Thomson.Opensource@diasemi.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/typec/tcpm/fusb302.c