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)
commitea3b4d5523bc8d3e955075d3716af536d6212cc7
tree871df18f9f4c81f2ba3c0e0bdef14744b43998c6
parent40326e857c57a0095d3f9d72c14cb13aef4ca564
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