* [PATCH V2 0/2] Suspend for gpio-vbus support
@ 2011-07-02 14:02 Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 1/2] gpio-vbus: support disabling D+ pullup on suspend Dmitry Eremin-Solenikov
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-02 14:02 UTC (permalink / raw)
To: linux-arm-kernel
Previous version of these patches generated quite a lot of comments.
Now I'd like to present an updated version of this patchset.
Changes since V1:
* Switch to using dev_pm_ops instead of platform_driver hooks
* Move suspend/resume to _noirq (LATE) to be sure that otg transceiver
suspends after the main UDC driver.
Dmitry Eremin-Solenikov (2):
gpio-vbus: support disabling D+ pullup on suspend
mioa701: move gpio-pullup functionality to gpio-vbus
arch/arm/mach-pxa/mioa701.c | 8 ++------
drivers/usb/otg/gpio_vbus.c | 32 ++++++++++++++++++++++++++++++++
include/linux/usb/gpio_vbus.h | 1 +
3 files changed, 35 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 1/2] gpio-vbus: support disabling D+ pullup on suspend
2011-07-02 14:02 [PATCH V2 0/2] Suspend for gpio-vbus support Dmitry Eremin-Solenikov
@ 2011-07-02 14:02 ` Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 2/2] mioa701: move gpio-pullup functionality to gpio-vbus Dmitry Eremin-Solenikov
2011-07-03 12:06 ` [PATCH V2 0/2] Suspend for gpio-vbus support Sergei Shtylyov
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-02 14:02 UTC (permalink / raw)
To: linux-arm-kernel
Some platforms would like to disable D+ pullup on suspend, to drain as
low power, as possible. E.g. this was requested by mioa701 board
maintainers.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
drivers/usb/otg/gpio_vbus.c | 32 ++++++++++++++++++++++++++++++++
include/linux/usb/gpio_vbus.h | 1 +
2 files changed, 33 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/otg/gpio_vbus.c b/drivers/usb/otg/gpio_vbus.c
index 52733d9..44527bd 100644
--- a/drivers/usb/otg/gpio_vbus.c
+++ b/drivers/usb/otg/gpio_vbus.c
@@ -327,6 +327,34 @@ static int __exit gpio_vbus_remove(struct platform_device *pdev)
return 0;
}
+#ifdef CONFIG_PM
+static int gpio_vbus_suspend(struct platform_device *pdev, pm_message_t state)
+{
+ struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
+ struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
+
+ if (gpio_vbus->otg.gadget && pdata->disconnect_on_suspend) {
+ /* optionally disable D+ pullup */
+ if (gpio_is_valid(pdata->gpio_pullup))
+ gpio_set_value(pdata->gpio_pullup,
+ pdata->gpio_pullup_inverted);
+
+ set_vbus_draw(gpio_vbus, 0);
+ }
+ return 0;
+}
+
+static int gpio_vbus_resume(struct platform_device *pdev)
+{
+ struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
+
+ if (gpio_vbus->otg.gadget)
+ schedule_work(&gpio_vbus->work);
+
+ return 0;
+}
+#endif
+
/* NOTE: the gpio-vbus device may *NOT* be hotplugged */
MODULE_ALIAS("platform:gpio-vbus");
@@ -337,6 +365,10 @@ static struct platform_driver gpio_vbus_driver = {
.owner = THIS_MODULE,
},
.remove = __exit_p(gpio_vbus_remove),
+#ifdef CONFIG_PM
+ .suspend = gpio_vbus_suspend,
+ .resume = gpio_vbus_resume
+#endif
};
static int __init gpio_vbus_init(void)
diff --git a/include/linux/usb/gpio_vbus.h b/include/linux/usb/gpio_vbus.h
index d9f03cc..2faa38d 100644
--- a/include/linux/usb/gpio_vbus.h
+++ b/include/linux/usb/gpio_vbus.h
@@ -27,4 +27,5 @@ struct gpio_vbus_mach_info {
int gpio_pullup;
bool gpio_vbus_inverted;
bool gpio_pullup_inverted;
+ bool disconnect_on_suspend;
};
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH V2 2/2] mioa701: move gpio-pullup functionality to gpio-vbus
2011-07-02 14:02 [PATCH V2 0/2] Suspend for gpio-vbus support Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 1/2] gpio-vbus: support disabling D+ pullup on suspend Dmitry Eremin-Solenikov
@ 2011-07-02 14:02 ` Dmitry Eremin-Solenikov
2011-07-03 12:06 ` [PATCH V2 0/2] Suspend for gpio-vbus support Sergei Shtylyov
2 siblings, 0 replies; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-02 14:02 UTC (permalink / raw)
To: linux-arm-kernel
gpio-vbus can (and should?) handle D+ pullup gpio for us. Move
gpio-pullup handling to gpio-vbus and stop providing udc_info as it's
empty now. Also tell gpio-vbus that it should disable D+ pullup on
suspend, as did pxa27x_udc driver.
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
arch/arm/mach-pxa/mioa701.c | 8 ++------
1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c
index bcbd359..2039a53 100644
--- a/arch/arm/mach-pxa/mioa701.c
+++ b/arch/arm/mach-pxa/mioa701.c
@@ -402,14 +402,11 @@ static void gsm_exit(void)
/*
* USB UDC
*/
-static struct pxa2xx_udc_mach_info mioa701_udc_info = {
- .gpio_pullup = GPIO22_USB_ENABLE,
-};
-
struct gpio_vbus_mach_info gpio_vbus_data = {
.gpio_vbus = GPIO13_nUSB_DETECT,
.gpio_vbus_inverted = 1,
- .gpio_pullup = -1,
+ .gpio_pullup = GPIO22_USB_ENABLE,
+ .disconnect_on_suspend = 1,
};
/*
@@ -770,7 +767,6 @@ static void __init mioa701_machine_init(void)
pxa_set_fb_info(NULL, &mioa701_pxafb_info);
pxa_set_mci_info(&mioa701_mci_info);
pxa_set_keypad_info(&mioa701_keypad_info);
- pxa_set_udc_info(&mioa701_udc_info);
pxa_set_ac97_info(&mioa701_ac97_info);
pm_power_off = mioa701_poweroff;
arm_pm_restart = mioa701_restart;
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH V2 0/2] Suspend for gpio-vbus support
2011-07-02 14:02 [PATCH V2 0/2] Suspend for gpio-vbus support Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 1/2] gpio-vbus: support disabling D+ pullup on suspend Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 2/2] mioa701: move gpio-pullup functionality to gpio-vbus Dmitry Eremin-Solenikov
@ 2011-07-03 12:06 ` Sergei Shtylyov
2011-07-03 22:43 ` Dmitry Eremin-Solenikov
2 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2011-07-03 12:06 UTC (permalink / raw)
To: linux-arm-kernel
Hello.
On 02-07-2011 18:02, Dmitry Eremin-Solenikov wrote:
> Previous version of these patches generated quite a lot of comments.
> Now I'd like to present an updated version of this patchset.
> Changes since V1:
> * Switch to using dev_pm_ops instead of platform_driver hooks
> * Move suspend/resume to _noirq (LATE) to be sure that otg transceiver
> suspends after the main UDC driver.
Frankly speaking, I don't see where you have done that...
> Dmitry Eremin-Solenikov (2):
> gpio-vbus: support disabling D+ pullup on suspend
> mioa701: move gpio-pullup functionality to gpio-vbus
WBR, Sergei
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH V2 0/2] Suspend for gpio-vbus support
2011-07-03 12:06 ` [PATCH V2 0/2] Suspend for gpio-vbus support Sergei Shtylyov
@ 2011-07-03 22:43 ` Dmitry Eremin-Solenikov
0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Eremin-Solenikov @ 2011-07-03 22:43 UTC (permalink / raw)
To: linux-arm-kernel
On 7/3/11, Sergei Shtylyov <sshtylyov@mvista.com> wrote:
> Hello.
>
> On 02-07-2011 18:02, Dmitry Eremin-Solenikov wrote:
>
>> Previous version of these patches generated quite a lot of comments.
>> Now I'd like to present an updated version of this patchset.
>
>> Changes since V1:
>> * Switch to using dev_pm_ops instead of platform_driver hooks
>> * Move suspend/resume to _noirq (LATE) to be sure that otg transceiver
>> suspends after the main UDC driver.
>
> Frankly speaking, I don't see where you have done that...
Oops... Sent a previous version of the patchset. Sorry.
>
>> Dmitry Eremin-Solenikov (2):
>> gpio-vbus: support disabling D+ pullup on suspend
>> mioa701: move gpio-pullup functionality to gpio-vbus
>
> WBR, Sergei
>
--
With best wishes
Dmitry
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-07-03 22:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-02 14:02 [PATCH V2 0/2] Suspend for gpio-vbus support Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 1/2] gpio-vbus: support disabling D+ pullup on suspend Dmitry Eremin-Solenikov
2011-07-02 14:02 ` [PATCH V2 2/2] mioa701: move gpio-pullup functionality to gpio-vbus Dmitry Eremin-Solenikov
2011-07-03 12:06 ` [PATCH V2 0/2] Suspend for gpio-vbus support Sergei Shtylyov
2011-07-03 22:43 ` Dmitry Eremin-Solenikov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.