Skip to contentSkip to conversation

extcon: palmas: Fix boot up state of VBUS when using GPIO detection

PATCH In review Roger Quadros 2 participants 5 messages Jun 14, 2016 – Jun 15, 2016

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

PATCH 1/1 extcon: palmas: Fix boot up state of VBUS when using GPIO detection

If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable.

Fixes b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO")
---
 drivers/extcon/extcon-palmas.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon-palmas.c +2 -0
index 8b3226d..caff46c 100644
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
 
 	palmas_enable_irq(palmas_usb);
 	/* perform initial detection */
+	if (palmas_usb->enable_gpio_vbus_detection)
+		palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
 	palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
 	device_set_wakeup_capable(&pdev->dev, true);
 	return 0;
Signature · 1 line
2.7.4
maintainer
#1 lore raw
Quoted 17 lines · Roger Quadros

If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable.

Fixes b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO")
---
 drivers/extcon/extcon-palmas.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon-palmas.c +0 -0
index 8b3226d..caff46c 100644

drivers/extcon/extcon-palmas.c static int palmas_usb_probe(struct platform_device *pdev) · line 367

Quoted 8 lines
drivers/extcon/extcon-palmas.c +2 -0
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
 
 	palmas_enable_irq(palmas_usb);
 	/* perform initial detection */
+	if (palmas_usb->enable_gpio_vbus_detection)
+		palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
 	palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
 	device_set_wakeup_capable(&pdev->dev, true);
 	return 0;

Applied it.

Thanks,
Chanwoo Choi

#2 lore raw
Quoted 18 lines · Chanwoo Choi
Quoted 17 lines · Roger Quadros

If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable.

Fixes b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO")
---
 drivers/extcon/extcon-palmas.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon-palmas.c +0 -0
index 8b3226d..caff46c 100644
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
 
Quoted 10 lines

drivers/extcon/extcon-palmas.c static int palmas_usb_probe(struct platform_device *pdev) · line 367

Quoted 8 lines
drivers/extcon/extcon-palmas.c +2 -0
 	palmas_enable_irq(palmas_usb);
 	/* perform initial detection */
+	if (palmas_usb->enable_gpio_vbus_detection)
+		palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
 	palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
 	device_set_wakeup_capable(&pdev->dev, true);
 	return 0;

Applied it.

Thanks. But this is a bug fix and must go in v4.7-rc as well as stable v4.6+.

Can you please add

--
cheers,
-roger

maintainer
#3 lore raw
Quoted 30 lines · Roger Quadros
Quoted 18 lines · Chanwoo Choi
Quoted 17 lines · Roger Quadros

If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable.

Fixes b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO")
---
 drivers/extcon/extcon-palmas.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon-palmas.c +0 -0
index 8b3226d..caff46c 100644
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
 
Quoted 10 lines

drivers/extcon/extcon-palmas.c static int palmas_usb_probe(struct platform_device *pdev) · line 367

Quoted 8 lines
drivers/extcon/extcon-palmas.c +2 -0
 	palmas_enable_irq(palmas_usb);
 	/* perform initial detection */
+	if (palmas_usb->enable_gpio_vbus_detection)
+		palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
 	palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
 	device_set_wakeup_capable(&pdev->dev, true);
 	return 0;

Applied it.

Quoted 2 lines

Thanks. But this is a bug fix and must go in v4.7-rc as well as stable v4.6+.

OK. I'll send the pull request for this patch.

Quoted 4 lines

Can you please add

If we should add the '[email protected]',
this patch should be sent to mailing list.
So, I think that you better to send this patch including stable mailing list. And then, I'll send pull request which apply this patch to 4.7-rc.

Thanks,
Chanwoo Choi

#4 lore raw

PATCH 1/1 extcon: palmas: Fix boot up state of VBUS when using GPIO detection

In reply to Roger Quadros

If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable.

Fixes b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO")
---
 drivers/extcon/extcon-palmas.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/extcon/extcon-palmas.c +2 -0
index 8b3226d..caff46c 100644
@@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev)
 
 	palmas_enable_irq(palmas_usb);
 	/* perform initial detection */
+	if (palmas_usb->enable_gpio_vbus_detection)
+		palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb);
 	palmas_gpio_id_detect(&palmas_usb->wq_detectid.work);
 	device_set_wakeup_capable(&pdev->dev, true);
 	return 0;
Signature · 1 line
2.7.4