FROMGIT: usb: typec: tcpm: frs sourcing vbus callback

During FRS hardware autonomously starts to source vbus. Provide
callback to perform chip specific operations.

Bug: 168158832
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20201029063138.1429760-5-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit a30a00e37c
 https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I1aa27bf1b486bdeb3f104e4b7871b1c0238abc04
This commit is contained in:
Badhri Jagan Sridharan
2020-10-28 23:31:32 -07:00
committed by Greg Kroah-Hartman
parent 2c6dc2a69e
commit 6d065abe6e
2 changed files with 13 additions and 0 deletions
+9
View File
@@ -4136,7 +4136,16 @@ static void _tcpm_pd_vbus_on(struct tcpm_port *port)
case SRC_TRY_DEBOUNCE:
/* Do nothing, waiting for sink detection */
break;
case FR_SWAP_SEND:
case FR_SWAP_SEND_TIMEOUT:
case FR_SWAP_SNK_SRC_TRANSITION_TO_OFF:
case FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED:
if (port->tcpc->frs_sourcing_vbus)
port->tcpc->frs_sourcing_vbus(port->tcpc);
break;
case FR_SWAP_SNK_SRC_NEW_SINK_READY:
if (port->tcpc->frs_sourcing_vbus)
port->tcpc->frs_sourcing_vbus(port->tcpc);
tcpm_set_state(port, FR_SWAP_SNK_SRC_SOURCE_VBUS_APPLIED, 0);
break;
+4
View File
@@ -83,6 +83,9 @@ enum tcpm_transmit_type {
* Optional; Called to enable/disable PD 3.0 fast role swap.
* Enabling frs is accessory dependent as not all PD3.0
* accessories support fast role swap.
* @frs_sourcing_vbus:
* Optional; Called to notify that vbus is now being sourced.
* Low level drivers can perform chip specific operations, if any.
* @check_contaminant:
* Optional; The callback is called when CC pins report open status
* at the end of the toggling period. Chip level drivers are
@@ -117,6 +120,7 @@ struct tcpc_dev {
const struct pd_message *msg);
int (*set_bist_data)(struct tcpc_dev *dev, bool on);
int (*enable_frs)(struct tcpc_dev *dev, bool enable);
void (*frs_sourcing_vbus)(struct tcpc_dev *dev);
int (*check_contaminant)(struct tcpc_dev *dev);
};