Commit 36b35ad8 authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski
Browse files

Merge tag 'qcom-drivers-fixes-for-7.0' of...

Merge tag 'qcom-drivers-fixes-for-7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/qcom/linux into arm/fixes

Qualcomm driver fixes for v7.0

Fix the length of the PD restart reason string in pd-mapper to avoid
QMI decoding errors, resulting in the notification being dropped.

Fix the newly introduce handling of TBT/USB4 notifications in pmic_glink
altmode driver, as it broke the handling of non-TBT/USB4 DisplayPort
unplug events.

* tag 'qcom-drivers-fixes-for-7.0' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/qcom/linux

:
  soc: qcom: pmic_glink_altmode: Fix TBT->SAFE->!TBT transition
  soc: qcom: pmic_glink_altmode: Fix SVID=DP && unconnected edge case
  soc: qcom: pd-mapper: Fix element length in servreg_loc_pfr_req_ei

Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
parents 7962fd93 a343fb1e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ struct servreg_set_ack_resp {

struct servreg_loc_pfr_req {
	char service[SERVREG_NAME_LENGTH + 1];
	char reason[257];
	char reason[SERVREG_PFR_LENGTH + 1];
};

struct servreg_loc_pfr_resp {
+28 −11
Original line number Diff line number Diff line
@@ -62,6 +62,9 @@ struct usbc_notify {
	u8 orientation;
	u8 mux_ctrl;
#define MUX_CTRL_STATE_NO_CONN			0
#define MUX_CTRL_STATE_USB3_ONLY		1
#define MUX_CTRL_STATE_DP4LN			2
#define MUX_CTRL_STATE_USB3_DP			3
#define MUX_CTRL_STATE_TUNNELING		4

	u8 res;
@@ -350,15 +353,20 @@ static void pmic_glink_altmode_worker(struct work_struct *work)

	typec_switch_set(alt_port->typec_switch, alt_port->orientation);

	/*
	 * MUX_CTRL_STATE_DP4LN/USB3_DP may only be set if SVID=DP, but we need
	 * to special-case the SVID=DP && mux_ctrl=NO_CONN case to deliver a
	 * HPD notification
	 */
	if (alt_port->svid == USB_TYPEC_DP_SID) {
		if (alt_port->mux_ctrl == MUX_CTRL_STATE_NO_CONN) {
			pmic_glink_altmode_safe(altmode, alt_port);
	} else if (alt_port->svid == USB_TYPEC_TBT_SID) {
		pmic_glink_altmode_enable_tbt(altmode, alt_port);
	} else if (alt_port->svid == USB_TYPEC_DP_SID) {
		} else {
			pmic_glink_altmode_enable_dp(altmode, alt_port,
						     alt_port->mode,
						     alt_port->hpd_state,
						     alt_port->hpd_irq);
		}

		if (alt_port->hpd_state)
			conn_status = connector_status_connected;
@@ -367,9 +375,18 @@ static void pmic_glink_altmode_worker(struct work_struct *work)

		drm_aux_hpd_bridge_notify(&alt_port->bridge->dev, conn_status);
	} else if (alt_port->mux_ctrl == MUX_CTRL_STATE_TUNNELING) {
		if (alt_port->svid == USB_TYPEC_TBT_SID)
			pmic_glink_altmode_enable_tbt(altmode, alt_port);
		else
			pmic_glink_altmode_enable_usb4(altmode, alt_port);
	} else {
	} else if (alt_port->mux_ctrl == MUX_CTRL_STATE_USB3_ONLY) {
		pmic_glink_altmode_enable_usb(altmode, alt_port);
	} else if (alt_port->mux_ctrl == MUX_CTRL_STATE_NO_CONN) {
		pmic_glink_altmode_safe(altmode, alt_port);
	} else {
		dev_err(altmode->dev, "Got unknown mux_ctrl: %u on port %u, forcing safe mode\n",
			alt_port->mux_ctrl, alt_port->index);
		pmic_glink_altmode_safe(altmode, alt_port);
	}

	pmic_glink_altmode_request(altmode, ALTMODE_PAN_ACK, alt_port->index);
+1 −1
Original line number Diff line number Diff line
@@ -325,7 +325,7 @@ const struct qmi_elem_info servreg_loc_pfr_req_ei[] = {
	},
	{
		.data_type = QMI_STRING,
		.elem_len = SERVREG_NAME_LENGTH + 1,
		.elem_len = SERVREG_PFR_LENGTH + 1,
		.elem_size = sizeof(char),
		.array_type = VAR_LEN_ARRAY,
		.tlv_type = 0x02,
+1 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#include <linux/soc/qcom/qmi.h>

#define SERVREG_NAME_LENGTH	64
#define SERVREG_PFR_LENGTH	256

struct pdr_service;
struct pdr_handle;