Skip to contentSkip to conversation

extcon: qcom-spmi-misc: Sync the extcon state on interrupt

PATCH In review Stephen Boyd 2 participants 2 messages Oct 18, 2016 – Oct 19, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 extcon: qcom-spmi-misc: Sync the extcon state on interrupt

The driver was changed after submission to use the new style APIs like extcon_set_state(). Unfortunately, that only sets the state, and doesn't notify any consumers that the cable state has changed. Use extcon_set_state_sync() here instead so that we notify cable consumers of the state change. This fixes USB host-device role switching on the db8074 platform.

Fixes 38085c987f52 ("extcon: Add support for qcom SPMI PMIC USB id detection hardware")
---
 drivers/extcon/extcon-qcom-spmi-misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-qcom-spmi-misc.c +1 -1
index ca957a5f4291..b8cde096a808 100644
@@ -51,7 +51,7 @@ static void qcom_usb_extcon_detect_cable(struct work_struct *work)
 	if (ret)
 		return;
 
-	extcon_set_state(info->edev, EXTCON_USB_HOST, !id);
+	extcon_set_state_sync(info->edev, EXTCON_USB_HOST, !id);
 }
 
 static irqreturn_t qcom_usb_irq_handler(int irq, void *dev_id)
Signature · 1 line
2.10.0.297.gf6727b0
maintainer
#1 lore raw

Hi Stephen,

Quoted 19 lines · Stephen Boyd

The driver was changed after submission to use the new style APIs like extcon_set_state(). Unfortunately, that only sets the state, and doesn't notify any consumers that the cable state has changed. Use extcon_set_state_sync() here instead so that we notify cable consumers of the state change. This fixes USB host-device role switching on the db8074 platform.

Fixes 38085c987f52 ("extcon: Add support for qcom SPMI PMIC USB id detection hardware")
---
 drivers/extcon/extcon-qcom-spmi-misc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/extcon/extcon-qcom-spmi-misc.c +0 -0
index ca957a5f4291..b8cde096a808 100644

drivers/extcon/extcon-qcom-spmi-misc.c static void qcom_usb_extcon_detect_cable(struct work_struct *work) · line 57

Quoted 8 lines
drivers/extcon/extcon-qcom-spmi-misc.c +1 -1
@@ -51,7 +51,7 @@ static void qcom_usb_extcon_detect_cable(struct work_struct *work)
 	if (ret)
 		return;
 
-	extcon_set_state(info->edev, EXTCON_USB_HOST, !id);
+	extcon_set_state_sync(info->edev, EXTCON_USB_HOST, !id);
 }
 
 static irqreturn_t qcom_usb_irq_handler(int irq, void *dev_id)

Applied it.

Best Regards,
Chanwoo Choi