extcon: palmas: Fix boot up state of VBUS when using GPIO detection
Subsystems (2)
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.
--- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+)
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 ;
Signature · 1 line
2.7.4
Chanwoo Choi
maintainerQuoted 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")Signed-off-by Roger Quadros <[email protected]>--- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+)drivers/extcon/extcon-palmas.c +0
-0
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
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")Signed-off-by Roger Quadros <[email protected]>--- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+)drivers/extcon/extcon-palmas.c +0
-0@@ -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
-0palmas_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
Chanwoo Choi
maintainerQuoted 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")Signed-off-by Roger Quadros <[email protected]>--- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+)drivers/extcon/extcon-palmas.c +0
-0@@ -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
-0palmas_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
Cc [email protected] # v4.6+
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
PATCH 1/1 extcon: palmas: Fix boot up state of VBUS when using GPIO detection
In reply to Roger QuadrosIf 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.
--- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+)
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 ;
Signature · 1 line
2.7.4