[PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Xiaotian Feng
If tasklet_disable() is called before related tasklet handled,
tasklet_kill will never be finished. tasklet_kill is enough.

Signed-off-by: Xiaotian Feng dannyf...@tencent.com
Cc: Li Yang le...@freescale.com
Cc: Felipe Balbi ba...@ti.com
Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
Cc: linux-usb@vger.kernel.org
Cc: linuxppc-...@lists.ozlabs.org
---
 drivers/usb/gadget/fsl_qe_udc.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index b09452d..4ad3b82 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2661,7 +2661,7 @@ static int __devexit qe_udc_remove(struct platform_device 
*ofdev)
usb_del_gadget_udc(udc-gadget);
 
udc-done = done;
-   tasklet_disable(udc-rx_tasklet);
+   tasklet_kill(udc-rx_tasklet);
 
if (udc-nullmap) {
dma_unmap_single(udc-gadget.dev.parent,
@@ -2698,8 +2698,6 @@ static int __devexit qe_udc_remove(struct platform_device 
*ofdev)
free_irq(udc-usb_irq, udc);
irq_dispose_mapping(udc-usb_irq);
 
-   tasklet_kill(udc-rx_tasklet);
-
iounmap(udc-usb_regs);
 
device_unregister(udc-gadget.dev);
-- 
1.7.9.5

--
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 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-31 Thread Oliver Neukum
On Wednesday 31 October 2012 11:05:33 Ming Lei wrote:
 On Wed, Oct 31, 2012 at 10:08 AM, Ming Lei ming@canonical.com wrote:
  I am afraid it is, because a disk may just have been probed as the 
  deviceis being reset.
 
  Yes, it is probable, and sounds like similar with 'root_wait' problem, see
  prepare_namespace(): init/do_mounts.c, so looks no good solution
  for the problem, and maybe we have to set the flag always before resetting
  usb device.
 
 The below idea may help the problem which 'memalloc_noio' flag isn't set 
 during
 usb_reset_device().
 
 - for usb mass storage device, call pm_runtime_set_memalloc_noio(true)
   inside usb_stor_probe2() and uas_probe(), and call
   pm_runtime_set_memalloc_noio(false) inside uas_disconnect()
   and usb_stor_disconnect().
 
 - for usb network device, register_netdev() is always called inside usb
   interface's probe(),  looks no such problem.

This still leaves networking done over PPP in the cold.

Regards
Oliver

--
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: Linux USB gadget mass storage

2012-10-31 Thread victor
Hi, 

In usb gadget file_storage.c, check_command(), the part Check that only
command bytes listed in the mask are non-zero cannot handle the
SCSI_INQUIRY command of  12 01 80 00 FF 00

The code will return EINVAL.

Is this a bug?

Thanks,
victor

-Original Message-
From: victor [mailto:vic...@keyasic.com] 
Sent: Wednesday, 31 October, 2012 1:20 PM
To: 'linux-usb@vger.kernel.org'
Subject: RE: Linux USB gadget mass storage

Hi,

In file_storage.c, send_status(), if (transport_is_bbb()), I add the line
bh-inreq-buf = bh - buf,

and in get_next_command(), if (transport_is_bbb()), I add the line
bh-outreq-context = bh, to make the bh address to be the same.

Is this patch ok?

victor

-Original Message-
From: victor [mailto:vic...@keyasic.com] 
Sent: Wednesday, 31 October, 2012 1:04 PM
To: 'linux-usb@vger.kernel.org'
Subject: Linux USB gadget mass storage

Hi,

I am using Linux USB gadget mass storage. I meet with problem in
file_storage.c. The bh-outreq-context in get_next_command() is not equal
to bh.

victor



CONFIDENTIALITY NOTE:
This e-mail and any attachments may contain confidential information and may be 
protected by legal privilege. If you are not the intended addressee (or 
authorized to receive for the addressee). be aware that any disclosure, 
copying, distribution or use of this e-mail or any attachment is prohibited. If 
you have received this e-mail in error, please notify us immediately by 
returning it to the sender and delete this copy from your system. Thank you for 
your cooperation.
KeyASIC Inc.

--
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: serial: remove driver version information

2012-10-31 Thread Johan Hovold
Remove all MODULE_VERSION macros and driver-version information (except
for garmin_gps which uses it in a status reply).

It is the kernel version that matters and not some private version
scheme which rarely even gets updated.

Signed-off-by: Johan Hovold jhov...@gmail.com
---
 drivers/usb/serial/aircable.c| 5 -
 drivers/usb/serial/ark3116.c | 5 -
 drivers/usb/serial/belkin_sa.c   | 5 -
 drivers/usb/serial/cp210x.c  | 5 -
 drivers/usb/serial/cyberjack.c   | 5 -
 drivers/usb/serial/cypress_m8.c  | 5 -
 drivers/usb/serial/digi_acceleport.c | 4 
 drivers/usb/serial/empeg.c   | 4 
 drivers/usb/serial/hp4x.c| 5 -
 drivers/usb/serial/io_edgeport.c | 4 
 drivers/usb/serial/io_ti.c   | 4 
 drivers/usb/serial/ipaq.c| 5 -
 drivers/usb/serial/ipw.c | 4 
 drivers/usb/serial/iuu_phoenix.c | 6 --
 drivers/usb/serial/keyspan.c | 4 
 drivers/usb/serial/keyspan_pda.c | 4 
 drivers/usb/serial/kl5kusb105.c  | 4 
 drivers/usb/serial/kobil_sct.c   | 2 --
 drivers/usb/serial/mct_u232.c| 4 
 drivers/usb/serial/metro-usb.c   | 2 --
 drivers/usb/serial/mos7720.c | 4 
 drivers/usb/serial/mos7840.c | 4 
 drivers/usb/serial/omninet.c | 4 
 drivers/usb/serial/option.c  | 2 --
 drivers/usb/serial/oti6858.c | 2 --
 drivers/usb/serial/quatech2.c| 2 --
 drivers/usb/serial/siemens_mpi.c | 2 --
 drivers/usb/serial/sierra.c  | 3 +--
 drivers/usb/serial/spcp8x5.c | 4 
 drivers/usb/serial/ssu100.c  | 2 --
 drivers/usb/serial/usb_wwan.c| 2 --
 drivers/usb/serial/vivopay-serial.c  | 3 ---
 32 files changed, 1 insertion(+), 119 deletions(-)

diff --git a/drivers/usb/serial/aircable.c b/drivers/usb/serial/aircable.c
index 54e1bb6..6d110a3 100644
--- a/drivers/usb/serial/aircable.c
+++ b/drivers/usb/serial/aircable.c
@@ -68,10 +68,6 @@
 #define THROTTLED  0x01
 #define ACTUALLY_THROTTLED 0x02
 
-/*
- * Version Information
- */
-#define DRIVER_VERSION v2.0
 #define DRIVER_AUTHOR Naranjo, Manuel Francisco naranjo.man...@gmail.com, 
Johan Hovold jhov...@gmail.com
 #define DRIVER_DESC AIRcable USB Driver
 
@@ -192,5 +188,4 @@ module_usb_serial_driver(serial_drivers, id_table);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE(GPL);
diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
index bd50a8a4..a2c 100644
--- a/drivers/usb/serial/ark3116.c
+++ b/drivers/usb/serial/ark3116.c
@@ -37,11 +37,6 @@
 #include linux/mutex.h
 #include linux/spinlock.h
 
-/*
- * Version information
- */
-
-#define DRIVER_VERSION v0.7
 #define DRIVER_AUTHOR Bart Hartgers bart.hartgers+ark3...@gmail.com
 #define DRIVER_DESC USB ARK3116 serial/IrDA driver
 #define DRIVER_DEV_DESC ARK3116 RS232/IrDA
diff --git a/drivers/usb/serial/belkin_sa.c b/drivers/usb/serial/belkin_sa.c
index ea29556..b72a4c1 100644
--- a/drivers/usb/serial/belkin_sa.c
+++ b/drivers/usb/serial/belkin_sa.c
@@ -37,10 +37,6 @@
 #include linux/usb/serial.h
 #include belkin_sa.h
 
-/*
- * Version Information
- */
-#define DRIVER_VERSION v1.3
 #define DRIVER_AUTHOR William Greathouse wgreatho...@smva.com
 #define DRIVER_DESC USB Belkin Serial converter driver
 
@@ -509,5 +505,4 @@ module_usb_serial_driver(serial_drivers, id_table);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE(GPL);
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 1264173..2858d8a 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -24,10 +24,6 @@
 #include linux/uaccess.h
 #include linux/usb/serial.h
 
-/*
- * Version Information
- */
-#define DRIVER_VERSION v0.09
 #define DRIVER_DESC Silicon Labs CP210x RS232 serial adaptor driver
 
 /*
@@ -871,5 +867,4 @@ static void cp210x_release(struct usb_serial *serial)
 module_usb_serial_driver(serial_drivers, id_table);
 
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE(GPL);
diff --git a/drivers/usb/serial/cyberjack.c b/drivers/usb/serial/cyberjack.c
index 4ee77dc..69a4fa1 100644
--- a/drivers/usb/serial/cyberjack.c
+++ b/drivers/usb/serial/cyberjack.c
@@ -43,10 +43,6 @@
 
 #define CYBERJACK_LOCAL_BUF_SIZE 32
 
-/*
- * Version Information
- */
-#define DRIVER_VERSION v1.01
 #define DRIVER_AUTHOR Matthias Bruestle
 #define DRIVER_DESC REINER SCT cyberJack pinpad/e-com USB Chipcard Reader 
Driver
 
@@ -441,5 +437,4 @@ module_usb_serial_driver(serial_drivers, id_table);
 
 MODULE_AUTHOR(DRIVER_AUTHOR);
 MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_VERSION(DRIVER_VERSION);
 MODULE_LICENSE(GPL);
diff --git a/drivers/usb/serial/cypress_m8.c b/drivers/usb/serial/cypress_m8.c
index f0da127..fd8c35f 100644
--- a/drivers/usb/serial/cypress_m8.c
+++ 

SIOCSIFFLAGS: No space left on device; error for 3G usb network dongle on linux 2.6.38

2012-10-31 Thread Ganesh Kumar
Hi all,

*** Sorry if this is not the right forum to post this issue, as i
searched for any linux usb users mailing list, dint get one, the one
on sourceforge seems obsolete, so tried posting here. ***

I'm working on Sierra wireless 3g usb dongle on Linux 2.6.38 on my
embedded board, I'm facing an issue w.r.t usb when I connect the 3g
dongle through a 7 port Dlink USB Hub.

1. below setup doesn't work
   board -- dlink hub --- 3g usb dongle
I connect the 3g usb dongle to the Dlink USB Hub and i issue the AT
commands through the busybox microcom, after I get OK for the
connection, if I try to
run dhclinet on wwan0 or if I do a ifconfig wwan0 up i see the below
error message:

SIOCSIFFLAGS: No space left on device

2. below setup works just fine:
   board --- 3g usb dongle
if i connect the 3g usb dongle directly to the embedded board's usb
port  try the  steps as per (1)
it works smoothly !!

is it something to do with the linux usb stack? any clue will really
help in resolving the issue
Has anyone faced this issue before?
Thanks in advance for your time!.

regards,
GK
--
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: SIOCSIFFLAGS: No space left on device; error for 3G usb network dongle on linux 2.6.38

2012-10-31 Thread Oliver Neukum
On Wednesday 31 October 2012 16:49:36 Ganesh Kumar wrote:
 Hi all,
 
 *** Sorry if this is not the right forum to post this issue, as i
 searched for any linux usb users mailing list, dint get one, the one
 on sourceforge seems obsolete, so tried posting here. ***
 
 I'm working on Sierra wireless 3g usb dongle on Linux 2.6.38 on my
 embedded board, I'm facing an issue w.r.t usb when I connect the 3g
 dongle through a 7 port Dlink USB Hub.
 
 1. below setup doesn't work
board -- dlink hub --- 3g usb dongle
 I connect the 3g usb dongle to the Dlink USB Hub and i issue the AT
 commands through the busybox microcom, after I get OK for the
 connection, if I try to
 run dhclinet on wwan0 or if I do a ifconfig wwan0 up i see the below
 error message:
 
 SIOCSIFFLAGS: No space left on device

-ENOSPC indicates that bandwidth was insufficient.

 2. below setup works just fine:
board --- 3g usb dongle
 if i connect the 3g usb dongle directly to the embedded board's usb
 port  try the  steps as per (1)
 it works smoothly !!
 
 is it something to do with the linux usb stack? any clue will really
 help in resolving the issue
 Has anyone faced this issue before?
 Thanks in advance for your time!.

Do you have anything else on that hub that eats bandwidth?

Regards
Oliver

--
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 v2 2/2] USB: DWC3: EXYNOS: Remove platform data for dwc3-exynos

2012-10-31 Thread Vivek Gautam
Hi all,


On Tue, Oct 16, 2012 at 2:15 PM, Vivek Gautam gautam.vi...@samsung.com wrote:
 We are removing plat data which was used till now to init and
 exit phy. We no longer need this since dwc3-core takes care of
 initializing and shutting-down the phy using usb_phy_init()
 and usb_phy_shutdown().

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

Any thoughts on this please ?

 ---
  drivers/usb/dwc3/dwc3-exynos.c |   16 
  1 files changed, 0 insertions(+), 16 deletions(-)

 diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c
 index d11ef49..5a2a73f 100644
 --- a/drivers/usb/dwc3/dwc3-exynos.c
 +++ b/drivers/usb/dwc3/dwc3-exynos.c
 @@ -92,7 +92,6 @@ static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);

  static int __devinit dwc3_exynos_probe(struct platform_device *pdev)
  {
 -   struct dwc3_exynos_data *pdata = pdev-dev.platform_data;
 struct platform_device  *dwc3;
 struct dwc3_exynos  *exynos;
 struct clk  *clk;
 @@ -150,14 +149,6 @@ static int __devinit dwc3_exynos_probe(struct 
 platform_device *pdev)

 clk_enable(exynos-clk);

 -   /* PHY initialization */
 -   if (!pdata) {
 -   dev_dbg(pdev-dev, missing platform data\n);
 -   } else {
 -   if (pdata-phy_init)
 -   pdata-phy_init(pdev, pdata-phy_type);
 -   }
 -
 ret = platform_device_add_resources(dwc3, pdev-resource,
 pdev-num_resources);
 if (ret) {
 @@ -174,9 +165,6 @@ static int __devinit dwc3_exynos_probe(struct 
 platform_device *pdev)
 return 0;

  err4:
 -   if (pdata  pdata-phy_exit)
 -   pdata-phy_exit(pdev, pdata-phy_type);
 -
 clk_disable(clk);
 clk_put(clk);
  err3:
 @@ -192,7 +180,6 @@ err0:
  static int __devexit dwc3_exynos_remove(struct platform_device *pdev)
  {
 struct dwc3_exynos  *exynos = platform_get_drvdata(pdev);
 -   struct dwc3_exynos_data *pdata = pdev-dev.platform_data;

 platform_device_unregister(exynos-dwc3);
 platform_device_unregister(exynos-usb2_phy);
 @@ -200,9 +187,6 @@ static int __devexit dwc3_exynos_remove(struct 
 platform_device *pdev)

 dwc3_put_device_id(exynos-dwc3-id);

 -   if (pdata  pdata-phy_exit)
 -   pdata-phy_exit(pdev, pdata-phy_type);
 -
 clk_disable(exynos-clk);
 clk_put(exynos-clk);

 --
 1.7.6.5

 --
 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


-- 
Thanks  Regards
Vivek
--
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 08/11] ARM: OMAP: USB: Change the TLL clock names

2012-10-31 Thread Keshava Munegowda
The tll ports clock names are renamed as channel clocks.
This is change is just adhere to TRM words

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 drivers/mfd/omap-usb-tll.c |   46 ++--
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index f457883..c882d91 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -97,8 +97,8 @@
 #define is_ehci_tll_mode(x)(x == OMAP_EHCI_PORT_MODE_TLL)
 
 struct usbtll_omap {
-   struct clk  *usbtll_p1_fck;
-   struct clk  *usbtll_p2_fck;
+   struct clk  *usbtll_ch0_clk;
+   struct clk  *usbtll_ch1_clk;
void __iomem*base;
enum usbhs_omap_port_mode   port_mode[OMAP3_HS_USB_PORTS];
 
@@ -316,32 +316,32 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
 
spin_lock_init(tll-lock);
 
-   tll-usbtll_p1_fck = clk_get(dev, usb_tll_hs_usb_ch0_clk);
-   if (IS_ERR(tll-usbtll_p1_fck)) {
-   ret = PTR_ERR(tll-usbtll_p1_fck);
-   dev_err(dev, usbtll_p1_fck failed error:%d\n, ret);
+   tll-usbtll_ch0_clk = clk_get(dev, usb_tll_hs_usb_ch0_clk);
+   if (IS_ERR(tll-usbtll_ch0_clk)) {
+   ret = PTR_ERR(tll-usbtll_ch0_clk);
+   dev_err(dev, usb_tll_hs_usb_ch0_clk failed error:%d\n, ret);
goto err_tll;
}
 
-   tll-usbtll_p2_fck = clk_get(dev, usb_tll_hs_usb_ch1_clk);
-   if (IS_ERR(tll-usbtll_p2_fck)) {
-   ret = PTR_ERR(tll-usbtll_p2_fck);
-   dev_err(dev, usbtll_p2_fck failed error:%d\n, ret);
-   goto err_usbtll_p1_fck;
+   tll-usbtll_ch1_clk = clk_get(dev, usb_tll_hs_usb_ch1_clk);
+   if (IS_ERR(tll-usbtll_ch1_clk)) {
+   ret = PTR_ERR(tll-usbtll_ch1_clk);
+   dev_err(dev, usb_tll_hs_usb_ch1_clk failed error:%d\n, ret);
+   goto err_usbtll_ch0_clk;
}
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, usb tll get resource failed\n);
ret = -ENODEV;
-   goto err_usbtll_p2_fck;
+   goto err_usbtll_ch1_clk;
}
 
tll-base = ioremap(res-start, resource_size(res));
if (!tll-base) {
dev_err(dev, TLL ioremap failed\n);
ret = -ENOMEM;
-   goto err_usbtll_p2_fck;
+   goto err_usbtll_ch1_clk;
}
 
platform_set_drvdata(pdev, tll);
@@ -349,11 +349,11 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
tll_pdev = pdev;
return 0;
 
-err_usbtll_p2_fck:
-   clk_put(tll-usbtll_p2_fck);
+err_usbtll_ch1_clk:
+   clk_put(tll-usbtll_ch0_clk);
 
-err_usbtll_p1_fck:
-   clk_put(tll-usbtll_p1_fck);
+err_usbtll_ch0_clk:
+   clk_put(tll-usbtll_ch1_clk);
 
 err_tll:
kfree(tll);
@@ -370,8 +370,8 @@ static int __devexit usbtll_omap_remove(struct 
platform_device *pdev)
 {
struct usbtll_omap *tll = platform_get_drvdata(pdev);
 
-   clk_put(tll-usbtll_p2_fck);
-   clk_put(tll-usbtll_p1_fck);
+   clk_put(tll-usbtll_ch1_clk);
+   clk_put(tll-usbtll_ch0_clk);
pm_runtime_disable(pdev-dev);
kfree(tll);
return 0;
@@ -392,10 +392,10 @@ static int usbtll_runtime_resume(struct device *dev)
spin_lock_irqsave(tll-lock, flags);
 
if (is_ehci_tll_mode(tll-port_mode[0]))
-   clk_enable(tll-usbtll_p1_fck);
+   clk_enable(tll-usbtll_ch0_clk);
 
if (is_ehci_tll_mode(tll-port_mode[1]))
-   clk_enable(tll-usbtll_p2_fck);
+   clk_enable(tll-usbtll_ch1_clk);
 
spin_unlock_irqrestore(tll-lock, flags);
 
@@ -417,10 +417,10 @@ static int usbtll_runtime_suspend(struct device *dev)
spin_lock_irqsave(tll-lock, flags);
 
if (is_ehci_tll_mode(tll-port_mode[0]))
-   clk_disable(tll-usbtll_p1_fck);
+   clk_disable(tll-usbtll_ch0_clk);
 
if (is_ehci_tll_mode(tll-port_mode[1]))
-   clk_disable(tll-usbtll_p2_fck);
+   clk_disable(tll-usbtll_ch1_clk);
 
spin_unlock_irqrestore(tll-lock, flags);
 
-- 
1.7.9.5

--
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 04/11] ARM: OMAP3: USB: Host: Beagle-XM board specific device tree node

2012-10-31 Thread Keshava Munegowda
OMAP3 Beagle-XM board specific data for usb2 host device tree node
is included.
In Beagle XM board , the port 2 of usb host is connected to a hub
with ethernet interface.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   32 
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts 
b/arch/arm/boot/dts/omap3-beagle-xm.dts
index c38cf76..b9f8667 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -113,3 +113,35 @@
 */
ti,pulldowns = 0x03a1c4;
 };
+
+usbhs {
+   /*
+* Maximum fill 3 port info.
+* port configured can be any one of the following values
+* OMAP_USBHS_PORT_MODE_UNUSED  = 0,
+* OMAP_EHCI_PORT_MODE_PHY  = 1,
+* OMAP_EHCI_PORT_MODE_TLL  = 2,
+* OMAP_EHCI_PORT_MODE_HSIC = 3,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0  = 4,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM= 5,
+* OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0  = 6,
+* OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM= 7,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0  = 8,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM= 9,
+* OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0  = 10,
+* OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM= 11,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0  = 12,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM= 13,
+*/
+   port-0 = 0;
+   port-1 = 1;
+   port-2 = 0;
+
+   /*
+* gpio resets should be given the format ( Max of 3 ports)
+* reset-gpio-1 = gpiox x x
+* reset-gpio-2 = gpiox x x
+* reset-gpio-3 = gpiox x x
+*/
+   reset-gpio-2 = gpio5 19 0;   /* gpio 147 */
+};
-- 
1.7.9.5

--
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 02/11] ARM: OMAP4: USB: Host: Panda board specific device tree node

2012-10-31 Thread Keshava Munegowda
OMAP4 panda board specific device tree node is included.

In OMAP4 panda board, the port 1 is used in ULPI PHY mode.
The port 1 is connected to a on board hub with ethernet
interface.

TODO:
   The clock bindings are not yet avilable for OMAP4.
   hence , USB hub specific clocks are exported as device tree string
   paramters.
   Will be changed to use the clock bindings later

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts |   33 +
 1 file changed, 33 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index e8f927c..dad0df6 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -184,3 +184,36 @@
 dmic {
status = disabled;
 };
+
+usbhs {
+   /*
+* Maximum fill 3 port info.
+* port configured can be any one of the following values
+* OMAP_USBHS_PORT_MODE_UNUSED  = 0,
+* OMAP_EHCI_PORT_MODE_PHY  = 1,
+* OMAP_EHCI_PORT_MODE_TLL  = 2,
+* OMAP_EHCI_PORT_MODE_HSIC = 3,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0  = 4,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM= 5,
+* OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0  = 6,
+* OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM= 7,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0  = 8,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM= 9,
+* OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0  = 10,
+* OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM= 11,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0  = 12,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM= 13,
+*/
+   port-0 = 1;
+   port-1 = 0;
+   port-2 = 0;
+
+   /*
+* In some boards, the controller is always connected to hub
+* the pandboard always has the hub connect to port0 of usbhs controller
+*/
+   hub-power-gpio = gpio1 1 0;
+   hub-reset-gpio = gpio2 30 0;  /* gpio 62 */
+   hub-clk = auxclk3_ck;
+   hub-clkrate = 1920;
+};
-- 
1.7.9.5

--
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 00/11] ARM: OMAP: USB: Host: Device tree Adaptation

2012-10-31 Thread Keshava Munegowda
The USB2 Host driver of OMAP3/OMAP4 are device tree complaiant with
this patch series.
The device tree data of UHH, EHCI, OHCI and TLL are included.
The drivers are updated to extract and use the register set and
interrupt numbers delivered by these device tree structures.

Keshava Munegowda (11):
  ARM: OMAP4: USB: Host: Add USB2 Host Device Tree Node
  ARM: OMAP4: USB: Host: Panda board specific device tree node
  ARM: OMAP3: USB: Add USB2 Host Device Tree Node
  ARM: OMAP3: USB: Host: Beagle-XM board specific device tree node
  ARM: OMAP: USB: Host: usb host Device tree node Adaptation
  ARM: OMAP: USB: Host: USB TLL Device tree node Adaptation
  ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data
  ARM: OMAP: USB: Change the TLL clock names
  ARM: OMAP: USB: Remove the device name for TLL channel clocks for
OMAP3
  ARM: OMAP4: USB: Add pin mux configuration for panda board
  ARM: OMAP3: USB: Add pin mux configuration for beagle-xm board

 .../devicetree/bindings/usb/omap-usb-host.txt  |   24 +++
 .../devicetree/bindings/usb/omap-usb-tll.txt   |   21 ++
 arch/arm/boot/dts/omap3-beagle-xm.dts  |   56 +
 arch/arm/boot/dts/omap3.dtsi   |   22 ++
 arch/arm/boot/dts/omap4-panda.dts  |   51 +
 arch/arm/boot/dts/omap4.dtsi   |   22 ++
 arch/arm/mach-omap2/clock3xxx_data.c   |6 +-
 arch/arm/mach-omap2/usb-host.c |   68 --
 drivers/mfd/omap-usb-host.c|  170 ++-
 drivers/mfd/omap-usb-tll.c |  216 
 drivers/usb/host/ehci-omap.c   |   40 ++--
 include/linux/platform_data/usb-omap.h |   31 ++-
 12 files changed, 485 insertions(+), 242 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-host.txt
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-tll.txt

-- 
1.7.9.5

--
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 06/11] ARM: OMAP: USB: Host: USB TLL Device tree node Adaptation

2012-10-31 Thread Keshava Munegowda
The USB TLL device node is extracted and used in the probe
of the driver to initialize the driver data.
This TLL driver exports an API to usbhs driver to perform
the port configuration. The usb2 hs driver invoke the same
API in its driver probe to initialize the ports.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 drivers/mfd/omap-usb-host.c|7 ++
 drivers/mfd/omap-usb-tll.c |  192 +++-
 include/linux/platform_data/usb-omap.h |2 +
 3 files changed, 124 insertions(+), 77 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 4b3af16..27aa85e 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -657,6 +657,11 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
platform_set_drvdata(pdev, omap);
dev-platform_data = pdata;
 
+   if (omap_tll_init(pdata-port_mode)) {
+   dev_err(dev, omap_tll_init failed\n);
+   goto err_tll;
+   }
+
omap_usbhs_init(dev);
ret = omap_usbhs_alloc_children(pdev);
if (ret) {
@@ -668,6 +673,8 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
 
 err_alloc:
omap_usbhs_deinit(pdev-dev);
+
+err_tll:
iounmap(omap-uhh_base);
 
 err_init_60m_fclk:
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 0db0dfa..f457883 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -24,6 +24,7 @@
 #include linux/platform_device.h
 #include linux/clk.h
 #include linux/io.h
+#include linux/of.h
 #include linux/err.h
 #include linux/pm_runtime.h
 #include linux/platform_data/usb-omap.h
@@ -98,7 +99,9 @@
 struct usbtll_omap {
struct clk  *usbtll_p1_fck;
struct clk  *usbtll_p2_fck;
-   struct usbtll_omap_platform_dataplatdata;
+   void __iomem*base;
+   enum usbhs_omap_port_mode   port_mode[OMAP3_HS_USB_PORTS];
+
/* secure the register updates */
spinlock_t  lock;
 };
@@ -196,17 +199,15 @@ static unsigned ohci_omap3_fslsmode(enum 
usbhs_omap_port_mode mode)
 }
 
 /**
- * usbtll_omap_probe - initialize TI-based HCDs
+ * usbtll_omap_initports - initialize TI-based HCDs
  *
- * Allocates basic resources for this USB host controller.
+ * initialize the usb tll ports. Maximum 3 ports
  */
-static int __devinit usbtll_omap_probe(struct platform_device *pdev)
+
+static int usbtll_initports(struct device *dev,
+   enum usbhs_omap_port_mode port_mode[])
 {
-   struct device   *dev =  pdev-dev;
-   struct usbtll_omap_platform_data*pdata = dev-platform_data;
-   void __iomem*base;
-   struct resource *res;
-   struct usbtll_omap  *tll;
+   struct usbtll_omap  *tll = dev_get_drvdata(dev);
unsignedreg;
unsigned long   flags;
int ret = 0;
@@ -214,53 +215,19 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
 
dev_dbg(dev, starting TI HSUSB TLL Controller\n);
 
-   tll = kzalloc(sizeof(struct usbtll_omap), GFP_KERNEL);
if (!tll) {
-   dev_err(dev, Memory allocation failed\n);
-   ret = -ENOMEM;
-   goto end;
+   dev_err(dev, %s: missing TLL Driver data\n, __func__);
+   return -ENOMEM;
}
 
-   spin_lock_init(tll-lock);
-
for (i = 0; i  OMAP3_HS_USB_PORTS; i++)
-   tll-platdata.port_mode[i] = pdata-port_mode[i];
+   tll-port_mode[i] = port_mode[i];
 
-   tll-usbtll_p1_fck = clk_get(dev, usb_tll_hs_usb_ch0_clk);
-   if (IS_ERR(tll-usbtll_p1_fck)) {
-   ret = PTR_ERR(tll-usbtll_p1_fck);
-   dev_err(dev, usbtll_p1_fck failed error:%d\n, ret);
-   goto err_tll;
-   }
-
-   tll-usbtll_p2_fck = clk_get(dev, usb_tll_hs_usb_ch1_clk);
-   if (IS_ERR(tll-usbtll_p2_fck)) {
-   ret = PTR_ERR(tll-usbtll_p2_fck);
-   dev_err(dev, usbtll_p2_fck failed error:%d\n, ret);
-   goto err_usbtll_p1_fck;
-   }
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(dev, usb tll get resource failed\n);
-   ret = -ENODEV;
-   goto err_usbtll_p2_fck;
-   }
-
-   base = ioremap(res-start, resource_size(res));
-   if (!base) {
-   dev_err(dev, TLL ioremap failed\n);
-   ret = -ENOMEM;
-   goto err_usbtll_p2_fck;
-   }
-
-   platform_set_drvdata(pdev, tll);
-   pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
 
   

[PATCH 11/11] ARM: OMAP3: USB: Add pin mux configuration for beagle-xm board

2012-10-31 Thread Keshava Munegowda
The port2 of omap4 panda board is used in ULPI PHY mode.
The pin mux of usbhs (usbb2) port 2 is configured accordingly.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts 
b/arch/arm/boot/dts/omap3-beagle-xm.dts
index b9f8667..c5da799 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -88,6 +88,30 @@
};
 };
 
+omap3_pmx_core {
+   pinctrl-names = default;
+   pinctrl-0 = 
+   usbb2_pins   /* port 1 of omap usb host port pin mux 
configuration */
+   ;
+
+   usbb2_pins: pinmux_usbb2_pins {
+   pinctrl-single,pins = 
+   0x5c0 0x3  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */
+   0x5c2 0x3  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
+   0x5c4 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
+   0x5c6 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
+   0x5c8 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
+   0x5cA 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
+   0x1a4 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
+   0x1a6 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
+   0x1a8 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
+   0x1aa 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
+   0x1ac 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
+   0x1ae 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
+   ;
+   };
+};
+
 mmc1 {
vmmc-supply = vmmc1;
vmmc_aux-supply = vsim;
-- 
1.7.9.5

--
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 05/11] ARM: OMAP: USB: Host: usb host Device tree node Adaptation

2012-10-31 Thread Keshava Munegowda
The USB2 Host device node is extracted and used in the probe
of the driver to initialize the usb ports and controller. The
platform specific initialization is also performed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/mach-omap2/usb-host.c |2 -
 drivers/mfd/omap-usb-host.c|  163 +++-
 include/linux/platform_data/usb-omap.h |   19 +++-
 3 files changed, 133 insertions(+), 51 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index d1dbe12..239c175 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -502,8 +502,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
}
ehci_data.phy_reset = pdata-phy_reset;
ohci_data.es2_compatibility = pdata-es2_compatibility;
-   usbhs_data.ehci_data = ehci_data;
-   usbhs_data.ohci_data = ohci_data;
 
if (cpu_is_omap34xx()) {
setup_ehci_io_mux(pdata-port_mode);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index cebfe0a..4b3af16 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -24,7 +24,7 @@
 #include linux/clk.h
 #include linux/dma-mapping.h
 #include linux/spinlock.h
-#include linux/gpio.h
+#include linux/of_gpio.h
 #include plat/cpu.h
 #include linux/platform_device.h
 #include linux/platform_data/usb-omap.h
@@ -103,8 +103,6 @@ struct usbhs_hcd_omap {
 
void __iomem*uhh_base;
 
-   struct usbhs_omap_platform_data platdata;
-
u32 usbhs_rev;
spinlock_t  lock;
 };
@@ -186,8 +184,6 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
 {
struct device   *dev = pdev-dev;
struct usbhs_hcd_omap   *omap;
-   struct ehci_hcd_omap_platform_data  *ehci_data;
-   struct ohci_hcd_omap_platform_data  *ohci_data;
struct platform_device  *ehci;
struct platform_device  *ohci;
struct resource *res;
@@ -195,8 +191,6 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
int ret;
 
omap = platform_get_drvdata(pdev);
-   ehci_data = omap-platdata.ehci_data;
-   ohci_data = omap-platdata.ohci_data;
 
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ehci);
if (!res) {
@@ -214,8 +208,8 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
}
resources[1] = *res;
 
-   ehci = omap_usbhs_alloc_child(OMAP_EHCI_DEVICE, resources, 2, ehci_data,
-   sizeof(*ehci_data), dev);
+   ehci = omap_usbhs_alloc_child(OMAP_EHCI_DEVICE, resources, 2, NULL,
+   0, dev);
 
if (!ehci) {
dev_err(dev, omap_usbhs_alloc_child failed\n);
@@ -239,8 +233,8 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
}
resources[1] = *res;
 
-   ohci = omap_usbhs_alloc_child(OMAP_OHCI_DEVICE, resources, 2, ohci_data,
-   sizeof(*ohci_data), dev);
+   ohci = omap_usbhs_alloc_child(OMAP_OHCI_DEVICE, resources, 2, NULL,
+   0, dev);
if (!ohci) {
dev_err(dev, omap_usbhs_alloc_child failed\n);
ret = -ENOMEM;
@@ -279,7 +273,7 @@ static bool is_ohci_port(enum usbhs_omap_port_mode pmode)
 static int usbhs_runtime_resume(struct device *dev)
 {
struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
-   struct usbhs_omap_platform_data *pdata = omap-platdata;
+   struct usbhs_omap_platform_data *pdata = dev-platform_data;
unsigned long   flags;
 
dev_dbg(dev, usbhs_runtime_resume\n);
@@ -295,6 +289,7 @@ static int usbhs_runtime_resume(struct device *dev)
if (omap-ehci_logic_fck  !IS_ERR(omap-ehci_logic_fck))
clk_enable(omap-ehci_logic_fck);
 
+   clk_enable(pdata-hub_clk);
if (is_ehci_tll_mode(pdata-port_mode[0]))
clk_enable(omap-usbhost_p1_fck);
if (is_ehci_tll_mode(pdata-port_mode[1]))
@@ -311,7 +306,7 @@ static int usbhs_runtime_resume(struct device *dev)
 static int usbhs_runtime_suspend(struct device *dev)
 {
struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
-   struct usbhs_omap_platform_data *pdata = omap-platdata;
+   struct usbhs_omap_platform_data *pdata = dev-platform_data;
unsigned long   flags;
 
dev_dbg(dev, usbhs_runtime_suspend\n);
@@ -331,6 +326,7 @@ static int usbhs_runtime_suspend(struct device *dev)
clk_disable(omap-utmi_p2_fck);
clk_disable(omap-utmi_p1_fck);
 
+   clk_disable(pdata-hub_clk);
if (omap-ehci_logic_fck  !IS_ERR(omap-ehci_logic_fck))
clk_disable(omap-ehci_logic_fck);
 
@@ 

[PATCH 07/11] ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data

2012-10-31 Thread Keshava Munegowda
The usbhs core driver data is used by the ehci driver, because
the ehci driver is child of usbhs core. The unused ehci, ohci
and tll specific structures are removed.
platform device creation of usbhs and tll using hwmod is
removed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/mach-omap2/usb-host.c |   66 
 drivers/usb/host/ehci-omap.c   |   40 ++-
 include/linux/platform_data/usb-omap.h |   16 
 3 files changed, 21 insertions(+), 101 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 239c175..75fa7ca 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -32,24 +32,6 @@
 
 #ifdef CONFIG_MFD_OMAP_USB_HOST
 
-#define OMAP_USBHS_DEVICE  usbhs_omap
-#define OMAP_USBTLL_DEVICE usbhs_tll
-#defineUSBHS_UHH_HWMODNAME usb_host_hs
-#define USBHS_TLL_HWMODNAMEusb_tll_hs
-
-static struct usbhs_omap_platform_data usbhs_data;
-static struct usbtll_omap_platform_datausbtll_data;
-static struct ehci_hcd_omap_platform_data  ehci_data;
-static struct ohci_hcd_omap_platform_data  ohci_data;
-
-static struct omap_device_pm_latency omap_uhhtll_latency[] = {
- {
-   .deactivate_func = omap_device_idle_hwmods,
-   .activate_func   = omap_device_enable_hwmods,
-   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
- },
-};
-
 /* MUX settings for EHCI pins */
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -487,22 +469,6 @@ void __init setup_4430ohci_io_mux(const enum 
usbhs_omap_port_mode *port_mode)
 
 void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
 {
-   struct omap_hwmod   *uhh_hwm, *tll_hwm;
-   struct platform_device  *pdev;
-   int bus_id = -1;
-   int i;
-
-   for (i = 0; i  OMAP3_HS_USB_PORTS; i++) {
-   usbhs_data.port_mode[i] = pdata-port_mode[i];
-   usbtll_data.port_mode[i] = pdata-port_mode[i];
-   ohci_data.port_mode[i] = pdata-port_mode[i];
-   ehci_data.port_mode[i] = pdata-port_mode[i];
-   ehci_data.reset_gpio_port[i] = pdata-reset_gpio_port[i];
-   ehci_data.regulator[i] = pdata-regulator[i];
-   }
-   ehci_data.phy_reset = pdata-phy_reset;
-   ohci_data.es2_compatibility = pdata-es2_compatibility;
-
if (cpu_is_omap34xx()) {
setup_ehci_io_mux(pdata-port_mode);
setup_ohci_io_mux(pdata-port_mode);
@@ -510,38 +476,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
setup_4430ehci_io_mux(pdata-port_mode);
setup_4430ohci_io_mux(pdata-port_mode);
}
-
-   uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
-   if (!uhh_hwm) {
-   pr_err(Could not look up %s\n, USBHS_UHH_HWMODNAME);
-   return;
-   }
-
-   tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
-   if (!tll_hwm) {
-   pr_err(Could not look up %s\n, USBHS_TLL_HWMODNAME);
-   return;
-   }
-
-   pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
-   usbtll_data, sizeof(usbtll_data),
-   omap_uhhtll_latency,
-   ARRAY_SIZE(omap_uhhtll_latency), false);
-   if (IS_ERR(pdev)) {
-   pr_err(Could not build hwmod device %s\n,
-  USBHS_TLL_HWMODNAME);
-   return;
-   }
-
-   pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
-   usbhs_data, sizeof(usbhs_data),
-   omap_uhhtll_latency,
-   ARRAY_SIZE(omap_uhhtll_latency), false);
-   if (IS_ERR(pdev)) {
-   pr_err(Could not build hwmod devices %s\n,
-  USBHS_UHH_HWMODNAME);
-   return;
-   }
 }
 
 #else
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 0d5ac36..a4d57b4 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -107,17 +107,17 @@ static int omap_ehci_init(struct usb_hcd *hcd)
 {
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
int rc;
-   struct ehci_hcd_omap_platform_data  *pdata;
+   struct usbhs_omap_platform_data *pdata;
 
-   pdata = hcd-self.controller-platform_data;
+   pdata = hcd-self.controller-parent-platform_data;
 
/* Hold PHYs in reset while initializing EHCI controller */
if (pdata-phy_reset) {
-   if (gpio_is_valid(pdata-reset_gpio_port[0]))
-   gpio_set_value_cansleep(pdata-reset_gpio_port[0], 0);
+   if (gpio_is_valid(pdata-reset_gpio[0]))
+   gpio_set_value_cansleep(pdata-reset_gpio[0], 0);
 

Re: [PATCH] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 24, 2012 at 08:47:04PM +0200, Michal Nazarewicz wrote:
  On Wed, Oct 24, 2012 at 07:30:42PM +0200, Michal Nazarewicz wrote:
  At first it looks strange as FSG does not use composite, but yeah:
 
 On Wed, Oct 24 2012, Sebastian Andrzej Siewior wrote:
  Yeah. However, it should be removed in v3.8 anyway :)
 
 Yep, that's what feature-removal-schedule.txt says. :]

except that it was dropped by commit
9c0ece069b32e8e122aea71aa47181c10eb85ba7

nevertheless, I should be receiving a patch right about now removing
that file. Alan, care to send a patch for that ?

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v5 1/4] Revert usb: otg: mxs-phy: Fix mx23 operation

2012-10-31 Thread Felipe Balbi
Hi,

On Mon, Oct 22, 2012 at 03:13:09PM +0800, Peter Chen wrote:
 The real reason causes mx23 fail are:
 
 - Calling mxs_phy_hw_init(mxs_phy) again at connection
 - Error connect/disconnect nodity at hub.c
 
 The coming patch will fix above two problems, Mike Thompson
 tested his hardware works OK after commented out this delay
 setting.
 
 This reverts commit 363366cf61c544ea476f3d220f43a95cb03014f5.
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

I can't really take this series because it touches usbcore. So I rather
Greg took care of the entire series:

Acked-by: Felipe Balbi ba...@ti.com

 ---
  drivers/usb/otg/mxs-phy.c |   38 +++---
  1 files changed, 3 insertions(+), 35 deletions(-)
 
 diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
 index 88db976..c1a67cb 100644
 --- a/drivers/usb/otg/mxs-phy.c
 +++ b/drivers/usb/otg/mxs-phy.c
 @@ -20,7 +20,6 @@
  #include linux/delay.h
  #include linux/err.h
  #include linux/io.h
 -#include linux/workqueue.h
  
  #define DRIVER_NAME mxs_phy
  
 @@ -35,16 +34,9 @@
  #define BM_USBPHY_CTRL_ENUTMILEVEL2  BIT(14)
  #define BM_USBPHY_CTRL_ENHOSTDISCONDETECTBIT(1)
  
 -/*
 - * Amount of delay in miliseconds to safely enable ENHOSTDISCONDETECT bit
 - * so that connection and reset processing can be completed for the root hub.
 - */
 -#define MXY_PHY_ENHOSTDISCONDETECT_DELAY 250
 -
  struct mxs_phy {
   struct usb_phy phy;
   struct clk *clk;
 - struct delayed_work enhostdiscondetect_work;
  };
  
  #define to_mxs_phy(p) container_of((p), struct mxs_phy, phy)
 @@ -70,7 +62,6 @@ static int mxs_phy_init(struct usb_phy *phy)
  
   clk_prepare_enable(mxs_phy-clk);
   mxs_phy_hw_init(mxs_phy);
 - INIT_DELAYED_WORK(mxs_phy-enhostdiscondetect_work, NULL);
  
   return 0;
  }
 @@ -85,34 +76,13 @@ static void mxs_phy_shutdown(struct usb_phy *phy)
   clk_disable_unprepare(mxs_phy-clk);
  }
  
 -static void mxs_phy_enhostdiscondetect_delay(struct work_struct *ws)
 -{
 - struct mxs_phy *mxs_phy = container_of(ws, struct mxs_phy,
 - enhostdiscondetect_work.work);
 -
 - /* Enable HOSTDISCONDETECT after delay. */
 - dev_dbg(mxs_phy-phy.dev, Setting ENHOSTDISCONDETECT\n);
 - writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
 - mxs_phy-phy.io_priv + HW_USBPHY_CTRL_SET);
 -}
 -
  static int mxs_phy_on_connect(struct usb_phy *phy, int port)
  {
 - struct mxs_phy *mxs_phy = to_mxs_phy(phy);
 -
   dev_dbg(phy-dev, Connect on port %d\n, port);
  
 - mxs_phy_hw_init(mxs_phy);
 -
 - /*
 -  * Delay enabling ENHOSTDISCONDETECT so that connection and
 -  * reset processing can be completed for the root hub.
 -  */
 - dev_dbg(phy-dev, Delaying setting ENHOSTDISCONDETECT\n);
 - PREPARE_DELAYED_WORK(mxs_phy-enhostdiscondetect_work,
 - mxs_phy_enhostdiscondetect_delay);
 - schedule_delayed_work(mxs_phy-enhostdiscondetect_work,
 - msecs_to_jiffies(MXY_PHY_ENHOSTDISCONDETECT_DELAY));
 + mxs_phy_hw_init(to_mxs_phy(phy));
 + writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
 + phy-io_priv + HW_USBPHY_CTRL_SET);
  
   return 0;
  }
 @@ -121,8 +91,6 @@ static int mxs_phy_on_disconnect(struct usb_phy *phy, int 
 port)
  {
   dev_dbg(phy-dev, Disconnect on port %d\n, port);
  
 - /* No need to delay before clearing ENHOSTDISCONDETECT. */
 - dev_dbg(phy-dev, Clearing ENHOSTDISCONDETECT\n);
   writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
   phy-io_priv + HW_USBPHY_CTRL_CLR);
  
 -- 
 1.7.0.4
 
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v5 2/4] usb: mxs-phy: re-init phy during the connection is useless

2012-10-31 Thread Felipe Balbi
On Mon, Oct 22, 2012 at 03:13:10PM +0800, Peter Chen wrote:
 As phy is working, re-init phy may cause unexpected results
 
 Signed-off-by: Peter Chen peter.c...@freescale.com

Acked-by: Felipe Balbi ba...@ti.com

 ---
  drivers/usb/otg/mxs-phy.c |1 -
  1 files changed, 0 insertions(+), 1 deletions(-)
 
 diff --git a/drivers/usb/otg/mxs-phy.c b/drivers/usb/otg/mxs-phy.c
 index c1a67cb..5b09f33 100644
 --- a/drivers/usb/otg/mxs-phy.c
 +++ b/drivers/usb/otg/mxs-phy.c
 @@ -80,7 +80,6 @@ static int mxs_phy_on_connect(struct usb_phy *phy, int port)
  {
   dev_dbg(phy-dev, Connect on port %d\n, port);
  
 - mxs_phy_hw_init(to_mxs_phy(phy));
   writel_relaxed(BM_USBPHY_CTRL_ENHOSTDISCONDETECT,
   phy-io_priv + HW_USBPHY_CTRL_SET);
  
 -- 
 1.7.0.4
 
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Michal Nazarewicz
On Wed, Oct 31 2012, Felipe Balbi ba...@ti.com wrote:
 nevertheless, I should be receiving a patch right about now removing
 that file. Alan, care to send a patch for that ?

I have some other stuff to remove as well, so I can take care of it, so
Alan can spend his time on something more important.

-- 
Best regards, _ _
.o. | Liege of Serenely Enlightened Majesty of  o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz(o o)
ooo +email/xmpp: m...@google.com--ooO--(_)--Ooo--

pgpyl2snMHB0k.pgp
Description: PGP signature


Re: [PATCH REPOST] usb: host: tegra remove include of mach/iomap.h

2012-10-31 Thread Felipe Balbi
Hi,

On Mon, Oct 29, 2012 at 11:01:08AM -0600, Stephen Warren wrote:
 On 10/24/2012 01:29 PM, Stephen Warren wrote:
  Almost nothing from this file is used, and the file will hopefully be
  deleted soon. Copy the tiny portions that are used directly into
  ehci-tegra.c. I believe that Venu Byravarasu is working on cleaning up
  our USB driver, and those cleanups will remove the need for these
  constants.
 
 Per suggestion from Greg, I have applied this to the Tegra tree for 3.8.

so I need not take this patch in my tree, right ?

just making sure.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 01:55:03PM +0100, Michal Nazarewicz wrote:
 On Wed, Oct 31 2012, Felipe Balbi ba...@ti.com wrote:
  nevertheless, I should be receiving a patch right about now removing
  that file. Alan, care to send a patch for that ?
 
 I have some other stuff to remove as well, so I can take care of it, so
 Alan can spend his time on something more important.

that's up to you guys, I just need the patch removing what we committed
to remove ;-) Either way is fine by me :-)

cheers

ps: thanks for volunteering :-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 05/16] usb/gadget: add some error recovery in afunc_bind()

2012-10-31 Thread Felipe Balbi
On Wed, Oct 24, 2012 at 02:20:02PM +0200, Sebastian Andrzej Siewior wrote:
 On 10/24/2012 12:25 PM, Sergei Shtylyov wrote:
 Hello.
 
 Hi,
 
 On 23-10-2012 0:14, Sebastian Andrzej Siewior wrote:
 
 In case something goes wrong here, don't leak memory / endpoints.
 
 Cc: jassisinghb...@gmail.com
 Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de
 ---
 drivers/usb/gadget/f_uac2.c | 25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)
 
 diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c
 index d3c6cff..f02b8ec 100644
 --- a/drivers/usb/gadget/f_uac2.c
 +++ b/drivers/usb/gadget/f_uac2.c
 [...]
 @@ -1014,9 +1019,23 @@ afunc_bind(struct usb_configuration *cfg,
 struct usb_function *fn)
 prm-max_psize = 0;
 dev_err(uac2-pdev.dev,
 %s:%d Error!\n, __func__, __LINE__);
 + goto err;
 }
 
 - return alsa_uac2_init(agdev);
 + ret = alsa_uac2_init(agdev);
 + if (ret)
 + goto err;
 + return 0;
 
 if (!ret)
 return 0;
 
 would be slightly less code.
 
 Yes, slightly. You lose the if (err) goto err which confuses me
 sometimes and if you add extra code past that statement you have to
 revert that piece.

I agree with you here. carry on

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 11/16] usb/gadget: fix error path in uvc_function_bind()

2012-10-31 Thread Felipe Balbi
Hi,

On Mon, Oct 22, 2012 at 10:15:05PM +0200, Sebastian Andrzej Siewior wrote:
 The video-minor = -1 assigment is done in V4L2 by
 video_register_device() so it is removed here.
 Now. uvc_function_bind() calls in error case uvc_function_unbind() for
 cleanup. The problem is that uvc_function_unbind() frees the uvc struct
 and uvc_bind_config() does as well in error case of usb_add_function().
 Removing kfree() in usb_add_function() would make the patch smaller but
 it would look odd because the new allocated memory is not cleaned up.
 However it is not guaranteed that if we call usb_add_function() we also
 get to the bind function.
 Therefore the patch extracts the conditional cleanup from
 uvc_function_unbind() applies to uvc_function_bind().
 uvc_function_unbind() now contains only the complete cleanup which is
 required once everything has been registrated.
 
 Cc: Laurent Pinchart laurent.pinch...@ideasonboard.com
 Cc: Bhupesh Sharma bhupesh.sha...@st.com
 Cc: stable sta...@vger.kernel.org
 Signed-off-by: Sebastian Andrzej Siewior bige...@linutronix.de

this has been soaking for long enough and no replies from either Laurent
or Bhupesh. I'm already applying this series, if there is something
wrong it will have to be a patch on top of my gadget branch.

cheers

-- 
balbi


signature.asc
Description: Digital signature


Re: dummy_hcd: try to add qh

2012-10-31 Thread Felipe Balbi
Hi,

On Sat, Oct 27, 2012 at 12:53:49AM +0200, Sebastian Andrzej Siewior wrote:
 I tried to add the qh structure. It is likely that patch #1 isn't 100%
 checkpatch clear. If we agree on #3 then I go and clean it up.

I wonder what I should do with this series...

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Felipe Balbi
On Wed, Oct 31, 2012 at 04:06:00PM +0800, Xiaotian Feng wrote:
 If tasklet_disable() is called before related tasklet handled,
 tasklet_kill will never be finished. tasklet_kill is enough.

how did you test this ? Why changing FSL driver instead of switching
over to chipidea which is supposed to be shared by every licensee of the
chipidea core ?

 Signed-off-by: Xiaotian Feng dannyf...@tencent.com
 Cc: Li Yang le...@freescale.com
 Cc: Felipe Balbi ba...@ti.com
 Cc: Greg Kroah-Hartman gre...@linuxfoundation.org
 Cc: linux-usb@vger.kernel.org
 Cc: linuxppc-...@lists.ozlabs.org
 ---
  drivers/usb/gadget/fsl_qe_udc.c |4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)
 
 diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
 index b09452d..4ad3b82 100644
 --- a/drivers/usb/gadget/fsl_qe_udc.c
 +++ b/drivers/usb/gadget/fsl_qe_udc.c
 @@ -2661,7 +2661,7 @@ static int __devexit qe_udc_remove(struct 
 platform_device *ofdev)
   usb_del_gadget_udc(udc-gadget);
  
   udc-done = done;
 - tasklet_disable(udc-rx_tasklet);
 + tasklet_kill(udc-rx_tasklet);
  
   if (udc-nullmap) {
   dma_unmap_single(udc-gadget.dev.parent,
 @@ -2698,8 +2698,6 @@ static int __devexit qe_udc_remove(struct 
 platform_device *ofdev)
   free_irq(udc-usb_irq, udc);
   irq_dispose_mapping(udc-usb_irq);
  
 - tasklet_kill(udc-rx_tasklet);
 -
   iounmap(udc-usb_regs);
  
   device_unregister(udc-gadget.dev);
 -- 
 1.7.9.5
 

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH V2 2/3] Remove VLAIS usage from gadget code

2012-10-31 Thread Felipe Balbi
hi,

On Tue, Oct 30, 2012 at 05:18:56PM -0400, Behan Webster wrote:
 The use of variable length arrays in structs (VLAIS) in the Linux Kernel code
 precludes the use of compilers which don't implement VLAIS (for instance the
 Clang compiler). This patch instead calculates offsets into the kmalloc-ed
 memory buffer using macros from valign.h.
 
 Signed-off-by: Behan Webster beh...@converseincode.com

this won't apply after the current cleanups I applied to gadget code
from Sebastian.

If someone takes this patch, it will generate a series of annoying,
hard-to-figure-out conflicts (at least judging by the looks of
$SUBJECT).

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb:musb: Dequeue urbs on device unplug

2012-10-31 Thread Felipe Balbi
hi,

On Mon, Oct 22, 2012 at 06:51:39AM +0200, Virupax SADASHIVPETIMATH wrote:
  -Original Message-
  From: Felipe Balbi [mailto:ba...@ti.com]
  Sent: Monday, October 15, 2012 5:49 PM
  To: Virupax SADASHIVPETIMATH
  Cc: ba...@ti.com; st...@rowland.harvard.edu; linux-usb@vger.kernel.org;
  linux-ker...@vger.kernel.org; linus.wall...@linaro.org; Rajaram REGUPATHY;
  Praveena NADAHALLY
  Subject: Re: [PATCH] usb:musb: Dequeue urbs on device unplug
  
  Hi,
  
  On Wed, Oct 10, 2012 at 10:06:03AM +0530, Virupax Sadashivpetimath wrote:
   Flush queued urbs on receiving device disconnect interrupt. This is
   required for successful disconnect and successive enumeration of the
   device.
  
   In a failure case khubd hangs on usb-storage thread for completion.
   Seen in the below trace.
  
   [ 1355.764526] SysRq : Show Blocked State
   [ 1355.768341]   taskPC stack   pid father
   [ 1355.773620] khubd   D c06a1fbc 0   503  2 0x
   [ 1355.780151] [c06a1fbc] (__schedule+0x3f0/0x8ec) from [c06a26a0]
   (schedule+0x58/0x70) [ 1355.788330] [c06a26a0] (schedule+0x58/0x70)
   from [c06a2af8] (schedule_timeout+0x1d8/0x31c) [ 1355.796997]
   [c06a2af8] (schedule_timeout+0x1d8/0x31c) from [c06a1994]
   (wait_for_common+0xd8/0x180) [ 1355.806396] [c06a1994]
   (wait_for_common+0xd8/0x180) from [c06a1b14]
   (wait_for_completion+0x20/0x24) [ 1355.815887] [c06a1b14]
  I would like to get some Tested-bys here.
 
 Can you please add 
 
 Tested-by: shuai@stericsson.com

as soon as you reply telling me how you tested. Which kind of testcases
did you run ?

thanks

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb:musb: Dequeue urbs on device unplug

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 10, 2012 at 10:06:03AM +0530, Virupax Sadashivpetimath wrote:
 Flush queued urbs on receiving device disconnect
 interrupt. This is required for successful disconnect
 and successive enumeration of the device.
 
 In a failure case khubd hangs on usb-storage thread
 for completion. Seen in the below trace.
 
 [ 1355.764526] SysRq : Show Blocked State
 [ 1355.768341]   taskPC stack   pid father
 [ 1355.773620] khubd   D c06a1fbc 0   503  2 0x
 [ 1355.780151] [c06a1fbc] (__schedule+0x3f0/0x8ec) from [c06a26a0] 
 (schedule+0x58/0x70)
 [ 1355.788330] [c06a26a0] (schedule+0x58/0x70) from [c06a2af8] 
 (schedule_timeout+0x1d8/0x31c)
 [ 1355.796997] [c06a2af8] (schedule_timeout+0x1d8/0x31c) from [c06a1994] 
 (wait_for_common+0xd8/0x180)
 [ 1355.806396] [c06a1994] (wait_for_common+0xd8/0x180) from [c06a1b14] 
 (wait_for_completion+0x20/0x24)
 [ 1355.815887] [c06a1b14] (wait_for_completion+0x20/0x24) from [c00b9998] 
 (kthread_stop+0x68/0x17c)
 [ 1355.825103] [c00b9998] (kthread_stop+0x68/0x17c) from [c039e0e0] 
 (release_everything+0x30/0x8c)
 [ 1355.834228] [c039e0e0] (release_everything+0x30/0x8c) from [c039e168] 
 (usb_stor_disconnect+0x2c/0x30)
 [ 1355.843902] [c039e168] (usb_stor_disconnect+0x2c/0x30) from [c038e3a8] 
 (usb_unbind_interface+0x60/0x1e0)
 [ 1355.853820] [c038e3a8] (usb_unbind_interface+0x60/0x1e0) from 
 [c031dcc0] (__device_release_driver+0x80/0xd0)
 [ 1355.864074] [c031dcc0] (__device_release_driver+0x80/0xd0) from 
 [c031ddfc] (device_release_driver+0x2c/0x38)
 [ 1355.874359] [c031ddfc] (device_release_driver+0x2c/0x38) from 
 [c031d0d8] (bus_remove_device+0xbc/0x10c)
 [ 1355.884155] [c031d0d8] (bus_remove_device+0xbc/0x10c) from [c031b63c] 
 (device_del+0x108/0x17c)
 [ 1355.893188] [c031b63c] (device_del+0x108/0x17c) from [c038afe8] 
 (usb_disable_device+0xbc/0x200)
 [ 1355.902313] [c038afe8] (usb_disable_device+0xbc/0x200) from [c0384c58] 
 (usb_disconnect+0xb8/0x194)
 [ 1355.911682] [c0384c58] (usb_disconnect+0xb8/0x194) from [c0385e58] 
 (hub_thread+0x45c/0x14b0)
 [ 1355.920562] [c0385e58] (hub_thread+0x45c/0x14b0) from [c00b97e0] 
 (kthread+0x98/0xa0)
 [ 1355.928710] [c00b97e0] (kthread+0x98/0xa0) from [c0064834] 
 (kernel_thread_exit+0x0/0x8)
 [ 1356.014373] usb-storage D c06a1fbc 0  2379  2 0x
 [ 1356.020843] [c06a1fbc] (__schedule+0x3f0/0x8ec) from [c06a26a0] 
 (schedule+0x58/0x70)
 [ 1356.029022] [c06a26a0] (schedule+0x58/0x70) from [c06a2af8] 
 (schedule_timeout+0x1d8/0x31c)
 [ 1356.037719] [c06a2af8] (schedule_timeout+0x1d8/0x31c) from [c06a1994] 
 (wait_for_common+0xd8/0x180)
 [ 1356.047088] [c06a1994] (wait_for_common+0xd8/0x180) from [c06a1b14] 
 (wait_for_completion+0x20/0x24)
 [ 1356.056549] [c06a1b14] (wait_for_completion+0x20/0x24) from [c038b5dc] 
 (usb_sg_wait+0x108/0x194)
 [ 1356.065795] [c038b5dc] (usb_sg_wait+0x108/0x194) from [c039d6dc] 
 (usb_stor_bulk_transfer_sglist+0x9c/0xf4)
 [ 1356.075866] [c039d6dc] (usb_stor_bulk_transfer_sglist+0x9c/0xf4) from 
 [c039d76c] (usb_stor_bulk_srb+0x38/0x50)
 [ 1356.086303] [c039d76c] (usb_stor_bulk_srb+0x38/0x50) from [c039d92c] 
 (usb_stor_Bulk_transport+0x114/0x2d0)
 [ 1356.096374] [c039d92c] (usb_stor_Bulk_transport+0x114/0x2d0) from 
 [c039d190] (usb_stor_invoke_transport+0x34/0x3f4)
 [ 1356.107238] [c039d190] (usb_stor_invoke_transport+0x34/0x3f4) from 
 [c039cc0c] (usb_stor_transparent_scsi_command+0x18/0x1c)
 [ 1356.118804] [c039cc0c] (usb_stor_transparent_scsi_command+0x18/0x1c) 
 from [c039f144] (usb_stor_control_thread+0x190/0x28c)
 [ 1356.130279] [c039f144] (usb_stor_control_thread+0x190/0x28c) from 
 [c00b97e0] (kthread+0x98/0xa0)
 [ 1356.139465] [c00b97e0] (kthread+0x98/0xa0) from [c0064834] 
 (kernel_thread_exit+0x0/0x8)
 
 Signed-off-by: Virupax Sadashivpetimath 
 virupax.sadashivpetim...@stericsson.com
 Acked-by: Linus Walleij linus.wall...@linaro.org
 ---
  drivers/usb/musb/musb_core.c |   37 +
  drivers/usb/musb/musb_host.c |3 +++
  2 files changed, 40 insertions(+), 0 deletions(-)
 
 diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
 index bb56a0e..fc6e990 100644
 --- a/drivers/usb/musb/musb_core.c
 +++ b/drivers/usb/musb/musb_core.c
 @@ -414,6 +414,41 @@ static void musb_otg_timer_func(unsigned long data)
   spin_unlock_irqrestore(musb-lock, flags);
  }
  
 +void musb_handle_disconnect(struct musb *musb)

missing static. Actually, why isn't this part of
musb_root_disconnect() ?? Any real reasoning behind it ?

Another point is that, if this function is really necessary, the name is
quite lame. It should be called musb_unlink_and_giveback_urbs() or
something similar.

 +{
 + int epnum, i;
 + struct urb  *urb;
 + struct musb_hw_ep   *hw_ep;
 + struct musb_qh  *qh;
 + struct usb_hcd *hcd = musb_to_hcd(musb);
 +
 + for (epnum = 0; epnum  musb-config-num_eps;
 + epnum++) {
 + hw_ep = 

Re: [PATCH] usb: gadget: ncm: correct endianess conversion

2012-10-31 Thread Felipe Balbi
On Sun, Oct 28, 2012 at 06:48:29PM +0100, Sebastian Andrzej Siewior wrote:
 On Sun, Oct 28, 2012 at 06:30:02PM +0100, Dmytro Milinevskyy wrote:
  I was trying to keep 2 tabs but checkpatch didn't accept long line
  that's why I killed extra tab.
 
 Then move them to the code section instead to initialize them in the
 declaration section.
 
  How does it work? Is the test on host side not strict enough?
  The host part(cdc_ncm) does not check this field.
  However I agree that at least on device side this should be corrected.
 Good.
 
  Felipe, do you want me to send another patch or resend previous one
  with this correction?
 If it hasn't been applied yet resend it.

I think I hasn't applied this one yet, so resending is the way to go.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb: gadget: ncm: correct endianess conversion

2012-10-31 Thread Felipe Balbi
Hi,

On Tue, Oct 30, 2012 at 10:44:27AM +0100, Dmytro Milinevskyy wrote:
 Convert USB descriptor's fields to CPU byte order before using locally in USB 
 NCM gadget driver.
 Tested on MIPS32 big-endian device.
 
 Signed-off-by: Dmytro Milinevskyy milinevs...@gmail.com
 ---
  drivers/usb/gadget/f_ncm.c | 12 ++--
  1 file changed, 6 insertions(+), 6 deletions(-)
 
 diff --git a/drivers/usb/gadget/f_ncm.c b/drivers/usb/gadget/f_ncm.c
 index b651b52..0b9e2ad 100644
 --- a/drivers/usb/gadget/f_ncm.c
 +++ b/drivers/usb/gadget/f_ncm.c
 @@ -102,7 +102,7 @@ static inline unsigned ncm_bitrate(struct usb_gadget *g)
USB_CDC_NCM_NTB32_SUPPORTED)
  static struct usb_cdc_ncm_ntb_parameters ntb_parameters = {
 - .wLength = sizeof ntb_parameters,
 + .wLength = cpu_to_le16(sizeof(ntb_parameters)),
   .bmNtbFormatsSupported = cpu_to_le16(FORMATS_SUPPORTED),
   .dwNtbInMaxSize = cpu_to_le32(NTB_DEFAULT_IN_SIZE),
   .wNdpInDivisor = cpu_to_le16(4),
 @@ -869,15 +869,15 @@ static struct sk_buff *ncm_wrap_ntb(struct gether *port,
   struct sk_buff  *skb2;
   int ncb_len = 0;
   __le16  *tmp;
 - int div = ntb_parameters.wNdpInDivisor;
 - int rem = ntb_parameters.wNdpInPayloadRemainder;
 - int pad;
 - int ndp_align = ntb_parameters.wNdpInAlignment;
 - int ndp_pad;
 + int div, rem, pad, ndp_align, ndp_pad;

I would not combine them in a single line. Keep them one per line.

cheers

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 00/11] ARM: OMAP: USB: Host: Device tree Adaptation

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 05:46:38PM +0530, Keshava Munegowda wrote:
 The USB2 Host driver of OMAP3/OMAP4 are device tree complaiant with
 this patch series.
 The device tree data of UHH, EHCI, OHCI and TLL are included.
 The drivers are updated to extract and use the register set and
 interrupt numbers delivered by these device tree structures.
 
 Keshava Munegowda (11):
   ARM: OMAP4: USB: Host: Add USB2 Host Device Tree Node
   ARM: OMAP4: USB: Host: Panda board specific device tree node
   ARM: OMAP3: USB: Add USB2 Host Device Tree Node
   ARM: OMAP3: USB: Host: Beagle-XM board specific device tree node
   ARM: OMAP: USB: Host: usb host Device tree node Adaptation
   ARM: OMAP: USB: Host: USB TLL Device tree node Adaptation
   ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data
   ARM: OMAP: USB: Change the TLL clock names
   ARM: OMAP: USB: Remove the device name for TLL channel clocks for
 OMAP3
   ARM: OMAP4: USB: Add pin mux configuration for panda board
   ARM: OMAP3: USB: Add pin mux configuration for beagle-xm board

Benoit should be in Cc on this series since he's the one handling DT for
OMAPs.

Care to resend with him in Cc ?

(everyone else, please ignore this series, sorry for the noise)

-- 
balbi


signature.asc
Description: Digital signature


Re: dummy_hcd: try to add qh

2012-10-31 Thread Sebastian Andrzej Siewior

On 10/31/2012 02:15 PM, Felipe Balbi wrote:

Hi,

Hi,


On Sat, Oct 27, 2012 at 12:53:49AM +0200, Sebastian Andrzej Siewior wrote:

I tried to add the qh structure. It is likely that patch #1 isn't 100%
checkpatch clear. If we agree on #3 then I go and clean it up.


I wonder what I should do with this series...


ignore it until Alan and I agree on something :)

Sebastian
--
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 v2 1/2] USB: dwc3-exynos: Add support for device tree

2012-10-31 Thread Felipe Balbi
Hi,
On Tue, Oct 16, 2012 at 02:15:56PM +0530, Vivek Gautam wrote:
 This patch adds support to parse probe data for
 dwc3-exynos driver using device tree.
 
 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

does not apply to my dwc3 branch. Care to respin ?

-- 
balbi


signature.asc
Description: Digital signature


Re: dummy_hcd: try to add qh

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 02:44:22PM +0100, Sebastian Andrzej Siewior wrote:
 On 10/31/2012 02:15 PM, Felipe Balbi wrote:
 Hi,
 Hi,
 
 On Sat, Oct 27, 2012 at 12:53:49AM +0200, Sebastian Andrzej Siewior wrote:
 I tried to add the qh structure. It is likely that patch #1 isn't 100%
 checkpatch clear. If we agree on #3 then I go and clean it up.
 
 I wonder what I should do with this series...
 
 ignore it until Alan and I agree on something :)

done ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb/musb: remove hand-crafted id handling

2012-10-31 Thread Sebastian Andrzej Siewior

On 10/31/2012 02:24 PM, Felipe Balbi wrote:

unfortunately doesn't apply to my musb branch. Care to respin this
patch ?


Let me wait a bit until your tree makes it to k.o and then I rebase on
top of it.

Sebastian
--
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] usb/musb: remove hand-crafted id handling

2012-10-31 Thread Felipe Balbi
On Wed, Oct 31, 2012 at 02:45:55PM +0100, Sebastian Andrzej Siewior wrote:
 On 10/31/2012 02:24 PM, Felipe Balbi wrote:
 unfortunately doesn't apply to my musb branch. Care to respin this
 patch ?
 
 Let me wait a bit until your tree makes it to k.o and then I rebase on
 top of it.

cool, thanks

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v7 2/5] usb: s3c-hsotg: Adding phy driver support

2012-10-31 Thread Felipe Balbi
Hi,

On Tue, Oct 30, 2012 at 10:27:34AM +0530, Praveen Paneri wrote:
 @@ -3501,20 +3511,27 @@ static int __devinit s3c_hsotg_probe(struct 
 platform_device *pdev)
   int ret;
   int i;
  
 - plat = pdev-dev.platform_data;
 - if (!plat) {
 - dev_err(pdev-dev, no platform data defined\n);
 - return -EINVAL;
 - }
 -
   hsotg = devm_kzalloc(pdev-dev, sizeof(struct s3c_hsotg), GFP_KERNEL);
   if (!hsotg) {
   dev_err(dev, cannot get memory\n);
   return -ENOMEM;
   }
  
 + plat = pdev-dev.platform_data;
 + if (!plat) {
 + /* Fallback for transceiver */
 + phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
 + if (IS_ERR_OR_NULL(phy)) {
 + dev_err(pdev-dev, no platform data or transceiver 
 defined\n);
 + return -EPROBE_DEFER;
 + } else {
 + hsotg-phy = phy;
 + }
 + } else {
 + hsotg-plat = plat;
 + }

I think this should be the other way around, meaning you try to grab the
phy, if you can't, then you fallback to pdata.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v3 0/4] Adding usb2.0 host-phy support for exynos5250

2012-10-31 Thread Felipe Balbi
Hi,

On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
 This patchset is based on the work by Praveen Paneri for
 samsung-usbphy driver:
 http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
 
 Changes from v2:
  - Using EXYNOS5_PHY_ as common prefix along with exact names for
PHY SFRs for register definitions
  - Using register names with bit macros to make things more clear.
  - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
in [patch 2/4 v2].
 
 Tested on smdk5250 target with usb-next branch along with arch patches
 for exynos5250:
 http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
 http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
 
 Vivek Gautam (4):
   usb: phy: samsung: Add host phy support to samsung-phy driver
   ARM: Exynos5250: Enabling samsung-usbphy driver
   USB: ehci-s5p: Add phy driver support
   USB: ohci-exynos: Add phy driver support

you should join forces with Praveen Paneri so you guys have a single PHY
code.

(I haven't fully read your patches, so apologize if what I'm saying is
already taken care of)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH] usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()

2012-10-31 Thread Rajaram R
Hi


On Tue, Oct 23, 2012 at 11:42 AM, Wei Yongjun weiyj...@gmail.com wrote:
 commit 65b3d52d02a558fbfe08e43688e15390c5ab3067
 (usb: musb: add musb_ida for multi instance support)
 used musbid in ux500_remove() but nerver declared it.

The above message doesnot match with your fix. You say ux500_remove is
using musbhid but build error is in probe.

I also dont see anywhere in the code we use this variable musbid.



 I found this in x86_64 platform, but not sure whether
 this is a error on the correct ARCH.

 $ make drivers/usb/musb/ux500.o
 make[1]: Nothing to be done for `all'.
 make[1]: Nothing to be done for `relocs'.
   CHK include/generated/uapi/linux/version.h
   CHK include/generated/utsrelease.h
   UPD include/generated/utsrelease.h
   CALLscripts/checksyscalls.sh
   CC  drivers/usb/musb/ux500.o
 drivers/usb/musb/ux500.c: In function 'ux500_probe':
 drivers/usb/musb/ux500.c:78:2: error: 'musbid' undeclared (first use in this 
 function)
 drivers/usb/musb/ux500.c:78:2: note: each undeclared identifier is reported 
 only once for each function it appears in
 make[1]: *** [drivers/usb/musb/ux500.o] Error 1
 make: *** [drivers/usb/musb/ux500.o] Error 2

 Signed-off-by: Wei Yongjun yongjun_...@trendmicro.com.cn
 ---
  drivers/usb/musb/ux500.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

 diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
 index d62a91f..0e62f50 100644
 --- a/drivers/usb/musb/ux500.c
 +++ b/drivers/usb/musb/ux500.c
 @@ -65,7 +65,7 @@ static int __devinit ux500_probe(struct platform_device 
 *pdev)
 struct platform_device  *musb;
 struct ux500_glue   *glue;
 struct clk  *clk;
 -
 +   int musbid;
 int ret = -ENOMEM;

 glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 --
 1.7.11.7


 --
 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
--
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: [GIT PULL] USB fixes for v3.7-rc4

2012-10-31 Thread Rajaram R
Hi Felipie/Greg

On Tue, Oct 30, 2012 at 6:17 PM, Felipe Balbi ba...@ti.com wrote:
 Hi Greg,

 Judging by how things are going, this is likely to be my last pull request
 for v3.7-rc cycle, unless someone finds a big regression which we really must
 fix during v3.7-rc.

 It's rather small; just a revert, a Kconfig change and the addition of a
 variable to a function. In fact, it's so small that I've added the full
 combined diff below FYI.

 Let me know if you want me to change anything.

 cheers

 The following changes since commit 1cb60156defa4f23d5318ea1ddd400f25b2d0ce5:

   usb: renesas_usbhs: fixup dma transfer stall (2012-10-23 09:44:37 +0300)

 are available in the git repository at:

   git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb.git 
 tags/fixes-for-v3.7-rc4

 for you to fetch changes up to f6bc8c29383456b89ac1b6f1aa768d195670fb53:

   usb: otg: Fix build errors if USB_MUSB_OMAP2PLUS is selected as module 
 (2012-10-30 14:37:07 +0200)

 
 usb: fixes for v3.7-rc4

 We're reverting MUSB Mode 1 DMA patch which caused many regressions. Meanwhile
 Roger is cooking a better version of that patch, which will hopefully be ready
 for v3.8 merge window.

 We also fix an undeclared error in ux5000_remove() and another build error
 when we try to build USB_MUSB_OMAP2PLUS as a module.

 
 Felipe Balbi (1):
   Revert usb: musb: use DMA mode 1 whenever possible

 Roger Quadros (1):
   usb: otg: Fix build errors if USB_MUSB_OMAP2PLUS is selected as module

 Wei Yongjun (1):
   usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()

This patch is incorrect. Please dont merge this patch.

  drivers/usb/musb/musb_gadget.c | 30 ++
  drivers/usb/musb/ux500.c   |  2 +-
  drivers/usb/otg/Kconfig|  4 ++--
  3 files changed, 29 insertions(+), 7 deletions(-)

 diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
 index d0b87e7..b6b84da 100644
 --- a/drivers/usb/musb/musb_gadget.c
 +++ b/drivers/usb/musb/musb_gadget.c
 @@ -707,11 +707,12 @@ static void rxstate(struct musb *musb, struct 
 musb_request *req)
 fifo_count = musb_readw(epio, MUSB_RXCOUNT);

 /*
 -*  use mode 1 only if we expect data of at least ep packet_sz
 -*  and have not yet received a short packet
 +* Enable Mode 1 on RX transfers only when short_not_ok flag
 +* is set. Currently short_not_ok flag is set only from
 +* file_storage and f_mass_storage drivers
  */
 -   if ((request-length - request-actual = musb_ep-packet_sz) 
 
 -   (fifo_count = musb_ep-packet_sz))
 +
 +   if (request-short_not_ok  fifo_count == musb_ep-packet_sz)
 use_mode_1 = 1;
 else
 use_mode_1 = 0;
 @@ -727,6 +728,27 @@ static void rxstate(struct musb *musb, struct 
 musb_request *req)
 c = musb-dma_controller;
 channel = musb_ep-dma;

 +   /* We use DMA Req mode 0 in rx_csr, and DMA controller operates in
 +* mode 0 only. So we do not get endpoint interrupts due to DMA
 +* completion. We only get interrupts from DMA controller.
 +*
 +* We could operate in DMA mode 1 if we knew the size of the tranfer
 +* in advance. For mass storage class, request-length = what the host
 +* sends, so that'd work.  But for pretty much everything else,
 +* request-length is routinely more than what the host sends. For
 +* most these gadgets, end of is signified either by a short packet,
 +* or filling the last byte of the buffer.  (Sending extra data in
 +* that last pckate should trigger an overflow fault.)  But in mode 1,
 +* we don't get DMA completion interrupt for short packets.
 +*
 +* Theoretically, we could enable DMAReq irq (MUSB_RXCSR_DMAMODE = 1),
 +* to get endpoint interrupt on every DMA req, but that didn't seem
 +* to work reliably.
 +*
 +* REVISIT an updated g_file_storage can set req-short_not_ok, which
 +* then becomes usable as a runtime use mode 1 hint...
 +*/
 +
 /* Experimental: Mode1 works with mass 
 storage use cases */
 if (use_mode_1) {
 csr |= MUSB_RXCSR_AUTOCLEAR;
 diff --git a/drivers/usb/musb/ux500.c b/drivers/usb/musb/ux500.c
 index d62a91f..0e62f50 100644
 --- a/drivers/usb/musb/ux500.c
 +++ b/drivers/usb/musb/ux500.c
 @@ -65,7 +65,7 @@ static int __devinit ux500_probe(struct platform_device 
 *pdev)
 struct platform_device  *musb;
 struct ux500_glue   *glue;

[PATCH 0/2] usb: musb: dsps: fixes for -rc

2012-10-31 Thread Afzal Mohammed
Hi Balbi,

This series contains a couple of fixes for musb dsps wrapper.

First one restores capability to support at least one instance of musb.
Without it, even a single instance can't be supported as change which
is reverted by it was made along with multi phy changes and nop
transciever dt support, both other changes didn't make it in during
previous merge window.

Second one corrects binding document; changes were made in driver as
per review comments, but documentation was not updated.

Please consider this series for inclusion in the next -rc cycle.

To support usb on beagle bone, further changes to handle control
module registers for phy has to be made, they will be posted as
a seperate series.


Regards
Afzal

Afzal Mohammed (2):
  Revert usb: musb: dsps: remove explicit NOP device creation
  usb: musb: dsps: document dt bindings properly

 Documentation/devicetree/bindings/usb/am33xx-usb.txt | 8 
 drivers/usb/musb/musb_dsps.c | 3 ++-
 2 files changed, 6 insertions(+), 5 deletions(-)

-- 
1.7.12

--
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/2] Revert usb: musb: dsps: remove explicit NOP device creation

2012-10-31 Thread Afzal Mohammed
This reverts commit d8c3ef256f88b7c6ecd673d03073b5645be9c5e4.

Above mentioned change was made along with multi usb phy change and
adding DT support for nop transceiver. But other two changes did not
make it to mainline. This in effect makes dsps musb wrapper unusable
even for single instance.

Hence revert it so that at least single instance can be supported.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 drivers/usb/musb/musb_dsps.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index 828d2a2..63128a3 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -377,7 +377,8 @@ static int dsps_musb_init(struct musb *musb)
/* mentor core register starts at offset of 0x400 from musb base */
musb-mregs += wrp-musb_core_offset;
 
-   /* Get the NOP PHY */
+   /* NOP driver needs change if supporting dual instance */
+   usb_nop_xceiv_register();
musb-xceiv = usb_get_phy(USB_PHY_TYPE_USB2);
if (IS_ERR_OR_NULL(musb-xceiv))
return -ENODEV;
-- 
1.7.12

--
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/2] usb: musb: dsps: document dt bindings properly

2012-10-31 Thread Afzal Mohammed
DT bindings normally use '-' (hyphens) instead of '_' (underscore),
driver has it the proper way, but binding documentation does not
reflect it, fix it.

Signed-off-by: Afzal Mohammed af...@ti.com
---
 Documentation/devicetree/bindings/usb/am33xx-usb.txt | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/usb/am33xx-usb.txt 
b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
index ca8fa56..a922505 100644
--- a/Documentation/devicetree/bindings/usb/am33xx-usb.txt
+++ b/Documentation/devicetree/bindings/usb/am33xx-usb.txt
@@ -3,12 +3,12 @@ AM33XX MUSB GLUE
  - ti,hwmods : must be usb_otg_hs
  - multipoint : Should be 1 indicating the musb controller supports
multipoint. This is a MUSB configuration-specific setting.
- - num_eps : Specifies the number of endpoints. This is also a
+ - num-eps : Specifies the number of endpoints. This is also a
MUSB configuration-specific setting. Should be set to 16
- - ram_bits : Specifies the ram address size. Should be set to 12
- - port0_mode : Should be 3 to represent OTG. 1 signifies HOST and 2
+ - ram-bits : Specifies the ram address size. Should be set to 12
+ - port0-mode : Should be 3 to represent OTG. 1 signifies HOST and 2
represents PERIPHERAL.
- - port1_mode : Should be 1 to represent HOST. 3 signifies OTG and 2
+ - port1-mode : Should be 1 to represent HOST. 3 signifies OTG and 2
represents PERIPHERAL.
  - power : Should be 250. This signifies the controller can supply upto
500mA when operating in host mode.
-- 
1.7.12

--
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


[RESEND PATCH 10/11] ARM: OMAP4: USB: Add pin mux configuration for panda board

2012-10-31 Thread Keshava Munegowda
The port1 of omap4 panda board is used in ULPI PHY mode.
The pin mux of usbhs (usbb1) port 1 is configured accordingly.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap4-panda.dts |   18 ++
 1 file changed, 18 insertions(+)

diff --git a/arch/arm/boot/dts/omap4-panda.dts 
b/arch/arm/boot/dts/omap4-panda.dts
index dad0df6..ea374cf 100644
--- a/arch/arm/boot/dts/omap4-panda.dts
+++ b/arch/arm/boot/dts/omap4-panda.dts
@@ -65,6 +65,7 @@
twl6040_pins
mcpdm_pins
mcbsp1_pins
+   usbb1_pins   /* port 0 of omap usb host port pin mux 
configuration */
;
 
twl6040_pins: pinmux_twl6040_pins {
@@ -92,6 +93,23 @@
0xc4 0x100  /* abe_mcbsp1_fsx.abe_mcbsp1_fsx INPUT 
| MODE0 */
;
};
+
+   usbb1_pins: pinmux_usbb1_pins {
+   pinctrl-single,pins = 
+   0x82 0x10C  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk INPUT | PULLDOWN */
+   0x84 0x4  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
+   0x86 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
+   0x88 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
+   0x8a 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
+   0x8c 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
+   0x8e 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
+   0x90 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
+   0x92 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
+   0x94 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
+   0x96 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
+   0x98 0x104  /* 
USBB1_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
+   ;
+   };
 };
 
 i2c1 {
-- 
1.7.9.5

--
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


[RESEND PATCH 08/11] ARM: OMAP: USB: Change the TLL clock names

2012-10-31 Thread Keshava Munegowda
The tll ports clock names are renamed as channel clocks.
This is change is just adhere to TRM words

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 drivers/mfd/omap-usb-tll.c |   46 ++--
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index f457883..c882d91 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -97,8 +97,8 @@
 #define is_ehci_tll_mode(x)(x == OMAP_EHCI_PORT_MODE_TLL)
 
 struct usbtll_omap {
-   struct clk  *usbtll_p1_fck;
-   struct clk  *usbtll_p2_fck;
+   struct clk  *usbtll_ch0_clk;
+   struct clk  *usbtll_ch1_clk;
void __iomem*base;
enum usbhs_omap_port_mode   port_mode[OMAP3_HS_USB_PORTS];
 
@@ -316,32 +316,32 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
 
spin_lock_init(tll-lock);
 
-   tll-usbtll_p1_fck = clk_get(dev, usb_tll_hs_usb_ch0_clk);
-   if (IS_ERR(tll-usbtll_p1_fck)) {
-   ret = PTR_ERR(tll-usbtll_p1_fck);
-   dev_err(dev, usbtll_p1_fck failed error:%d\n, ret);
+   tll-usbtll_ch0_clk = clk_get(dev, usb_tll_hs_usb_ch0_clk);
+   if (IS_ERR(tll-usbtll_ch0_clk)) {
+   ret = PTR_ERR(tll-usbtll_ch0_clk);
+   dev_err(dev, usb_tll_hs_usb_ch0_clk failed error:%d\n, ret);
goto err_tll;
}
 
-   tll-usbtll_p2_fck = clk_get(dev, usb_tll_hs_usb_ch1_clk);
-   if (IS_ERR(tll-usbtll_p2_fck)) {
-   ret = PTR_ERR(tll-usbtll_p2_fck);
-   dev_err(dev, usbtll_p2_fck failed error:%d\n, ret);
-   goto err_usbtll_p1_fck;
+   tll-usbtll_ch1_clk = clk_get(dev, usb_tll_hs_usb_ch1_clk);
+   if (IS_ERR(tll-usbtll_ch1_clk)) {
+   ret = PTR_ERR(tll-usbtll_ch1_clk);
+   dev_err(dev, usb_tll_hs_usb_ch1_clk failed error:%d\n, ret);
+   goto err_usbtll_ch0_clk;
}
 
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
dev_err(dev, usb tll get resource failed\n);
ret = -ENODEV;
-   goto err_usbtll_p2_fck;
+   goto err_usbtll_ch1_clk;
}
 
tll-base = ioremap(res-start, resource_size(res));
if (!tll-base) {
dev_err(dev, TLL ioremap failed\n);
ret = -ENOMEM;
-   goto err_usbtll_p2_fck;
+   goto err_usbtll_ch1_clk;
}
 
platform_set_drvdata(pdev, tll);
@@ -349,11 +349,11 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
tll_pdev = pdev;
return 0;
 
-err_usbtll_p2_fck:
-   clk_put(tll-usbtll_p2_fck);
+err_usbtll_ch1_clk:
+   clk_put(tll-usbtll_ch0_clk);
 
-err_usbtll_p1_fck:
-   clk_put(tll-usbtll_p1_fck);
+err_usbtll_ch0_clk:
+   clk_put(tll-usbtll_ch1_clk);
 
 err_tll:
kfree(tll);
@@ -370,8 +370,8 @@ static int __devexit usbtll_omap_remove(struct 
platform_device *pdev)
 {
struct usbtll_omap *tll = platform_get_drvdata(pdev);
 
-   clk_put(tll-usbtll_p2_fck);
-   clk_put(tll-usbtll_p1_fck);
+   clk_put(tll-usbtll_ch1_clk);
+   clk_put(tll-usbtll_ch0_clk);
pm_runtime_disable(pdev-dev);
kfree(tll);
return 0;
@@ -392,10 +392,10 @@ static int usbtll_runtime_resume(struct device *dev)
spin_lock_irqsave(tll-lock, flags);
 
if (is_ehci_tll_mode(tll-port_mode[0]))
-   clk_enable(tll-usbtll_p1_fck);
+   clk_enable(tll-usbtll_ch0_clk);
 
if (is_ehci_tll_mode(tll-port_mode[1]))
-   clk_enable(tll-usbtll_p2_fck);
+   clk_enable(tll-usbtll_ch1_clk);
 
spin_unlock_irqrestore(tll-lock, flags);
 
@@ -417,10 +417,10 @@ static int usbtll_runtime_suspend(struct device *dev)
spin_lock_irqsave(tll-lock, flags);
 
if (is_ehci_tll_mode(tll-port_mode[0]))
-   clk_disable(tll-usbtll_p1_fck);
+   clk_disable(tll-usbtll_ch0_clk);
 
if (is_ehci_tll_mode(tll-port_mode[1]))
-   clk_disable(tll-usbtll_p2_fck);
+   clk_disable(tll-usbtll_ch1_clk);
 
spin_unlock_irqrestore(tll-lock, flags);
 
-- 
1.7.9.5

--
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


[RESEND PATCH 01/11] ARM: OMAP4: USB: Host: Add USB2 Host Device Tree Node

2012-10-31 Thread Keshava Munegowda
The device tree node details of usb2 host and tll components
are included for OMAP4 SOC

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 .../devicetree/bindings/usb/omap-usb-host.txt  |   24 
 .../devicetree/bindings/usb/omap-usb-tll.txt   |   21 +
 arch/arm/boot/dts/omap4.dtsi   |   22 ++
 3 files changed, 67 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-host.txt
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-tll.txt

diff --git a/Documentation/devicetree/bindings/usb/omap-usb-host.txt 
b/Documentation/devicetree/bindings/usb/omap-usb-host.txt
new file mode 100644
index 000..2ea987f
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/omap-usb-host.txt
@@ -0,0 +1,24 @@
+USB HOST
+
+OMAP USB2 UHH
+
+Required properties:
+ - compatible: Should be ti,usbhs
+ - reg : Address set of system configuration of the usb host.Also
+has the register address of ehci and ohci IPs.
+ - interrupts :interrupts of ehci and ohci IPs.
+
+This is usually a subnode of ocp to which it is connected.
+
+usbhs: usbhs@0x4a064000 {
+   compatible = ti,usbhs;
+   reg = 0x4a064000 0x800, /* uhh */
+ 0x4a064800 0x400, /* ohci */
+ 0x4a064c00 0x400; /* ehci */
+   reg-names = uhh, ohci, ehci;
+   interrupts = 0 76 0x4, 0 77 0x4;
+   interrupt-names = ohci-irq, ehci-irq;
+   interrupt-parent = gic;
+   ti,hwmods = usb_host_hs;
+};
+
diff --git a/Documentation/devicetree/bindings/usb/omap-usb-tll.txt 
b/Documentation/devicetree/bindings/usb/omap-usb-tll.txt
new file mode 100644
index 000..e2e49fd
--- /dev/null
+++ b/Documentation/devicetree/bindings/usb/omap-usb-tll.txt
@@ -0,0 +1,21 @@
+USB TLL
+
+OMAP USB2 TLL
+
+Required properties:
+ - compatible: Should be ti,usbtll
+ - reg : Address set of system configuration of the usb tll.
+ - interrupts :interrupts of usb tll.
+
+This is usually a subnode of ocp to which it is connected.
+
+usbtll: usbtll@0x4a062000 {
+   compatible = ti,usbtll;
+   reg = 0x4a062000 0x1000;
+   reg-names = tll;
+   interrupts = 0 78 0x4;
+   interrupt-names = tll-irq;
+   interrupt-parent = gic;
+   ti,hwmods = usb_tll_hs;
+};
+
diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
index 3883f94..fb76ba3 100644
--- a/arch/arm/boot/dts/omap4.dtsi
+++ b/arch/arm/boot/dts/omap4.dtsi
@@ -438,5 +438,27 @@
ranges;
ti,hwmods = ocp2scp_usb_phy;
};
+
+   usbhs: usbhs@0x4a064000 {
+   compatible = ti,usbhs;
+   reg = 0x4a064000 0x800, /* uhh */
+ 0x4a064800 0x400, /* ohci */
+ 0x4a064c00 0x400; /* ehci */
+   reg-names = uhh, ohci, ehci;
+   interrupts = 0 76 0x4, 0 77 0x4;
+   interrupt-names = ohci-irq, ehci-irq;
+   interrupt-parent = gic;
+   ti,hwmods = usb_host_hs;
+   };
+
+   usbtll: usbtll@0x4a062000 {
+   compatible = ti,usbtll;
+   reg = 0x4a062000 0x1000;
+   reg-names = tll;
+   interrupts = 0 78 0x4;
+   interrupt-names = tll-irq;
+   interrupt-parent = gic;
+   ti,hwmods = usb_tll_hs;
+   };
};
 };
-- 
1.7.9.5

--
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


[RESEND PATCH 07/11] ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data

2012-10-31 Thread Keshava Munegowda
The usbhs core driver data is used by the ehci driver, because
the ehci driver is child of usbhs core. The unused ehci, ohci
and tll specific structures are removed.
platform device creation of usbhs and tll using hwmod is
removed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/mach-omap2/usb-host.c |   66 
 drivers/usb/host/ehci-omap.c   |   40 ++-
 include/linux/platform_data/usb-omap.h |   16 
 3 files changed, 21 insertions(+), 101 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index 239c175..75fa7ca 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -32,24 +32,6 @@
 
 #ifdef CONFIG_MFD_OMAP_USB_HOST
 
-#define OMAP_USBHS_DEVICE  usbhs_omap
-#define OMAP_USBTLL_DEVICE usbhs_tll
-#defineUSBHS_UHH_HWMODNAME usb_host_hs
-#define USBHS_TLL_HWMODNAMEusb_tll_hs
-
-static struct usbhs_omap_platform_data usbhs_data;
-static struct usbtll_omap_platform_datausbtll_data;
-static struct ehci_hcd_omap_platform_data  ehci_data;
-static struct ohci_hcd_omap_platform_data  ohci_data;
-
-static struct omap_device_pm_latency omap_uhhtll_latency[] = {
- {
-   .deactivate_func = omap_device_idle_hwmods,
-   .activate_func   = omap_device_enable_hwmods,
-   .flags = OMAP_DEVICE_LATENCY_AUTO_ADJUST,
- },
-};
-
 /* MUX settings for EHCI pins */
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -487,22 +469,6 @@ void __init setup_4430ohci_io_mux(const enum 
usbhs_omap_port_mode *port_mode)
 
 void __init usbhs_init(const struct usbhs_omap_board_data *pdata)
 {
-   struct omap_hwmod   *uhh_hwm, *tll_hwm;
-   struct platform_device  *pdev;
-   int bus_id = -1;
-   int i;
-
-   for (i = 0; i  OMAP3_HS_USB_PORTS; i++) {
-   usbhs_data.port_mode[i] = pdata-port_mode[i];
-   usbtll_data.port_mode[i] = pdata-port_mode[i];
-   ohci_data.port_mode[i] = pdata-port_mode[i];
-   ehci_data.port_mode[i] = pdata-port_mode[i];
-   ehci_data.reset_gpio_port[i] = pdata-reset_gpio_port[i];
-   ehci_data.regulator[i] = pdata-regulator[i];
-   }
-   ehci_data.phy_reset = pdata-phy_reset;
-   ohci_data.es2_compatibility = pdata-es2_compatibility;
-
if (cpu_is_omap34xx()) {
setup_ehci_io_mux(pdata-port_mode);
setup_ohci_io_mux(pdata-port_mode);
@@ -510,38 +476,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
setup_4430ehci_io_mux(pdata-port_mode);
setup_4430ohci_io_mux(pdata-port_mode);
}
-
-   uhh_hwm = omap_hwmod_lookup(USBHS_UHH_HWMODNAME);
-   if (!uhh_hwm) {
-   pr_err(Could not look up %s\n, USBHS_UHH_HWMODNAME);
-   return;
-   }
-
-   tll_hwm = omap_hwmod_lookup(USBHS_TLL_HWMODNAME);
-   if (!tll_hwm) {
-   pr_err(Could not look up %s\n, USBHS_TLL_HWMODNAME);
-   return;
-   }
-
-   pdev = omap_device_build(OMAP_USBTLL_DEVICE, bus_id, tll_hwm,
-   usbtll_data, sizeof(usbtll_data),
-   omap_uhhtll_latency,
-   ARRAY_SIZE(omap_uhhtll_latency), false);
-   if (IS_ERR(pdev)) {
-   pr_err(Could not build hwmod device %s\n,
-  USBHS_TLL_HWMODNAME);
-   return;
-   }
-
-   pdev = omap_device_build(OMAP_USBHS_DEVICE, bus_id, uhh_hwm,
-   usbhs_data, sizeof(usbhs_data),
-   omap_uhhtll_latency,
-   ARRAY_SIZE(omap_uhhtll_latency), false);
-   if (IS_ERR(pdev)) {
-   pr_err(Could not build hwmod devices %s\n,
-  USBHS_UHH_HWMODNAME);
-   return;
-   }
 }
 
 #else
diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 0d5ac36..a4d57b4 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -107,17 +107,17 @@ static int omap_ehci_init(struct usb_hcd *hcd)
 {
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
int rc;
-   struct ehci_hcd_omap_platform_data  *pdata;
+   struct usbhs_omap_platform_data *pdata;
 
-   pdata = hcd-self.controller-platform_data;
+   pdata = hcd-self.controller-parent-platform_data;
 
/* Hold PHYs in reset while initializing EHCI controller */
if (pdata-phy_reset) {
-   if (gpio_is_valid(pdata-reset_gpio_port[0]))
-   gpio_set_value_cansleep(pdata-reset_gpio_port[0], 0);
+   if (gpio_is_valid(pdata-reset_gpio[0]))
+   gpio_set_value_cansleep(pdata-reset_gpio[0], 0);
 

[RESEND PATCH 05/11] ARM: OMAP: USB: Host: usb host Device tree node Adaptation

2012-10-31 Thread Keshava Munegowda
The USB2 Host device node is extracted and used in the probe
of the driver to initialize the usb ports and controller. The
platform specific initialization is also performed.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/mach-omap2/usb-host.c |2 -
 drivers/mfd/omap-usb-host.c|  163 +++-
 include/linux/platform_data/usb-omap.h |   19 +++-
 3 files changed, 133 insertions(+), 51 deletions(-)

diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
index d1dbe12..239c175 100644
--- a/arch/arm/mach-omap2/usb-host.c
+++ b/arch/arm/mach-omap2/usb-host.c
@@ -502,8 +502,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
*pdata)
}
ehci_data.phy_reset = pdata-phy_reset;
ohci_data.es2_compatibility = pdata-es2_compatibility;
-   usbhs_data.ehci_data = ehci_data;
-   usbhs_data.ohci_data = ohci_data;
 
if (cpu_is_omap34xx()) {
setup_ehci_io_mux(pdata-port_mode);
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index cebfe0a..4b3af16 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -24,7 +24,7 @@
 #include linux/clk.h
 #include linux/dma-mapping.h
 #include linux/spinlock.h
-#include linux/gpio.h
+#include linux/of_gpio.h
 #include plat/cpu.h
 #include linux/platform_device.h
 #include linux/platform_data/usb-omap.h
@@ -103,8 +103,6 @@ struct usbhs_hcd_omap {
 
void __iomem*uhh_base;
 
-   struct usbhs_omap_platform_data platdata;
-
u32 usbhs_rev;
spinlock_t  lock;
 };
@@ -186,8 +184,6 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
 {
struct device   *dev = pdev-dev;
struct usbhs_hcd_omap   *omap;
-   struct ehci_hcd_omap_platform_data  *ehci_data;
-   struct ohci_hcd_omap_platform_data  *ohci_data;
struct platform_device  *ehci;
struct platform_device  *ohci;
struct resource *res;
@@ -195,8 +191,6 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
int ret;
 
omap = platform_get_drvdata(pdev);
-   ehci_data = omap-platdata.ehci_data;
-   ohci_data = omap-platdata.ohci_data;
 
res = platform_get_resource_byname(pdev, IORESOURCE_MEM, ehci);
if (!res) {
@@ -214,8 +208,8 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
}
resources[1] = *res;
 
-   ehci = omap_usbhs_alloc_child(OMAP_EHCI_DEVICE, resources, 2, ehci_data,
-   sizeof(*ehci_data), dev);
+   ehci = omap_usbhs_alloc_child(OMAP_EHCI_DEVICE, resources, 2, NULL,
+   0, dev);
 
if (!ehci) {
dev_err(dev, omap_usbhs_alloc_child failed\n);
@@ -239,8 +233,8 @@ static int omap_usbhs_alloc_children(struct platform_device 
*pdev)
}
resources[1] = *res;
 
-   ohci = omap_usbhs_alloc_child(OMAP_OHCI_DEVICE, resources, 2, ohci_data,
-   sizeof(*ohci_data), dev);
+   ohci = omap_usbhs_alloc_child(OMAP_OHCI_DEVICE, resources, 2, NULL,
+   0, dev);
if (!ohci) {
dev_err(dev, omap_usbhs_alloc_child failed\n);
ret = -ENOMEM;
@@ -279,7 +273,7 @@ static bool is_ohci_port(enum usbhs_omap_port_mode pmode)
 static int usbhs_runtime_resume(struct device *dev)
 {
struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
-   struct usbhs_omap_platform_data *pdata = omap-platdata;
+   struct usbhs_omap_platform_data *pdata = dev-platform_data;
unsigned long   flags;
 
dev_dbg(dev, usbhs_runtime_resume\n);
@@ -295,6 +289,7 @@ static int usbhs_runtime_resume(struct device *dev)
if (omap-ehci_logic_fck  !IS_ERR(omap-ehci_logic_fck))
clk_enable(omap-ehci_logic_fck);
 
+   clk_enable(pdata-hub_clk);
if (is_ehci_tll_mode(pdata-port_mode[0]))
clk_enable(omap-usbhost_p1_fck);
if (is_ehci_tll_mode(pdata-port_mode[1]))
@@ -311,7 +306,7 @@ static int usbhs_runtime_resume(struct device *dev)
 static int usbhs_runtime_suspend(struct device *dev)
 {
struct usbhs_hcd_omap   *omap = dev_get_drvdata(dev);
-   struct usbhs_omap_platform_data *pdata = omap-platdata;
+   struct usbhs_omap_platform_data *pdata = dev-platform_data;
unsigned long   flags;
 
dev_dbg(dev, usbhs_runtime_suspend\n);
@@ -331,6 +326,7 @@ static int usbhs_runtime_suspend(struct device *dev)
clk_disable(omap-utmi_p2_fck);
clk_disable(omap-utmi_p1_fck);
 
+   clk_disable(pdata-hub_clk);
if (omap-ehci_logic_fck  !IS_ERR(omap-ehci_logic_fck))
clk_disable(omap-ehci_logic_fck);
 
@@ 

[RESEND PATCH 06/11] ARM: OMAP: USB: Host: USB TLL Device tree node Adaptation

2012-10-31 Thread Keshava Munegowda
The USB TLL device node is extracted and used in the probe
of the driver to initialize the driver data.
This TLL driver exports an API to usbhs driver to perform
the port configuration. The usb2 hs driver invoke the same
API in its driver probe to initialize the ports.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 drivers/mfd/omap-usb-host.c|7 ++
 drivers/mfd/omap-usb-tll.c |  192 +++-
 include/linux/platform_data/usb-omap.h |2 +
 3 files changed, 124 insertions(+), 77 deletions(-)

diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 4b3af16..27aa85e 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -657,6 +657,11 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
platform_set_drvdata(pdev, omap);
dev-platform_data = pdata;
 
+   if (omap_tll_init(pdata-port_mode)) {
+   dev_err(dev, omap_tll_init failed\n);
+   goto err_tll;
+   }
+
omap_usbhs_init(dev);
ret = omap_usbhs_alloc_children(pdev);
if (ret) {
@@ -668,6 +673,8 @@ static int __devinit usbhs_omap_probe(struct 
platform_device *pdev)
 
 err_alloc:
omap_usbhs_deinit(pdev-dev);
+
+err_tll:
iounmap(omap-uhh_base);
 
 err_init_60m_fclk:
diff --git a/drivers/mfd/omap-usb-tll.c b/drivers/mfd/omap-usb-tll.c
index 0db0dfa..f457883 100644
--- a/drivers/mfd/omap-usb-tll.c
+++ b/drivers/mfd/omap-usb-tll.c
@@ -24,6 +24,7 @@
 #include linux/platform_device.h
 #include linux/clk.h
 #include linux/io.h
+#include linux/of.h
 #include linux/err.h
 #include linux/pm_runtime.h
 #include linux/platform_data/usb-omap.h
@@ -98,7 +99,9 @@
 struct usbtll_omap {
struct clk  *usbtll_p1_fck;
struct clk  *usbtll_p2_fck;
-   struct usbtll_omap_platform_dataplatdata;
+   void __iomem*base;
+   enum usbhs_omap_port_mode   port_mode[OMAP3_HS_USB_PORTS];
+
/* secure the register updates */
spinlock_t  lock;
 };
@@ -196,17 +199,15 @@ static unsigned ohci_omap3_fslsmode(enum 
usbhs_omap_port_mode mode)
 }
 
 /**
- * usbtll_omap_probe - initialize TI-based HCDs
+ * usbtll_omap_initports - initialize TI-based HCDs
  *
- * Allocates basic resources for this USB host controller.
+ * initialize the usb tll ports. Maximum 3 ports
  */
-static int __devinit usbtll_omap_probe(struct platform_device *pdev)
+
+static int usbtll_initports(struct device *dev,
+   enum usbhs_omap_port_mode port_mode[])
 {
-   struct device   *dev =  pdev-dev;
-   struct usbtll_omap_platform_data*pdata = dev-platform_data;
-   void __iomem*base;
-   struct resource *res;
-   struct usbtll_omap  *tll;
+   struct usbtll_omap  *tll = dev_get_drvdata(dev);
unsignedreg;
unsigned long   flags;
int ret = 0;
@@ -214,53 +215,19 @@ static int __devinit usbtll_omap_probe(struct 
platform_device *pdev)
 
dev_dbg(dev, starting TI HSUSB TLL Controller\n);
 
-   tll = kzalloc(sizeof(struct usbtll_omap), GFP_KERNEL);
if (!tll) {
-   dev_err(dev, Memory allocation failed\n);
-   ret = -ENOMEM;
-   goto end;
+   dev_err(dev, %s: missing TLL Driver data\n, __func__);
+   return -ENOMEM;
}
 
-   spin_lock_init(tll-lock);
-
for (i = 0; i  OMAP3_HS_USB_PORTS; i++)
-   tll-platdata.port_mode[i] = pdata-port_mode[i];
+   tll-port_mode[i] = port_mode[i];
 
-   tll-usbtll_p1_fck = clk_get(dev, usb_tll_hs_usb_ch0_clk);
-   if (IS_ERR(tll-usbtll_p1_fck)) {
-   ret = PTR_ERR(tll-usbtll_p1_fck);
-   dev_err(dev, usbtll_p1_fck failed error:%d\n, ret);
-   goto err_tll;
-   }
-
-   tll-usbtll_p2_fck = clk_get(dev, usb_tll_hs_usb_ch1_clk);
-   if (IS_ERR(tll-usbtll_p2_fck)) {
-   ret = PTR_ERR(tll-usbtll_p2_fck);
-   dev_err(dev, usbtll_p2_fck failed error:%d\n, ret);
-   goto err_usbtll_p1_fck;
-   }
-
-   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-   if (!res) {
-   dev_err(dev, usb tll get resource failed\n);
-   ret = -ENODEV;
-   goto err_usbtll_p2_fck;
-   }
-
-   base = ioremap(res-start, resource_size(res));
-   if (!base) {
-   dev_err(dev, TLL ioremap failed\n);
-   ret = -ENOMEM;
-   goto err_usbtll_p2_fck;
-   }
-
-   platform_set_drvdata(pdev, tll);
-   pm_runtime_enable(dev);
pm_runtime_get_sync(dev);
 
   

[RESEND PATCH 03/11] ARM: OMAP3: USB: Add USB2 Host Device Tree Node

2012-10-31 Thread Keshava Munegowda
The device tree node details of usb2 host and tll components
are included for OMAP3

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap3.dtsi |   22 ++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/omap3.dtsi b/arch/arm/boot/dts/omap3.dtsi
index 696e929..5c805d7 100644
--- a/arch/arm/boot/dts/omap3.dtsi
+++ b/arch/arm/boot/dts/omap3.dtsi
@@ -300,5 +300,27 @@
ti,buffer-size = 128;
ti,hwmods = mcbsp5;
};
+
+   usbhs: usbhs@0x4a064000 {
+   compatible = ti,usbhs;
+   reg = 0x48064000 0x400, /* uhh */
+ 0x48064400 0x400, /* ohci */
+ 0x48064800 0x400; /* ehci */
+   reg-names = uhh, ohci, ehci;
+   interrupts = 76, 77;
+   interrupt-names = ohci-irq, ehci-irq;
+   interrupt-parent = intc;
+   ti,hwmods = usb_host_hs;
+   };
+
+   usbtll: usbtll@0x4a062000 {
+   compatible = ti,usbtll;
+   reg = 0x48062000 0x1000;
+   reg-names = tll;
+   interrupts = 78;
+   interrupt-names = tll-irq;
+   interrupt-parent = intc;
+   ti,hwmods = usb_tll_hs;
+   };
};
 };
-- 
1.7.9.5

--
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


[RESEND PATCH 00/11] ARM: OMAP: USB: Host: Device tree Adaptation

2012-10-31 Thread Keshava Munegowda
The USB2 Host driver of OMAP3/OMAP4 are device tree complaiant with
this patch series.
The device tree data of UHH, EHCI, OHCI and TLL are included.
The drivers are updated to extract and use the register set and
interrupt numbers delivered by these device tree structures.

Keshava Munegowda (11):
  ARM: OMAP4: USB: Host: Add USB2 Host Device Tree Node
  ARM: OMAP4: USB: Host: Panda board specific device tree node
  ARM: OMAP3: USB: Add USB2 Host Device Tree Node
  ARM: OMAP3: USB: Host: Beagle-XM board specific device tree node
  ARM: OMAP: USB: Host: usb host Device tree node Adaptation
  ARM: OMAP: USB: Host: USB TLL Device tree node Adaptation
  ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data
  ARM: OMAP: USB: Change the TLL clock names
  ARM: OMAP: USB: Remove the device name for TLL channel clocks for
OMAP3
  ARM: OMAP4: USB: Add pin mux configuration for panda board
  ARM: OMAP3: USB: Add pin mux configuration for beagle-xm board

 .../devicetree/bindings/usb/omap-usb-host.txt  |   24 +++
 .../devicetree/bindings/usb/omap-usb-tll.txt   |   21 ++
 arch/arm/boot/dts/omap3-beagle-xm.dts  |   56 +
 arch/arm/boot/dts/omap3.dtsi   |   22 ++
 arch/arm/boot/dts/omap4-panda.dts  |   51 +
 arch/arm/boot/dts/omap4.dtsi   |   22 ++
 arch/arm/mach-omap2/clock3xxx_data.c   |6 +-
 arch/arm/mach-omap2/usb-host.c |   68 --
 drivers/mfd/omap-usb-host.c|  170 ++-
 drivers/mfd/omap-usb-tll.c |  216 
 drivers/usb/host/ehci-omap.c   |   40 ++--
 include/linux/platform_data/usb-omap.h |   31 ++-
 12 files changed, 485 insertions(+), 242 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-host.txt
 create mode 100644 Documentation/devicetree/bindings/usb/omap-usb-tll.txt

-- 
1.7.9.5

--
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


[RESEND PATCH 09/11] ARM: OMAP: USB: Remove the device name for TLL channel clocks for OMAP3

2012-10-31 Thread Keshava Munegowda
Since TLL channels clocks are dummy(virtual) nodes for OMAP3.
The device names for these clocks are set to NULL.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/mach-omap2/clock3xxx_data.c |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/clock3xxx_data.c 
b/arch/arm/mach-omap2/clock3xxx_data.c
index 6cca199..c63c818 100644
--- a/arch/arm/mach-omap2/clock3xxx_data.c
+++ b/arch/arm/mach-omap2/clock3xxx_data.c
@@ -3404,10 +3404,8 @@ static struct omap_clk omap3xxx_clks[] = {
CLK(NULL,   xclk60mhsp2_ck,   dummy_ck,  CK_3XXX),
CLK(NULL,   usb_host_hs_utmi_p1_clk,  dummy_ck,  
CK_3XXX),
CLK(NULL,   usb_host_hs_utmi_p2_clk,  dummy_ck,  
CK_3XXX),
-   CLK(usbhs_omap,   usb_tll_hs_usb_ch0_clk,   dummy_ck,  
CK_3XXX),
-   CLK(usbhs_omap,   usb_tll_hs_usb_ch1_clk,   dummy_ck,  
CK_3XXX),
-   CLK(usbhs_tll,usb_tll_hs_usb_ch0_clk,   dummy_ck,  
CK_3XXX),
-   CLK(usbhs_tll,usb_tll_hs_usb_ch1_clk,   dummy_ck,  
CK_3XXX),
+   CLK(NULL,   usb_tll_hs_usb_ch0_clk,   dummy_ck,  
CK_3XXX),
+   CLK(NULL,   usb_tll_hs_usb_ch1_clk,   dummy_ck,  
CK_3XXX),
CLK(NULL,   init_60m_fclk,dummy_ck,  CK_3XXX),
CLK(NULL,   usim_fck, usim_fck,  CK_3430ES2PLUS | 
CK_36XX),
CLK(NULL,   gpt1_fck, gpt1_fck,  CK_3XXX),
-- 
1.7.9.5

--
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


[RESEND PATCH 11/11] ARM: OMAP3: USB: Add pin mux configuration for beagle-xm board

2012-10-31 Thread Keshava Munegowda
The port2 of omap4 panda board is used in ULPI PHY mode.
The pin mux of usbhs (usbb2) port 2 is configured accordingly.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   24 
 1 file changed, 24 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts 
b/arch/arm/boot/dts/omap3-beagle-xm.dts
index b9f8667..c5da799 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -88,6 +88,30 @@
};
 };
 
+omap3_pmx_core {
+   pinctrl-names = default;
+   pinctrl-0 = 
+   usbb2_pins   /* port 1 of omap usb host port pin mux 
configuration */
+   ;
+
+   usbb2_pins: pinmux_usbb2_pins {
+   pinctrl-single,pins = 
+   0x5c0 0x3  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_clk OUTPUT */
+   0x5c2 0x3  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_stp OUTPUT */
+   0x5c4 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dir INPUT | PULLDOWN */
+   0x5c6 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_nxt INPUT | PULLDOWN */
+   0x5c8 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat0 INPUT | PULLDOWN */
+   0x5cA 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat1 INPUT | PULLDOWN */
+   0x1a4 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat2 INPUT | PULLDOWN */
+   0x1a6 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat3 INPUT | PULLDOWN */
+   0x1a8 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat4 INPUT | PULLDOWN */
+   0x1aa 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat5 INPUT | PULLDOWN */
+   0x1ac 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat6 INPUT | PULLDOWN */
+   0x1ae 0x10b  /* 
USBB2_ULPITLL_CLK_MUXMODE.usbb1_ulpiphy_dat7 INPUT | PULLDOWN */
+   ;
+   };
+};
+
 mmc1 {
vmmc-supply = vmmc1;
vmmc_aux-supply = vsim;
-- 
1.7.9.5

--
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


[RESEND PATCH 04/11] ARM: OMAP3: USB: Host: Beagle-XM board specific device tree node

2012-10-31 Thread Keshava Munegowda
OMAP3 Beagle-XM board specific data for usb2 host device tree node
is included.
In Beagle XM board , the port 2 of usb host is connected to a hub
with ethernet interface.

Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
---
 arch/arm/boot/dts/omap3-beagle-xm.dts |   32 
 1 file changed, 32 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-beagle-xm.dts 
b/arch/arm/boot/dts/omap3-beagle-xm.dts
index c38cf76..b9f8667 100644
--- a/arch/arm/boot/dts/omap3-beagle-xm.dts
+++ b/arch/arm/boot/dts/omap3-beagle-xm.dts
@@ -113,3 +113,35 @@
 */
ti,pulldowns = 0x03a1c4;
 };
+
+usbhs {
+   /*
+* Maximum fill 3 port info.
+* port configured can be any one of the following values
+* OMAP_USBHS_PORT_MODE_UNUSED  = 0,
+* OMAP_EHCI_PORT_MODE_PHY  = 1,
+* OMAP_EHCI_PORT_MODE_TLL  = 2,
+* OMAP_EHCI_PORT_MODE_HSIC = 3,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0  = 4,
+* OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM= 5,
+* OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0  = 6,
+* OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM= 7,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0  = 8,
+* OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM= 9,
+* OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0  = 10,
+* OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM= 11,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0  = 12,
+* OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM= 13,
+*/
+   port-0 = 0;
+   port-1 = 1;
+   port-2 = 0;
+
+   /*
+* gpio resets should be given the format ( Max of 3 ports)
+* reset-gpio-1 = gpiox x x
+* reset-gpio-2 = gpiox x x
+* reset-gpio-3 = gpiox x x
+*/
+   reset-gpio-2 = gpio5 19 0;   /* gpio 147 */
+};
-- 
1.7.9.5

--
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: otg: nop: add dt support

2012-10-31 Thread Afzal Mohammed

Hi Balbi,

On Thursday 27 September 2012 11:15 AM, Afzal Mohammed wrote:


This series is made over over Balbi's usb master branch.

It applies cleanly over musb branch too.


Please ignore this series, a new series has been posted,
usb: musb: dsps: fixes for -rc.

Regards
Afzal
--
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 v2 1/2] USB: dwc3-exynos: Add support for device tree

2012-10-31 Thread Vivek Gautam
Hi Felipe,

On Wed, Oct 31, 2012 at 7:08 PM, Felipe Balbi ba...@ti.com wrote:
 Hi,
 On Tue, Oct 16, 2012 at 02:15:56PM +0530, Vivek Gautam wrote:
 This patch adds support to parse probe data for
 dwc3-exynos driver using device tree.

 Signed-off-by: Vivek Gautam gautam.vi...@samsung.com

 does not apply to my dwc3 branch. Care to respin ?

Sure, i shall respin on latest tree.

 --
 balbi


-- 
Thanks  Regards
Vivek
--
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 0/4] Adding usb2.0 host-phy support for exynos5250

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 04:07:23PM +0200, Felipe Balbi wrote:
 Hi,
 
 On Mon, Oct 29, 2012 at 07:12:36PM +0530, Vivek Gautam wrote:
  This patchset is based on the work by Praveen Paneri for
  samsung-usbphy driver:
  http://comments.gmane.org/gmane.linux.kernel.samsung-soc/12653
  
  Changes from v2:
   - Using EXYNOS5_PHY_ as common prefix along with exact names for
 PHY SFRs for register definitions
   - Using register names with bit macros to make things more clear.
   - Removed parentheses around 0x230 in definition for EXYNOS5_USB_CFG
 in [patch 2/4 v2].
  
  Tested on smdk5250 target with usb-next branch along with arch patches
  for exynos5250:
  http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13042
  http://thread.gmane.org/gmane.linux.kernel.samsung-soc/13048
  
  Vivek Gautam (4):
usb: phy: samsung: Add host phy support to samsung-phy driver
ARM: Exynos5250: Enabling samsung-usbphy driver
USB: ehci-s5p: Add phy driver support
USB: ohci-exynos: Add phy driver support
 
 you should join forces with Praveen Paneri so you guys have a single PHY
 code.
 
 (I haven't fully read your patches, so apologize if what I'm saying is
 already taken care of)

nevermind this comment, now I read more carefully :-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Li Yang
On Wed, Oct 31, 2012 at 9:26 PM, Felipe Balbi ba...@ti.com wrote:
 On Wed, Oct 31, 2012 at 04:06:00PM +0800, Xiaotian Feng wrote:
 If tasklet_disable() is called before related tasklet handled,
 tasklet_kill will never be finished. tasklet_kill is enough.

 how did you test this ? Why changing FSL driver instead of switching
 over to chipidea which is supposed to be shared by every licensee of the
 chipidea core ?

The QE UDC is an private controller that is not compatible with the
Chipidea core.

- Leo
--
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] usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 07:45:53PM +0530, Rajaram R wrote:
 On Tue, Oct 23, 2012 at 11:42 AM, Wei Yongjun weiyj...@gmail.com wrote:
  commit 65b3d52d02a558fbfe08e43688e15390c5ab3067
  (usb: musb: add musb_ida for multi instance support)
  used musbid in ux500_remove() but nerver declared it.
 
 The above message doesnot match with your fix. You say ux500_remove is
 using musbhid but build error is in probe.
 
 I also dont see anywhere in the code we use this variable musbid.

-ECONFUSED:

static int __devinit ux500_probe(struct platform_device *pdev)
{
struct musb_hdrc_platform_data  *pdata = pdev-dev.platform_data;
struct platform_device  *musb;
struct ux500_glue   *glue;
struct clk  *clk;
int musbid;
int ret = -ENOMEM;

glue = kzalloc(sizeof(*glue), GFP_KERNEL);
if (!glue) {
dev_err(pdev-dev, failed to allocate glue context\n);
goto err0;
}

/* get the musb id */
musbid = musb_get_id(pdev-dev, GFP_KERNEL);
if (musbid  0) {
dev_err(pdev-dev, failed to allocate musb id\n);
ret = -ENOMEM;
goto err1;
}

musb = platform_device_alloc(musb-hdrc, musbid);
if (!musb) {
dev_err(pdev-dev, failed to allocate musb device\n);
goto err2;
}

clk = clk_get(pdev-dev, usb);
if (IS_ERR(clk)) {
dev_err(pdev-dev, failed to get clock\n);
ret = PTR_ERR(clk);
goto err3;
}

ret = clk_enable(clk);
if (ret) {
dev_err(pdev-dev, failed to enable clock\n);
goto err4;
}

musb-id= musbid;
musb-dev.parent= pdev-dev;
musb-dev.dma_mask  = pdev-dev.dma_mask;
musb-dev.coherent_dma_mask = pdev-dev.coherent_dma_mask;

glue-dev   = pdev-dev;
glue-musb  = musb;
glue-clk   = clk;

pdata-platform_ops = ux500_ops;

platform_set_drvdata(pdev, glue);

ret = platform_device_add_resources(musb, pdev-resource,
pdev-num_resources);
if (ret) {
dev_err(pdev-dev, failed to add resources\n);
goto err5;
}

ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
if (ret) {
dev_err(pdev-dev, failed to add platform_data\n);
goto err5;
}

ret = platform_device_add(musb);
if (ret) {
dev_err(pdev-dev, failed to register musb device\n);
goto err5;
}

return 0;

err5:
clk_disable(clk);

err4:
clk_put(clk);

err3:
platform_device_put(musb);

err2:
musb_put_id(pdev-dev, musbid);

err1:
kfree(glue);

err0:
return ret;
}

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH 2/3] usb: gadget: fsl_qe_udc: do not use tasklet_disable before tasklet_kill

2012-10-31 Thread Felipe Balbi
Hi,

On Wed, Oct 31, 2012 at 10:35:37PM +0800, Li Yang wrote:
 On Wed, Oct 31, 2012 at 9:26 PM, Felipe Balbi ba...@ti.com wrote:
  On Wed, Oct 31, 2012 at 04:06:00PM +0800, Xiaotian Feng wrote:
  If tasklet_disable() is called before related tasklet handled,
  tasklet_kill will never be finished. tasklet_kill is enough.
 
  how did you test this ? Why changing FSL driver instead of switching
  over to chipidea which is supposed to be shared by every licensee of the
  chipidea core ?
 
 The QE UDC is an private controller that is not compatible with the
 Chipidea core.

thanks for the clarification, but you still haven't answered how you
tested this ;-)

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v7 2/5] usb: s3c-hsotg: Adding phy driver support

2012-10-31 Thread Lukasz Majewski
Hi Felipe,

 Hi,
 
 On Tue, Oct 30, 2012 at 10:27:34AM +0530, Praveen Paneri wrote:
  @@ -3501,20 +3511,27 @@ static int __devinit s3c_hsotg_probe(struct
  platform_device *pdev) int ret;
  int i;
   
  -   plat = pdev-dev.platform_data;
  -   if (!plat) {
  -   dev_err(pdev-dev, no platform data defined\n);
  -   return -EINVAL;
  -   }
  -
  hsotg = devm_kzalloc(pdev-dev, sizeof(struct s3c_hsotg),
  GFP_KERNEL); if (!hsotg) {
  dev_err(dev, cannot get memory\n);
  return -ENOMEM;
  }
   
  +   plat = pdev-dev.platform_data;
  +   if (!plat) {
  +   /* Fallback for transceiver */
  +   phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
  +   if (IS_ERR_OR_NULL(phy)) {
  +   dev_err(pdev-dev, no platform data or
  transceiver defined\n);
  +   return -EPROBE_DEFER;
  +   } else {
  +   hsotg-phy = phy;
  +   }
  +   } else {
  +   hsotg-plat = plat;
  +   }
 
 I think this should be the other way around, meaning you try to grab
 the phy, if you can't, then you fallback to pdata.
 

I agree.

The new approach is to use new PHY driver. And only when failed we
shall use legacy approach.

-- 
Best regards,

Lukasz Majewski

Samsung Poland RD Center | Linux Platform Group
--
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/Ver2] [trivial] usb: Fix typo in drivers/usb

2012-10-31 Thread Masanari Iida
Correct spelling typo in debug messages within drivers/usb.

Signed-off-by: Masanari Iida standby2...@gmail.com
Acked-by: Felipe Balbi ba...@ti.com
---
 drivers/usb/gadget/fsl_udc_core.c   | 2 +-
 drivers/usb/gadget/tcm_usb_gadget.c | 2 +-
 drivers/usb/musb/musb_dsps.c| 2 +-
 drivers/usb/renesas_usbhs/fifo.c| 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/gadget/fsl_udc_core.c 
b/drivers/usb/gadget/fsl_udc_core.c
index 6ae70cb..c19f7f1 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2126,7 +2126,7 @@ static int fsl_proc_read(char *page, char **start, off_t 
off, int count,
 
tmp_reg = fsl_readl(dr_regs-usbintr);
t = scnprintf(next, size,
-   USB Intrrupt Enable Reg:\n
+   USB Interrupt Enable Reg:\n
Sleep Enable: %d SOF Received Enable: %d 
Reset Enable: %d\n
System Error Enable: %d 
diff --git a/drivers/usb/gadget/tcm_usb_gadget.c 
b/drivers/usb/gadget/tcm_usb_gadget.c
index 97e68b3..3849218 100644
--- a/drivers/usb/gadget/tcm_usb_gadget.c
+++ b/drivers/usb/gadget/tcm_usb_gadget.c
@@ -1384,7 +1384,7 @@ static struct se_node_acl *usbg_alloc_fabric_acl(struct 
se_portal_group *se_tpg)
 
nacl = kzalloc(sizeof(struct usbg_nacl), GFP_KERNEL);
if (!nacl) {
-   printk(KERN_ERR Unable to alocate struct usbg_nacl\n);
+   printk(KERN_ERR Unable to allocate struct usbg_nacl\n);
return NULL;
}
 
diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c
index ff5f112..65470eb 100644
--- a/drivers/usb/musb/musb_dsps.c
+++ b/drivers/usb/musb/musb_dsps.c
@@ -296,7 +296,7 @@ static irqreturn_t dsps_interrupt(int irq, void *hci)
 * Also, DRVVBUS pulses for SRP (but not at 5V) ...
 */
if (usbintr  MUSB_INTR_BABBLE)
-   pr_info(CAUTION: musb: Babble Interrupt Occured\n);
+   pr_info(CAUTION: musb: Babble Interrupt Occurred\n);
 
if (usbintr  ((1  wrp-drvvbus)  wrp-usb_shift)) {
int drvvbus = dsps_readl(reg_base, wrp-status);
diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c
index c021b20..0d6f9f3 100644
--- a/drivers/usb/renesas_usbhs/fifo.c
+++ b/drivers/usb/renesas_usbhs/fifo.c
@@ -163,7 +163,7 @@ static int usbhsf_pkt_handler(struct usbhs_pipe *pipe, int 
type)
func = pkt-handler-dma_done;
break;
default:
-   dev_err(dev, unknown pkt hander\n);
+   dev_err(dev, unknown pkt handler\n);
goto __usbhs_pkt_handler_end;
}
 
-- 
1.8.0.rc3.16.g8ead1bf

--
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] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, Michal Nazarewicz wrote:

 On Wed, Oct 31 2012, Felipe Balbi ba...@ti.com wrote:
  nevertheless, I should be receiving a patch right about now removing
  that file. Alan, care to send a patch for that ?
 
 I have some other stuff to remove as well, so I can take care of it, so
 Alan can spend his time on something more important.

I'm happy to have Michal remove g_file_storage.  That way, he gets to 
deal with any complaints.  :-)

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/Ver2] [trivial] usb: Fix typo in drivers/usb

2012-10-31 Thread Felipe Balbi
Hi,

On Thu, Nov 01, 2012 at 12:03:51AM +0900, Masanari Iida wrote:
 Correct spelling typo in debug messages within drivers/usb.
 
 Signed-off-by: Masanari Iida standby2...@gmail.com
 Acked-by: Felipe Balbi ba...@ti.com

Greg, since now this only touches the stuff I handle, I can apply this
myself.

whatever works best for you, let me know.

-- 
balbi


signature.asc
Description: Digital signature


Re: [PATCH v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, Ming Lei wrote:

 The below idea may help the problem which 'memalloc_noio' flag isn't set 
 during
 usb_reset_device().
 
 - for usb mass storage device, call pm_runtime_set_memalloc_noio(true)
   inside usb_stor_probe2() and uas_probe(), and call
   pm_runtime_set_memalloc_noio(false) inside uas_disconnect()
   and usb_stor_disconnect().

Why would you want to do that?  The probe and disconnect routines
usually -- but not always -- run in the khubd thread.  Surely you don't
want to prevent khubd from using GFP_KERNEL?

And what if probe runs in khubd but disconnect runs in a different 
thread?

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] usb: musb: ux500: fix 'musbid' undeclared error in ux500_remove()

2012-10-31 Thread Rajaram R
On Wed, Oct 31, 2012 at 8:00 PM, Felipe Balbi ba...@ti.com wrote:
 Hi,

 On Wed, Oct 31, 2012 at 07:45:53PM +0530, Rajaram R wrote:
 On Tue, Oct 23, 2012 at 11:42 AM, Wei Yongjun weiyj...@gmail.com wrote:
  commit 65b3d52d02a558fbfe08e43688e15390c5ab3067
  (usb: musb: add musb_ida for multi instance support)
  used musbid in ux500_remove() but nerver declared it.

 The above message doesnot match with your fix. You say ux500_remove is
 using musbhid but build error is in probe.

 I also dont see anywhere in the code we use this variable musbid.

 -ECONFUSED:

:-) No.. This patch could have been avoided if a build test was done
when the original patch pushed this change... !!

Anyway I can send a patch correcting the text if required...


 static int __devinit ux500_probe(struct platform_device *pdev)
 {
 struct musb_hdrc_platform_data  *pdata = pdev-dev.platform_data;
 struct platform_device  *musb;
 struct ux500_glue   *glue;
 struct clk  *clk;
 int musbid;
 int ret = -ENOMEM;

 glue = kzalloc(sizeof(*glue), GFP_KERNEL);
 if (!glue) {
 dev_err(pdev-dev, failed to allocate glue context\n);
 goto err0;
 }

 /* get the musb id */
 musbid = musb_get_id(pdev-dev, GFP_KERNEL);
 if (musbid  0) {
 dev_err(pdev-dev, failed to allocate musb id\n);
 ret = -ENOMEM;
 goto err1;
 }

 musb = platform_device_alloc(musb-hdrc, musbid);
 if (!musb) {
 dev_err(pdev-dev, failed to allocate musb device\n);
 goto err2;
 }

 clk = clk_get(pdev-dev, usb);
 if (IS_ERR(clk)) {
 dev_err(pdev-dev, failed to get clock\n);
 ret = PTR_ERR(clk);
 goto err3;
 }

 ret = clk_enable(clk);
 if (ret) {
 dev_err(pdev-dev, failed to enable clock\n);
 goto err4;
 }

 musb-id= musbid;
 musb-dev.parent= pdev-dev;
 musb-dev.dma_mask  = pdev-dev.dma_mask;
 musb-dev.coherent_dma_mask = pdev-dev.coherent_dma_mask;

 glue-dev   = pdev-dev;
 glue-musb  = musb;
 glue-clk   = clk;

 pdata-platform_ops = ux500_ops;

 platform_set_drvdata(pdev, glue);

 ret = platform_device_add_resources(musb, pdev-resource,
 pdev-num_resources);
 if (ret) {
 dev_err(pdev-dev, failed to add resources\n);
 goto err5;
 }

 ret = platform_device_add_data(musb, pdata, sizeof(*pdata));
 if (ret) {
 dev_err(pdev-dev, failed to add platform_data\n);
 goto err5;
 }

 ret = platform_device_add(musb);
 if (ret) {
 dev_err(pdev-dev, failed to register musb device\n);
 goto err5;
 }

 return 0;

 err5:
 clk_disable(clk);

 err4:
 clk_put(clk);

 err3:
 platform_device_put(musb);

 err2:
 musb_put_id(pdev-dev, musbid);

 err1:
 kfree(glue);

 err0:
 return ret;
 }

 --
 balbi
--
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: During xHC Initialization (device is not connected), when HC-RESET is asserted, software is not expecting WRC or PRC bit set

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, Bhavik Kothari wrote:

 Hi Alan,
 
 Thanks for your inputs.
 
 As per your given instruction, we have modified a code and below is a patch,
 
 
 --- a/linux-3.6.1/drivers/usb/core/hub.c2012-10-07 21:11:28.0
 +0530
 +++ b/linux-3.6.1/drivers/usb/core/hub.c2012-10-31 11:37:26.760917272
 +0530
 @@ -1078,6 +1078,12 @@ static void hub_activate(struct usb_hub
  clear_port_feature(hub-hdev, port1,
  USB_PORT_FEAT_C_BH_PORT_RESET);
  }
 +if (portchange  USB_PORT_STAT_C_RESET) {
 +need_debounce_delay = true;
 +clear_port_feature(hub-hdev, port1,
 +USB_PORT_FEAT_C_RESET);
 +}
 +
  /* We can forget about a removed device when there's a
   * physical disconnect or the connect status changes.
   */
 
 
 We have created a patch using Linux 3.6.1 code. Now, we would like to
 submit the patch.
 
 Please let us know, in case of any concern.

Please follow the instructions in Documentation/SubmittingPatches.

And be careful to use a mail program that doesn't damage the whitespace
in the patch.  In the patch above, the tab characters were converted to
spaces.  This makes the patch useless.

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: Linux USB gadget mass storage

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, victor wrote:

 Hi,
 
 In file_storage.c, send_status(), if (transport_is_bbb()), I add the line
 bh-inreq-buf = bh - buf,
 
 and in get_next_command(), if (transport_is_bbb()), I add the line
 bh-outreq-context = bh, to make the bh address to be the same.
 
 Is this patch ok?

What patch?  You didn't post a patch, just a description of some 
changes.

 victor
 
 -Original Message-
 From: victor [mailto:vic...@keyasic.com] 
 Sent: Wednesday, 31 October, 2012 1:04 PM
 To: 'linux-usb@vger.kernel.org'
 Subject: Linux USB gadget mass storage
 
 Hi,
 
 I am using Linux USB gadget mass storage. I meet with problem in
 file_storage.c. The bh-outreq-context in get_next_command() is not equal
 to bh.

do_set_interface() sets bh-inreq-buf to bh-buf and 
bh-outreq-context to bh.  Does anything ever change these values?

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: Linux USB gadget mass storage

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, victor wrote:

 Hi, 
 
 In usb gadget file_storage.c, check_command(), the part Check that only
 command bytes listed in the mask are non-zero cannot handle the
 SCSI_INQUIRY command of  12 01 80 00 FF 00
 
 The code will return EINVAL.
 
 Is this a bug?

No.

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 v3 2/6] PM / Runtime: introduce pm_runtime_set[get]_memalloc_noio()

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, Alan Stern wrote:

 On Wed, 31 Oct 2012, Ming Lei wrote:
 
  The below idea may help the problem which 'memalloc_noio' flag isn't set 
  during
  usb_reset_device().
  
  - for usb mass storage device, call pm_runtime_set_memalloc_noio(true)
inside usb_stor_probe2() and uas_probe(), and call
pm_runtime_set_memalloc_noio(false) inside uas_disconnect()
and usb_stor_disconnect().
 
 Why would you want to do that?  The probe and disconnect routines
 usually -- but not always -- run in the khubd thread.  Surely you don't
 want to prevent khubd from using GFP_KERNEL?
 
 And what if probe runs in khubd but disconnect runs in a different 
 thread?

Sorry, I misread your message.  You are setting the device's flag, not 
the thread's flag.

This still doesn't help in this case where CONFIG_PM_RUNTIME is 
disabled.  I think it will be simpler to set the noio flag during every 
device reset.

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: [RESEND PATCH 07/11] ARM: OMAP: USB: Host: Ehci driver uses the usbhs port data

2012-10-31 Thread Alan Stern
On Wed, 31 Oct 2012, Keshava Munegowda wrote:

 The usbhs core driver data is used by the ehci driver, because
 the ehci driver is child of usbhs core. The unused ehci, ohci
 and tll specific structures are removed.
 platform device creation of usbhs and tll using hwmod is
 removed.
 
 Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
 ---
  arch/arm/mach-omap2/usb-host.c |   66 
 
  drivers/usb/host/ehci-omap.c   |   40 ++-
  include/linux/platform_data/usb-omap.h |   16 
  3 files changed, 21 insertions(+), 101 deletions(-)

For the ehci-omap.c part:

Acked-by: Alan Stern st...@rowland.harvard.edu

--
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/Ver2] [trivial] usb: Fix typo in drivers/usb

2012-10-31 Thread Greg KH
On Wed, Oct 31, 2012 at 05:06:54PM +0200, Felipe Balbi wrote:
 Hi,
 
 On Thu, Nov 01, 2012 at 12:03:51AM +0900, Masanari Iida wrote:
  Correct spelling typo in debug messages within drivers/usb.
  
  Signed-off-by: Masanari Iida standby2...@gmail.com
  Acked-by: Felipe Balbi ba...@ti.com
 
 Greg, since now this only touches the stuff I handle, I can apply this
 myself.

Ok, that makes it easy for me, thanks:

Acked-by: Greg Kroah-Hartman gre...@linuxfoundation.org
--
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 REPOST] usb: host: tegra remove include of mach/iomap.h

2012-10-31 Thread Stephen Warren
On 10/31/2012 06:51 AM, Felipe Balbi wrote:
 Hi,
 
 On Mon, Oct 29, 2012 at 11:01:08AM -0600, Stephen Warren wrote:
 On 10/24/2012 01:29 PM, Stephen Warren wrote:
 Almost nothing from this file is used, and the file will
 hopefully be deleted soon. Copy the tiny portions that are used
 directly into ehci-tegra.c. I believe that Venu Byravarasu is
 working on cleaning up our USB driver, and those cleanups will
 remove the need for these constants.
 
 Per suggestion from Greg, I have applied this to the Tegra tree
 for 3.8.
 
 so I need not take this patch in my tree, right ?
 
 just making sure.

I'm fairly sure you'll want to have the patch in your tree too; Greg's
suggestion was simply to merge it everywhere it was needed.

To summarize:

* I've applied the patch to the Tegra tree since it's a dependency for
some cleanup.

* I think it's needed in whichever USB tree(s) will take the
forthcoming Tegra PHY driver rework. Apparently that's your PHY tree.
This is however simply to avoid any merge conflicts. If the PHY driver
rework ends up not adding any extra includes of mach/iomap.h
(unlikely if new files are added) then perhaps it isn't needed. Also,
if the PHY driver rework ends up not re-arranging the includes a lot,
then perhaps it will merge OK without you needing the patch. If you
want, perhaps the best course of action is to hold off applying the
patch until the PHY driver rework patches appear, and it's obvious
whether there will be a hard-to-resolve conflict, and only apply the
patch if strictly needed to avoid sticky merge conflicts.

* Greg has taken both patches into his USB tree already. Does
development process allow you to simply merge that?
--
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 V2 0/3] Removing the use of VLAIS from USB Gadget and netfilter

2012-10-31 Thread David Miller

I'm not pulling this crap into my tree to deal with limitations
of a non-gcc compiler.
--
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: remove iteration limit in hub_tt_work()

2012-10-31 Thread Alan Stern
This patch (as1621) removes the limit on the number of loops allowed
in hub_tt_work().  The value is arbitrary, and it's silly to have a
limit in the first place -- anything beyond the limit would not get
handled.

Besides, it's most unlikely that we'll ever need to clear more than a
couple of TT buffers at any time.

Signed-off-by: Alan Stern st...@rowland.harvard.edu

---

 drivers/usb/core/hub.c |4 
 1 file changed, 4 deletions(-)

Index: usb-3.7/drivers/usb/core/hub.c
===
--- usb-3.7.orig/drivers/usb/core/hub.c
+++ usb-3.7/drivers/usb/core/hub.c
@@ -741,7 +741,6 @@ static void hub_tt_work(struct work_stru
struct usb_hub  *hub =
container_of(work, struct usb_hub, tt.clear_work);
unsigned long   flags;
-   int limit = 100;
 
spin_lock_irqsave (hub-tt.lock, flags);
while (!list_empty(hub-tt.clear_list)) {
@@ -751,9 +750,6 @@ static void hub_tt_work(struct work_stru
const struct hc_driver  *drv;
int status;
 
-   if (!hub-quiescing  --limit  0)
-   break;
-
next = hub-tt.clear_list.next;
clear = list_entry (next, struct usb_tt_clear, clear_list);
list_del (clear-clear_list);

--
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: EHCI: remove unused Link Power Management code

2012-10-31 Thread Alan Stern
This patch (as1622) removes the USB-2.1 Link Power Management code
from the ehci-hcd driver.  This code was never integrated with
usbcore, it is full of bugs, and it was not getting used by anybody.

However, the debugging code for dumping the LPM-related fields in the
EHCI registers is left in place.  In theory it might be useful to see
these values, even though we don't use them.

This essentially amounts to a partial revert of commit
aa4d8342988d0c1a79ff19b2ede1e81dfbb16ea5 (USB: EHCI: EHCI 1.1
addendum: preparation) and an almost full revert of commit
48f24970144479c29b8cee6d2e1dbedf6dcf9cfb (USB: EHCI: EHCI 1.1
addendum: Basic LPM feature support) plus its follow-ons.

Signed-off-by: Alan Stern st...@rowland.harvard.edu

---

 drivers/usb/host/ehci-dbg.c|   97 ---
 drivers/usb/host/ehci-hcd.c|   18 ---
 drivers/usb/host/ehci-hub.c|5 --
 drivers/usb/host/ehci-lpm.c|  101 -
 drivers/usb/host/ehci-pci.c|   13 -
 drivers/usb/host/ehci-vt8500.c |5 --
 drivers/usb/host/ehci.h|1 
 7 files changed, 1 insertion(+), 239 deletions(-)

Index: usb-3.7/drivers/usb/host/ehci.h
===
--- usb-3.7.orig/drivers/usb/host/ehci.h
+++ usb-3.7/drivers/usb/host/ehci.h
@@ -206,7 +206,6 @@ struct ehci_hcd {   /* one per controlle
#define OHCI_HCCTRL_LEN 0x4
__hc32  *ohci_hcctrl_reg;
unsignedhas_hostpc:1;
-   unsignedhas_lpm:1;  /* support link power management */
unsignedhas_ppcd:1; /* support per-port change bits */
u8  sbrn;   /* packed release number */
 
Index: usb-3.7/drivers/usb/host/ehci-hcd.c
===
--- usb-3.7.orig/drivers/usb/host/ehci-hcd.c
+++ usb-3.7/drivers/usb/host/ehci-hcd.c
@@ -39,7 +39,6 @@
 #include linux/dma-mapping.h
 #include linux/debugfs.h
 #include linux/slab.h
-#include linux/uaccess.h
 
 #include asm/byteorder.h
 #include asm/io.h
@@ -108,11 +107,6 @@ static bool ignore_oc = 0;
 module_param (ignore_oc, bool, S_IRUGO);
 MODULE_PARM_DESC (ignore_oc, ignore bogus hardware overcurrent indications);
 
-/* for link power management(LPM) feature */
-static unsigned int hird;
-module_param(hird, int, S_IRUGO);
-MODULE_PARM_DESC(hird, host initiated resume duration, +1 for each 75us);
-
 #defineINTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
 
 /*-*/
@@ -318,7 +312,6 @@ static void end_unlink_intr(struct ehci_
 
 #include ehci-timer.c
 #include ehci-hub.c
-#include ehci-lpm.c
 #include ehci-mem.c
 #include ehci-q.c
 #include ehci-sched.c
@@ -580,17 +573,6 @@ static int ehci_init(struct usb_hcd *hcd
temp = ~(3  2);
temp |= (EHCI_TUNE_FLS  2);
}
-   if (HCC_LPM(hcc_params)) {
-   /* support link power management EHCI 1.1 addendum */
-   ehci_dbg(ehci, support lpm\n);
-   ehci-has_lpm = 1;
-   if (hird  0xf) {
-   ehci_dbg(ehci, hird %d invalid, use default 0,
-   hird);
-   hird = 0;
-   }
-   temp |= hird  24;
-   }
ehci-command = temp;
 
/* Accept arbitrarily long scatter-gather lists */
Index: usb-3.7/drivers/usb/host/ehci-hub.c
===
--- usb-3.7.orig/drivers/usb/host/ehci-hub.c
+++ usb-3.7/drivers/usb/host/ehci-hub.c
@@ -777,11 +777,6 @@ static int ehci_hub_control (
status_reg);
break;
case USB_PORT_FEAT_C_CONNECTION:
-   if (ehci-has_lpm) {
-   /* clear PORTSC bits on disconnect */
-   temp = ~PORT_LPM;
-   temp = ~PORT_DEV_ADDR;
-   }
ehci_writel(ehci, temp | PORT_CSC, status_reg);
break;
case USB_PORT_FEAT_C_OVER_CURRENT:
Index: usb-3.7/drivers/usb/host/ehci-vt8500.c
===
--- usb-3.7.orig/drivers/usb/host/ehci-vt8500.c
+++ usb-3.7/drivers/usb/host/ehci-vt8500.c
@@ -61,11 +61,6 @@ static const struct hc_driver vt8500_ehc
.relinquish_port= ehci_relinquish_port,
.port_handed_over   = ehci_port_handed_over,
 
-   /*
-* call back when device connected and addressed
-*/
-   .update_device =ehci_update_device,
-
.clear_tt_buffer_complete   = ehci_clear_tt_buffer_complete,
 };
 
Index: usb-3.7/drivers/usb/host/ehci-pci.c

Re: Endpoint is not halted

2012-10-31 Thread Sarah Sharp
On Wed, Oct 31, 2012 at 07:33:17PM +0530, Bhavik Kothari wrote:
 Hi Sarah,
 
 Thanks Sarah, for your TD-size patch.
 
 We have tried with your given driver.
 At first time, USB device gets successfully mounted, however after removing
 USB device, once again if we insert the USB device, it does not get
 enumerated.

Ok, so it looks like the TD size patch helped with TD completion events.  Good.

 While inserting USB device second time, we have observed two things, which
 we have marked as bold in below mentioned log:

I can only read the plain text version of your email, so you'll have to
avoid using formatting.  The html portion of your email doesn't display
in Firefox correctly either.

 1.  Internal device (xhci) and in hub, USB device address is
 different.

 2.  Driver, shows WARN URB submitted to disabled ep.

Both of those issues are caused by the fact that your host did not write
any state to the output context that the xHCI driver provided on the
second set address command.  It did write state after the first set
address command, but not the second:

Oct 31 12:26:32 xilinx-desktop kernel: [  357.288289] xhci_hcd :01:00.0: 
Successful Address Device command
...
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288503] xhci_hcd :01:00.0: 
Slot ID 1 Output Context:
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288507] xhci_hcd :01:00.0: 
Slot Context:
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288511] xhci_hcd :01:00.0: 
@ed0b8000 (virt) @2d0b8000 (dma) 0x00 - dev_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288516] xhci_hcd :01:00.0: 
@ed0b8004 (virt) @2d0b8004 (dma) 0x00 - dev_info2
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288520] xhci_hcd :01:00.0: 
@ed0b8008 (virt) @2d0b8008 (dma) 0x00 - tt_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288524] xhci_hcd :01:00.0: 
@ed0b800c (virt) @2d0b800c (dma) 0x00 - dev_state
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288529] xhci_hcd :01:00.0: 
@ed0b8010 (virt) @2d0b8010 (dma) 0x00 - rsvd[0]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288534] xhci_hcd :01:00.0: 
@ed0b8014 (virt) @2d0b8014 (dma) 0x00 - rsvd[1]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288539] xhci_hcd :01:00.0: 
@ed0b8018 (virt) @2d0b8018 (dma) 0x00 - rsvd[2]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288543] xhci_hcd :01:00.0: 
@ed0b801c (virt) @2d0b801c (dma) 0x00 - rsvd[3]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288547] xhci_hcd :01:00.0: 
Endpoint 00 Context:
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288552] xhci_hcd :01:00.0: 
@ed0b8020 (virt) @2d0b8020 (dma) 0x00 - ep_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288556] xhci_hcd :01:00.0: 
@ed0b8024 (virt) @2d0b8024 (dma) 0x00 - ep_info2
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288561] xhci_hcd :01:00.0: 
@ed0b8028 (virt) @2d0b8028 (dma) 0x00 - deq
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288565] xhci_hcd :01:00.0: 
@ed0b8030 (virt) @2d0b8030 (dma) 0x00 - tx_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288570] xhci_hcd :01:00.0: 
@ed0b8034 (virt) @2d0b8034 (dma) 0x00 - rsvd[0]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288575] xhci_hcd :01:00.0: 
@ed0b8038 (virt) @2d0b8038 (dma) 0x00 - rsvd[1]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288580] xhci_hcd :01:00.0: 
@ed0b803c (virt) @2d0b803c (dma) 0x00 - rsvd[2]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288584] xhci_hcd :01:00.0: 
Endpoint 01 Context:
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288588] xhci_hcd :01:00.0: 
@ed0b8040 (virt) @2d0b8040 (dma) 0x00 - ep_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288593] xhci_hcd :01:00.0: 
@ed0b8044 (virt) @2d0b8044 (dma) 0x00 - ep_info2
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288597] xhci_hcd :01:00.0: 
@ed0b8048 (virt) @2d0b8048 (dma) 0x00 - deq
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288602] xhci_hcd :01:00.0: 
@ed0b8050 (virt) @2d0b8050 (dma) 0x00 - tx_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288606] xhci_hcd :01:00.0: 
@ed0b8054 (virt) @2d0b8054 (dma) 0x00 - rsvd[0]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288611] xhci_hcd :01:00.0: 
@ed0b8058 (virt) @2d0b8058 (dma) 0x00 - rsvd[1]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288616] xhci_hcd :01:00.0: 
@ed0b805c (virt) @2d0b805c (dma) 0x00 - rsvd[2]
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288620] xhci_hcd :01:00.0: 
Endpoint 02 Context:
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288624] xhci_hcd :01:00.0: 
@ed0b8060 (virt) @2d0b8060 (dma) 0x00 - ep_info
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288629] xhci_hcd :01:00.0: 
@ed0b8064 (virt) @2d0b8064 (dma) 0x00 - ep_info2
Oct 31 12:26:32 xilinx-desktop kernel: [  357.288633] xhci_hcd :01:00.0: 
@ed0b8068 (virt) @2d0b8068 (dma) 0x00 - deq
Oct 31 12:26:32 xilinx-desktop kernel: [  

[PATCH] USB: EHCI: remove ehci_port_power() routine

2012-10-31 Thread Alan Stern
This patch (as1623) removes the ehci_port_power() routine and all the
places that call it.  There's no reason for ehci-hcd to change the
port power settings; the hub driver takes care of all that stuff.

There is one exception: When the controller is resumed from
hibernation or following a loss of power, the ports that are supposed
to be handed over to a companion controller must be powered on first.
Otherwise the handover won't work.  This process is not visible to the
hub driver, so it has to be handled in ehci-hcd.

Signed-off-by: Alan Stern st...@rowland.harvard.edu

---

 arch/arm/mach-cns3xxx/cns3420vb.c |1 -
 arch/mips/ath79/dev-usb.c |2 --
 arch/mips/loongson1/common/platform.c |1 -
 drivers/usb/chipidea/host.c   |   18 +-
 drivers/usb/host/ehci-atmel.c |9 +
 drivers/usb/host/ehci-fsl.c   |1 -
 drivers/usb/host/ehci-grlib.c |   18 +-
 drivers/usb/host/ehci-hcd.c   |   21 -
 drivers/usb/host/ehci-hub.c   |   13 +
 drivers/usb/host/ehci-msm.c   |1 -
 drivers/usb/host/ehci-mxc.c   |8 +---
 drivers/usb/host/ehci-octeon.c|3 ---
 drivers/usb/host/ehci-omap.c  |3 ---
 drivers/usb/host/ehci-orion.c |   16 +---
 drivers/usb/host/ehci-pci.c   |1 -
 drivers/usb/host/ehci-platform.c  |5 -
 drivers/usb/host/ehci-pmcmsp.c|1 -
 drivers/usb/host/ehci-sh.c|9 +
 drivers/usb/host/ehci-spear.c |9 +
 drivers/usb/host/ehci-tegra.c |8 +---
 include/linux/usb/ehci_pdriver.h  |2 --
 21 files changed, 21 insertions(+), 129 deletions(-)

Index: usb-3.7/drivers/usb/host/ehci-hcd.c
===
--- usb-3.7.orig/drivers/usb/host/ehci-hcd.c
+++ usb-3.7/drivers/usb/host/ehci-hcd.c
@@ -371,24 +371,6 @@ static void ehci_shutdown(struct usb_hcd
hrtimer_cancel(ehci-hrtimer);
 }
 
-static void ehci_port_power (struct ehci_hcd *ehci, int is_on)
-{
-   unsigned port;
-
-   if (!HCS_PPC (ehci-hcs_params))
-   return;
-
-   ehci_dbg (ehci, ...power%s ports...\n, is_on ? up : down);
-   for (port = HCS_N_PORTS (ehci-hcs_params); port  0; )
-   (void) ehci_hub_control(ehci_to_hcd(ehci),
-   is_on ? SetPortFeature : ClearPortFeature,
-   USB_PORT_FEAT_POWER,
-   port--, NULL, 0);
-   /* Flush those writes */
-   ehci_readl(ehci, ehci-regs-command);
-   msleep(20);
-}
-
 /*-*/
 
 /*
@@ -1184,9 +1166,6 @@ static int __maybe_unused ehci_resume(st
ehci-rh_state = EHCI_RH_SUSPENDED;
spin_unlock_irq(ehci-lock);
 
-   /* here we know root ports should always stay powered */
-   ehci_port_power(ehci, 1);
-
return 1;
 }
 
Index: usb-3.7/drivers/usb/host/ehci-hub.c
===
--- usb-3.7.orig/drivers/usb/host/ehci-hub.c
+++ usb-3.7/drivers/usb/host/ehci-hub.c
@@ -56,6 +56,19 @@ static void ehci_handover_companion_port
if (!ehci-owned_ports)
return;
 
+   /* Make sure the ports are powered */
+   port = HCS_N_PORTS(ehci-hcs_params);
+   while (port--) {
+   if (test_bit(port, ehci-owned_ports)) {
+   reg = ehci-regs-port_status[port];
+   status = ehci_readl(ehci, reg)  ~PORT_RWC_BITS;
+   if (!(status  PORT_POWER)) {
+   status |= PORT_POWER;
+   ehci_writel(ehci, status, reg);
+   }
+   }
+   }
+
/* Give the connections some time to appear */
msleep(20);
 
Index: usb-3.7/include/linux/usb/ehci_pdriver.h
===
--- usb-3.7.orig/include/linux/usb/ehci_pdriver.h
+++ usb-3.7/include/linux/usb/ehci_pdriver.h
@@ -41,8 +41,6 @@ struct usb_ehci_pdata {
unsignedhas_synopsys_hc_bug:1;
unsignedbig_endian_desc:1;
unsignedbig_endian_mmio:1;
-   unsignedport_power_on:1;
-   unsignedport_power_off:1;
unsignedno_io_watchdog:1;
 
/* Turn on all power and clocks */
Index: usb-3.7/arch/arm/mach-cns3xxx/cns3420vb.c
===
--- usb-3.7.orig/arch/arm/mach-cns3xxx/cns3420vb.c
+++ usb-3.7/arch/arm/mach-cns3xxx/cns3420vb.c
@@ -162,7 +162,6 @@ static void csn3xxx_usb_power_off(struct
 }
 
 static struct usb_ehci_pdata cns3xxx_usb_ehci_pdata = {
-   .port_power_off = 1,
.power_on   = csn3xxx_usb_power_on,
.power_off  = csn3xxx_usb_power_off,
 };

Re: [RESEND PATCH 05/11] ARM: OMAP: USB: Host: usb host Device tree node Adaptation

2012-10-31 Thread Tony Lindgren
* Keshava Munegowda keshava_mgo...@ti.com [121031 07:29]:
 The USB2 Host device node is extracted and used in the probe
 of the driver to initialize the usb ports and controller. The
 platform specific initialization is also performed.
 
 Signed-off-by: Keshava Munegowda keshava_mgo...@ti.com
 ---
  arch/arm/mach-omap2/usb-host.c |2 -
  drivers/mfd/omap-usb-host.c|  163 
 +++-
  include/linux/platform_data/usb-omap.h |   19 +++-
  3 files changed, 133 insertions(+), 51 deletions(-)
 
 diff --git a/arch/arm/mach-omap2/usb-host.c b/arch/arm/mach-omap2/usb-host.c
 index d1dbe12..239c175 100644
 --- a/arch/arm/mach-omap2/usb-host.c
 +++ b/arch/arm/mach-omap2/usb-host.c
 @@ -502,8 +502,6 @@ void __init usbhs_init(const struct usbhs_omap_board_data 
 *pdata)
   }
   ehci_data.phy_reset = pdata-phy_reset;
   ohci_data.es2_compatibility = pdata-es2_compatibility;
 - usbhs_data.ehci_data = ehci_data;
 - usbhs_data.ohci_data = ohci_data;
  
   if (cpu_is_omap34xx()) {
   setup_ehci_io_mux(pdata-port_mode);

Just checking.. Have you tested that these patches also
still work without device tree?

Regards,

Tony
--
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] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Paul Zimmerman
 From: linux-usb-ow...@vger.kernel.org 
 [mailto:linux-usb-ow...@vger.kernel.org] On Behalf Of Felipe Balbi
 Sent: Wednesday, October 31, 2012 8:07 AM
 On Wed, Oct 31, 2012 at 11:07:44AM -0400, Alan Stern wrote:
  On Wed, 31 Oct 2012, Michal Nazarewicz wrote:
 
   On Wed, Oct 31 2012, Felipe Balbi ba...@ti.com wrote:
nevertheless, I should be receiving a patch right about now removing
that file. Alan, care to send a patch for that ?
  
   I have some other stuff to remove as well, so I can take care of it, so
   Alan can spend his time on something more important.
 
  I'm happy to have Michal remove g_file_storage.  That way, he gets to
  deal with any complaints.  :-)
 
 heh, good point :-)

Regarding that, would you guys accept a patch that adds the buflen
module parameter to the mass-storage gadget? Without increasing the
buffer length above 16K, it's impossible to approach the max throughput
allowed by SuperSpeed hosts.

-- 
Paul

--
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: mos7840: fix port-data memory leak

2012-10-31 Thread Johan Hovold
commit 80c00750f0c9867a65b30a17880939b6bc660a77 upstream.

Fix port-data memory leak by moving port data allocation and
deallocation to port_probe and port_remove.

Since commit 0998d0631001288 (device-core: Ensure drvdata = NULL when no
driver is bound) the port private data is no longer freed at release as
it is no longer accessible.

Note that the indentation was kept intact using a do-while(0) in order
to facilitate review. A follow-up patch will remove it.

Compile-only tested.

Cc: stable sta...@vger.kernel.org
Signed-off-by: Johan Hovold jhov...@gmail.com
---

This a backport of 80c00750f0c9867 from v3.7-rc to v3.6.5 as requested.

Thanks,
Johan


 drivers/usb/serial/mos7840.c | 198 ---
 1 file changed, 71 insertions(+), 127 deletions(-)

diff --git a/drivers/usb/serial/mos7840.c b/drivers/usb/serial/mos7840.c
index 52e5ca7..5311819 100644
--- a/drivers/usb/serial/mos7840.c
+++ b/drivers/usb/serial/mos7840.c
@@ -2405,52 +2405,43 @@ static int mos7840_calc_num_ports(struct usb_serial 
*serial)
return mos7840_num_ports;
 }
 
-/
- * mos7840_startup
- /
-
-static int mos7840_startup(struct usb_serial *serial)
+static int mos7840_port_probe(struct usb_serial_port *port)
 {
+   struct usb_serial *serial = port-serial;
struct moschip_port *mos7840_port;
-   struct usb_device *dev;
-   int i, status;
+   int status;
+   int pnum;
__u16 Data;
 
-   if (!serial) {
-   dbg(%s, Invalid Handler);
-   return -1;
-   }
-
-   dev = serial-dev;
-
/* we set up the pointers to the endpoints in the mos7840_open *
 * function, as the structures aren't created yet. */
 
-   /* set up port private structures */
-   for (i = 0; i  serial-num_ports; ++i) {
-   dbg (mos7840_startup: configuring port %d, i);
+   pnum = port-number - serial-minor;
+
+   /* FIXME: remove do-while(0) loop used to keep stable patch minimal.
+*/
+   do {
+   dbg(mos7840_startup: configuring port %d, pnum);
mos7840_port = kzalloc(sizeof(struct moschip_port), GFP_KERNEL);
if (mos7840_port == NULL) {
-   dev_err(dev-dev, %s - Out of memory\n, __func__);
-   status = -ENOMEM;
-   i--; /* don't follow NULL pointer cleaning up */
-   goto error;
+   dev_err(port-dev, %s - Out of memory\n, __func__);
+   return -ENOMEM;
}
 
/* Initialize all port interrupt end point to port 0 int
 * endpoint. Our device has only one interrupt end point
 * common to all port */
 
-   mos7840_port-port = serial-port[i];
-   mos7840_set_port_private(serial-port[i], mos7840_port);
+   mos7840_port-port = port;
+   mos7840_set_port_private(port, mos7840_port);
spin_lock_init(mos7840_port-pool_lock);
 
/* minor is not initialised until later by
 * usb-serial.c:get_free_serial() and cannot therefore be used
 * to index device instances */
-   mos7840_port-port_num = i + 1;
-   dbg (serial-port[i]-number = %d, serial-port[i]-number);
-   dbg (serial-port[i]-serial-minor = %d, 
serial-port[i]-serial-minor);
+   mos7840_port-port_num = pnum + 1;
+   dbg(port-number = %d, port-number);
+   dbg(port-serial-minor = %d, port-serial-minor);
dbg (mos7840_port-port_num = %d, mos7840_port-port_num);
dbg (serial-minor = %d, serial-minor);
 
@@ -2480,10 +2471,10 @@ static int mos7840_startup(struct usb_serial *serial)
mos7840_port-DcrRegOffset = 0x1c;
}
mos7840_dump_serial_port(mos7840_port);
-   mos7840_set_port_private(serial-port[i], mos7840_port);
+   mos7840_set_port_private(port, mos7840_port);
 
/* enable rx_disable bit in control register */
-   status = mos7840_get_reg_sync(serial-port[i],
+   status = mos7840_get_reg_sync(port,
 mos7840_port-ControlRegOffset, Data);
if (status  0) {
dbg(Reading ControlReg failed status-0x%x, status);
@@ -2491,12 +2482,13 @@ static int mos7840_startup(struct usb_serial *serial)
} else
dbg(ControlReg Reading success val is %x, status%d,
Data, status);
+
Data |= 0x08;   /* setting driver done bit */
Data |= 0x04;   /* sp1_bit to have cts change reflect in

Re: HDD spins up to slow for USB and/or Mass-Storage Driver

2012-10-31 Thread Alan Stern
On Fri, 26 Oct 2012, Sarah Sharp wrote:

 On Fri, Oct 26, 2012 at 03:01:32PM -0700, Sarah Sharp wrote:
  The USB core isn't dropping the endpoints before it calls
  xhci_check_bandwidth.  I remember running into this bug a while back,
  and I even started on a fix, but then couldn't reproduce the problem.
  I found the branch with the old fix on it, but it still needs a bit of
  work.  I'll send you a patch on Monday.
 
 Matthias, can you try the attached patch?  You should be able to echo 1
 to the configuration file after this is applied.

Matthias, here's a different patch to fix the same bug.  Can you try it
out in place of Sarah's patch?

Alan Stern



Index: usb-3.7/drivers/usb/core/message.c
===
--- usb-3.7.orig/drivers/usb/core/message.c
+++ usb-3.7/drivers/usb/core/message.c
@@ -1806,29 +1806,8 @@ free_interfaces:
goto free_interfaces;
}
 
-   ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
- USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
- NULL, 0, USB_CTRL_SET_TIMEOUT);
-   if (ret  0) {
-   /* All the old state is gone, so what else can we do?
-* The device is probably useless now anyway.
-*/
-   cp = NULL;
-   }
-
-   dev-actconfig = cp;
-   if (!cp) {
-   usb_set_device_state(dev, USB_STATE_ADDRESS);
-   usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
-   /* Leave LPM disabled while the device is unconfigured. */
-   mutex_unlock(hcd-bandwidth_mutex);
-   usb_autosuspend_device(dev);
-   goto free_interfaces;
-   }
-   mutex_unlock(hcd-bandwidth_mutex);
-   usb_set_device_state(dev, USB_STATE_CONFIGURED);
-
-   /* Initialize the new interface structures and the
+   /*
+* Initialize the new interface structures and the
 * hc/hcd/usbcore interface/endpoint state.
 */
for (i = 0; i  nintf; ++i) {
@@ -1872,6 +1851,35 @@ free_interfaces:
}
kfree(new_interfaces);
 
+   ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
+ USB_REQ_SET_CONFIGURATION, 0, configuration, 0,
+ NULL, 0, USB_CTRL_SET_TIMEOUT);
+   if (ret  0  cp) {
+   /*
+* All the old state is gone, so what else can we do?
+* The device is probably useless now anyway.
+*/
+   for (i = 0; i  nintf; ++i) {
+   usb_disable_interface(dev, cp-interface[i], true);
+   put_device(cp-interface[i]-dev);
+   cp-interface[i] = NULL;
+   }
+   cp = NULL;
+   usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
+   }
+
+   dev-actconfig = cp;
+   mutex_unlock(hcd-bandwidth_mutex);
+
+   if (!cp) {
+   usb_set_device_state(dev, USB_STATE_ADDRESS);
+
+   /* Leave LPM disabled while the device is unconfigured. */
+   usb_autosuspend_device(dev);
+   return ret;
+   }
+   usb_set_device_state(dev, USB_STATE_CONFIGURED);
+
if (cp-string == NULL 
!(dev-quirks  USB_QUIRK_CONFIG_INTF_STRINGS))
cp-string = usb_cache_string(dev, cp-desc.iConfiguration);

--
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 0/6] Some USB gadget cleanups

2012-10-31 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

This patchset remove the following:
- the File-backed Storage Gadget (g_file_storage), and
- is_dualspeed file and line referenced in sysfs.

Once g_file_storage is removed, it also does some cleanup inside of
the storage_common.c file.

Based on top of felipe/master
(42748fde426943d9aad9c8bc801bfda7861e3037).

Compile tested with allmodconfig on x86_64.

Michal Nazarewicz (6):
  arch: Change defconfigs to point to g_mass_storage.
  usb: gadget: Remove File-backed Storage Gadget (g_file_storage).
  usb: gadget: storage_common: Remove FSG specific definitions.
  usb: gadget: storage_common: Drop #ifdefs used for the sake of FSG.
  usb: gadget: storage_common: Make fsg_lun_is_open() a function.
  usb: gadget: Remove reference to is_dualspeed from sysfs.

 Documentation/DocBook/gadget.tmpl  |2 +-
 Documentation/usb/mass-storage.txt |   15 +-
 arch/arm/configs/afeb9260_defconfig|2 +-
 arch/arm/configs/at91sam9260_defconfig |2 +-
 arch/arm/configs/at91sam9261_defconfig |2 +-
 arch/arm/configs/at91sam9263_defconfig |2 +-
 arch/arm/configs/at91sam9g20_defconfig |2 +-
 arch/arm/configs/corgi_defconfig   |2 +-
 arch/arm/configs/davinci_all_defconfig |2 +-
 arch/arm/configs/h7202_defconfig   |3 +-
 arch/arm/configs/magician_defconfig|2 +-
 arch/arm/configs/mini2440_defconfig|2 +-
 arch/arm/configs/omap1_defconfig   |3 +-
 arch/arm/configs/prima2_defconfig  |1 -
 arch/arm/configs/qil-a9260_defconfig   |1 -
 arch/arm/configs/spitz_defconfig   |2 +-
 arch/arm/configs/stamp9g20_defconfig   |2 +-
 arch/arm/configs/viper_defconfig   |2 +-
 arch/arm/configs/zeus_defconfig|2 +-
 arch/avr32/configs/atngw100_defconfig  |2 +-
 arch/avr32/configs/atngw100_evklcd100_defconfig|2 +-
 arch/avr32/configs/atngw100_evklcd101_defconfig|2 +-
 arch/avr32/configs/atngw100_mrmt_defconfig |2 +-
 arch/avr32/configs/atngw100mkii_defconfig  |2 +-
 .../avr32/configs/atngw100mkii_evklcd100_defconfig |2 +-
 .../avr32/configs/atngw100mkii_evklcd101_defconfig |2 +-
 arch/avr32/configs/atstk1002_defconfig |2 +-
 arch/avr32/configs/atstk1003_defconfig |2 +-
 arch/avr32/configs/atstk1004_defconfig |2 +-
 arch/avr32/configs/atstk1006_defconfig |2 +-
 arch/avr32/configs/favr-32_defconfig   |2 +-
 arch/avr32/configs/hammerhead_defconfig|2 +-
 arch/blackfin/configs/CM-BF527_defconfig   |2 +-
 arch/blackfin/configs/CM-BF548_defconfig   |2 +-
 arch/blackfin/configs/CM-BF561_defconfig   |2 +-
 arch/mips/configs/bcm47xx_defconfig|2 +-
 arch/mips/configs/mtx1_defconfig   |2 +-
 arch/sh/configs/ecovec24_defconfig |2 +-
 arch/sh/configs/se7724_defconfig   |2 +-
 drivers/usb/chipidea/debug.c   |3 -
 drivers/usb/gadget/Kconfig |   30 +-
 drivers/usb/gadget/Makefile|2 -
 drivers/usb/gadget/f_mass_storage.c|4 -
 drivers/usb/gadget/file_storage.c  | 3656 
 drivers/usb/gadget/net2280.c   |2 +-
 drivers/usb/gadget/pxa27x_udc.h|2 +-
 drivers/usb/gadget/storage_common.c|  165 +-
 drivers/usb/gadget/udc-core.c  |   11 -
 drivers/usb/musb/musb_gadget.c |5 +-
 49 files changed, 53 insertions(+), 3918 deletions(-)
 delete mode 100644 drivers/usb/gadget/file_storage.c

-- 
1.7.7.3

--
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/6] arch: Change defconfigs to point to g_mass_storage.

2012-10-31 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

The File-backed Storage Gadget (g_file_storage) is being removed, since
it has been replaced by Mass Storage Gadget (g_mass_storage).  This commit
changes defconfigs point to the new gadget.

Signed-off-by: Michal Nazarewicz min...@mina86.com
---
 arch/arm/configs/afeb9260_defconfig|2 +-
 arch/arm/configs/at91sam9260_defconfig |2 +-
 arch/arm/configs/at91sam9261_defconfig |2 +-
 arch/arm/configs/at91sam9263_defconfig |2 +-
 arch/arm/configs/at91sam9g20_defconfig |2 +-
 arch/arm/configs/corgi_defconfig   |2 +-
 arch/arm/configs/davinci_all_defconfig |2 +-
 arch/arm/configs/h7202_defconfig   |3 +--
 arch/arm/configs/magician_defconfig|2 +-
 arch/arm/configs/mini2440_defconfig|2 +-
 arch/arm/configs/omap1_defconfig   |3 +--
 arch/arm/configs/prima2_defconfig  |1 -
 arch/arm/configs/qil-a9260_defconfig   |1 -
 arch/arm/configs/spitz_defconfig   |2 +-
 arch/arm/configs/stamp9g20_defconfig   |2 +-
 arch/arm/configs/viper_defconfig   |2 +-
 arch/arm/configs/zeus_defconfig|2 +-
 arch/avr32/configs/atngw100_defconfig  |2 +-
 arch/avr32/configs/atngw100_evklcd100_defconfig|2 +-
 arch/avr32/configs/atngw100_evklcd101_defconfig|2 +-
 arch/avr32/configs/atngw100_mrmt_defconfig |2 +-
 arch/avr32/configs/atngw100mkii_defconfig  |2 +-
 .../avr32/configs/atngw100mkii_evklcd100_defconfig |2 +-
 .../avr32/configs/atngw100mkii_evklcd101_defconfig |2 +-
 arch/avr32/configs/atstk1002_defconfig |2 +-
 arch/avr32/configs/atstk1003_defconfig |2 +-
 arch/avr32/configs/atstk1004_defconfig |2 +-
 arch/avr32/configs/atstk1006_defconfig |2 +-
 arch/avr32/configs/favr-32_defconfig   |2 +-
 arch/avr32/configs/hammerhead_defconfig|2 +-
 arch/blackfin/configs/CM-BF527_defconfig   |2 +-
 arch/blackfin/configs/CM-BF548_defconfig   |2 +-
 arch/blackfin/configs/CM-BF561_defconfig   |2 +-
 arch/mips/configs/bcm47xx_defconfig|2 +-
 arch/mips/configs/mtx1_defconfig   |2 +-
 arch/sh/configs/ecovec24_defconfig |2 +-
 arch/sh/configs/se7724_defconfig   |2 +-
 37 files changed, 35 insertions(+), 39 deletions(-)

diff --git a/arch/arm/configs/afeb9260_defconfig 
b/arch/arm/configs/afeb9260_defconfig
index c285a9d..a8dbc1e 100644
--- a/arch/arm/configs/afeb9260_defconfig
+++ b/arch/arm/configs/afeb9260_defconfig
@@ -79,7 +79,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DEBUG=y
diff --git a/arch/arm/configs/at91sam9260_defconfig 
b/arch/arm/configs/at91sam9260_defconfig
index 505b376..0ea5d2c 100644
--- a/arch/arm/configs/at91sam9260_defconfig
+++ b/arch/arm/configs/at91sam9260_defconfig
@@ -75,7 +75,7 @@ CONFIG_USB_STORAGE_DEBUG=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_RTC_CLASS=y
 CONFIG_RTC_DRV_AT91SAM9=y
diff --git a/arch/arm/configs/at91sam9261_defconfig 
b/arch/arm/configs/at91sam9261_defconfig
index 1e8712e..c87beb9 100644
--- a/arch/arm/configs/at91sam9261_defconfig
+++ b/arch/arm/configs/at91sam9261_defconfig
@@ -125,7 +125,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_ETH=m
 CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_MMC=y
 CONFIG_MMC_ATMELMCI=m
diff --git a/arch/arm/configs/at91sam9263_defconfig 
b/arch/arm/configs/at91sam9263_defconfig
index d2050ca..c5212f4 100644
--- a/arch/arm/configs/at91sam9263_defconfig
+++ b/arch/arm/configs/at91sam9263_defconfig
@@ -133,7 +133,7 @@ CONFIG_USB_GADGET=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_ETH=m
 CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_MMC=y
 CONFIG_SDIO_UART=m
diff --git a/arch/arm/configs/at91sam9g20_defconfig 
b/arch/arm/configs/at91sam9g20_defconfig
index e1b0e80..3b18810 100644
--- a/arch/arm/configs/at91sam9g20_defconfig
+++ b/arch/arm/configs/at91sam9g20_defconfig
@@ -96,7 +96,7 @@ CONFIG_USB_STORAGE=y
 CONFIG_USB_GADGET=y
 CONFIG_USB_ZERO=m
 CONFIG_USB_GADGETFS=m
-CONFIG_USB_FILE_STORAGE=m
+CONFIG_USB_MASS_STORAGE=m
 CONFIG_USB_G_SERIAL=m
 CONFIG_MMC=y
 CONFIG_MMC_ATMELMCI=m
diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig
index 4b8a25d..1fd1d1d 100644
--- a/arch/arm/configs/corgi_defconfig
+++ b/arch/arm/configs/corgi_defconfig
@@ -218,7 +218,7 @@ 

[PATCH 4/6] usb: gadget: storage_common: Drop #ifdefs used for the sake of FSG.

2012-10-31 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

storage_common.c has been used by both file_storage.c and f_mass_storage.c
which had some different requirements in a few places.  To accomodate for
that, storage_common.c provided configuratian macros which were to be
defined (or not) prior to the file #inclusion.  Because now
file_storage.c is no longer with us, we can remove support for those
macros and thus simplify the code slightly.

Signed-off-by: Michal Nazarewicz min...@mina86.com
---
 drivers/usb/gadget/f_mass_storage.c |4 -
 drivers/usb/gadget/storage_common.c |  130 ---
 2 files changed, 0 insertions(+), 134 deletions(-)

diff --git a/drivers/usb/gadget/f_mass_storage.c 
b/drivers/usb/gadget/f_mass_storage.c
index 3433e43..5d027b3 100644
--- a/drivers/usb/gadget/f_mass_storage.c
+++ b/drivers/usb/gadget/f_mass_storage.c
@@ -228,10 +228,6 @@
 
 static const char fsg_string_interface[] = Mass Storage;
 
-#define FSG_NO_DEVICE_STRINGS1
-#define FSG_NO_OTG   1
-#define FSG_NO_INTR_EP   1
-
 #include storage_common.c
 
 
diff --git a/drivers/usb/gadget/storage_common.c 
b/drivers/usb/gadget/storage_common.c
index b381e0c..1b5bc69 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -11,30 +11,10 @@
  * (at your option) any later version.
  */
 
-
 /*
  * This file requires the following identifiers used in USB strings to
  * be defined (each of type pointer to char):
- *  - fsg_string_manufacturer -- name of the manufacturer
- *  - fsg_string_product  -- name of the product
- *  - fsg_string_config   -- name of the configuration
  *  - fsg_string_interface-- name of the interface
- * The first four are only needed when FSG_DESCRIPTORS_DEVICE_STRINGS
- * macro is defined prior to including this file.
- */
-
-/*
- * When FSG_NO_INTR_EP is defined fsg_fs_intr_in_desc and
- * fsg_hs_intr_in_desc objects as well as
- * FSG_FS_FUNCTION_PRE_EP_ENTRIES and FSG_HS_FUNCTION_PRE_EP_ENTRIES
- * macros are not defined.
- *
- * When FSG_NO_DEVICE_STRINGS is defined FSG_STRING_MANUFACTURER,
- * FSG_STRING_PRODUCT, FSG_STRING_SERIAL and FSG_STRING_CONFIG are not
- * defined (as well as corresponding entries in string tables are
- * missing) and FSG_STRING_INTERFACE has value of zero.
- *
- * When FSG_NO_OTG is defined fsg_otg_desc won't be defined.
  */
 
 /*
@@ -280,26 +260,10 @@ static inline u32 get_unaligned_be24(u8 *buf)
 
 
 enum {
-#ifndef FSG_NO_DEVICE_STRINGS
-   FSG_STRING_MANUFACTURER = 1,
-   FSG_STRING_PRODUCT,
-   FSG_STRING_SERIAL,
-   FSG_STRING_CONFIG,
-#endif
FSG_STRING_INTERFACE
 };
 
 
-#ifndef FSG_NO_OTG
-static struct usb_otg_descriptor
-fsg_otg_desc = {
-   .bLength =  sizeof fsg_otg_desc,
-   .bDescriptorType =  USB_DT_OTG,
-
-   .bmAttributes = USB_OTG_SRP,
-};
-#endif
-
 /* There is only one interface. */
 
 static struct usb_interface_descriptor
@@ -339,37 +303,10 @@ fsg_fs_bulk_out_desc = {
/* wMaxPacketSize set by autoconfiguration */
 };
 
-#ifndef FSG_NO_INTR_EP
-
-static struct usb_endpoint_descriptor
-fsg_fs_intr_in_desc = {
-   .bLength =  USB_DT_ENDPOINT_SIZE,
-   .bDescriptorType =  USB_DT_ENDPOINT,
-
-   .bEndpointAddress = USB_DIR_IN,
-   .bmAttributes = USB_ENDPOINT_XFER_INT,
-   .wMaxPacketSize =   cpu_to_le16(2),
-   .bInterval =32, /* frames - 32 ms */
-};
-
-#ifndef FSG_NO_OTG
-#  define FSG_FS_FUNCTION_PRE_EP_ENTRIES   2
-#else
-#  define FSG_FS_FUNCTION_PRE_EP_ENTRIES   1
-#endif
-
-#endif
-
 static struct usb_descriptor_header *fsg_fs_function[] = {
-#ifndef FSG_NO_OTG
-   (struct usb_descriptor_header *) fsg_otg_desc,
-#endif
(struct usb_descriptor_header *) fsg_intf_desc,
(struct usb_descriptor_header *) fsg_fs_bulk_in_desc,
(struct usb_descriptor_header *) fsg_fs_bulk_out_desc,
-#ifndef FSG_NO_INTR_EP
-   (struct usb_descriptor_header *) fsg_fs_intr_in_desc,
-#endif
NULL,
 };
 
@@ -403,37 +340,11 @@ fsg_hs_bulk_out_desc = {
.bInterval =1,  /* NAK every 1 uframe */
 };
 
-#ifndef FSG_NO_INTR_EP
-
-static struct usb_endpoint_descriptor
-fsg_hs_intr_in_desc = {
-   .bLength =  USB_DT_ENDPOINT_SIZE,
-   .bDescriptorType =  USB_DT_ENDPOINT,
-
-   /* bEndpointAddress copied from fs_intr_in_desc during fsg_bind() */
-   .bmAttributes = USB_ENDPOINT_XFER_INT,
-   .wMaxPacketSize =   cpu_to_le16(2),
-   .bInterval =USB_MS_TO_HS_INTERVAL(32),  /* 32 ms */
-};
-
-#ifndef FSG_NO_OTG
-#  define FSG_HS_FUNCTION_PRE_EP_ENTRIES   2
-#else
-#  define FSG_HS_FUNCTION_PRE_EP_ENTRIES   1
-#endif
-
-#endif
 
 static struct usb_descriptor_header *fsg_hs_function[] = {
-#ifndef FSG_NO_OTG
-   (struct usb_descriptor_header *) fsg_otg_desc,
-#endif
(struct usb_descriptor_header *) 

[PATCH 5/6] usb: gadget: storage_common: Make fsg_lun_is_open() a function.

2012-10-31 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

Since function-line macros are to be avoided, this commit replaces
the fsg_lun_is_open() macro with a static inline function.

While at it, this commit also adds “inline” modifier to the
fsg_lun_from_dev() function.

Signed-off-by: Michal Nazarewicz min...@mina86.com
---
 drivers/usb/gadget/storage_common.c |7 +--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/storage_common.c 
b/drivers/usb/gadget/storage_common.c
index 1b5bc69..0e3ae43 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -155,9 +155,12 @@ struct fsg_lun {
struct device   dev;
 };
 
-#define fsg_lun_is_open(curlun)((curlun)-filp != NULL)
+static inline bool fsg_lun_is_open(struct fsg_lun *curlun)
+{
+   return curlun-filp != NULL;
+}
 
-static struct fsg_lun *fsg_lun_from_dev(struct device *dev)
+static inline struct fsg_lun *fsg_lun_from_dev(struct device *dev)
 {
return container_of(dev, struct fsg_lun, dev);
 }
-- 
1.7.7.3

--
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/6] usb: gadget: storage_common: Remove FSG specific definitions.

2012-10-31 Thread Michal Nazarewicz
From: Michal Nazarewicz min...@mina86.com

Since g_file_storage has been removed, this commit removes code from
the storage_common.c file which has been used by file_storage.c only
(and not by f_mass_storage.c).

Signed-off-by: Michal Nazarewicz min...@mina86.com
---
 drivers/usb/gadget/storage_common.c |   28 
 1 files changed, 0 insertions(+), 28 deletions(-)

diff --git a/drivers/usb/gadget/storage_common.c 
b/drivers/usb/gadget/storage_common.c
index 14199d7..b381e0c 100644
--- a/drivers/usb/gadget/storage_common.c
+++ b/drivers/usb/gadget/storage_common.c
@@ -78,34 +78,6 @@
 #define LWARN(lun, fmt, args...)  dev_warn((lun)-dev, fmt, ## args)
 #define LINFO(lun, fmt, args...)  dev_info((lun)-dev, fmt, ## args)
 
-/*
- * Keep those macros in sync with those in
- * include/linux/usb/composite.h or else GCC will complain.  If they
- * are identical (the same names of arguments, white spaces in the
- * same places) GCC will allow redefinition otherwise (even if some
- * white space is removed or added) warning will be issued.
- *
- * Those macros are needed here because File Storage Gadget does not
- * include the composite.h header.  For composite gadgets those macros
- * are redundant since composite.h is included any way.
- *
- * One could check whether those macros are already defined (which
- * would indicate composite.h had been included) or not (which would
- * indicate we were in FSG) but this is not done because a warning is
- * desired if definitions here differ from the ones in composite.h.
- *
- * We want the definitions to match and be the same in File Storage
- * Gadget as well as Mass Storage Function (and so composite gadgets
- * using MSF).  If someone changes them in composite.h it will produce
- * a warning in this file when building MSF.
- */
-#define DBG(d, fmt, args...) dev_dbg((d)-gadget-dev , fmt , ## args)
-#define VDBG(d, fmt, args...)dev_vdbg((d)-gadget-dev , fmt , ## args)
-#define ERROR(d, fmt, args...)   dev_err((d)-gadget-dev , fmt , ## args)
-#define WARNING(d, fmt, args...) dev_warn((d)-gadget-dev , fmt , ## args)
-#define INFO(d, fmt, args...)dev_info((d)-gadget-dev , fmt , ## args)
-
-
 
 #ifdef DUMP_MSGS
 
-- 
1.7.7.3

--
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


Can't use gpio = gpio1 0 0 in reg_usb_otg_vbus: usb_otg_vbus

2012-10-31 Thread Rick Bronson
Hi,

  You can't seem to use:

 gpio = gpio1 0 0;

  inside of:

reg_usb_otg_vbus: usb_otg_vbus {


  because that equates to a value of zero in config-ena_gpio
in drivers/regulator/core.c:

   if (config-ena_gpio  gpio_is_valid(config-ena_gpio)) {

  which means it won't drop into the if statement.  I think I have a fix
but it's a bit invasive, touches a lot of files.  The gist is changing:

struct regulator_config cfg = { };

 to
struct regulator_config cfg = { .ena_gpio = -ENODEV, };  /* set to
invalid, we we can use zero */


  and changing:
if (whatever-ena_gpio)

 to:
if (gpio_is_valid(whatever-ena_gpio))

  Maybe someone has a better idea...

  Cheers,

  Rick






--
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] usb/gadget: let file storage gadget select libcomposite

2012-10-31 Thread Paul Zimmerman
 From: Michal Nazarewicz [mailto:m...@google.com] On Behalf Of Michal 
 Nazarewicz
 Sent: Wednesday, October 31, 2012 1:10 PM
 
 On Wed, Oct 31 2012, Paul Zimmerman wrote:
  Regarding that, would you guys accept a patch that adds the buflen
  module parameter to the mass-storage gadget? Without increasing the
  buffer length above 16K, it's impossible to approach the max throughput
  allowed by SuperSpeed hosts.
 
 I have no problem with that.  But did you try setting up 4 buffers?  you
 can set number of buffers g_{file,mass}_storage uses with config
 USB_GADGET_STORAGE_NUM_BUFFERS (or if you select USB_GADGET_DEBUG_FILES
 you get a fsg_num_buffers module parameter).

Yeah, I tried that, but it didn't have much effect. Whereas increasing 
num_buffers
to 4 and buffer length to 128K gives a large improvement, from less than 200 
MB/s
to about 290 MB/s.

-- 
Paul



[PATCH v6] usb: phy: add R-Car USB phy driver

2012-10-31 Thread Kuninori Morimoto
This patch adds Renesas R-Car USB phy driver.
It supports R8A7779 chip at this point.

R-Car has some USB controllers, but has only one phy-initializer.
So, this driver is counting users.

Signed-off-by: Kuninori Morimoto kuninori.morimoto...@renesas.com
---
v5 - v6

 - used if (priv-counter++ == 0)
 - used if (priv-counter-- == 1)
 - fixup missing *
 - fixup macro prefix
 - fixup __devexit

 But as I explained before, this driver can't use devm_request_and_ioremap(),
 because this Renesas R-Car PHY address has strange mapping.
 Some registers of this PHY address are mapped to crevice of USB EHCI/OHCI 
register area.
 like below, so I added /* CAUTION */ to explain why it didn't use 
devm_request_and_ioremap()

  0x  ===
 EHCI
  0x0094 PHY
  0x009C PHY
 EHCI
  0x0400  ==
  ...
  0x0800  ==
 PHY
  0x0900  ==

 drivers/usb/phy/Kconfig|   12 +++
 drivers/usb/phy/Makefile   |1 +
 drivers/usb/phy/rcar-phy.c |  220 
 3 files changed, 233 insertions(+)
 create mode 100644 drivers/usb/phy/rcar-phy.c

diff --git a/drivers/usb/phy/Kconfig b/drivers/usb/phy/Kconfig
index 63c339b..7eb73c5 100644
--- a/drivers/usb/phy/Kconfig
+++ b/drivers/usb/phy/Kconfig
@@ -32,3 +32,15 @@ config MV_U3D_PHY
help
  Enable this to support Marvell USB 3.0 phy controller for Marvell
  SoC.
+
+config USB_RCAR_PHY
+   tristate Renesas R-Car USB phy support
+   depends on USB || USB_GADGET
+   select USB_OTG_UTILS
+   help
+ Say Y here to add support for the Renesas R-Car USB phy driver.
+ This chip is typically used as USB phy for USB host, gadget.
+ This driver supports: R8A7779
+
+ To compile this driver as a module, choose M here: the
+ module will be called rcar-phy.
diff --git a/drivers/usb/phy/Makefile b/drivers/usb/phy/Makefile
index b069f29..1a579a8 100644
--- a/drivers/usb/phy/Makefile
+++ b/drivers/usb/phy/Makefile
@@ -8,3 +8,4 @@ obj-$(CONFIG_OMAP_USB2) += omap-usb2.o
 obj-$(CONFIG_USB_ISP1301)  += isp1301.o
 obj-$(CONFIG_MV_U3D_PHY)   += mv_u3d_phy.o
 obj-$(CONFIG_USB_EHCI_TEGRA)   += tegra_usb_phy.o
+obj-$(CONFIG_USB_RCAR_PHY) += rcar-phy.o
diff --git a/drivers/usb/phy/rcar-phy.c b/drivers/usb/phy/rcar-phy.c
new file mode 100644
index 000..792f505
--- /dev/null
+++ b/drivers/usb/phy/rcar-phy.c
@@ -0,0 +1,220 @@
+/*
+ * Renesas R-Car USB phy driver
+ *
+ * Copyright (C) 2012 Renesas Solutions Corp.
+ * Kuninori Morimoto kuninori.morimoto...@renesas.com
+ *
+ * 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/delay.h
+#include linux/io.h
+#include linux/usb/otg.h
+#include linux/platform_device.h
+#include linux/spinlock.h
+#include linux/module.h
+
+/* USBH common register */
+#define USBPCTRL0  0x0800
+#define USBPCTRL1  0x0804
+#define USBST  0x0808
+#define USBEH0 0x080C
+#define USBOH0 0x081C
+#define USBCTL00x0858
+#define EIIBC1 0x0094
+#define EIIBC2 0x009C
+
+/* USBPCTRL1 */
+#define PHY_RST(1  2)
+#define PLL_ENB(1  1)
+#define PHY_ENB(1  0)
+
+/* USBST */
+#define ST_ACT (1  31)
+#define ST_PLL (1  30)
+
+struct rcar_usb_phy_priv {
+   struct usb_phy phy;
+   spinlock_t lock;
+
+   void __iomem *reg0;
+   void __iomem *reg1;
+   int counter;
+};
+
+#define usb_phy_to_priv(p) container_of(p, struct rcar_usb_phy_priv, phy)
+
+
+/*
+ * USB initial/install operation.
+ *
+ * This function setup USB phy.
+ * The used value and setting order came from
+ * [USB :: Initial setting] on datasheet.
+ */
+static int rcar_usb_phy_init(struct usb_phy *phy)
+{
+   struct rcar_usb_phy_priv *priv = usb_phy_to_priv(phy);
+   struct device *dev = phy-dev;
+   void __iomem *reg0 = priv-reg0;
+   void __iomem *reg1 = priv-reg1;
+   int i;
+   u32 val;
+   unsigned long flags;
+
+   spin_lock_irqsave(priv-lock, flags);
+   if (priv-counter++ == 0) {
+
+   /*
+* USB phy start-up
+*/
+
+   /* (1) USB-PHY standby release */
+   iowrite32(PHY_ENB, (reg0 + USBPCTRL1));
+
+   /* (2) start USB-PHY internal PLL */
+   iowrite32(PHY_ENB | PLL_ENB, (reg0 + USBPCTRL1));
+
+   /* (3) USB module status check */
+   for (i = 0; i  1024; i++) {
+   udelay(10);
+   val = ioread32(reg0 + USBST);
+   if (val == (ST_ACT | ST_PLL))
+   break;
+   }
+
+   if (val != (ST_ACT | ST_PLL)) {
+  

[PATCH 2/4] usb: chipidea: add otg id switch and vbus connect/disconnect detect

2012-10-31 Thread Peter Chen
The main design flow is the same with msm otg driver, that is the id and
vbus interrupt are handled at core driver, others are handled by
individual drivers.

- At former design, when switch usb role from device-host, it will call
udc_stop, it will remove the gadget driver, so when switch role
from host-device, it can't add gadget driver any more.
At new design, when role switch occurs, the gadget just calls
usb_gadget_vbus_disconnect/usb_gadget_vbus_connect as well as
reset controller, it will not free any device/gadget structure

- Add vbus connect and disconnect to core interrupt handler, it can
notify udc driver by calling usb_gadget_vbus_disconnect/usb_gadget_vbus_connect.

- Add otg.c to implement struct usb_otg, in that case, calling 
otg_set_peripheral
will not be failed at udc.c. Besides, we enable id interrupt at
ci_hdrc_otg_init.

- Add special case handling, like connecting to host during boot up at device
mode, usb device at the MicroB to A cable at host mode, etc.

Signed-off-by: Peter Chen peter.c...@freescale.com
---
 drivers/usb/chipidea/Makefile |2 +-
 drivers/usb/chipidea/bits.h   |   10 ++
 drivers/usb/chipidea/ci.h |6 +
 drivers/usb/chipidea/core.c   |  217 +
 drivers/usb/chipidea/otg.c|   60 +++
 drivers/usb/chipidea/otg.h|6 +
 drivers/usb/chipidea/udc.c|2 +
 7 files changed, 284 insertions(+), 19 deletions(-)

diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
index d92ca32..11f513c 100644
--- a/drivers/usb/chipidea/Makefile
+++ b/drivers/usb/chipidea/Makefile
@@ -2,7 +2,7 @@ ccflags-$(CONFIG_USB_CHIPIDEA_DEBUG) := -DDEBUG
 
 obj-$(CONFIG_USB_CHIPIDEA) += ci_hdrc.o
 
-ci_hdrc-y  := core.o
+ci_hdrc-y  := core.o otg.o
 ci_hdrc-$(CONFIG_USB_CHIPIDEA_UDC) += udc.o
 ci_hdrc-$(CONFIG_USB_CHIPIDEA_HOST)+= host.o
 ci_hdrc-$(CONFIG_USB_CHIPIDEA_DEBUG)   += debug.o
diff --git a/drivers/usb/chipidea/bits.h b/drivers/usb/chipidea/bits.h
index 050de85..4b6ae3e 100644
--- a/drivers/usb/chipidea/bits.h
+++ b/drivers/usb/chipidea/bits.h
@@ -65,11 +65,21 @@
 #define OTGSC_ASVIS  BIT(18)
 #define OTGSC_BSVIS  BIT(19)
 #define OTGSC_BSEIS  BIT(20)
+#define OTGSC_1MSIS  BIT(21)
+#define OTGSC_DPIS   BIT(22)
 #define OTGSC_IDIE   BIT(24)
 #define OTGSC_AVVIE  BIT(25)
 #define OTGSC_ASVIE  BIT(26)
 #define OTGSC_BSVIE  BIT(27)
 #define OTGSC_BSEIE  BIT(28)
+#define OTGSC_1MSIE  BIT(29)
+#define OTGSC_DPIE   BIT(30)
+#define OTGSC_INT_EN_BITS  (BIT(24) | BIT(25) | BIT(26)\
+   | BIT(27) | BIT(28) | BIT(29)   \
+   | BIT(30))
+#define OTGSC_INT_STATUS_BITS  (BIT(16) | BIT(17) | BIT(18)\
+   | BIT(19) | BIT(20) | BIT(21)   \
+   | BIT(22))
 
 /* USBMODE */
 #define USBMODE_CM(0x03UL   0)
diff --git a/drivers/usb/chipidea/ci.h b/drivers/usb/chipidea/ci.h
index d738603..d32f932 100644
--- a/drivers/usb/chipidea/ci.h
+++ b/drivers/usb/chipidea/ci.h
@@ -139,6 +139,7 @@ struct ci13xxx {
enum ci_rolerole;
boolis_otg;
struct work_struct  work;
+   struct delayed_work dwork;
struct workqueue_struct *wq;
 
struct dma_pool *qh_pool;
@@ -164,6 +165,11 @@ struct ci13xxx {
boolglobal_phy;
struct usb_phy  *transceiver;
struct usb_hcd  *hcd;
+   /* events handled at ci_role_work */
+#define ID 0
+#define B_SESS_VALID   1
+   unsigned long events;
+   struct usb_otg  otg;
 };
 
 static inline struct ci_role_driver *ci_role(struct ci13xxx *ci)
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index f69d029..b50b77a 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
@@ -73,6 +73,7 @@
 #include bits.h
 #include host.h
 #include debug.h
+#include otg.h
 
 /* Controller register map */
 static uintptr_t ci_regs_nolpm[] = {
@@ -264,25 +265,138 @@ static enum ci_role ci_otg_role(struct ci13xxx *ci)
return role;
 }
 
+#define CI_WAIT_VBUS_STABLE_TIMEOUT 500
 /**
- * ci_role_work - perform role changing based on ID pin
- * @work: work struct
+ * ci_wait_vbus_stable
+ * When usb role switches, we need to turn on/off internal vbus
+ * regulaor, sometimes, the real vbus value may not lower fast
+ * enough due to capacitance, and we do want the vbus lower
+ * than 0.8v if it is device mode, and higher than 4.4v, if it
+ * is host mode.
+ *
+ * @low: true, Wait vbus lower than B_SESSION_VALID
+ * : false, Wait vbus higher than A_VBUS_VALID
  */
-static void ci_role_work(struct work_struct *work)
+static void 

[PATCH 3/4] usb: chipidea: udc: add pullup/pulldown dp at hw_device_state

2012-10-31 Thread Peter Chen
- During the connect/disconnect host, we need to pullup
and pulldown dp
- Make sure the dp is not pullup until the vbus is on when
flag CI13XXX_PULLUP_ON_VBUS is set

Signed-off-by: Peter Chen peter.c...@freescale.com
---
 drivers/usb/chipidea/udc.c |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index b52cb10..0ed2e1a 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
@@ -90,8 +90,10 @@ static int hw_device_state(struct ci13xxx *ci, u32 dma)
/* interrupt, error, port change, reset, sleep/suspend */
hw_write(ci, OP_USBINTR, ~0,
 USBi_UI|USBi_UEI|USBi_PCI|USBi_URI|USBi_SLI);
+   hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
} else {
hw_write(ci, OP_USBINTR, ~0, 0);
+   hw_write(ci, OP_USBCMD, USBCMD_RS, 0);
}
return 0;
 }
@@ -1423,6 +1425,10 @@ static int ci13xxx_pullup(struct usb_gadget *_gadget, 
int is_on)
 {
struct ci13xxx *ci = container_of(_gadget, struct ci13xxx, gadget);
 
+   if ((ci-platdata-flags  CI13XXX_PULLUP_ON_VBUS) 
+   !ci-vbus_active)
+   return 0;
+
if (is_on)
hw_write(ci, OP_USBCMD, USBCMD_RS, USBCMD_RS);
else
-- 
1.7.0.4


--
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