diff mbox series

[v2] usb: typec: qcom: properly detect Audio Accessory mode peripherals

Message ID 20230709200235.265674-1-dmitry.baryshkov@linaro.org
State New
Headers show
Series [v2] usb: typec: qcom: properly detect Audio Accessory mode peripherals | expand

Commit Message

Dmitry Baryshkov July 9, 2023, 8:02 p.m. UTC
Detect and report if the Audio Accessory device has been attached to the
corresponding USB-C port.

Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---

Changes since v1:
- Fixed typo in commit subject (Bjorn)
- Removed 'the' in the commit message (Sergei)

---
 drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Guenter Roeck July 10, 2023, 1:52 p.m. UTC | #1
On Sun, Jul 09, 2023 at 11:02:35PM +0300, Dmitry Baryshkov wrote:
> Detect and report if the Audio Accessory device has been attached to the
> corresponding USB-C port.
> 
> Acked-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

> ---
> 
> Changes since v1:
> - Fixed typo in commit subject (Bjorn)
> - Removed 'the' in the commit message (Sergei)
> 
> ---
>  drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> index 94285f64b67d..56df04af2d2b 100644
> --- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> +++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
> @@ -214,6 +214,11 @@ int qcom_pmic_typec_port_get_cc(struct pmic_typec_port *pmic_typec_port,
>  		if (ret)
>  			goto done;
>  		switch (val & DETECTED_SRC_TYPE_MASK) {
> +		case AUDIO_ACCESS_RA_RA:
> +			val = TYPEC_CC_RA;
> +			*cc1 = TYPEC_CC_RA;
> +			*cc2 = TYPEC_CC_RA;
> +			break;
>  		case SRC_RD_OPEN:
>  			val = TYPEC_CC_RD;
>  			break;
> -- 
> 2.39.2
>
diff mbox series

Patch

diff --git a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
index 94285f64b67d..56df04af2d2b 100644
--- a/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
+++ b/drivers/usb/typec/tcpm/qcom/qcom_pmic_typec_port.c
@@ -214,6 +214,11 @@  int qcom_pmic_typec_port_get_cc(struct pmic_typec_port *pmic_typec_port,
 		if (ret)
 			goto done;
 		switch (val & DETECTED_SRC_TYPE_MASK) {
+		case AUDIO_ACCESS_RA_RA:
+			val = TYPEC_CC_RA;
+			*cc1 = TYPEC_CC_RA;
+			*cc2 = TYPEC_CC_RA;
+			break;
 		case SRC_RD_OPEN:
 			val = TYPEC_CC_RD;
 			break;