[PATCHv2 1/2] USB: host: ehci_atmel: Add suspend/resume support

2015-01-17 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 32 1 file changed, 32 insertions(+) diff

[PATCHv2 2/2] USB: host: ohci_at91: Stop/start USB PLL for all sleep modes

2015-01-17 Thread Sylvain Rochet
is not negligible but acceptable considering the amount of power we are saving. Signed-off-by: Sylvain Rochet Reported-by: Boris Brezillon --- drivers/usb/host/ohci-at91.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c

[PATCH 2/3] USB: host: ohci_at91: Move global variables to private struct

2015-01-17 Thread Sylvain Rochet
This patch move Atmel OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91, appended at the end of the parent struct usb_hcd. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 85 +++- 1 file changed, 52

[PATCH 3/3] USB: host: ohci_at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-17 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation to NULL; Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohc

[PATCH 1/3] USB: host: ehci_atmel: Move global variables to private struct

2015-01-17 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci, appended at the end of the parent struct usb_hcd. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 75 +++ 1 file changed, 48

[PATCHv3 2/5] USB: host: ohci_at91: Stop/start USB PLL for all sleep modes

2015-01-17 Thread Sylvain Rochet
is not negligible but acceptable considering the amount of power we are saving. Signed-off-by: Sylvain Rochet Reported-by: Boris Brezillon --- drivers/usb/host/ohci-at91.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c

[PATCHv3 1/5] USB: host: ehci_atmel: Add suspend/resume support

2015-01-17 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 32 1 file changed, 32 insertions(+) diff

[PATCHv3 3/5] USB: host: ehci_atmel: Move global variables to private struct

2015-01-17 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci_priv, stored in ehci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 78 +++ 1 file changed, 49 insertions(+), 29 deleti

[PATCHv3 0/5] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-17 Thread Sylvain Rochet
Sylvain Rochet (5): USB: host: ehci_atmel: Add suspend/resume support USB: host: ohci_at91: Stop/start USB PLL for all sleep modes USB: host: ehci_atmel: Move global variables to private struct USB: host: ohci_at91: Move global variables to private struct USB: host: ohci_at91

[PATCHv3 5/5] USB: host: ohci_at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-17 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-at91.c b/d

[PATCHv3 4/5] USB: host: ohci_at91: Move global variables to private struct

2015-01-17 Thread Sylvain Rochet
This patch move AT91 OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91_priv, stored in ohci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 85 ++-- 1 file changed, 51 insertions(+), 34 deleti

Re: [PATCH 1/3] USB: host: ehci_atmel: Move global variables to private struct

2015-01-17 Thread Sylvain Rochet
Hello Alan, On Sat, Jan 17, 2015 at 03:30:45PM -0500, Alan Stern wrote: > > This is not the right way to do it. For an example of the right way, > see the ehci-platform.c file. Your private structure is stored in > ehci->priv, and its size is specified by the .extra_priv_size member of > an

Re: [PATCHv3 1/5] USB: host: ehci_atmel: Add suspend/resume support

2015-01-17 Thread Sylvain Rochet
Hi Sergei, On Sun, Jan 18, 2015 at 01:22:38AM +0300, Sergei Shtylyov wrote: > >There's little inconsistency in your patch subjects: you're using > '_' but the files you're modifying are named using '-'... Indeed. > >@@ -187,6 +217,8 @@ static struct platform_driver ehci_atmel_driver = { >

[PATCHv2 0/2] USB: gadget: atmel_usba_udc: Enable/disable USB PLL on Vbus change

2015-01-18 Thread Sylvain Rochet
to an USB host is fine for what I need, this patch allow suspending with USB PLL stopped when USB device is not currently used. Change since v1: * Using a threaded irq and mutex instead of spinclock as suggested * Moved a silently fixed bug in a separate patch (1/2) Sylvain Rochet (2): USB

[PATCH 2/2] USB: gadget: atmel_usba_udc: Enable/disable USB PLL on Vbus change

2015-01-18 Thread Sylvain Rochet
to an USB host is fine for what I need, this patch allow suspending with USB PLL stopped when USB device is not currently used. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 95 - drivers/usb/gadget/udc/atmel_usba_udc.h | 4 ++ 2

[PATCHv2 1/2] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-18 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++ 1 file changed, 2

[PATCHv3 1/2] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-18 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 2 ++ 1 file changed, 2

[PATCHv3 2/2] USB: gadget: atmel_usba_udc: Enable/disable USB PLL on Vbus change

2015-01-18 Thread Sylvain Rochet
to an USB host is fine for what I need, this patch allow suspending with USB PLL stopped when USB device is not currently used. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 96 - drivers/usb/gadget/udc/atmel_usba_udc.h | 4 ++ 2

[PATCHv3 0/2] USB: gadget: atmel_usba_udc: Enable/disable USB PLL on Vbus change

2015-01-18 Thread Sylvain Rochet
useless and probably harmful IRQF_NO_SUSPEND from devm_request_threaded_irq() flags Changes since v1: * Using a threaded irq and mutex instead of spinclock as suggested * Moved a silently fixed bug in a separate patch (1/2) Sylvain Rochet (2): USB: gadget: atmel_usba_udc: Fixed vbus_prev

[PATCHv4 2/6] USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver

2015-01-18 Thread Sylvain Rochet
This patch replace struct platform_driver.{resume,suspend} PM bindings to a new struct dev_pm_ops. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers

[PATCHv4 1/6] USB: host: ehci-atmel: Add suspend/resume support

2015-01-18 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 31 +++ 1 file changed, 31 insertions(+) diff

[PATCHv4 4/6] USB: host: ehci-atmel: Move global variables to private struct

2015-01-18 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci_priv, stored in ehci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 79 +++ 1 file changed, 50 insertions(+), 29 deleti

[PATCHv4 6/6] USB: host: ohci-at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-18 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-at91.c b/d

[PATCHv4 0/6] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-18 Thread Sylvain Rochet
CI, we are trying to get read of this of this function * Removed at91_suspend_entering_slow_clock() from OHCI Sylvain Rochet (6): USB: host: ehci-atmel: Add suspend/resume support USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver USB: host: ohci-at91: Stop

[PATCHv4 3/6] USB: host: ohci-at91: Stop/start USB PLL for all sleep modes

2015-01-18 Thread Sylvain Rochet
is not negligible but acceptable considering the amount of power we are saving. Signed-off-by: Sylvain Rochet Reported-by: Boris Brezillon --- drivers/usb/host/ohci-at91.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c

[PATCHv4 5/6] USB: host: ohci-at91: Move global variables to private struct

2015-01-18 Thread Sylvain Rochet
This patch move AT91 OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91_priv, stored in ohci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 86 ++-- 1 file changed, 52 insertions(+), 34 deleti

Re: [PATCHv3 0/5] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-18 Thread Sylvain Rochet
Hello Alan, On Sun, Jan 18, 2015 at 12:20:49PM -0500, Alan Stern wrote: > On Sat, 17 Jan 2015, Sylvain Rochet wrote: > > > Sylvain Rochet (5): > > USB: host: ehci_atmel: Add suspend/resume support > > USB: host: ohci_at91: Stop/start USB PLL for all sleep modes >

Re: [PATCHv4 3/6] USB: host: ohci-at91: Stop/start USB PLL for all sleep modes

2015-01-18 Thread Sylvain Rochet
Hello, On Sun, Jan 18, 2015 at 08:36:03PM +0100, Sylvain Rochet wrote: > Disable/unprepare clocks without testing the sleep target_state, removed > the at91_suspend_entering_slow_clock() call (which is only a > target_state == PM_SUSPEND_MEM). > > Other kind of suspend now benefit

[PATCHv5 0/6] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-18 Thread Sylvain Rochet
Changes since v1: * Don't use at91_suspend_entering_slow_clock() on EHCI, we are trying to get read of this of this function * Removed at91_suspend_entering_slow_clock() from OHCI Sylvain Rochet (6): USB: host: ehci-atmel: Add suspend/resume support USB: host: ohci-at91: Use struct

[PATCHv5 3/6] USB: host: ehci-atmel: Move global variables to private struct

2015-01-18 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci_priv, stored in ehci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 79 +++ 1 file changed, 50 insertions(+), 29 deleti

[PATCHv5 1/6] USB: host: ehci-atmel: Add suspend/resume support

2015-01-18 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 31 +++ 1 file changed, 31 insertions(+) diff

[PATCHv5 5/6] USB: host: ohci-at91: Move global variables to private struct

2015-01-18 Thread Sylvain Rochet
This patch move AT91 OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91_priv, stored in ohci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 86 ++-- 1 file changed, 52 insertions(+), 34 deleti

[PATCHv5 6/6] USB: host: ohci-at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-18 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-at91.c b/d

[PATCHv5 2/6] USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver

2015-01-18 Thread Sylvain Rochet
This patch replace struct platform_driver.{resume,suspend} PM bindings to a new struct dev_pm_ops. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers

[PATCHv5 4/6] USB: host: ohci-at91: Fix wake-up support

2015-01-18 Thread Sylvain Rochet
. Now, if STANDBY target is chosen the device is still clocked with wake up support enabled, which were the previous default and if MEM target is chosen the device is declocked with wake up support disabled. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 19

[PATCHv6 2/6] USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver

2015-01-19 Thread Sylvain Rochet
This patch replace struct platform_driver.{resume,suspend} PM bindings to a new struct dev_pm_ops. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/drivers/usb/host/ohci-at91.c b/drivers

[PATCHv6 1/6] USB: host: ehci-atmel: Add suspend/resume support

2015-01-19 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 31 +++ 1 file changed, 31 insertions(+) diff

[PATCHv6 6/6] USB: host: ohci-at91: Fix wake-up support

2015-01-19 Thread Sylvain Rochet
. Now, if STANDBY target is chosen the device is still clocked with wake up support enabled, which were the previous default and if MEM target is chosen the device is declocked with wake up support disabled. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 27

[PATCHv6 5/6] USB: host: ohci-at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-19 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/ohci-at91.c b/d

[PATCHv6 4/6] USB: host: ohci-at91: Move global variables to private struct

2015-01-19 Thread Sylvain Rochet
This patch move AT91 OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91_priv, stored in ohci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ohci-at91.c | 84 +++- 1 file changed, 51 insertions(+), 33 deleti

[PATCHv6 0/6] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-19 Thread Sylvain Rochet
tering_slow_clock() from OHCI Sylvain Rochet (6): USB: host: ehci-atmel: Add suspend/resume support USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver USB: host: ehci-atmel: Move global variables to private struct USB: host: ohci-at91: Move global variables to pr

[PATCHv6 3/6] USB: host: ehci-atmel: Move global variables to private struct

2015-01-19 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci_priv, stored in ehci->priv. Signed-off-by: Sylvain Rochet --- drivers/usb/host/ehci-atmel.c | 79 +++ 1 file changed, 50 insertions(+), 29 deleti

Re: [PATCHv5 0/6] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-19 Thread Sylvain Rochet
Hello Nicolas, On Mon, Jan 19, 2015 at 02:34:20PM +0100, Nicolas Ferre wrote: > Le 18/01/2015 23:25, Sylvain Rochet a écrit : > > USB: host: Atmel OHCI and EHCI drivers improvements > > > > Suspend/resume support for EHCI. > > struct dev_pm_ops for OHCI. > > R

Re: [PATCHv3 2/2] USB: gadget: atmel_usba_udc: Enable/disable USB PLL on Vbus change

2015-01-19 Thread Sylvain Rochet
Hello Nicolas, On Mon, Jan 19, 2015 at 05:55:18PM +0100, Nicolas Ferre wrote: > Le 18/01/2015 18:24, Sylvain Rochet a écrit : > > Prepare_enable on rising edge, disable_unprepare on falling edge. Reduce > > Please re-write which "edge" we are talking about: "... fal

Re: [PATCHv3 1/2] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-20 Thread Sylvain Rochet
Hello, On Mon, Jan 19, 2015 at 12:55:47PM -0600, Felipe Balbi wrote: > On Mon, Jan 19, 2015 at 03:09:44PM +0100, Nicolas Ferre wrote: > > Le 18/01/2015 18:24, Sylvain Rochet a écrit : > > > If vbus gpio is high at init, we should set vbus_prev to true > > > accordingl

[PATCHv7 3/6] USB: host: ehci-atmel: Move global variables to private struct

2015-01-20 Thread Sylvain Rochet
This patch move Atmel EHCI global variables (clocks ptr and clocked boolean) to private struct atmel_ehci_priv, stored in ehci->priv. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by: Nicolas Ferre --- drivers/usb/host/ehci-atmel.c |

[PATCHv7 6/6] USB: host: ohci-at91: Fix wake-up support

2015-01-20 Thread Sylvain Rochet
. Now, if STANDBY target is chosen the device is still clocked with wake up support enabled, which were the previous default and if MEM target is chosen the device is declocked with wake up support disabled. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by

[PATCHv7 4/6] USB: host: ohci-at91: Move global variables to private struct

2015-01-20 Thread Sylvain Rochet
This patch move AT91 OHCI global variables (clocks ptr and clocked boolean) to private struct ohci_at91_priv, stored in ohci->priv. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by: Nicolas Ferre --- drivers/usb/host/ohci-at91.c |

[PATCHv7 0/6] USB: host: Atmel OHCI and EHCI drivers improvements

2015-01-20 Thread Sylvain Rochet
of this of this function * Removed at91_suspend_entering_slow_clock() from OHCI Sylvain Rochet (6): USB: host: ehci-atmel: Add suspend/resume support USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver USB: host: ehci-atmel: Move global variables to private struct US

[PATCHv7 1/6] USB: host: ehci-atmel: Add suspend/resume support

2015-01-20 Thread Sylvain Rochet
This patch add suspend/resume support for Atmel EHCI, mostly about disabling and unpreparing clocks so USB PLL is stopped before entering sleep state. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by: Nicolas Ferre Acked-by: Alexandre Belloni --- drivers

[PATCHv7 5/6] USB: host: ohci-at91: usb_hcd_at91_probe(), remove useless stack initialisation

2015-01-20 Thread Sylvain Rochet
struct usb_hcd *hcd = NULL; ... hcd = usb_create_hcd(driver, dev, "at91"); This patch remove *hcd useless initialisation Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by: Nicolas Ferre --- drivers/usb/host/ohci-at91.c | 2 +- 1 file changed, 1

[PATCHv7 2/6] USB: host: ohci-at91: Use struct dev_pm_ops instead of struct platform_driver

2015-01-20 Thread Sylvain Rochet
This patch replace struct platform_driver.{resume,suspend} PM bindings to a new struct dev_pm_ops. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon Acked-by: Alan Stern Acked-by: Nicolas Ferre --- drivers/usb/host/ohci-at91.c | 21 ++--- 1 file changed, 10 insertions

[PATCHv4 2/3] USB: gadget: atmel_usba_udc: Enable Vbus signal IRQ in UDC start instead of UDC probe

2015-01-20 Thread Sylvain Rochet
RQ (IRQF_NOAUTOEN flag) because set_irq_flags() can't change just one flag, therefore it must be called with all flags, without respecting what the AIC previously did. Naively copying IRQ flags currently set by the AIC looked like error-prone if defaults flags change at some point in the futu

[PATCHv4 3/3] USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on falling edge of the Vbus signal

2015-01-20 Thread Sylvain Rochet
driver in the future. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre --- drivers/usb/gadget/udc/atmel_usba_udc.c | 86 - drivers/usb/gadget/udc/atmel_usba_udc.h | 4 ++ 2 files changed, 66 insertions(+), 24 deletions(-) diff --git a/drivers/usb/gadget/udc

[PATCHv4 1/3] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-20 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Fixes: 914a3f3b3754 ("USB: add atmel_usb

[PATCHv4 0/3] USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on falling edge of the Vbus signal

2015-01-20 Thread Sylvain Rochet
bug in a separate patch (1/2) Sylvain Rochet (3): USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state USB: gadget: atmel_usba_udc: Enable Vbus signal IRQ in UDC start instead of UDC probe USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on fal

Re: [PATCHv4 2/3] USB: gadget: atmel_usba_udc: Enable Vbus signal IRQ in UDC start instead of UDC probe

2015-01-21 Thread Sylvain Rochet
Hi Boris, On Wed, Jan 21, 2015 at 10:20:16AM +0100, Boris Brezillon wrote: > > > > udc->vbus_prev = 0; > > - if (gpio_is_valid(udc->vbus_pin)) > > - enable_irq(gpio_to_irq(udc->vbus_pin)); > > + if (gpio_is_valid(udc->vbus_pin)) { > > + ret = request_irq(gpio_to_irq(u

[PATCHv5 1/4] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-21 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Fixes: 914a3f3b3754 ("USB: add atmel_usb

[PATCHv5 2/4] USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ instead of an auto enabled IRQ request followed by IRQ disable

2015-01-21 Thread Sylvain Rochet
al IRQ instead of an auto enabled IRQ followed by disable_irq(). This way we remove the very small timeslot of enabled IRQ which existed previously between request() and disable(). We don't need anymore to check if udc->driver is NULL in IRQ handler. Signed-off-by: Sylvain Rochet Sugge

[PATCHv5 4/4] USB: gadget: atmel_usba_udc: Add suspend/resume with wakeup support

2015-01-21 Thread Sylvain Rochet
clocks and USBA we stopped them. If a device is connected, i.e. connected while we were suspended without wakeup enabled, we enable the controller. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 61 + 1 file changed, 61 insertions(+) diff

[PATCHv5 3/4] USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on falling edge of the Vbus signal

2015-01-21 Thread Sylvain Rochet
stays continuously clocked. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre --- drivers/usb/gadget/udc/atmel_usba_udc.c | 149 +--- drivers/usb/gadget/udc/atmel_usba_udc.h | 4 + 2 files changed, 104 insertions(+), 49 deletions(-) diff --git a/drivers/usb/gadget

[PATCHv5 0/4] USB: gadget: atmel_usba_udc: Driver improvements

2015-01-21 Thread Sylvain Rochet
ed interrupt because we are not in irq context anymore * Removed useless and probably harmful IRQF_NO_SUSPEND from devm_request_threaded_irq() flags Changes since v1: * Using a threaded irq and mutex instead of spinclock as suggested * Moved a silently fixed bug in a separate patch (1

[PATCHv6 5/5] USB: gadget: atmel_usba_udc: Add suspend/resume with wakeup support

2015-01-22 Thread Sylvain Rochet
clocks and USBA if we stopped them. If a device is currently connected at resume time we enable the controller. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon --- drivers/usb/gadget/udc/atmel_usba_udc.c | 68 + 1 file changed, 68 insertions(+) diff --git a

[PATCHv6 2/5] USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ instead of an auto enabled IRQ request followed by IRQ disable

2015-01-22 Thread Sylvain Rochet
al IRQ instead of an auto enabled IRQ followed by disable_irq(). This way we remove the very small timeslot of enabled IRQ which existed previously between request() and disable(). We don't need anymore to check if udc->driver is NULL in IRQ handler. Signed-off-by: Sylvain Rochet Sugge

[PATCHv6 3/5] USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on falling edge of the Vbus signal

2015-01-22 Thread Sylvain Rochet
stays continuously clocked. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Acked-by: Boris Brezillon --- drivers/usb/gadget/udc/atmel_usba_udc.c | 144 +--- drivers/usb/gadget/udc/atmel_usba_udc.h | 4 + 2 files changed, 100 insertions(+), 48 deletions(-) diff

[PATCHv6 4/5] USB: gadget: atmel_usba_udc: Prepare for IRQ single edge support

2015-01-22 Thread Sylvain Rochet
IRQ_TYPE_EDGE_RISING, otherwise set to false. Signed-off-by: Sylvain Rochet --- drivers/usb/gadget/udc/atmel_usba_udc.c | 25 +++-- drivers/usb/gadget/udc/atmel_usba_udc.h | 5 +++-- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/usb/gadget/udc/atmel_usba_udc.c b

[PATCHv6 1/5] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-01-22 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Acked-by: Boris Brezillon --- drivers/usb

[PATCHv6 0/5] USB: gadget: atmel_usba_udc: Driver improvements

2015-01-22 Thread Sylvain Rochet
threaded_irq() flags Changes since v1: * Using a threaded irq and mutex instead of spinclock as suggested * Moved a silently fixed bug in a separate patch (1/2) Sylvain Rochet (5): USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state USB: gadget: atmel_usba_udc: Request an auto disabled

Re: [PATCHv6 2/5] USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ instead of an auto enabled IRQ request followed by IRQ disable

2015-01-23 Thread Sylvain Rochet
Hello, On Fri, Jan 23, 2015 at 09:59:58AM +0100, Nicolas Ferre wrote: > Le 23/01/2015 08:43, Jean-Christophe PLAGNIOL-VILLARD a écrit : > > > On Jan 23, 2015, at 12:56 AM, Sylvain Rochet > > > wrote: > > > + irq_set_status_f

Re: [PATCHv6 4/5] USB: gadget: atmel_usba_udc: Prepare for IRQ single edge support

2015-02-07 Thread Sylvain Rochet
Hello Nicolas, On Thu, Feb 05, 2015 at 06:19:55PM +0100, Nicolas Ferre wrote: > Le 22/01/2015 18:14, Boris Brezillon a écrit : > > On Thu, 22 Jan 2015 17:56:44 +0100 > > Sylvain Rochet wrote: > > > > > -static const struct usba_udc_errata at91sam9g45_errata

Re: [PATCH 3/3] ARM: at91: dt: at91sam9n12ek: enable udp

2015-02-09 Thread Sylvain Rochet
Hello Bo, On Mon, Feb 09, 2015 at 05:02:52PM +0800, Bo Shen wrote: > Enable usb device port on at91sam9n12ek board. > > Signed-off-by: Bo Shen > --- > > arch/arm/boot/dts/at91sam9n12ek.dts | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/arch/arm/boot/dts/at91sam9n12ek.dts > b/a

[PATCHv7 2/4] USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ instead of an auto enabled IRQ request followed by IRQ disable

2015-02-12 Thread Sylvain Rochet
al IRQ instead of an auto enabled IRQ followed by disable_irq(). This way we remove the very small timeslot of enabled IRQ which existed previously between request() and disable(). We don't need anymore to check if udc->driver is NULL in IRQ handler. Signed-off-by: Sylvain Rochet Sugge

[PATCHv7 4/4] USB: gadget: atmel_usba_udc: Add suspend/resume with wakeup support

2015-02-12 Thread Sylvain Rochet
clocks and USBA if we stopped them. If a device is currently connected at resume time we enable the controller. Signed-off-by: Sylvain Rochet Acked-by: Boris Brezillon --- drivers/usb/gadget/udc/atmel_usba_udc.c | 57 + 1 file changed, 57 insertions(+) diff --git a

[PATCHv7 3/4] USB: gadget: atmel_usba_udc: Start clocks on rising edge of the Vbus signal, stop clocks on falling edge of the Vbus signal

2015-02-12 Thread Sylvain Rochet
stays continuously clocked. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Acked-by: Boris Brezillon --- drivers/usb/gadget/udc/atmel_usba_udc.c | 144 +--- drivers/usb/gadget/udc/atmel_usba_udc.h | 4 + 2 files changed, 100 insertions(+), 48 deletions(-) diff

[PATCHv7 1/4] USB: gadget: atmel_usba_udc: Fixed vbus_prev initial state

2015-02-12 Thread Sylvain Rochet
If vbus gpio is high at init, we should set vbus_prev to true accordingly to the current vbus state. Without that, we skip the first vbus interrupt because the saved vbus state is not consistent. Signed-off-by: Sylvain Rochet Acked-by: Nicolas Ferre Acked-by: Boris Brezillon --- drivers/usb

[PATCHv7 0/4] USB: gadget: atmel_usba_udc: PM driver improvements

2015-02-12 Thread Sylvain Rochet
s and probably harmful IRQF_NO_SUSPEND from devm_request_threaded_irq() flags Changes since v1: * Using a threaded irq and mutex instead of spinclock as suggested * Moved a silently fixed bug in a separate patch (1/2) Sylvain Rochet (4): USB: gadget: atmel_usba_udc: Fixed vbus_prev initi

Re: [PATCHv6 4/5] USB: gadget: atmel_usba_udc: Prepare for IRQ single edge support

2015-02-12 Thread Sylvain Rochet
Hello Boris, On Sun, Feb 08, 2015 at 10:24:39AM +0100, Boris Brezillon wrote: > On Sat, 7 Feb 2015 20:37:23 +0100 > Sylvain Rochet wrote: > > > If not, is udc->caps->irq_single_edge_support boolean acceptable ? > > Do you mean keeping the current approach ? Yes!

Re: [PATCHv7 2/4] USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ instead of an auto enabled IRQ request followed by IRQ disable

2015-03-12 Thread Sylvain Rochet
Hello Felipe, On Tue, Mar 10, 2015 at 04:12:14PM -0500, Felipe Balbi wrote: > Hi, > > (dropping patch, my only context is subject line) > > "USB: gadget: atmel_usba_udc: Request an auto disabled Vbus signal IRQ > instead of an auto enabled IRQ request followed by IRQ disable" > > Holy crap, tha