staging: typec: handle vendor defined part and modify drp toggling flow
authorShuFan Lee <shufan_lee@richtek.com>
Tue, 6 Mar 2018 01:50:32 +0000 (09:50 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Mar 2018 19:21:46 +0000 (11:21 -0800)
commit8f94390226487bcb86c554ddc12eef0d27bdec3b
treee387bef5e8734a014660600a2d8fa29ce7700fb4
parentb27560e4d9e5240b5544c9c5650c7442e482646e
staging: typec: handle vendor defined part and modify drp toggling flow

Handle vendor defined behavior in tcpci_init, tcpci_set_vconn, tcpci_start_drp_toggling
and export tcpci_irq. More operations can be extended in tcpci_data if needed.
According to TCPCI specification, 4.4.5.2 ROLE_CONTROL,
TCPC shall not start DRP toggling until subsequently the TCPM
writes to the COMMAND register to start DRP toggling.
DRP toggling flow is changed as following:
  - Write DRP = 1, Rp level and RC.CCx to Rd/Rd or Rp/Rp
  - Set LOOK4CONNECTION command

Signed-off-by: ShuFan Lee <shufan_lee@richtek.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/typec/tcpci.c
drivers/staging/typec/tcpci.h