Re: [PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy

2013-10-08 Thread Valentine

On 10/08/2013 07:27 AM, Kuninori Morimoto wrote:


Hi Valentine


Hi Morimoto-san,



Thank you for your patch


Thanks for looking at it.




+/* Setup USB channels */
+static void __rcar_gen2_usb_phy_setup(struct rcar_gen2_usb_phy_priv *priv)
+{
+   u32 val;
+
+   clk_prepare_enable(priv-clk);
+
+   /* Set USB channels in the USBHS UGCTRL2 register */
+   val = ioread32(priv-base);
+   val = ~(USBHS_UGCTRL2_USB0_HS | USBHS_UGCTRL2_USB2_SS);
+   val |= priv-ugctrl2;
+   iowrite32(val, priv-base);
+}


 From my point of view, if you use clk_enable() on setup(),
then, it is easy to read if it has exit() or similar name function
which calls clk_disable()


Since in this case all is needed is to disable the clocks, I've decided 
not to put it in a separate exit function. I'll add one for better 
readability.





+static int rcar_gen2_usb_phy_set_suspend(struct usb_phy *phy, int suspend)
+{
+   struct rcar_gen2_usb_phy_priv *priv = usb_phy_to_priv(phy);
+   unsigned long flags;
+   int retval;
+
+   spin_lock_irqsave(priv-lock, flags);
+   if (suspend) {
+   /* Suspend USBHS internal phy */
+   retval = __rcar_gen2_usbhs_phy_disable(priv-base);
+   /*
+* If nothing else is using USB channel 0/2
+* disable the clocks as well
+*/
+   if (priv-usecount == 1) {
+   clk_disable_unprepare(priv-clk);
+   priv-usecount--;
+   }
+   } else {
+   /*
+* Enable the clock and setup USB channels
+* if needed.
+*/
+   if (!priv-usecount) {
+   priv-usecount++;
+   __rcar_gen2_usb_phy_setup(priv);
+   }
+   /* Resume USBHS internal phy */
+   retval = __rcar_gen2_usbhs_phy_enable(priv-base);
+   }


Are these usecount++/usecount-- position correct ?


The idea was to disable the clocks here if the phy is not used by other 
drivers (PCI USB host or USBSS), so that suspending the gadget would 
disable USBHS clocks. However, this needs phy enabled before the 
shutdown is called. I guess I'll drop the clock handling here and leave 
it solely to init/shutdown callbacks.





+static int rcar_gen2_usb_phy_probe(struct platform_device *pdev)
+{
+   struct device *dev = pdev-dev;
+   struct rcar_gen2_phy_platform_data *pdata;
+   struct rcar_gen2_usb_phy_priv *priv;
+   struct resource *res;
+   void __iomem *base;
+   struct clk *clk;
+   int retval;
+
+   pdata = dev_get_platdata(pdev-dev);
+   if (!pdata) {
+   dev_err(dev, No platform data\n);
+   return -EINVAL;
+   }
+
+   clk = devm_clk_get(pdev-dev, usbhs);
+   if (IS_ERR(clk)) {
+   dev_err(pdev-dev, Can't get the clock\n);
+   return PTR_ERR(clk);
+   }


This case (if you use usb_phy_rcar_gen2 driver),
you can use pm_runtime_xxx instead of clk_get/enable/disable()



Yes, I could. The reason I did not is that I'm not sure that a phy 
driver should use runtime PM, since it is actually mastered by other 
drivers which are supposed to control its power via init/shutdown and 
set_suspend callbacks. Thus, looks like the phy driver can't really 
auto-suspend and doesn't really support runtime PM.


I think that handling clocks in the init/shutdown is a bit cleaner.
It gives us more control over the phy power, where pm_runtime_xxx will 
do nothing if CONFIG_PM_RUNTIME is disabled.


Thanks,
Val.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] arm: shmobile: lager: Add USBHS support

2013-10-08 Thread Valentine

On 10/08/2013 07:31 AM, Kuninori Morimoto wrote:


Hi Valentine


This adds USBHS PHY and registers USBHS device if the driver is enabled.

Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
---

(snip)

+/* USBHS */
+#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
+static const struct resource usbhs_resources[] __initconst = {
+   DEFINE_RES_MEM(0xe659, 0x100),
+   DEFINE_RES_IRQ(gic_spi(107)),
+};


Why it needs #if IS_ENABLED() ?
I guess nothing happen if renesas_usbhs driver
registered without CONFIG_USB_RENESAS_USBHS_UDC.
But am I misunderstanding ?



Since USB channel 0 is shared between PCI USB host and USBHS
we'll still need it later to properly configure the channel.
Besides, is saves us some bits leaving all the unused callbacks and 
device structures out if we do not register the device when the driver 
is disabled.


Thanks,
Val.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] arm: shmobile: lager: Add USBHS support

2013-10-08 Thread Kuninori Morimoto

Hi Valentine

  +/* USBHS */
  +#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
  +static const struct resource usbhs_resources[] __initconst = {
  +  DEFINE_RES_MEM(0xe659, 0x100),
  +  DEFINE_RES_IRQ(gic_spi(107)),
  +};
 
  Why it needs #if IS_ENABLED() ?
  I guess nothing happen if renesas_usbhs driver
  registered without CONFIG_USB_RENESAS_USBHS_UDC.
  But am I misunderstanding ?
 
 
 Since USB channel 0 is shared between PCI USB host and USBHS
 we'll still need it later to properly configure the channel.
 Besides, is saves us some bits leaving all the unused callbacks and 
 device structures out if we do not register the device when the driver 
 is disabled.

Ahh, I see.
Sorry for my noise

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy

2013-10-08 Thread Kuninori Morimoto

Hi Valentine

   From my point of view, if you use clk_enable() on setup(),
  then, it is easy to read if it has exit() or similar name function
  which calls clk_disable()
 
 Since in this case all is needed is to disable the clocks, I've decided 
 not to put it in a separate exit function. I'll add one for better 
 readability.

Thank you

  Are these usecount++/usecount-- position correct ?
 
 The idea was to disable the clocks here if the phy is not used by other 
 drivers (PCI USB host or USBSS), so that suspending the gadget would 
 disable USBHS clocks. However, this needs phy enabled before the 
 shutdown is called. I guess I'll drop the clock handling here and leave 
 it solely to init/shutdown callbacks.

Thank you

  +  clk = devm_clk_get(pdev-dev, usbhs);
  +  if (IS_ERR(clk)) {
  +  dev_err(pdev-dev, Can't get the clock\n);
  +  return PTR_ERR(clk);
  +  }
 
  This case (if you use usb_phy_rcar_gen2 driver),
  you can use pm_runtime_xxx instead of clk_get/enable/disable()
 
 
 Yes, I could. The reason I did not is that I'm not sure that a phy 
 driver should use runtime PM, since it is actually mastered by other 
 drivers which are supposed to control its power via init/shutdown and 
 set_suspend callbacks. Thus, looks like the phy driver can't really 
 auto-suspend and doesn't really support runtime PM.
 
 I think that handling clocks in the init/shutdown is a bit cleaner.
 It gives us more control over the phy power, where pm_runtime_xxx will 
 do nothing if CONFIG_PM_RUNTIME is disabled.

OK, it is reasonable for me

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 5/6] Revert ARM: OMAP2+: Provide alias to USB PHY clock

2013-10-08 Thread Roger Quadros
This reverts commit 741532c4a995be11815cb72d4d7a48f442a22fea.

The proper clock reference is provided in device tree so we
no longer need this.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/mach-omap2/board-generic.c |   23 +--
 1 files changed, 1 insertions(+), 22 deletions(-)

diff --git a/arch/arm/mach-omap2/board-generic.c 
b/arch/arm/mach-omap2/board-generic.c
index cd85b36..da4e9b2 100644
--- a/arch/arm/mach-omap2/board-generic.c
+++ b/arch/arm/mach-omap2/board-generic.c
@@ -15,7 +15,6 @@
 #include linux/of_irq.h
 #include linux/of_platform.h
 #include linux/irqdomain.h
-#include linux/clk.h
 
 #include asm/mach/arch.h
 
@@ -36,21 +35,6 @@ static struct of_device_id omap_dt_match_table[] __initdata 
= {
{ }
 };
 
-/*
- * Create alias for USB host PHY clock.
- * Remove this when clock phandle can be provided via DT
- */
-static void __init legacy_init_ehci_clk(char *clkname)
-{
-   int ret;
-
-   ret = clk_add_alias(main_clk, NULL, clkname, NULL);
-   if (ret) {
-   pr_err(%s:Failed to add main_clk alias to %s :%d\n,
-   __func__, clkname, ret);
-   }
-}
-
 static void __init omap_generic_init(void)
 {
omap_sdrc_init(NULL, NULL);
@@ -61,15 +45,10 @@ static void __init omap_generic_init(void)
 * HACK: call display setup code for selected boards to enable omapdss.
 * This will be removed when omapdss supports DT.
 */
-   if (of_machine_is_compatible(ti,omap4-panda)) {
+   if (of_machine_is_compatible(ti,omap4-panda))
omap4_panda_display_init_of();
-   legacy_init_ehci_clk(auxclk3_ck);
-
-   }
else if (of_machine_is_compatible(ti,omap4-sdp))
omap_4430sdp_display_init_of();
-   else if (of_machine_is_compatible(ti,omap5-uevm))
-   legacy_init_ehci_clk(auxclk1_ck);
 }
 
 #ifdef CONFIG_SOC_OMAP2420
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 0/6] Add USB Host support for OMAP5 uevm for 3.13

2013-10-08 Thread Roger Quadros
Hi,

This patch series provide USB host support for the OMAP5 uEVM board.
As ethernet port is over USB, it brings up ethernet as well.

Series depends on the OMAP clock tree DT data series by Tero Kristo [1]

Tested on OMAP5 uEVM and OMAP4 Panda.

cheers,
-roger

[1] -   OMAP Clock DT conversion
http://www.spinics.net/lists/arm-kernel/msg275311.html

Roger Quadros (6):
  ARM: OMAP5: hwmod data: Add USB Host and TLL modules
  ARM: dts: OMAP5: Add 60MHz clock reference to USB Host module
  ARM: dts: omap4-panda: Provide USB PHY clock
  ARM: dts: omap5-uevm: Provide USB PHY clock
  Revert ARM: OMAP2+: Provide alias to USB PHY clock
  mfd: omap-usb: prepare/unprepare clock while enable/disable

 arch/arm/boot/dts/omap4-panda-common.dtsi  |8 +--
 arch/arm/boot/dts/omap5-uevm.dts   |8 +--
 arch/arm/boot/dts/omap5.dtsi   |2 +
 arch/arm/mach-omap2/board-generic.c|   23 +-
 arch/arm/mach-omap2/omap_hwmod_54xx_data.c |  135 
 drivers/mfd/omap-usb-host.c|   16 ++--
 drivers/mfd/omap-usb-tll.c |4 +-
 7 files changed, 152 insertions(+), 44 deletions(-)

-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 3/6] ARM: dts: omap4-panda: Provide USB PHY clock

2013-10-08 Thread Roger Quadros
The USB PHY gets its clock from AUXCLK3. Provide this
information.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap4-panda-common.dtsi |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap4-panda-common.dtsi 
b/arch/arm/boot/dts/omap4-panda-common.dtsi
index 3e6801c..f90a1d4 100644
--- a/arch/arm/boot/dts/omap4-panda-common.dtsi
+++ b/arch/arm/boot/dts/omap4-panda-common.dtsi
@@ -83,12 +83,8 @@
compatible = usb-nop-xceiv;
reset-gpios = gpio2 30 GPIO_ACTIVE_LOW;   /* gpio_62 */
vcc-supply = hsusb1_power;
-   /**
-* FIXME:
-* put the right clock phandle here when available
-*  clocks = auxclk3;
-*  clock-names = main_clk;
-*/
+   clocks = auxclk3_ck;
+   clock-names = main_clk;
clock-frequency = 1920;
};
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 1/6] ARM: OMAP5: hwmod data: Add USB Host and TLL modules

2013-10-08 Thread Roger Quadros
Add hwmod data for High Speed USB host and TLL modules

CC: Paul Walmsley p...@pwsan.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/mach-omap2/omap_hwmod_54xx_data.c |  135 
 1 files changed, 135 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c 
b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
index 1a21a81..1dd2c20 100644
--- a/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_54xx_data.c
@@ -1501,6 +1501,123 @@ static struct omap_hwmod omap54xx_uart6_hwmod = {
 };
 
 /*
+ * 'usb_host_hs' class
+ * high-speed multi-port usb host controller
+ */
+
+static struct omap_hwmod_class_sysconfig omap54xx_usb_host_hs_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .sysc_flags = (SYSC_HAS_MIDLEMODE | SYSC_HAS_RESET_STATUS |
+  SYSC_HAS_SIDLEMODE | SYSC_HAS_SOFTRESET),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART |
+  SIDLE_SMART_WKUP | MSTANDBY_FORCE | MSTANDBY_NO |
+  MSTANDBY_SMART | MSTANDBY_SMART_WKUP),
+   .sysc_fields= omap_hwmod_sysc_type2,
+};
+
+static struct omap_hwmod_class omap54xx_usb_host_hs_hwmod_class = {
+   .name   = usb_host_hs,
+   .sysc   = omap54xx_usb_host_hs_sysc,
+};
+
+static struct omap_hwmod omap54xx_usb_host_hs_hwmod = {
+   .name   = usb_host_hs,
+   .class  = omap54xx_usb_host_hs_hwmod_class,
+   .clkdm_name = l3init_clkdm,
+   /*
+* Errata: USBHOST Configured In Smart-Idle Can Lead To a Deadlock
+* id: i660
+*
+* Description:
+* In the following configuration :
+* - USBHOST module is set to smart-idle mode
+* - PRCM asserts idle_req to the USBHOST module ( This typically
+*   happens when the system is going to a low power mode : all ports
+*   have been suspended, the master part of the USBHOST module has
+*   entered the standby state, and SW has cut the functional clocks)
+* - an USBHOST interrupt occurs before the module is able to answer
+*   idle_ack, typically a remote wakeup IRQ.
+* Then the USB HOST module will enter a deadlock situation where it
+* is no more accessible nor functional.
+*
+* Workaround:
+* Don't use smart idle; use only force idle, hence HWMOD_SWSUP_SIDLE
+*/
+
+   /*
+* Errata: USB host EHCI may stall when entering smart-standby mode
+* Id: i571
+*
+* Description:
+* When the USBHOST module is set to smart-standby mode, and when it is
+* ready to enter the standby state (i.e. all ports are suspended and
+* all attached devices are in suspend mode), then it can wrongly assert
+* the Mstandby signal too early while there are still some residual OCP
+* transactions ongoing. If this condition occurs, the internal state
+* machine may go to an undefined state and the USB link may be stuck
+* upon the next resume.
+*
+* Workaround:
+* Don't use smart standby; use only force standby,
+* hence HWMOD_SWSUP_MSTANDBY
+*/
+
+   /*
+* During system boot; If the hwmod framework resets the module
+* the module will have smart idle settings; which can lead to deadlock
+* (above Errata Id:i660); so, dont reset the module during boot;
+* Use HWMOD_INIT_NO_RESET.
+*/
+
+   .flags  = HWMOD_SWSUP_SIDLE | HWMOD_SWSUP_MSTANDBY |
+ HWMOD_INIT_NO_RESET,
+   .main_clk   = l3init_60m_fclk,
+   .prcm = {
+   .omap4 = {
+   .clkctrl_offs = 
OMAP54XX_CM_L3INIT_USB_HOST_HS_CLKCTRL_OFFSET,
+   .context_offs = 
OMAP54XX_RM_L3INIT_USB_HOST_HS_CONTEXT_OFFSET,
+   .modulemode   = MODULEMODE_SWCTRL,
+   },
+   },
+};
+
+/*
+ * 'usb_tll_hs' class
+ * usb_tll_hs module is the adapter on the usb_host_hs ports
+ */
+
+static struct omap_hwmod_class_sysconfig omap54xx_usb_tll_hs_sysc = {
+   .rev_offs   = 0x,
+   .sysc_offs  = 0x0010,
+   .syss_offs  = 0x0014,
+   .sysc_flags = (SYSC_HAS_AUTOIDLE | SYSC_HAS_CLOCKACTIVITY |
+  SYSC_HAS_ENAWAKEUP | SYSC_HAS_SIDLEMODE |
+  SYSC_HAS_SOFTRESET | SYSS_HAS_RESET_STATUS),
+   .idlemodes  = (SIDLE_FORCE | SIDLE_NO | SIDLE_SMART),
+   .sysc_fields= omap_hwmod_sysc_type1,
+};
+
+static struct omap_hwmod_class omap54xx_usb_tll_hs_hwmod_class = {
+   .name   = usb_tll_hs,
+   .sysc   = omap54xx_usb_tll_hs_sysc,
+};
+
+static struct omap_hwmod omap54xx_usb_tll_hs_hwmod = {
+   .name   = usb_tll_hs,
+   .class  = omap54xx_usb_tll_hs_hwmod_class,
+   .clkdm_name = l3init_clkdm,
+   

[PATCH v2 6/6] mfd: omap-usb: prepare/unprepare clock while enable/disable

2013-10-08 Thread Roger Quadros
This should fix the following warning at boot on OMAP5 uEVM
[8.783155] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:883 
__clk_enable+0x94/0xa4()

CC: Samuel Ortiz sa...@linux.intel.com
CC: Lee Jones lee.jo...@linaro.org
CC: Tero Kristo t-kri...@ti.com
Signed-off-by: Roger Quadros rog...@ti.com
---
 drivers/mfd/omap-usb-host.c |   16 
 drivers/mfd/omap-usb-tll.c  |4 ++--
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 29ee54d..a5b91f1 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -328,13 +328,13 @@ static int usbhs_runtime_resume(struct device *dev)
omap_tll_enable(pdata);
 
if (!IS_ERR(omap-ehci_logic_fck))
-   clk_enable(omap-ehci_logic_fck);
+   clk_prepare_enable(omap-ehci_logic_fck);
 
for (i = 0; i  omap-nports; i++) {
switch (pdata-port_mode[i]) {
case OMAP_EHCI_PORT_MODE_HSIC:
if (!IS_ERR(omap-hsic60m_clk[i])) {
-   r = clk_enable(omap-hsic60m_clk[i]);
+   r = clk_prepare_enable(omap-hsic60m_clk[i]);
if (r) {
dev_err(dev,
 Can't enable port %d hsic60m 
clk:%d\n,
@@ -343,7 +343,7 @@ static int usbhs_runtime_resume(struct device *dev)
}
 
if (!IS_ERR(omap-hsic480m_clk[i])) {
-   r = clk_enable(omap-hsic480m_clk[i]);
+   r = clk_prepare_enable(omap-hsic480m_clk[i]);
if (r) {
dev_err(dev,
 Can't enable port %d hsic480m 
clk:%d\n,
@@ -354,7 +354,7 @@ static int usbhs_runtime_resume(struct device *dev)
 
case OMAP_EHCI_PORT_MODE_TLL:
if (!IS_ERR(omap-utmi_clk[i])) {
-   r = clk_enable(omap-utmi_clk[i]);
+   r = clk_prepare_enable(omap-utmi_clk[i]);
if (r) {
dev_err(dev,
 Can't enable port %d clk : %d\n,
@@ -382,15 +382,15 @@ static int usbhs_runtime_suspend(struct device *dev)
switch (pdata-port_mode[i]) {
case OMAP_EHCI_PORT_MODE_HSIC:
if (!IS_ERR(omap-hsic60m_clk[i]))
-   clk_disable(omap-hsic60m_clk[i]);
+   clk_disable_unprepare(omap-hsic60m_clk[i]);
 
if (!IS_ERR(omap-hsic480m_clk[i]))
-   clk_disable(omap-hsic480m_clk[i]);
+   clk_disable_unprepare(omap-hsic480m_clk[i]);
/* Fall through as utmi_clks were used in HSIC mode */
 
case OMAP_EHCI_PORT_MODE_TLL:
if (!IS_ERR(omap-utmi_clk[i]))
-   clk_disable(omap-utmi_clk[i]);
+   clk_disable_unprepare(omap-utmi_clk[i]);
break;
default:
break;
@@ -398,7 +398,7 @@ static int usbhs_runtime_suspend(struct device *dev)
}
 
if (!IS_ERR(omap-ehci_logic_fck))
-   clk_disable(omap-ehci_logic_fck);
+   clk_disable_unprepare(omap-ehci_logic_fck);
 
omap_tll_disable(pdata);
 
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index e59ac4c..1e57712 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -429,7 +429,7 @@ int omap_tll_enable(struct usbhs_omap_platform_data *pdata)
if (IS_ERR(tll-ch_clk[i]))
continue;
 
-   r = clk_enable(tll-ch_clk[i]);
+   r = clk_prepare_enable(tll-ch_clk[i]);
if (r) {
dev_err(tll_dev,
 Error enabling ch %d clock: %d\n, i, r);
@@ -460,7 +460,7 @@ int omap_tll_disable(struct usbhs_omap_platform_data *pdata)
for (i = 0; i  tll-nch; i++) {
if (omap_usb_mode_needs_tll(pdata-port_mode[i])) {
if (!IS_ERR(tll-ch_clk[i]))
-   clk_disable(tll-ch_clk[i]);
+   clk_disable_unprepare(tll-ch_clk[i]);
}
}
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 2/6] ARM: dts: OMAP5: Add 60MHz clock reference to USB Host module

2013-10-08 Thread Roger Quadros
USB Host driver (drivers/mfd/omap-usb-host.c) expects the 60MHz
reference clock to be named init_60m_fclk. Provide this
information.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap5.dtsi |2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index edc801f..6f98be2 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -703,6 +703,8 @@
#address-cells = 1;
#size-cells = 1;
ranges;
+   clocks = l3init_60m_fclk;
+   clock-names = init_60m_fclk;
 
usbhsohci: ohci@4a064800 {
compatible = ti,ohci-omap3, usb-ohci;
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH v2 4/6] ARM: dts: omap5-uevm: Provide USB PHY clock

2013-10-08 Thread Roger Quadros
The HS USB 2 PHY gets its clock from AUXCLK1. Provide this
information.

Signed-off-by: Roger Quadros rog...@ti.com
---
 arch/arm/boot/dts/omap5-uevm.dts |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts
index 748f6bf..6a0d73c 100644
--- a/arch/arm/boot/dts/omap5-uevm.dts
+++ b/arch/arm/boot/dts/omap5-uevm.dts
@@ -31,12 +31,8 @@
hsusb2_phy: hsusb2_phy {
compatible = usb-nop-xceiv;
reset-gpios = gpio3 16 GPIO_ACTIVE_LOW; /* gpio3_80 
HUB_NRESET */
-   /**
- * FIXME
- * Put the right clock phandle here when available
- * clocks = auxclk1;
- * clock-names = main_clk;
- */
+   clocks = auxclk1_ck;
+   clock-names = main_clk;
clock-frequency = 1920;
};
 
-- 
1.7.4.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: logitech - lg2ff: Add IDs for Formula Vibration Feedback Wheel

2013-10-08 Thread Michal Malý
Hey guys,

I assume that we're talking about this wheel 
(http://www.logitech.com/en-roeu/support/298)?

Does the wheel have an actual FFB servo or does it have just a rumble motor 
that shakes the wheel? If it's the latter, supporting it in lg2ff is a way to 
go. Description in KConfig should probably be updated to reflect this.

As for the HID descriptors, Simon's suggestion will work just fine. 
Alternatively you can use Wireshark which can use usbmon to capture USB 
traffic. (Wireshark must run as root and usbmon module must be loaded before 
Wireshark starts). We can hack the descriptor in hid-logitech just like we did 
it for DFP. If we come across more wheels that need a hacked descriptor, 
perhaps we should consider handling the raw data ourselves (check out the Wii 
remote driver for details)...

Michal.
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] usb: musb: dsps: disable the otg_timer while going to sleep

2013-10-08 Thread Sebastian Andrzej Siewior
Testing with freeze I run into:

| PM: Syncing filesystems ... done.
| PM: Preparing system for freeze sleep
| Freezing user space processes ... (elapsed 0.002 seconds) done.
| Freezing remaining freezable tasks ... (elapsed 0.002 seconds) done.
| PM: Entering freeze sleep
| usb usb2: usb auto-resume
| hub 2-0:1.0: hub_resume
| hub 2-0:1.0: hub_suspend
| usb usb2: bus suspend, wakeup 0
| usb usb1: usb auto-resume
| hub 1-0:1.0: hub_resume
| hub 1-0:1.0: hub_suspend
| usb usb1: bus suspend, wakeup 0
| PM: suspend of devices complete after 54.622 msecs
| PM: late suspend of devices complete after 4.782 msecs
| PM: noirq suspend of devices complete after 4.990 msecs
| Unhandled fault: external abort on non-linefetch (0x1008) at 0xf0442460
| Internal error: : 1008 [#1] ARM
| PC is at otg_timer+0x28/0x140 [musb_dsps]

This is comming from first dsps_readb() in otg_timer(). The problem is
that the device is already suspended (the clocks are off) and the timer
tries to access register which fails.
Since there is no need to keep this timer aroud while the device is
going to suspend I suggest to remove the timer in suspend and queue it
in the resume path.

Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de
---
I don't have the suspend target in state just the freezer and with
it I get into trouble in the otg_timer(). This triggers a few seconds
after the suspend but since this depends on timming, it might trigger
just a few secs after the suspend.
What about the this?

 drivers/usb/musb/musb_dsps.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index ced2b76..61b3f3e 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -659,6 +659,7 @@ static int dsps_suspend(struct device *dev)
glue-context.tx_mode = dsps_readl(mbase, wrp-tx_mode);
glue-context.rx_mode = dsps_readl(mbase, wrp-rx_mode);
 
+   del_timer_sync(glue-timer);
return 0;
 }
 
@@ -679,6 +680,7 @@ static int dsps_resume(struct device *dev)
 
musb-port_reset_state = false;
schedule_work(musb-port_reset_work);
+   mod_timer(glue-timer, jiffies + wrp-poll_seconds * HZ);
 
return 0;
 }
-- 
1.8.4.rc3

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Switching OMAP2430 MUSB between host and device mode

2013-10-08 Thread Alan Stern
Felipe:

I've got an Android device that uses the omap2430 musb driver.  It's
configured to go into device mode when it starts up, which I guess is
the normal thing for Android devices to do.

Can you explain how to switch the controller over to host mode (and
back)?  I tried writing host to the sysfs mode attribute, but all
that happened was an immediate crash and reboot.

(Related to this, it is notable that the omap2430_musb_set_mode()  
routine ignores its second argument, musb_mode.  That looks awfully
strange, even if it is right.)

Thanks,

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Looking for a USB device that uses cdc-wdm driver

2013-10-08 Thread Don Zickus
Hi Oliver,

I am trying to verify a fix for the cdc-wdm driver and am having trouble
figuring out what devices requires that driver.  It seems related to cell
phones but I wasn't sure if there was a particular one or all of them in
general (I couldn't get my cell to use it).  Thanks in advance!

Cheers,
Don
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Looking for a USB device that uses cdc-wdm driver

2013-10-08 Thread Bjørn Mork
Don Zickus dzic...@redhat.com writes:

 I am trying to verify a fix for the cdc-wdm driver and am having trouble
 figuring out what devices requires that driver.  It seems related to cell
 phones but I wasn't sure if there was a particular one or all of them in
 general (I couldn't get my cell to use it).  Thanks in advance!

The Ericsson MBM devices use it. E.g F3507g, F5521gw etc.


Bjørn
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v6 2/3] usb: phy: Add Qualcomm SS-USB and HS-USB drivers for DW PHY's

2013-10-08 Thread Ivan T. Ivanov

Hi Stan,

On Mon, 2013-10-07 at 12:22 +0300, Stanimir Varbanov wrote: 
 Hi Ivan,
 
 Few comments below.
 
 On 10/07/2013 10:44 AM, Ivan T. Ivanov wrote:
  From: Ivan T. Ivanov iiva...@mm-sol.com
  
  These drivers handles control and configuration of the HS
  and SS USB PHY transceivers. They are part of the driver
  which manage Synopsys DesignWare USB3 controller stack
  inside Qualcomm SoC's.
  
  Signed-off-by: Ivan T. Ivanov iiva...@mm-sol.com
  ---
   drivers/usb/phy/Kconfig |   11 ++
   drivers/usb/phy/Makefile|2 +
   drivers/usb/phy/phy-msm-dw-hs.c |  329 ++
   drivers/usb/phy/phy-msm-dw-ss.c |  375 
  +++
   4 files changed, 717 insertions(+)
   create mode 100644 drivers/usb/phy/phy-msm-dw-hs.c
   create mode 100644 drivers/usb/phy/phy-msm-dw-ss.c
  
  diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
  index d5589f9..bbb2d0e 100644
  --- a/drivers/usb/phy/Kconfig
  +++ b/drivers/usb/phy/Kconfig
  @@ -214,6 +214,17 @@ config USB_RCAR_PHY
To compile this driver as a module, choose M here: the
module will be called phy-rcar-usb.
   
  +config USB_MSM_DW_PHYS
  +   tristate Qualcomm USB controller DW PHY's wrappers support
  +   depends on (USB || USB_GADGET)  ARCH_MSM
  +   select USB_PHY
  +   help
  + Enable this to support the DW USB PHY transceivers on MSM chips
  + with DWC3 USB core. It handles PHY initialization, clock
  + management required after resetting the hardware and power
  + management. This driver is required even for peripheral only or
  + host only mode configurations.
  +
   config USB_ULPI
  bool Generic ULPI Transceiver Driver
  depends on ARM
  diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
  index 2135e85..4813eb5 100644
  --- a/drivers/usb/phy/Makefile
  +++ b/drivers/usb/phy/Makefile
  @@ -26,6 +26,8 @@ obj-$(CONFIG_USB_EHCI_TEGRA)  += 
  phy-tegra-usb.o
   obj-$(CONFIG_USB_GPIO_VBUS)+= phy-gpio-vbus-usb.o
   obj-$(CONFIG_USB_ISP1301)  += phy-isp1301.o
   obj-$(CONFIG_USB_MSM_OTG)  += phy-msm-usb.o
  +obj-$(CONFIG_USB_MSM_DW_PHYS)  += phy-msm-dw-hs.o
  +obj-$(CONFIG_USB_MSM_DW_PHYS)  += phy-msm-dw-ss.o
   obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
   obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
   obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
  diff --git a/drivers/usb/phy/phy-msm-dw-hs.c 
  b/drivers/usb/phy/phy-msm-dw-hs.c
  new file mode 100644
  index 000..d29c1f1
  --- /dev/null
  +++ b/drivers/usb/phy/phy-msm-dw-hs.c
  @@ -0,0 +1,329 @@
  +/* Copyright (c) 2013, Code Aurora Forum. All rights reserved.
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License version 2 and
  + * only version 2 as published by the Free Software Foundation.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + */
  +
  +#include linux/clk.h
  +#include linux/err.h
  +#include linux/io.h
  +#include linux/module.h
  +#include linux/of.h
  +#include linux/platform_device.h
  +#include linux/regulator/consumer.h
  +#include linux/usb/phy.h
  +
  +/**
  + *  USB QSCRATCH Hardware registers
  + */
  +#define QSCRATCH_CTRL_REG  (0x04)
  +#define QSCRATCH_GENERAL_CFG   (0x08)
  +#define PHY_CTRL_REG   (0x10)
  +#define PARAMETER_OVERRIDE_X_REG   (0x14)
  +#define CHARGING_DET_CTRL_REG  (0x18)
  +#define CHARGING_DET_OUTPUT_REG(0x1c)
  +#define ALT_INTERRUPT_EN_REG   (0x20)
  +#define PHY_IRQ_STAT_REG   (0x24)
  +#define CGCTL_REG  (0x28)
  +
 
 Please remove braces above and below.

ok

 
  +#define PHY_3P3_VOL_MIN305 /* uV */
  +#define PHY_3P3_VOL_MAX330 /* uV */
  +#define PHY_3P3_HPM_LOAD   16000   /* uA */
  +
  +#define PHY_1P8_VOL_MIN180 /* uV */
  +#define PHY_1P8_VOL_MAX180 /* uV */
  +#define PHY_1P8_HPM_LOAD   19000   /* uA */
  +
  +/* TODO: these are suspicious */
  +#define USB_VDDCX_NO   1   /* index */
  +#define USB_VDDCX_MIN  5   /* index */
  +#define USB_VDDCX_MAX  7   /* index */
  +
  +struct msm_dw_hs_phy {
  +   struct usb_phy  phy;
  +   void __iomem*base;
  +   struct device   *dev;
  +
  +   struct clk  *xo_clk;
  +   struct clk  *sleep_a_clk;
  +
  +   struct regulator*v3p3;
  +   struct regulator*v1p8;
  +   struct regulator*vddcx;
  +   struct regulator

Re: [PATCH v6 3/3] usb: dwc3: Add Qualcomm DWC3 glue layer driver

2013-10-08 Thread Ivan T. Ivanov

Hi Stan, 

On Mon, 2013-10-07 at 12:28 +0300, Stanimir Varbanov wrote: 
 Hi Ivan,
 
 Minor comments below.
 
 On 10/07/2013 10:44 AM, Ivan T. Ivanov wrote:
  From: Ivan T. Ivanov iiva...@mm-sol.com
  
  DWC3 glue layer is hardware layer around Synopsys DesignWare
  USB3 core. Its purpose is to supply Synopsys IP with required
  clocks, voltages and interface it with the rest of the SoC.
  
  Signed-off-by: Ivan T. Ivanov iiva...@mm-sol.com
  ---
   drivers/usb/dwc3/Kconfig|8 +++
   drivers/usb/dwc3/Makefile   |1 +
   drivers/usb/dwc3/dwc3-msm.c |  168 
  +++
   3 files changed, 177 insertions(+)
   create mode 100644 drivers/usb/dwc3/dwc3-msm.c
  
  diff --git a/drivers/usb/dwc3/Kconfig b/drivers/usb/dwc3/Kconfig
  index 70fc430..4c7b5a4 100644
  --- a/drivers/usb/dwc3/Kconfig
  +++ b/drivers/usb/dwc3/Kconfig
  @@ -59,6 +59,14 @@ config USB_DWC3_EXYNOS
Recent Exynos5 SoCs ship with one DesignWare Core USB3 IP inside,
say 'Y' or 'M' if you have one such device.
   
  +config USB_DWC3_MSM
  +   tristate Qualcomm MSM/APQ Platforms
  +   default USB_DWC3
  +   select USB_MSM_DWC3_PHYS
  +   help
  + Recent Qualcomm SoCs ship with one DesignWare Core USB3 IP inside,
  + say 'Y' or 'M' if you have one such device.
  +
   config USB_DWC3_PCI
  tristate PCIe-based Platforms
  depends on PCI
  diff --git a/drivers/usb/dwc3/Makefile b/drivers/usb/dwc3/Makefile
  index dd17601..a90de66 100644
  --- a/drivers/usb/dwc3/Makefile
  +++ b/drivers/usb/dwc3/Makefile
  @@ -31,4 +31,5 @@ endif
   
   obj-$(CONFIG_USB_DWC3_OMAP)+= dwc3-omap.o
   obj-$(CONFIG_USB_DWC3_EXYNOS)  += dwc3-exynos.o
  +obj-$(CONFIG_USB_DWC3_MSM) += dwc3-msm.o
   obj-$(CONFIG_USB_DWC3_PCI) += dwc3-pci.o
  diff --git a/drivers/usb/dwc3/dwc3-msm.c b/drivers/usb/dwc3/dwc3-msm.c
  new file mode 100644
  index 000..1d73f92
  --- /dev/null
  +++ b/drivers/usb/dwc3/dwc3-msm.c
  @@ -0,0 +1,168 @@
  +/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
  + *
  + * This program is free software; you can redistribute it and/or modify
  + * it under the terms of the GNU General Public License version 2 and
  + * only version 2 as published by the Free Software Foundation.
  + *
  + * This program is distributed in the hope that it will be useful,
  + * but WITHOUT ANY WARRANTY; without even the implied warranty of
  + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  + * GNU General Public License for more details.
  + */
  +
  +#include linux/clk.h
  +#include linux/err.h
  +#include linux/io.h
  +#include linux/module.h
  +#include linux/of.h
  +#include linux/of_platform.h
  +#include linux/platform_device.h
  +#include linux/regulator/consumer.h
  +#include linux/usb/phy.h
  +
  +struct dwc3_msm {
  +   struct device   *dev;
  +
  +   struct clk  *core_clk;
  +   struct clk  *iface_clk;
  +   struct clk  *sleep_clk;
  +   struct clk  *utmi_clk;
  +
  +   struct regulator*gdsc;
  +};
  +
  +static int dwc3_msm_probe(struct platform_device *pdev)
  +{
  +   struct device_node *node = pdev-dev.of_node;
  +   struct dwc3_msm *mdwc;
  +   struct resource *res;
  +   void __iomem *tcsr;
  +   int ret = 0;
  +
  +   mdwc = devm_kzalloc(pdev-dev, sizeof(*mdwc), GFP_KERNEL);
  +   if (!mdwc)
  +   return -ENOMEM;
  +
  +   platform_set_drvdata(pdev, mdwc);
  +
  +   mdwc-dev = pdev-dev;
  +
  +   mdwc-gdsc = devm_regulator_get(mdwc-dev, gdsc);
  +
  +   mdwc-core_clk = devm_clk_get(mdwc-dev, core);
  +   if (IS_ERR(mdwc-core_clk)) {
  +   dev_dbg(mdwc-dev, failed to get core clock\n);
  +   return PTR_ERR(mdwc-core_clk);
  +   }
  +
  +   mdwc-iface_clk = devm_clk_get(mdwc-dev, iface);
  +   if (IS_ERR(mdwc-iface_clk)) {
  +   dev_dbg(mdwc-dev, failed to get iface clock\n);
  +   return PTR_ERR(mdwc-iface_clk);
  +   }
  +
  +   mdwc-sleep_clk = devm_clk_get(mdwc-dev, sleep);
  +   if (IS_ERR(mdwc-sleep_clk)) {
  +   dev_dbg(mdwc-dev, failed to get sleep clock\n);
  +   return  PTR_ERR(mdwc-sleep_clk);
  +   }
  +
  +   mdwc-utmi_clk = devm_clk_get(mdwc-dev, utmi);
  +   if (IS_ERR(mdwc-utmi_clk)) {
  +   dev_dbg(mdwc-dev, failed to get utmi clock\n);
  +   return  PTR_ERR(mdwc-utmi_clk);
  +   }
 
 I'm not sure that those dev_dbg() are useful at all.

They are, if you deal with WIP clocks and regulators implementations,
which is the case for this platform.

 
  +
  +   if (!IS_ERR(mdwc-gdsc)) {
  +   ret = regulator_enable(mdwc-gdsc);
  +   if (ret)
  +   dev_err(mdwc-dev, cannot enable gdsc\n);
  +   }
  +
  +   /*
  +* DWC3 Core requires its CORE CLK (aka master / bus clk) to
  +* run at 125Mhz in SSUSB mode and 60MHZ for HSUSB mode.
  +*/
  +   clk_set_rate(mdwc-core_clk, 12500);
  +   

Re: Looking for a USB device that uses cdc-wdm driver

2013-10-08 Thread Dan Williams
On Tue, 2013-10-08 at 11:29 -0400, Don Zickus wrote:
 Hi Oliver,
 
 I am trying to verify a fix for the cdc-wdm driver and am having trouble
 figuring out what devices requires that driver.  It seems related to cell
 phones but I wasn't sure if there was a particular one or all of them in
 general (I couldn't get my cell to use it).  Thanks in advance!

Find an Ericsson F3507 or F3607 PCIe minicard WWAN modem, like:

http://www.ebay.com/itm/New-Unlocked-Ericsson-F3607GW-DELL-Wireless-5540-3G-GPS-Mini-WWAN-Card-/290659200462?pt=US_Internal_Network_Cardshash=item43aca36dce

They're cheap.  They expose a couple cdc-wdm ports, one of which speaks
AT commands and another which might do the GPS stuff.  You don't need a
SIM.  If you're at a loss for how to connect it to your computer, or
your BIOS locks out unauthorized cards, grab one of these:

http://www.hwtools.net/Adapter/USBMS-F.html

which is a small PCIe minicard carrier with a USB connector.

Dan

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/1] Possibly fix USB OTG on GTA04 and N900

2013-10-08 Thread Sebastian Reichel
Hi,

On Mon, Oct 07, 2013 at 04:28:12PM +0300, Roger Quadros wrote:
 USB OTG on these boards might be broken on Greg's usb-next branch [1]
 after the Generic PHY framework and associated patches were merged.
 
 This is a probable fix but I'm not able to test these boards. Please
 give it a try and your Ack if it works. Thanks.
 
 [1] - git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git

I have tested the Nokia N900 part of the patch. Without this patch
the USB port does not work:

[1.015014] musb-omap2430 480ab000.usb_otg_hs: unable to find phy

With the patch everything seems to work.

Tested-by: Sebastian Reichel s...@debian.org

-- Sebastian


signature.asc
Description: Digital signature


Re: Looking for a USB device that uses cdc-wdm driver

2013-10-08 Thread Don Zickus
On Tue, Oct 08, 2013 at 05:36:46PM +0200, Bjørn Mork wrote:
 Don Zickus dzic...@redhat.com writes:
 
  I am trying to verify a fix for the cdc-wdm driver and am having trouble
  figuring out what devices requires that driver.  It seems related to cell
  phones but I wasn't sure if there was a particular one or all of them in
  general (I couldn't get my cell to use it).  Thanks in advance!
 
 The Ericsson MBM devices use it. E.g F3507g, F5521gw etc.

Thanks!

Cheers,
Don
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Looking for a USB device that uses cdc-wdm driver

2013-10-08 Thread Don Zickus
On Tue, Oct 08, 2013 at 11:10:52AM -0500, Dan Williams wrote:
 On Tue, 2013-10-08 at 11:29 -0400, Don Zickus wrote:
  Hi Oliver,
  
  I am trying to verify a fix for the cdc-wdm driver and am having trouble
  figuring out what devices requires that driver.  It seems related to cell
  phones but I wasn't sure if there was a particular one or all of them in
  general (I couldn't get my cell to use it).  Thanks in advance!
 
 Find an Ericsson F3507 or F3607 PCIe minicard WWAN modem, like:
 
 http://www.ebay.com/itm/New-Unlocked-Ericsson-F3607GW-DELL-Wireless-5540-3G-GPS-Mini-WWAN-Card-/290659200462?pt=US_Internal_Network_Cardshash=item43aca36dce
 
 They're cheap.  They expose a couple cdc-wdm ports, one of which speaks
 AT commands and another which might do the GPS stuff.  You don't need a
 SIM.  If you're at a loss for how to connect it to your computer, or
 your BIOS locks out unauthorized cards, grab one of these:
 
 http://www.hwtools.net/Adapter/USBMS-F.html
 
 which is a small PCIe minicard carrier with a USB connector.

Thanks!

Cheers,
Don
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


no reset_resume for driver snd-usb-audio for logitech headset H600

2013-10-08 Thread baumber

Hello,

please help me with the bug for my Logitech Headset;

https://bugzilla.kernel.org/show_bug.cgi?id=62691

Bug ID: 62691
Summary: no reset_resume for driver snd-usb-audio for logitech headset H600

Thank you

Best regards, Bernhard
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


USB-related NULL pointer dereference

2013-10-08 Thread Luke-Jr
I rather suddenly got a NULL pointer dereference yesterday, running 3.10.9. 
Curiously, the same re-occurred on my next boot (shutdown, cold poweron), 
around when udev was loading modules. After this, I shutdown again, and turned 
the PSU switch off for a few seconds - at the next boot, the problem stopped.

[613257.292304] BUG: unable to handle kernel NULL pointer dereference at
   
(null)
[613257.292337] IP: [a030035e] hub_quiesce+0x4e/0xb0 [usbcore]
[613257.292363] PGD 411313067 PUD 411380067 PMD 0 
[613257.292386] Oops:  [#1] PREEMPT SMP 
[613257.292405] Modules linked in: usb_storage fuse netconsole configfs 
cfq_iosched bridge stp llc ipv6 cdc_acm ftdi_sio cp210x usbserial hid_generic 
usbhid hid evdev coretemp hwmon mperf 8250_pci intel_powerclamp 8250 
serial_core xhci_hcd ehci_pci ehci_hcd i915 video drm_kms_helper drm 
i2c_algo_bit ata_generic usbcore i2c_i801 kvm_intel kvm psmouse firewire_ohci 
firewire_core usb_common tpm_tis crc_itu_t tpm tpm_bios pata_acpi 
snd_hda_codec_hdmi snd_hda_codec_realtek e1000e 8139too rtc_cmos mii ptp 
pps_core snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc 
snd_timer snd button
[613257.292748] CPU: 0 PID: 1284 Comm: khubd Tainted: GW3.10.9-
gentoo #1
[613257.292767] Hardware name:  /DQ67SW, BIOS 
SWQ6710H.86A.0062.2012.0418.1112 04/18/2012
[613257.292792] task: 880429abf060 ti: 880426024000 task.ti: 
880426024000
[613257.292813] RIP: 0010:[a030035e]  [a030035e] 
hub_quiesce+0x4e/0xb0 [usbcore]
[613257.292843] RSP: :880426025828  EFLAGS: 00010246
[613257.292859] RAX: 8800b86273c0 RBX: 8803fb069400 RCX: 
0006
[613257.292878] RDX:  RSI: 7fff RDI: 

[613257.292898] RBP: 880426025848 R08:  R09: 

[613257.292917] R10: 06a6 R11:  R12: 
8804020cc000
[613257.292936] R13:  R14: 8803b6736430 R15: 
0096
[613257.292956] FS:  () GS:88043e20() 
knlGS:
[613257.292977] CS:  0010 DS:  ES:  CR0: 80050033
[613257.292993] CR2:  CR3: 000409a08000 CR4: 
000407f0
[613257.293012] DR0:  DR1:  DR2: 

[613257.293032] DR3:  DR6: 0ff0 DR7: 
0400
[613257.293051] Stack:
[613257.293057]  880426025848 8803fb069400 8804020cc088 
8803b6736400
[613257.293089]  880426025878 a0300679 8803fb069400 
8803b6736400
[613257.293121]  8804020cc000 880428dc2000 880426025918 
a0302fa1
[613257.293152] Call Trace:
[613257.293164]  [a0300679] hub_disconnect+0x79/0x140 [usbcore]
[613257.293184]  [a0302fa1] hub_probe+0x301/0x820 [usbcore]
[613257.293204]  [a030b361] usb_probe_interface+0x1a1/0x290 
[usbcore]
[613257.293226]  [81300756] driver_probe_device+0x76/0x240
[613257.293243]  [81300a0b] __device_attach+0x4b/0x60
[613257.293259]  [813009c0] ? __driver_attach+0xa0/0xa0
[613257.293276]  [812feb64] bus_for_each_drv+0x54/0x90
[613257.293292]  [813006a8] device_attach+0x98/0xb0
[613257.293308]  [812ffba8] bus_probe_device+0x98/0xc0
[613257.293324]  [812fdfa4] device_add+0x5b4/0x670
[613257.293341]  [a02fe09b] ? usb_set_device_state+0xab/0x180 
[usbcore]
[613257.293363]  [a0309655] usb_set_configuration+0x5f5/0x810 
[usbcore]
[613257.293385]  [a0313132] generic_probe+0x32/0x90 [usbcore]
[613257.293405]  [a030b47d] usb_probe_device+0x2d/0x60 [usbcore]
[613257.293423]  [81300756] driver_probe_device+0x76/0x240
[613257.293439]  [81300a0b] __device_attach+0x4b/0x60
[613257.293455]  [813009c0] ? __driver_attach+0xa0/0xa0
[613257.293471]  [812feb64] bus_for_each_drv+0x54/0x90
[613257.293487]  [813006a8] device_attach+0x98/0xb0
[613257.293503]  [812ffba8] bus_probe_device+0x98/0xc0
[613257.293518]  [812fdfa4] device_add+0x5b4/0x670
[613257.293535]  [a0300917] usb_new_device+0x1d7/0x370 [usbcore]
[613257.293555]  [a0301cac] hub_thread+0x69c/0x1420 [usbcore]
[613257.293573]  [81059f10] ? abort_exclusive_wait+0xb0/0xb0
[613257.293592]  [a0301610] ? hub_port_debounce+0xe0/0xe0 [usbcore]
[613257.293611]  [8105959b] kthread+0xbb/0xc0
[613257.293625]  [8143] ? generic_processor_info+0x75/0x18a
[613257.293643]  [810594e0] ? 
kthread_freezable_should_stop+0x70/0x70
[613257.293662]  [8143c2ec] ret_from_fork+0x7c/0xb0
[613257.293677]  [810594e0] ? 
kthread_freezable_should_stop+0x70/0x70
[613257.293697] Code: 80 8b f0 00 00 00 02 41 83 fd 02 74 37 45 8b ac 24 78 04 
00 00 45 85 ed 7e 2a 45 31 ed 48 8b 83 10 02 00 00 49 63 d5 48 8b 3c d0 48 
83 3f 00 74 05 e8 07 fe ff ff 41 83 c5 01 45 39 ac 24 78 04 

Re: LTE vodafone K5150 (hilink) 12d1 1f16 ; 12d1 1575 cdc_ether mbim?

2013-10-08 Thread Thomas Schäfer
Am Montag, 7. Oktober 2013, 16:04:49 schrieben Sie:

 Have you verified that the latest version of usb-modeswitch doesn't fix
 this issue?  I think I've seen reports that it does, but it would be
 good if you could test that out and verify it.

May be it is intention. Under win8 it does not change its ID. 
Do we make the same break as MS does. (cdc -- mbim?)

I copy my statement from 

http://www.draisberghof.de/usb_modeswitch/bb/viewtopic.php?f=3t=1703


There are two modes:

Windows 7 and before has 12d1 1575
Windows 8 uses 12d1 1f16 (without switching, or without ID-change)

Windows 8 information:
hardware IDs
USB\VID_12D1PID_1F16REV_0102MI_00
USB\VID_12D1PID_1F16MI_00
comatible IDs
USB\Class_02SubClass_0eProt_00
USB\Class_02SubClass_0e
USB\Class_02

lsusb -v with kernel 3.7 (like windows 7)


Code:
Bus 001 Device 004: ID 12d1:1575 Huawei Technologies Co., Ltd.
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass2 Communications
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x12d1 Huawei Technologies Co., Ltd.
  idProduct  0x1575
  bcdDevice1.02
  iManufacturer   5 Vodafone (Huawei)
  iProduct4 K5150
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   71
bNumInterfaces  2
bConfigurationValue 1
iConfiguration  2 configuration 0
bmAttributes 0x80
  (Bus Powered)
MaxPower  500mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   1
  bInterfaceClass 2 Communications
  bInterfaceSubClass  6 Ethernet Networking
  bInterfaceProtocol  0
  iInterface  0
  CDC Header:
bcdCDC   1.10
  CDC Ethernet:
iMacAddress  1 582C80139263
bmEthernetStatistics0x0005
wMaxSegmentSize   1514
wNumberMCFilters0x0003
bNumberPowerFilters  1
  CDC Union:
bMasterInterface0
bSlaveInterface 1
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0040  1x 64 bytes
bInterval   5
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber1
  bAlternateSetting   0
  bNumEndpoints   2
  bInterfaceClass10 CDC Data
  bInterfaceSubClass  6
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval  32
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x01  EP 1 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval  32
Device Qualifier (for other device speed):
  bLength10
  bDescriptorType 6
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  bNumConfigurations  1
Device Status: 0x
  (Bus Powered)


lsusb -v with kernel 3.11 (like windows 8?)

Code:

Bus 001 Device 003: ID 12d1:1f16 Huawei Technologies Co., Ltd.
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass0 (Defined at Interface level)
  bDeviceSubClass 0
  bDeviceProtocol   255
  bMaxPacketSize064
  idVendor   0x12d1 Huawei Technologies Co., Ltd.
  idProduct  0x1f16
  bcdDevice1.02
  iManufacturer   5 Vodafone (Huawei)
  iProduct4 K5150
  iSerial 7 
  bNumConfigurations  2
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   32
bNumInterfaces  1
bConfigurationValue 1

Re: no reset_resume for driver snd-usb-audio for logitech headset H600

2013-10-08 Thread Alan Stern
On Tue, 8 Oct 2013 baum...@hotmail.com wrote:

 Hello,
 
 please help me with the bug for my Logitech Headset;
 
 https://bugzilla.kernel.org/show_bug.cgi?id=62691
 
 Bug ID: 62691
 Summary: no reset_resume for driver snd-usb-audio for logitech headset H600
 
 Thank you
 
 Best regards, Bernhard

Actually this should be brought to the attention of the ALSA 
developers (CC'ed).  They are the people in charge of the snd-usb-audio 
driver.

Alan Stern

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] HID: logitech - lg2ff: Add IDs for Formula Vibration Feedback Wheel

2013-10-08 Thread simon
 We can hack the descriptor in hid-logitech just
 like we did it for DFP. If we come across more wheels that need a hacked
 descriptor, perhaps we should consider handling the raw data ourselves
 (check out the Wii remote driver for details)...

We currently 'hack HID desc.' for the DF, DFP and MOMO-Red. The DFGT, G25
and G27 are pushed into native mode and automatically split the brake and
accel axis.

I'll get the 'hack HID desc.' done for Elias' wheel and the MOMO-black I
picked last week. Should be done this week sometime.

I think we've got every wheel variant covered unless the release more
with different IDs (recently saw a new DFGT version).

In the longer term we may wish to add an option/control to split (or not)
the brake/accel as the user requests. I don't actually think that anyone
wants combined axis, but there's no telling with some people ;-)

Simon

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] arm: shmobile: lager: Add USBHS support

2013-10-08 Thread Valentine Barshak
This adds USBHS PHY and registers USBHS device if the driver is enabled.

Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
---
 arch/arm/mach-shmobile/board-lager.c | 115 +++
 1 file changed, 115 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-lager.c 
b/arch/arm/mach-shmobile/board-lager.c
index a8d3ce6..f375eae 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -18,6 +18,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
  */
 
+#include linux/clk.h
 #include linux/gpio.h
 #include linux/gpio_keys.h
 #include linux/input.h
@@ -29,11 +30,14 @@
 #include linux/pinctrl/machine.h
 #include linux/platform_data/gpio-rcar.h
 #include linux/platform_data/rcar-du.h
+#include linux/platform_data/usb-rcar-gen2-phy.h
 #include linux/platform_device.h
 #include linux/phy.h
 #include linux/regulator/fixed.h
 #include linux/regulator/machine.h
 #include linux/sh_eth.h
+#include linux/usb/phy.h
+#include linux/usb/renesas_usbhs.h
 #include mach/common.h
 #include mach/irqs.h
 #include mach/r8a7790.h
@@ -165,6 +169,107 @@ static const struct resource ether_resources[] 
__initconst = {
DEFINE_RES_IRQ(gic_spi(162)),
 };
 
+/* USBHS */
+#if IS_ENABLED(CONFIG_USB_RENESAS_USBHS_UDC)
+static const struct resource usbhs_resources[] __initconst = {
+   DEFINE_RES_MEM(0xe659, 0x100),
+   DEFINE_RES_IRQ(gic_spi(107)),
+};
+
+struct usbhs_private {
+   struct renesas_usbhs_platform_info info;
+   struct usb_phy *phy;
+};
+
+#define usbhs_get_priv(pdev) \
+   container_of(renesas_usbhs_get_info(pdev), struct usbhs_private, info)
+
+static int usbhs_power_ctrl(struct platform_device *pdev,
+   void __iomem *base, int enable)
+{
+   struct usbhs_private *priv = usbhs_get_priv(pdev);
+
+   if (!priv-phy)
+   return -ENODEV;
+
+   if (enable) {
+   int retval = usb_phy_init(priv-phy);
+
+   if (!retval)
+   retval = usb_phy_set_suspend(priv-phy, 0);
+   return retval;
+   }
+
+   usb_phy_set_suspend(priv-phy, 1);
+   usb_phy_shutdown(priv-phy);
+   return 0;
+}
+
+static int usbhs_hardware_init(struct platform_device *pdev)
+{
+   struct usbhs_private *priv = usbhs_get_priv(pdev);
+   struct usb_phy *phy;
+
+   phy = usb_get_phy(USB_PHY_TYPE_USB2);
+   if (IS_ERR(phy))
+   return PTR_ERR(phy);
+
+   priv-phy = phy;
+   return 0;
+}
+
+static int usbhs_hardware_exit(struct platform_device *pdev)
+{
+   struct usbhs_private *priv = usbhs_get_priv(pdev);
+
+   if (!priv-phy)
+   return 0;
+
+   usb_put_phy(priv-phy);
+   priv-phy = NULL;
+   return 0;
+}
+
+static int usbhs_get_id(struct platform_device *pdev)
+{
+   return USBHS_GADGET;
+}
+
+static struct usbhs_private usbhs_priv __initdata = {
+   .info = {
+   .platform_callback = {
+   .power_ctrl = usbhs_power_ctrl,
+   .hardware_init  = usbhs_hardware_init,
+   .hardware_exit  = usbhs_hardware_exit,
+   .get_id = usbhs_get_id,
+   },
+   .driver_param = {
+   .buswait_bwait  = 4,
+   },
+   }
+};
+
+#define lager_register_usbhs() \
+   platform_device_register_resndata(platform_bus,\
+ renesas_usbhs, -1,  \
+ usbhs_resources,  \
+ ARRAY_SIZE(usbhs_resources),  \
+ usbhs_priv.info, \
+ sizeof(usbhs_priv.info))
+#else  /* CONFIG_USB_RENESAS_USBHS_UDC */
+#define lager_register_usbhs()
+#endif /* CONFIG_USB_RENESAS_USBHS_UDC */
+
+/* USBHS PHY */
+static const struct rcar_gen2_phy_platform_data usbhs_phy_pdata __initconst = {
+   .chan0_pci = 0, /* Channel 0 is USBHS */
+   .chan2_pci = 1, /* Channel 2 is PCI USB */
+};
+
+static const struct resource usbhs_phy_resources[] __initconst = {
+   DEFINE_RES_MEM(0xe6590100, 0x100),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
/* DU (CN10: ARGB0, CN13: LVDS) */
PIN_MAP_MUX_GROUP_DEFAULT(rcar-du-r8a7790, pfc-r8a7790,
@@ -193,6 +298,9 @@ static const struct pinctrl_map lager_pinctrl_map[] = {
  eth_rmii, eth),
PIN_MAP_MUX_GROUP_DEFAULT(r8a7790-ether, pfc-r8a7790,
  intc_irq0, intc),
+   /* USB0 */
+   PIN_MAP_MUX_GROUP_DEFAULT(renesas_usbhs, pfc-r8a7790,
+ usb0, usb0),
 };
 
 static void __init lager_add_standard_devices(void)
@@ -221,6 +329,13 @@ static void __init 

[PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Valentine Barshak
This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
also enables USBHS for the Lager board. It has been updated, based
on the comments to the previous version.

The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
The first patch also applies fine to the usb.git at kernel.org.
It adds RCAR Gen2 phy driver which is used to configure the shared USB
channels 0/2 and to control USBHS internal PHY.
All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
should acquire the USB phy first to set proper channel configuration.

The other two patches add USBHS support to Lager board, which requires
RCAR Gen2 phy driver.

Changes from previous version:
* use-counting and clock handling done in the usb_phy_init/shutdown
  callbacks only;
* a minor typo in the comments fixed;
* phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
* usb_phy_init/shutdown called from usbhs_power_ctrl callback
  to allow renesas_usbhs driver disable USB PHY completely
  when it is not needed.

Valentine Barshak (3):
  usb: phy: Add RCAR Gen2 USB phy
  arm: shmobile: r8a7790: Add USBHS clock support
  arm: shmobile: lager: Add USBHS support

 arch/arm/mach-shmobile/board-lager.c| 106 ++
 arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
 drivers/usb/phy/Kconfig |  13 ++
 drivers/usb/phy/Makefile|   1 +
 drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
 include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
 6 files changed, 401 insertions(+)
 create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
 create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h

-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LTE vodafone K5150 (hilink) 12d1 1f16 ; 12d1 1575 cdc_ether mbim?

2013-10-08 Thread Thomas Schäfer
hpmini:~ # usb_modeswitch -j -v 12d1 -p 1f16
Search USB devices...
Found device, searching for MBIM configuration...
2
hpmini:~ # usb_modeswitch -W -j -v 12d1 -p 1f16
Taking all parameters from the command line


 * usb_modeswitch: handle USB devices with multiple modes
 * Version 1.2.5 (C) Josua Dietze 2012
 * Based on libusb0 (0.1.12 and above)

 ! PLEASE REPORT NEW CONFIGURATIONS !

DefaultVendor=  0x12d1
DefaultProduct= 0x1f16
TargetVendor=   not set
TargetProduct=  not set
TargetClass=not set
TargetProductList=

DetachStorageOnly=0
HuaweiMode=0
SierraMode=0
SonyMode=0
QisdaMode=0
GCTMode=0
KobilMode=0
SequansMode=0
MobileActionMode=0
CiscoMode=0
MessageEndpoint=  not set
MessageContent=
NeedResponse=0
ResponseEndpoint= not set

InquireDevice enabled (default)
Success check disabled
System integration mode disabled


Search USB devices...
Found device, searching for MBIM configuration...
2
hpmini:~ # 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/3] arm: shmobile: r8a7790: Add USBHS clock support

2013-10-08 Thread Valentine Barshak
This adds USBHS clock support.

Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
---
 arch/arm/mach-shmobile/clock-r8a7790.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c 
b/arch/arm/mach-shmobile/clock-r8a7790.c
index a64f965..161d44e 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -186,6 +186,7 @@ enum {
MSTP813,
MSTP726, MSTP725, MSTP724, MSTP723, MSTP722, MSTP721, MSTP720,
MSTP717, MSTP716,
+   MSTP704,
MSTP522,
MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
@@ -208,6 +209,7 @@ static struct clk mstp_clks[MSTP_NR] = {
[MSTP720] = SH_CLK_MSTP32(p_clk, SMSTPCR7, 20, 0), /* SCIF1 */
[MSTP717] = SH_CLK_MSTP32(zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
[MSTP716] = SH_CLK_MSTP32(zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
+   [MSTP704] = SH_CLK_MSTP32(mp_clk, SMSTPCR7, 4, 0), /* HSUSB */
[MSTP522] = SH_CLK_MSTP32(extal_clk, SMSTPCR5, 22, 0), /* Thermal */
[MSTP315] = SH_CLK_MSTP32(div6_clks[DIV6_MMC0], SMSTPCR3, 15, 0), /* 
MMC0 */
[MSTP314] = SH_CLK_MSTP32(div4_clks[DIV4_SD0], SMSTPCR3, 14, 0), /* 
SDHI0 */
@@ -296,6 +298,8 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID(ee22.mmcif, mstp_clks[MSTP305]),
CLKDEV_DEV_ID(sh_mmcif.1, mstp_clks[MSTP305]),
CLKDEV_DEV_ID(sh_cmt.0, mstp_clks[MSTP124]),
+   CLKDEV_DEV_ID(renesas_usbhs, mstp_clks[MSTP704]),
+   CLKDEV_ICK_ID(usbhs, usb_phy_rcar_gen2, mstp_clks[MSTP704]),
 };
 
 #define R8A7790_CLOCK_ROOT(e, m, p0, p1, p30, p31) \
-- 
1.8.3.1

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] usb: phy: Add RCAR Gen2 USB phy

2013-10-08 Thread Valentine Barshak
This adds RCAR Gen2 USB phy support. The driver configures
USB channels 0/2 which are shared between PCI USB hosts and
USBHS/USBSS devices. It also controls internal USBHS phy.

Signed-off-by: Valentine Barshak valentine.bars...@cogentembedded.com
---
 drivers/usb/phy/Kconfig |  13 ++
 drivers/usb/phy/Makefile|   1 +
 drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
 include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
 4 files changed, 291 insertions(+)
 create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
 create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index d5589f9..297062c 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -214,6 +214,19 @@ config USB_RCAR_PHY
  To compile this driver as a module, choose M here: the
  module will be called phy-rcar-usb.
 
+config USB_RCAR_GEN2_PHY
+   tristate Renesas R-Car Gen2 USB PHY support
+   depends on ARCH_R8A7790 || ARCH_R8A7791
+   select USB_PHY
+   help
+ Say Y here to add support for the Renesas R-Car Gen2 USB PHY driver.
+ It is typically used to control internal USB PHY for USBHS,
+ and to configure shared USB channels 0 and 2.
+ This driver supports R8A7790 and R8A7791.
+
+ To compile this driver as a module, choose M here: the
+ module will be called phy-rcar-gen2-usb.
+
 config USB_ULPI
bool Generic ULPI Transceiver Driver
depends on ARM
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index 2135e85..8c5b147 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -29,5 +29,6 @@ obj-$(CONFIG_USB_MSM_OTG) += phy-msm-usb.o
 obj-$(CONFIG_USB_MV_OTG)   += phy-mv-usb.o
 obj-$(CONFIG_USB_MXS_PHY)  += phy-mxs-usb.o
 obj-$(CONFIG_USB_RCAR_PHY) += phy-rcar-usb.o
+obj-$(CONFIG_USB_RCAR_GEN2_PHY)+= phy-rcar-gen2-usb.o
 obj-$(CONFIG_USB_ULPI) += phy-ulpi.o
 obj-$(CONFIG_USB_ULPI_VIEWPORT)+= phy-ulpi-viewport.o
diff --git a/drivers/usb/phy/phy-rcar-gen2-usb.c 
b/drivers/usb/phy/phy-rcar-gen2-usb.c
new file mode 100644
index 000..a2e6f9f
--- /dev/null
+++ b/drivers/usb/phy/phy-rcar-gen2-usb.c
@@ -0,0 +1,255 @@
+/*
+ * Renesas R-Car Gen2 USB phy driver
+ *
+ * Copyright (C) 2013 Renesas Solutions Corp.
+ * Copyright (C) 2013 Cogent Embedded, Inc.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include linux/clk.h
+#include linux/delay.h
+#include linux/io.h
+#include linux/usb/otg.h
+#include linux/platform_data/usb-rcar-gen2-phy.h
+#include linux/platform_device.h
+#include linux/spinlock.h
+#include linux/module.h
+
+struct rcar_gen2_usb_phy_priv {
+   struct usb_phy phy;
+   void __iomem *base;
+   struct clk *clk;
+   spinlock_t lock;
+   int usecount;
+   u32 ugctrl2;
+};
+
+#define usb_phy_to_priv(p) container_of(p, struct rcar_gen2_usb_phy_priv, phy)
+
+/* Low Power Status register */
+#define USBHS_LPSTS_REG0x02
+#define USBHS_LPSTS_SUSPM  (1  14)
+
+/* USB General control register */
+#define USBHS_UGCTRL_REG   0x80
+#define USBHS_UGCTRL_CONNECT   (1  2)
+#define USBHS_UGCTRL_PLLRESET  (1  0)
+
+/* USB General control register 2 */
+#define USBHS_UGCTRL2_REG  0x84
+#define USBHS_UGCTRL2_USB0_PCI (1  4)
+#define USBHS_UGCTRL2_USB0_HS  (3  4)
+#define USBHS_UGCTRL2_USB2_PCI (0  31)
+#define USBHS_UGCTRL2_USB2_SS  (1  31)
+
+/* USB General status register */
+#define USBHS_UGSTS_REG0x88
+#define USBHS_UGSTS_LOCK   (3  8)
+
+/* Enable USBHS internal phy */
+static int __rcar_gen2_usbhs_phy_enable(void __iomem *base)
+{
+   u32 val;
+   int i;
+
+   /* USBHS PHY power on */
+   val = ioread32(base + USBHS_UGCTRL_REG);
+   val = ~USBHS_UGCTRL_PLLRESET;
+   iowrite32(val, base + USBHS_UGCTRL_REG);
+
+   val = ioread16(base + USBHS_LPSTS_REG);
+   val |= USBHS_LPSTS_SUSPM;
+   iowrite16(val, base + USBHS_LPSTS_REG);
+
+   for (i = 0; i  20; i++) {
+   val = ioread32(base + USBHS_UGSTS_REG);
+   if ((val  USBHS_UGSTS_LOCK) == USBHS_UGSTS_LOCK) {
+   val = ioread32(base + USBHS_UGCTRL_REG);
+   val |= USBHS_UGCTRL_CONNECT;
+   iowrite32(val, base + USBHS_UGCTRL_REG);
+   return 0;
+   }
+   udelay(1);
+   }
+
+   /* Timed out waiting for the PLL lock */
+   return -ETIMEDOUT;
+}
+
+/* Disable USBHS internal phy */
+static int __rcar_gen2_usbhs_phy_disable(void 

[Trivial PATCH] usb: Remove unnecessary semicolons

2013-10-08 Thread Joe Perches
These aren't necessary after switch and if blocks.

Signed-off-by: Joe Perches j...@perches.com
---
 drivers/usb/core/hcd.c  | 2 +-
 drivers/usb/core/hub.c  | 2 +-
 drivers/usb/dwc3/ep0.c  | 6 +++---
 drivers/usb/gadget/composite.c  | 2 +-
 drivers/usb/gadget/dummy_hcd.c  | 6 +++---
 drivers/usb/gadget/goku_udc.c   | 2 +-
 drivers/usb/gadget/net2280.c| 4 ++--
 drivers/usb/gadget/rndis.c  | 2 +-
 drivers/usb/gadget/tcm_usb_gadget.c | 4 ++--
 drivers/usb/host/ehci-dbg.c | 2 +-
 drivers/usb/host/fotg210-hcd.c  | 2 +-
 drivers/usb/host/fusbh200-hcd.c | 2 +-
 drivers/usb/host/isp1362-hcd.c  | 2 +-
 drivers/usb/host/ohci-dbg.c | 2 +-
 drivers/usb/host/sl811-hcd.c| 4 ++--
 drivers/usb/host/uhci-pci.c | 2 +-
 drivers/usb/host/whci/hcd.c | 4 ++--
 drivers/usb/musb/musb_core.c| 2 +-
 drivers/usb/musb/musb_dsps.c| 2 +-
 drivers/usb/musb/musb_gadget.c  | 2 +-
 drivers/usb/musb/musb_host.c| 2 +-
 drivers/usb/phy/phy-twl4030-usb.c   | 2 +-
 drivers/usb/phy/phy-ulpi-viewport.c | 2 +-
 drivers/usb/wusbcore/cbaf.c | 4 ++--
 drivers/usb/wusbcore/devconnect.c   | 2 +-
 drivers/usb/wusbcore/wa-xfer.c  | 4 ++--
 26 files changed, 36 insertions(+), 36 deletions(-)

diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
index d6a8d23..b915cac 100644
--- a/drivers/usb/core/hcd.c
+++ b/drivers/usb/core/hcd.c
@@ -1813,7 +1813,7 @@ rescan:
s = -intr; break;
 default:
s = -iso; break;
-   };
+   }
s;
}));
usb_put_urb (urb);
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index e6b682c..c95e2fc 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -433,7 +433,7 @@ static void set_port_led(
case HUB_LED_OFF: s = off; break;
case HUB_LED_AUTO: s = auto; break;
default: s = ??; break;
-   }; s; }),
+   } s; }),
status);
 }
 
diff --git a/drivers/usb/dwc3/ep0.c b/drivers/usb/dwc3/ep0.c
index 7fa93f4..95f7649 100644
--- a/drivers/usb/dwc3/ep0.c
+++ b/drivers/usb/dwc3/ep0.c
@@ -352,7 +352,7 @@ static int dwc3_ep0_handle_status(struct dwc3 *dwc,
break;
default:
return -EINVAL;
-   };
+   }
 
response_pkt = (__le16 *) dwc-setup_buf;
*response_pkt = cpu_to_le16(usb_status);
@@ -470,7 +470,7 @@ static int dwc3_ep0_handle_feature(struct dwc3 *dwc,
 
default:
return -EINVAL;
-   };
+   }
 
return 0;
 }
@@ -709,7 +709,7 @@ static int dwc3_ep0_std_request(struct dwc3 *dwc, struct 
usb_ctrlrequest *ctrl)
dev_vdbg(dwc-dev, Forwarding to gadget driver\n);
ret = dwc3_ep0_delegate_req(dwc, ctrl);
break;
-   };
+   }
 
return ret;
 }
diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index d4f0f33..3e7ae70 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -354,7 +354,7 @@ static u8 encode_bMaxPower(enum usb_device_speed speed,
return DIV_ROUND_UP(val, 8);
default:
return DIV_ROUND_UP(val, 2);
-   };
+   }
 }
 
 static int config_buf(struct usb_configuration *config,
diff --git a/drivers/usb/gadget/dummy_hcd.c b/drivers/usb/gadget/dummy_hcd.c
index b8a2376..8f4dae3 100644
--- a/drivers/usb/gadget/dummy_hcd.c
+++ b/drivers/usb/gadget/dummy_hcd.c
@@ -544,7 +544,7 @@ static int dummy_enable(struct usb_ep *_ep,
 default:
 val = ctrl;
 break;
-}; val; }),
+} val; }),
max, ep-stream_en ? enabled : disabled);
 
/* at this point real hardware should be NAKing transfers
@@ -2271,7 +2271,7 @@ static inline ssize_t show_urb(char *buf, size_t size, 
struct urb *urb)
default:
s = ?;
break;
-}; s; }),
+} s; }),
ep, ep ? (usb_pipein(urb-pipe) ? in : out) : ,
({ char *s; \
switch (usb_pipetype(urb-pipe)) { \
@@ -2287,7 +2287,7 @@ static inline ssize_t show_urb(char *buf, size_t size, 
struct urb *urb)
default: \
s = -iso; \
break; \
-   }; s; }),
+   } s; }),
urb-actual_length, urb-transfer_buffer_length);
 }
 
diff --git a/drivers/usb/gadget/goku_udc.c b/drivers/usb/gadget/goku_udc.c
index c64deb9..ef7ba00 100644
--- a/drivers/usb/gadget/goku_udc.c
+++ b/drivers/usb/gadget/goku_udc.c

[PATCH] xhci: correct the usage of USB_CTRL_SET_TIMEOUT

2013-10-08 Thread Xiao Jin
From: xiao jin jin.x...@intel.com
Date: Wed, 9 Oct 2013 09:09:46 +0800
Subject: [PATCH] xhci: correct the usage of USB_CTRL_SET_TIMEOUT

The usage of USB_CTRL_SET_TIMEOUT is incorrect. The
definition of USB_CTRL_SET_TIMEOUT is 5000ms. The
input timeout to wait_for_completion_interruptible_timeout
is jiffies. That makes the timeout be longer than what
we want, such as 50s in some platform.

The patch is to convert USB_CTRL_SET_TIMEOUT to jiffies as
command completion event timeout.

Signed-off-by: xiao jin jin.x...@intel.com
---
 drivers/usb/host/xhci-hub.c |2 +-
 drivers/usb/host/xhci.c |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
index 1d35459..78cf294 100644
--- a/drivers/usb/host/xhci-hub.c
+++ b/drivers/usb/host/xhci-hub.c
@@ -295,7 +295,7 @@ static int xhci_stop_device(struct xhci_hcd *xhci, int 
slot_id, int suspend)
/* Wait for last stop endpoint command to finish */
timeleft = wait_for_completion_interruptible_timeout(
cmd-completion,
-   USB_CTRL_SET_TIMEOUT);
+   msecs_to_jiffies(USB_CTRL_SET_TIMEOUT));
if (timeleft = 0) {
xhci_warn(xhci, %s while waiting for stop endpoint command\n,
timeleft == 0 ? Timeout : Signal);
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 9478caa..f9ebc72 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -3486,7 +3486,7 @@ int xhci_discover_or_reset_device(struct usb_hcd *hcd, 
struct usb_device *udev)
/* Wait for the Reset Device command to finish */
timeleft = wait_for_completion_interruptible_timeout(
reset_device_cmd-completion,
-   USB_CTRL_SET_TIMEOUT);
+   msecs_to_jiffies(USB_CTRL_SET_TIMEOUT));
if (timeleft = 0) {
xhci_warn(xhci, %s while waiting for reset device command\n,
timeleft == 0 ? Timeout : Signal);
-- 
1.7.1



--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Simon Horman
On Tue, Oct 08, 2013 at 11:43:24PM +0400, Valentine Barshak wrote:
 This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
 also enables USBHS for the Lager board. It has been updated, based
 on the comments to the previous version.
 
 The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
 The first patch also applies fine to the usb.git at kernel.org.
 It adds RCAR Gen2 phy driver which is used to configure the shared USB
 channels 0/2 and to control USBHS internal PHY.
 All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
 should acquire the USB phy first to set proper channel configuration.
 
 The other two patches add USBHS support to Lager board, which requires
 RCAR Gen2 phy driver.
 
 Changes from previous version:
 * use-counting and clock handling done in the usb_phy_init/shutdown
   callbacks only;
 * a minor typo in the comments fixed;
 * phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
 * usb_phy_init/shutdown called from usbhs_power_ctrl callback
   to allow renesas_usbhs driver disable USB PHY completely
   when it is not needed.

Hi Morimoto-san,

I could you review this revised series?

My assumption is that in the current form the first patch will
go through the USB tree while the latter patches will subsequently
go through (my) renesas tree.

 Valentine Barshak (3):
   usb: phy: Add RCAR Gen2 USB phy
   arm: shmobile: r8a7790: Add USBHS clock support
   arm: shmobile: lager: Add USBHS support
 
  arch/arm/mach-shmobile/board-lager.c| 106 ++
  arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
  drivers/usb/phy/Kconfig |  13 ++
  drivers/usb/phy/Makefile|   1 +
  drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
 
  include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
  6 files changed, 401 insertions(+)
  create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
  create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h
 
 -- 
 1.8.3.1
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-sh in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: XHCI: Handling of Zero length packet in data stage

2013-10-08 Thread Jack Pham
Hi Sarah, Alan,

I'm taking over reporting of this issue for Hemant while he is out on
vacation.

On Mon, Oct 07, 2013 at 05:44:56PM -0400, Alan Stern wrote:
 On Mon, 7 Oct 2013, Sarah Sharp wrote:
  What should urb-actual_length be set to instead?  The device sent
  zero bytes in the data stage and urb-transfer_buffer_length *is*
  zero, so it

 No, urb-transfer_buffer_length  0.  That's the point.

 If I understand the OP correctly, he is saying that a 0-length
 response to (for example) an 8-byte control-in transfer will end up
 with urb-actual_length set to 8 rather than 0.

That's correct.

In our case we are not setting URB_SHORT_NOT_OK, and the URB's
transfer_buffer_length is non-zero, so the data stage TRB does get
enqueued. The device responds with a zero-length data packet but that
is resulting in the URB incorrectly getting its actual_length set to
transfer_buffer_length, instead of 0 as we would expect.

This problem is not seen when connected to an EHCI controller.

On Tue, Oct 08, 2013 at 10:19:11AM -0400, Alan Stern wrote:
 On Mon, 7 Oct 2013, Sarah Sharp wrote:
 
   i am using 3.10 kernel. Also i looked at tip i see same implementation for
   process_ctrl_td()
   
   https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/drivers/usb/host/xhci-ring.c
  
  Yeah, the implementation has always been this way.  I've known since the
  beginning of writing the xHCI driver that it needs to handle zero-length
  data phases, but hadn't had ever had a report that it was required by a
  device under Linux.
 
 This code, near the end of process_ctrl_td(), looks a little strange:
 
   /*
* Did we transfer any data, despite the errors that might have
* happened?  I.e. did we get past the setup stage?
*/
   if (event_trb != ep_ring-dequeue) {
   /* The event was for the status stage */
   if (event_trb == td-last_trb) {
   if (td-urb-actual_length != 0) {
   /* Don't overwrite a previously set error code
*/
   if ((*status == -EINPROGRESS || *status == 0) 
   (td-urb-transfer_flags
 URB_SHORT_NOT_OK))
   /* Did we already see a short data
* stage? */
   *status = -EREMOTEIO;
 
 If you already saw a short data stage, why isn't the status already set
 to -EREMOTEIO?
 
 Also what's the reason for the test td-urb-actual_length != 0?  
 What does this have to do with getting a short data stage?  Are you 
 assuming that at this point, actual_length will be nonzero if and only 
 if there was a short data stage?
 
   } else {
   td-urb-actual_length =
   td-urb-transfer_buffer_length;
   }
 
 What's the purpose of this clause?
 
 It looks like the driver is confusing actual_length == 0 with 
 actual_length was never set.  What if actual_length _was_ previously 
 set, but it was set to 0?

Alan, your analysis is consistent with our findings as well. We are
seeing that if actual_length got set to 0 in the data stage, then when
the status stage is processed the above else clause ends up overwriting
this value before handing back the URB. Thus the zero-length packet is
incorrectly reported as a successful transfer of transfer_buffer_length.

Here's a patch we came up with that seems to fix the immediate issue.
However, I'm not sure if this has other side effects or not, e.g. if
URB_SHORT_NOT_OK is set.

Jack

8
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
index 204110c..507a72d 100644
--- a/drivers/usb/host/xhci-ring.c
+++ b/drivers/usb/host/xhci-ring.c
@@ -2056,6 +2056,8 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct 
xhci_td *td,
/* Did we already see a short data
 * stage? */
*status = -EREMOTEIO;
+   } else if (td-zlp_data) {
+   td-zlp_data = false;
} else {
td-urb-actual_length =
td-urb-transfer_buffer_length;
@@ -2065,6 +2067,10 @@ static int process_ctrl_td(struct xhci_hcd *xhci, struct 
xhci_td *td,
td-urb-actual_length =
td-urb-transfer_buffer_length -
EVENT_TRB_LEN(le32_to_cpu(event-transfer_len));
+
+   if (td-urb-actual_length == 0)
+   td-zlp_data = true;
+
xhci_dbg(xhci, Waiting for status 
stage event\n);
  

Re: [PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Kuninori Morimoto

Hi

 This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
 also enables USBHS for the Lager board. It has been updated, based
 on the comments to the previous version.
 
 The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
 The first patch also applies fine to the usb.git at kernel.org.
 It adds RCAR Gen2 phy driver which is used to configure the shared USB
 channels 0/2 and to control USBHS internal PHY.
 All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
 should acquire the USB phy first to set proper channel configuration.
 
 The other two patches add USBHS support to Lager board, which requires
 RCAR Gen2 phy driver.
 
 Changes from previous version:
 * use-counting and clock handling done in the usb_phy_init/shutdown
   callbacks only;
 * a minor typo in the comments fixed;
 * phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
 * usb_phy_init/shutdown called from usbhs_power_ctrl callback
   to allow renesas_usbhs driver disable USB PHY completely
   when it is not needed.
 
 Valentine Barshak (3):
   usb: phy: Add RCAR Gen2 USB phy
   arm: shmobile: r8a7790: Add USBHS clock support
   arm: shmobile: lager: Add USBHS support
 
  arch/arm/mach-shmobile/board-lager.c| 106 ++
  arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
  drivers/usb/phy/Kconfig |  13 ++
  drivers/usb/phy/Makefile|   1 +
  drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
 
  include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
  6 files changed, 401 insertions(+)
  create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
  create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h

For all patches

Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com

# I think we can implement usb_phy_xxx() method
# in renesas_usbhs driver someday.

Best regards
---
Kuninori Morimoto
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 0/3] Add USBHS support to Lager (take 2)

2013-10-08 Thread Simon Horman
On Tue, Oct 08, 2013 at 07:09:36PM -0700, Kuninori Morimoto wrote:
 
 Hi
 
  This patch set adds internal USB PHY support to RCAR Gen2 SoC, and
  also enables USBHS for the Lager board. It has been updated, based
  on the comments to the previous version.
  
  The patches apply fine to the renesas-devel-20131008 tag of the renesas.git.
  The first patch also applies fine to the usb.git at kernel.org.
  It adds RCAR Gen2 phy driver which is used to configure the shared USB
  channels 0/2 and to control USBHS internal PHY.
  All the drivers that use the shared USB channels (USBHS/USBSS/PCI USB host)
  should acquire the USB phy first to set proper channel configuration.
  
  The other two patches add USBHS support to Lager board, which requires
  RCAR Gen2 phy driver.
  
  Changes from previous version:
  * use-counting and clock handling done in the usb_phy_init/shutdown
callbacks only;
  * a minor typo in the comments fixed;
  * phy clean up moved to __rcar_gen2_usb_phy_shutdown function;
  * usb_phy_init/shutdown called from usbhs_power_ctrl callback
to allow renesas_usbhs driver disable USB PHY completely
when it is not needed.
  
  Valentine Barshak (3):
usb: phy: Add RCAR Gen2 USB phy
arm: shmobile: r8a7790: Add USBHS clock support
arm: shmobile: lager: Add USBHS support
  
   arch/arm/mach-shmobile/board-lager.c| 106 ++
   arch/arm/mach-shmobile/clock-r8a7790.c  |   4 +
   drivers/usb/phy/Kconfig |  13 ++
   drivers/usb/phy/Makefile|   1 +
   drivers/usb/phy/phy-rcar-gen2-usb.c | 255 
  
   include/linux/platform_data/usb-rcar-gen2-phy.h |  22 ++
   6 files changed, 401 insertions(+)
   create mode 100644 drivers/usb/phy/phy-rcar-gen2-usb.c
   create mode 100644 include/linux/platform_data/usb-rcar-gen2-phy.h
 
 For all patches
 
 Acked-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
 
 # I think we can implement usb_phy_xxx() method
 # in renesas_usbhs driver someday.

Hi Felipe,

could you consider taking the first patch of this series?
And if so, could you provide a branch that I can use
as a base for the other changes in the series?

Thanks
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks

2013-10-08 Thread Joel Fernandes
On 10/01/2013 10:04 AM, Daniel Mack wrote:
 This patch makes the edma driver resume correctly after suspend. Tested
 on an AM33xx platform with cyclic audio streams.
 
 The code was shamelessly taken from an ancient BSP tree.
 
 Signed-off-by: Daniel Mack zon...@gmail.com
 ---
  arch/arm/common/edma.c | 133 
 +
  1 file changed, 133 insertions(+)
 
 diff --git a/arch/arm/common/edma.c b/arch/arm/common/edma.c
 index 2a72169..d787f14 100644
 --- a/arch/arm/common/edma.c
 +++ b/arch/arm/common/edma.c
 @@ -258,6 +258,20 @@ struct edma {
   void *data);
   void *data;
   } intr_data[EDMA_MAX_DMACH];
 +
 + struct {
 + struct edmacc_param *prm_set;
 + unsigned int *ch_map;   /* 64 registers */
 + unsigned int *que_num;  /* 8 registers */

This is OK to save.

 + unsigned int sh_esr;
 + unsigned int sh_esrh;
 + unsigned int sh_eesr;
 + unsigned int sh_eesrh;
 + unsigned int sh_iesr;
 + unsigned int sh_iesrh;

Are all these really necessary?

esr and eer- No one should really be setting the esr and should not depend on it
when going to a low power state. I wouldn't expect any driver to suspend between
edma_start and edma_stop. In DMA Engine, this would correspond to the driver
getting a successful callback.

Before suspend, drivers using DMA should anyway be done with using the channel
before they can goto suspend, correct me if I'm wrong. So this seems unnecessary
to do.

Only thing that makes sense to me to save here is the iesr registers.

 + unsigned int que_tc_map;
 + unsigned int que_pri;

This is OK to save.

 + } context;
  };
  
  static struct edma *edma_cc[EDMA_MAX_CC];
 @@ -1655,6 +1669,16 @@ static int edma_probe(struct platform_device *pdev)
   memcpy_toio(edmacc_regs_base[j] + PARM_OFFSET(i),
   dummy_paramset, PARM_SIZE);
  
 + /* resume context */
 + edma_cc[j]-context.prm_set =
 + kzalloc((sizeof(struct edmacc_param) *
 +  edma_cc[j]-num_slots), GFP_KERNEL);

Why should you back-up PaRAM set? I feel this is not necessary. PaRAM set will
be setup again for the transfer after the resume, and there shouldn't be any
pending transfers before the suspend.

Looks like in your audio driver you need to make sure any pending DMA transfers
are completed before suspending (unless you're already doing so).

 + edma_cc[j]-context.ch_map =
 + kzalloc((sizeof(unsigned int) *
 +  edma_cc[j]-num_channels), GFP_KERNEL);
 + edma_cc[j]-context.que_num =
 + kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL);

Can these allocations be moved to the suspend path? For systems that don't
suspend/resume even once, I feel we shouldn't allocate memory that we don't use.
These allocations are better to do there.

-Joel

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH v3] ARM: omap: edma: add suspend suspend/resume hooks

2013-10-08 Thread Gururaja Hebbar
On Wednesday 09 October 2013 09:58 AM, Joel Fernandes wrote:
 On 10/01/2013 10:04 AM, Daniel Mack wrote:
 This patch makes the edma driver resume correctly after suspend. Tested
 on an AM33xx platform with cyclic audio streams.

 The code was shamelessly taken from an ancient BSP tree.

 Signed-off-by: Daniel Mack zon...@gmail.com
 ---
  arch/arm/common/edma.c | 133 
 +
  1 file changed, 133 insertions(+)


..snip..
..snip..
 
 +edma_cc[j]-context.ch_map =
 +kzalloc((sizeof(unsigned int) *
 + edma_cc[j]-num_channels), GFP_KERNEL);
 +edma_cc[j]-context.que_num =
 +kzalloc((sizeof(unsigned int) * 8), GFP_KERNEL);
 
 Can these allocations be moved to the suspend path? For systems that don't
 suspend/resume even once, I feel we shouldn't allocate memory that we don't 
 use.
 These allocations are better to do there.

AFAIK, Suspend/resume should be quick. Allocating and deallocating on
every iterating would be useless and time consuming.

Also this task is one time and quick.

Are there any systems (Linux based for now) which doesn't
suspend/resume? I believe the probability is very less.

regards
Gururaja

 
 -Joel
 
 --
 To unsubscribe from this list: send the line unsubscribe linux-omap in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html
 

--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html