From 44b6a8ed8f5056eefcd96acc92e1fdf10ef18f31 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 7 Mar 2025 09:49:56 +0000 Subject: [PATCH] Revert "usb: typec: tcpci: Prevent Sink disconnection before vPpsShutdown in SPR PPS" This reverts commit 495320792721fcc527c36c82ec8e10f46adc8347 which is commit 4d27afbf256028a1f54363367f30efc8854433c3 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: I6b743cfeb8ce98af2f957100d6a32ab4ea4bf515 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/typec/tcpm/tcpci.c | 3 +-- drivers/usb/typec/tcpm/tcpm.c | 3 +-- include/linux/usb/tcpm.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/usb/typec/tcpm/tcpci.c b/drivers/usb/typec/tcpm/tcpci.c index ec30d2facd8a..c6f846fbe69e 100644 --- a/drivers/usb/typec/tcpm/tcpci.c +++ b/drivers/usb/typec/tcpm/tcpci.c @@ -341,8 +341,7 @@ static int tcpci_enable_auto_vbus_discharge(struct tcpc_dev *dev, bool enable) } static int tcpci_set_auto_vbus_discharge_threshold(struct tcpc_dev *dev, enum typec_pwr_opmode mode, - bool pps_active, u32 requested_vbus_voltage_mv, - u32 apdo_min_voltage_mv) + bool pps_active, u32 requested_vbus_voltage_mv) { struct tcpci *tcpci = tcpc_to_tcpci(dev); unsigned int pwr_ctrl, threshold = 0; diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 65df311dcf66..f3fd8d9d217b 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -2353,8 +2353,7 @@ static int tcpm_set_auto_vbus_discharge_threshold(struct tcpm_port *port, else voltage = requested_vbus_voltage; - ret = port->tcpc->set_auto_vbus_discharge_threshold(port->tcpc, mode, pps_active, voltage, - port->pps_data.min_volt); + ret = port->tcpc->set_auto_vbus_discharge_threshold(port->tcpc, mode, pps_active, voltage); tcpm_log_force(port, "set_auto_vbus_discharge_threshold mode:%d pps_active:%c vbus:%u pps_apdo_min_volt:%u ret:%d", mode, pps_active ? 'y' : 'n', requested_vbus_voltage, diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h index 0bdb4f565d0f..ab7ca872950b 100644 --- a/include/linux/usb/tcpm.h +++ b/include/linux/usb/tcpm.h @@ -150,8 +150,7 @@ struct tcpc_dev { void (*frs_sourcing_vbus)(struct tcpc_dev *dev); int (*enable_auto_vbus_discharge)(struct tcpc_dev *dev, bool enable); int (*set_auto_vbus_discharge_threshold)(struct tcpc_dev *dev, enum typec_pwr_opmode mode, - bool pps_active, u32 requested_vbus_voltage, - u32 pps_apdo_min_voltage); + bool pps_active, u32 requested_vbus_voltage); bool (*is_vbus_vsafe0v)(struct tcpc_dev *dev); void (*set_partner_usb_comm_capable)(struct tcpc_dev *dev, bool enable); void (*check_contaminant)(struct tcpc_dev *dev);