Re: How to associate lsusb bus/device with /dev entry?

2012-09-16 Thread Peter Stuge
Mathew Binkley wrote:
> Hi all.  Could someone tell me how to associate a USB Bus:Device
> info with a /dev/entry?

This is subsystem-specific. Feel free to take inspiration from my
script for usb-serial at http://stuge.se/find430.sh

You'll have to change the code inside:
  for usbiface in "${port}/${port}:"*; do

(And of course ids.)


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


Question regarding kernel 3.5 dropping support for usbfs

2012-09-16 Thread Unknown
Hi,

I recently upgraded from 3.3 to 3.5 kernel (gentoo). A USB device
(Midisport2x2) depends on firmware loading using fxload from a udev
rules script. Without usbfs, can someone give me a recommendation for
replacing the udev script to load the firmware?

At the moment, I compiled the 3.5 kernel with CONFIG_DEVTMPFS_MOUNT=y
and can manually run /sbin/fxload using the dev path but that is not a
desirable long-term solution.

I am searching for pointers but haven't run into any answers yet.

Thanks in advance,
Andrew

--
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: Question regarding kernel 3.5 dropping support for usbfs

2012-09-16 Thread Greg KH
On Sun, Sep 16, 2012 at 10:03:49AM -0400, Unknown wrote:
> Hi,
> 
> I recently upgraded from 3.3 to 3.5 kernel (gentoo). A USB device
> (Midisport2x2) depends on firmware loading using fxload from a udev
> rules script. Without usbfs, can someone give me a recommendation for
> replacing the udev script to load the firmware?
> 
> At the moment, I compiled the 3.5 kernel with CONFIG_DEVTMPFS_MOUNT=y
> and can manually run /sbin/fxload using the dev path but that is not a
> desirable long-term solution.

Why is that not a long-term solution?  It's what all the other distros
switched to years ago.

If you don't want to use devtmpfs, then create the device nodes
statically, or use udev to create them.

greg k-h
--
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: How to associate lsusb bus/device with /dev entry?

2012-09-16 Thread Peter Stuge
Peter Stuge wrote:
> > Hi all.  Could someone tell me how to associate a USB Bus:Device
> > info with a /dev/entry?
> 
> This is subsystem-specific. Feel free to take inspiration from my
> script for usb-serial at http://stuge.se/find430.sh
> 
> You'll have to change the code inside:
>   for usbiface in "${port}/${port}:"*; do
> 
> (And of course ids.)

I hacked something up, see http://stuge.se/findstor.sh

Note that this script does not do any checking beyond finding the
usb-storage driver for a USB interface. I think this is too
simplistic to be a proper generic solution, but it's something you
could start from.


//Peter
--
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: Question regarding kernel 3.5 dropping support for usbfs

2012-09-16 Thread Unknown
On Sun, 2012-09-16 at 07:30 -0700, Greg KH wrote:
> On Sun, Sep 16, 2012 at 10:03:49AM -0400, Unknown wrote:
> > Hi,
> > 
> > I recently upgraded from 3.3 to 3.5 kernel (gentoo). A USB device
> > (Midisport2x2) depends on firmware loading using fxload from a udev
> > rules script. Without usbfs, can someone give me a recommendation for
> > replacing the udev script to load the firmware?
> > 
> > At the moment, I compiled the 3.5 kernel with CONFIG_DEVTMPFS_MOUNT=y
> > and can manually run /sbin/fxload using the dev path but that is not a
> > desirable long-term solution.
> 
> Why is that not a long-term solution?  It's what all the other distros
> switched to years ago.
> 

To clarify, manually running the fxload command myself is not desirable,
I'd like the firmware to load when I plugin the device.

> If you don't want to use devtmpfs, then create the device nodes
> statically, or use udev to create them.
> 

If using devtmpfs is the  go-forward solution then should I research how
to  pass the devtmpfs path to the udev rule?

Or is there something newer in kernel 3.5 for loading firmware to
replace the use of fxload and udev rules?  I see some options in the
kernel, would exploring their use apply to my situation?
CONFIG_FIRMWARE_IN_KERNEL=y
CONFIG_EXTRA_FIRMWARE=""



> greg k-h

Thanks for the reply and any further suggestions, 
Andrew


--
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: usb3 writes fail with transcend rdf8 + ASMedia ASM1042 woes

2012-09-16 Thread Sami Farin
On Fri, Sep 14, 2012 at 12:01:36 -0700, Sarah Sharp wrote:

some logs with the 0x4000 quirk enabled..  I tried to write to a file
on VFAT fs—the Transcend SDHC again—I got only IO error and
when mounted on USB2 port, filesystem had 0-byte file.

sarah-quirk-dmesg.txt
(action starts at 180 seconds)
https://docs.google.com/file/d/0B_EMXtsx7o56UDUyVzlBVUpnbzg/edit

sarah-quirk-usbmon.txt
https://docs.google.com/file/d/0B_EMXtsx7o56LXZwc19mUU1pWk0/edit

-- 
Do what you love because life is too short for anything else.

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


gadget: fixes and create a copy of descriptors.

2012-09-16 Thread Sebastian Andrzej Siewior
last patch introduces a copy of each descriptor for each function. Most
gadgets were doing this but not all of them.
The remaining patches are fixes which I noticed while inspecting each
function. One thing that is still not done properly:
We have no function to return/free endpoints and interface numbers. For
endpoints, some gadgets do "ep->driver_data = NULL" to free them. This does
only work for UDCs which have the endpoint number in their name. The endpoints
which use a auto created number need the counter reset. Currently this is not
an issue because composite resets these counter. I think it will be required
to add and remove function with configfs.

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


[PATCH 1/8] usb/gadget: add some error recovery in afunc_bind()

2012-09-16 Thread Sebastian Andrzej Siewior
In case something goes wrong here, don't leak memory / endpoints.

Cc: Yadwinder Singh 
Cc: Jaswinder Singh 
Signed-off-by: Sebastian Andrzej Siewior 
---
 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
@@ -978,15 +978,19 @@ afunc_bind(struct usb_configuration *cfg, struct 
usb_function *fn)
INTF_SET(agdev->as_in_alt, ret);
 
agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
-   if (!agdev->out_ep)
+   if (!agdev->out_ep) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
+   goto err;
+   }
agdev->out_ep->driver_data = agdev;
 
agdev->in_ep = usb_ep_autoconfig(gadget, &fs_epin_desc);
-   if (!agdev->in_ep)
+   if (!agdev->in_ep) {
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
+   goto err;
+   }
agdev->in_ep->driver_data = agdev;
 
hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
@@ -1005,6 +1009,7 @@ 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;
}
 
prm = &agdev->uac2.p_prm;
@@ -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;
+err:
+   kfree(agdev->uac2.p_prm.rbuf);
+   kfree(agdev->uac2.c_prm.rbuf);
+   usb_free_descriptors(fn->hs_descriptors);
+   usb_free_descriptors(fn->descriptors);
+   if (agdev->in_ep)
+   agdev->in_ep->driver_data = NULL;
+   if (agdev->out_ep)
+   agdev->out_ep->driver_data = NULL;
+   return -EINVAL;
 }
 
 static void
-- 
1.7.10.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


[PATCH 5/8] usb/gadget: make FS and HS available in f_midi

2012-09-16 Thread Sebastian Andrzej Siewior
This function works only on FS or HS. If the gadget is HS capable only
HS descriptors are assigned. If we plug it to an 1.1 host it won't work
because we have only 2.0 descriptors. This patch changes the behavior to
provide both sets.

Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_midi.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c
index b978c5d..b265ee8 100644
--- a/drivers/usb/gadget/f_midi.c
+++ b/drivers/usb/gadget/f_midi.c
@@ -882,18 +882,24 @@ f_midi_bind(struct usb_configuration *c, struct 
usb_function *f)
 * both speeds
 */
/* copy descriptors, and track endpoint copies */
+   f->descriptors = usb_copy_descriptors(midi_function);
+   if (!f->descriptors)
+   goto fail_f_midi;
if (gadget_is_dualspeed(c->cdev->gadget)) {
bulk_in_desc.wMaxPacketSize = cpu_to_le16(512);
bulk_out_desc.wMaxPacketSize = cpu_to_le16(512);
f->hs_descriptors = usb_copy_descriptors(midi_function);
-   } else {
-   f->descriptors = usb_copy_descriptors(midi_function);
+   if (!f->hs_descriptors)
+   goto fail_f_midi;
}
 
kfree(midi_function);
 
return 0;
 
+fail_f_midi:
+   kfree(midi_function);
+   usb_free_descriptors(f->hs_descriptors);
 fail:
/* we might as well release our claims on endpoints */
if (midi->out_ep)
-- 
1.7.10.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


[PATCH 6/8] usb/gadget: free requests in pn_bind()'s error path

2012-09-16 Thread Sebastian Andrzej Siewior
Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_phonet.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/gadget/f_phonet.c b/drivers/usb/gadget/f_phonet.c
index 8ee9268..a6c19a4 100644
--- a/drivers/usb/gadget/f_phonet.c
+++ b/drivers/usb/gadget/f_phonet.c
@@ -531,7 +531,7 @@ int pn_bind(struct usb_configuration *c, struct 
usb_function *f)
 
req = usb_ep_alloc_request(fp->out_ep, GFP_KERNEL);
if (!req)
-   goto err;
+   goto err_req;
 
req->complete = pn_rx_complete;
fp->out_reqv[i] = req;
@@ -540,14 +540,18 @@ int pn_bind(struct usb_configuration *c, struct 
usb_function *f)
/* Outgoing USB requests */
fp->in_req = usb_ep_alloc_request(fp->in_ep, GFP_KERNEL);
if (!fp->in_req)
-   goto err;
+   goto err_req;
 
INFO(cdev, "USB CDC Phonet function\n");
INFO(cdev, "using %s, OUT %s, IN %s\n", cdev->gadget->name,
fp->out_ep->name, fp->in_ep->name);
return 0;
 
+err_req:
+   for (i = 0; i < phonet_rxq_size && fp->out_reqv[i]; i++)
+   usb_ep_free_request(fp->out_ep, fp->out_reqv[i]);
 err:
+
if (fp->out_ep)
fp->out_ep->driver_data = NULL;
if (fp->in_ep)
-- 
1.7.10.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


[PATCH 4/8] usb/gadget: free hs descriptors in f_midi

2012-09-16 Thread Sebastian Andrzej Siewior
The HS descriptors are only created if HS is supported by the UDC but we
never free them.

Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_midi.c |1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c
index b2522ba..b978c5d 100644
--- a/drivers/usb/gadget/f_midi.c
+++ b/drivers/usb/gadget/f_midi.c
@@ -415,6 +415,7 @@ static void f_midi_unbind(struct usb_configuration *c, 
struct usb_function *f)
midi->id = NULL;
 
usb_free_descriptors(f->descriptors);
+   usb_free_descriptors(f->hs_descriptors);
kfree(midi);
 }
 
-- 
1.7.10.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


[PATCH 2/8] usb/gadget: fix bind() error path in network gadgets

2012-09-16 Thread Sebastian Andrzej Siewior
I think this wrong since 72c973dd ("usb: gadget: add
usb_endpoint_descriptor to struct usb_ep"). If we fail to allocate an ep
or bail out early we shouldn't check for the descriptor which is
assigned at ep_enable() time.

Cc: Tatyana Brokhman 
Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_ecm.c|4 ++--
 drivers/usb/gadget/f_eem.c|5 ++---
 drivers/usb/gadget/f_ncm.c|4 ++--
 drivers/usb/gadget/f_rndis.c  |4 ++--
 drivers/usb/gadget/f_subset.c |4 ++--
 5 files changed, 10 insertions(+), 11 deletions(-)

diff --git a/drivers/usb/gadget/f_ecm.c b/drivers/usb/gadget/f_ecm.c
index 7892427..a158740 100644
--- a/drivers/usb/gadget/f_ecm.c
+++ b/drivers/usb/gadget/f_ecm.c
@@ -809,9 +809,9 @@ fail:
/* we might as well release our claims on endpoints */
if (ecm->notify)
ecm->notify->driver_data = NULL;
-   if (ecm->port.out_ep->desc)
+   if (ecm->port.out_ep)
ecm->port.out_ep->driver_data = NULL;
-   if (ecm->port.in_ep->desc)
+   if (ecm->port.in_ep)
ecm->port.in_ep->driver_data = NULL;
 
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
diff --git a/drivers/usb/gadget/f_eem.c b/drivers/usb/gadget/f_eem.c
index 1a7b2dd..a9cf2052 100644
--- a/drivers/usb/gadget/f_eem.c
+++ b/drivers/usb/gadget/f_eem.c
@@ -319,10 +319,9 @@ fail:
if (f->hs_descriptors)
usb_free_descriptors(f->hs_descriptors);
 
-   /* we might as well release our claims on endpoints */
-   if (eem->port.out_ep->desc)
+   if (eem->port.out_ep)
eem->port.out_ep->driver_data = NULL;
-   if (eem->port.in_ep->desc)
+   if (eem->port.in_ep)
eem->port.in_ep->driver_data = NULL;
 
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
diff --git a/drivers/usb/gadget/f_ncm.c b/drivers/usb/gadget/f_ncm.c
index 4f09500..424fc3d 100644
--- a/drivers/usb/gadget/f_ncm.c
+++ b/drivers/usb/gadget/f_ncm.c
@@ -1259,9 +1259,9 @@ fail:
/* we might as well release our claims on endpoints */
if (ncm->notify)
ncm->notify->driver_data = NULL;
-   if (ncm->port.out_ep->desc)
+   if (ncm->port.out_ep)
ncm->port.out_ep->driver_data = NULL;
-   if (ncm->port.in_ep->desc)
+   if (ncm->port.in_ep)
ncm->port.in_ep->driver_data = NULL;
 
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
diff --git a/drivers/usb/gadget/f_rndis.c b/drivers/usb/gadget/f_rndis.c
index 61f4b13..7c27626 100644
--- a/drivers/usb/gadget/f_rndis.c
+++ b/drivers/usb/gadget/f_rndis.c
@@ -803,9 +803,9 @@ fail:
/* we might as well release our claims on endpoints */
if (rndis->notify)
rndis->notify->driver_data = NULL;
-   if (rndis->port.out_ep->desc)
+   if (rndis->port.out_ep)
rndis->port.out_ep->driver_data = NULL;
-   if (rndis->port.in_ep->desc)
+   if (rndis->port.in_ep)
rndis->port.in_ep->driver_data = NULL;
 
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
diff --git a/drivers/usb/gadget/f_subset.c b/drivers/usb/gadget/f_subset.c
index 4060c0b..deb437c 100644
--- a/drivers/usb/gadget/f_subset.c
+++ b/drivers/usb/gadget/f_subset.c
@@ -370,9 +370,9 @@ fail:
usb_free_descriptors(f->hs_descriptors);
 
/* we might as well release our claims on endpoints */
-   if (geth->port.out_ep->desc)
+   if (geth->port.out_ep)
geth->port.out_ep->driver_data = NULL;
-   if (geth->port.in_ep->desc)
+   if (geth->port.in_ep)
geth->port.in_ep->driver_data = NULL;
 
ERROR(cdev, "%s: can't bind, err %d\n", f->name, status);
-- 
1.7.10.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


[PATCH 3/8] usb/gadget: remove c->highpseed = true from f_mini and uac1

2012-09-16 Thread Sebastian Andrzej Siewior
Whether highspeed configuration is valid or not is something that
composite decides and not the gadget. That gadget can only provide the
required descriptors for it.

Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_midi.c |1 -
 drivers/usb/gadget/f_uac1.c |1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/usb/gadget/f_midi.c b/drivers/usb/gadget/f_midi.c
index 8ed1259..b2522ba 100644
--- a/drivers/usb/gadget/f_midi.c
+++ b/drivers/usb/gadget/f_midi.c
@@ -882,7 +882,6 @@ f_midi_bind(struct usb_configuration *c, struct 
usb_function *f)
 */
/* copy descriptors, and track endpoint copies */
if (gadget_is_dualspeed(c->cdev->gadget)) {
-   c->highspeed = true;
bulk_in_desc.wMaxPacketSize = cpu_to_le16(512);
bulk_out_desc.wMaxPacketSize = cpu_to_le16(512);
f->hs_descriptors = usb_copy_descriptors(midi_function);
diff --git a/drivers/usb/gadget/f_uac1.c b/drivers/usb/gadget/f_uac1.c
index 1a5dcd5..c8ed41b 100644
--- a/drivers/usb/gadget/f_uac1.c
+++ b/drivers/usb/gadget/f_uac1.c
@@ -667,7 +667,6 @@ f_audio_bind(struct usb_configuration *c, struct 
usb_function *f)
 * both speeds
 */
if (gadget_is_dualspeed(c->cdev->gadget)) {
-   c->highspeed = true;
f->hs_descriptors = usb_copy_descriptors(f_audio_desc);
}
 
-- 
1.7.10.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


[PATCH 8/8] usb/gadget: always update HS/SS descriptors and create a copy of them

2012-09-16 Thread Sebastian Andrzej Siewior
HS and SS descriptors are staticaly created. They are updated during the
bind process with the endpoint address, string id or interface numbers.
After that, the descriptor chain is linked to struct usb_function which
is used by composite in order to serve the GET_DESCRIPTOR requests,
number of available configs and so on.
There is no need to assign the HS descriptor only if the UDC supports
HS speed because composite won't report those to the Host if HS support
has not been reached. The same goes for SS.
This patch makes sure each functions updates HS/SS descriptors
unconditionally and uses the newly introcued helper function to create a
copy the descriptors for the speed which is supported by the UDC.

Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/composite.c  |8 +--
 drivers/usb/gadget/config.c |   39 -
 drivers/usb/gadget/f_acm.c  |   45 +--
 drivers/usb/gadget/f_ecm.c  |   57 +--
 drivers/usb/gadget/f_eem.c  |   46 
 drivers/usb/gadget/f_fs.c   |4 +-
 drivers/usb/gadget/f_hid.c  |   30 --
 drivers/usb/gadget/f_loopback.c |   27 -
 drivers/usb/gadget/f_mass_storage.c |   59 +++-
 drivers/usb/gadget/f_midi.c |8 +--
 drivers/usb/gadget/f_ncm.c  |   32 +++
 drivers/usb/gadget/f_obex.c |   23 +++-
 drivers/usb/gadget/f_phonet.c   |   15 ++---
 drivers/usb/gadget/f_rndis.c|   55 +--
 drivers/usb/gadget/f_serial.c   |   38 -
 drivers/usb/gadget/f_sourcesink.c   |  103 ---
 drivers/usb/gadget/f_subset.c   |   48 
 drivers/usb/gadget/f_uac1.c |   22 +++-
 drivers/usb/gadget/f_uac2.c |   16 ++
 drivers/usb/gadget/f_uvc.c  |   79 +++
 drivers/usb/gadget/printer.c|   12 +++-
 drivers/usb/gadget/tcm_usb_gadget.c |   10 +++-
 include/linux/usb/composite.h   |2 +-
 include/linux/usb/gadget.h  |7 +++
 24 files changed, 305 insertions(+), 480 deletions(-)

diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
index 957f973..2a6bfe7 100644
--- a/drivers/usb/gadget/composite.c
+++ b/drivers/usb/gadget/composite.c
@@ -107,7 +107,7 @@ int config_ep_by_speed(struct usb_gadget *g,
}
/* else: fall through */
default:
-   speed_desc = f->descriptors;
+   speed_desc = f->fs_descriptors;
}
/* find descriptors */
for_each_ep_desc(speed_desc, d_spd) {
@@ -200,7 +200,7 @@ int usb_add_function(struct usb_configuration *config,
 * as full speed ... it's the function drivers that will need
 * to avoid bulk and ISO transfers.
 */
-   if (!config->fullspeed && function->descriptors)
+   if (!config->fullspeed && function->fs_descriptors)
config->fullspeed = true;
if (!config->highspeed && function->hs_descriptors)
config->highspeed = true;
@@ -363,7 +363,7 @@ static int config_buf(struct usb_configuration *config,
descriptors = f->hs_descriptors;
break;
default:
-   descriptors = f->descriptors;
+   descriptors = f->fs_descriptors;
}
 
if (!descriptors)
@@ -620,7 +620,7 @@ static int set_config(struct usb_composite_dev *cdev,
descriptors = f->hs_descriptors;
break;
default:
-   descriptors = f->descriptors;
+   descriptors = f->fs_descriptors;
}
 
for (; *descriptors; ++descriptors) {
diff --git a/drivers/usb/gadget/config.c b/drivers/usb/gadget/config.c
index e3a9892..34e12fc 100644
--- a/drivers/usb/gadget/config.c
+++ b/drivers/usb/gadget/config.c
@@ -19,7 +19,7 @@
 
 #include 
 #include 
-
+#include 
 
 /**
  * usb_descriptor_fillbuf - fill buffer with descriptors
@@ -158,3 +158,40 @@ usb_copy_descriptors(struct usb_descriptor_header **src)
return ret;
 }
 EXPORT_SYMBOL_GPL(usb_copy_descriptors);
+
+int usb_assign_descriptors(struct usb_function *f,
+   struct usb_descriptor_header **fs,
+   struct usb_descriptor_header **hs,
+   struct usb_descriptor_header **ss)
+{
+   struct usb_gadget *g = f->config->cdev->gadget;
+
+   if (fs) {
+   f->fs_descriptors = usb_copy_descriptors(fs);
+   if (!f->fs_descriptors)
+   goto err;
+   }
+   if (hs && gadget_is_dualspeed(g)) {
+   f->hs_descriptors = usb_copy_descriptors(hs);
+   if (!f->hs_descriptors)
+   goto err;
+   }
+   if (ss && gadget_is_superspeed(g)) {
+   f->ss_descriptors = usb_copy

[PATCH 7/8] usb/gadget: fix error path in uvc_function_bind()

2012-09-16 Thread Sebastian Andrzej Siewior
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 
Cc: Bhupesh Sharma 
Signed-off-by: Sebastian Andrzej Siewior 
---
 drivers/usb/gadget/f_uvc.c |   39 +--
 1 file changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/gadget/f_uvc.c b/drivers/usb/gadget/f_uvc.c
index 2a8bf06..10f13c1 100644
--- a/drivers/usb/gadget/f_uvc.c
+++ b/drivers/usb/gadget/f_uvc.c
@@ -417,7 +417,6 @@ uvc_register_video(struct uvc_device *uvc)
return -ENOMEM;
 
video->parent = &cdev->gadget->dev;
-   video->minor = -1;
video->fops = &uvc_v4l2_fops;
video->release = video_device_release;
strncpy(video->name, cdev->gadget->name, sizeof(video->name));
@@ -577,23 +576,12 @@ uvc_function_unbind(struct usb_configuration *c, struct 
usb_function *f)
 
INFO(cdev, "uvc_function_unbind\n");
 
-   if (uvc->vdev) {
-   if (uvc->vdev->minor == -1)
-   video_device_release(uvc->vdev);
-   else
-   video_unregister_device(uvc->vdev);
-   uvc->vdev = NULL;
-   }
-
-   if (uvc->control_ep)
-   uvc->control_ep->driver_data = NULL;
-   if (uvc->video.ep)
-   uvc->video.ep->driver_data = NULL;
+   video_unregister_device(uvc->vdev);
+   uvc->control_ep->driver_data = NULL;
+   uvc->video.ep->driver_data = NULL;
 
-   if (uvc->control_req) {
-   usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
-   kfree(uvc->control_buf);
-   }
+   usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
+   kfree(uvc->control_buf);
 
kfree(f->descriptors);
kfree(f->hs_descriptors);
@@ -740,7 +728,22 @@ uvc_function_bind(struct usb_configuration *c, struct 
usb_function *f)
return 0;
 
 error:
-   uvc_function_unbind(c, f);
+   if (uvc->vdev)
+   video_device_release(uvc->vdev);
+
+   if (uvc->control_ep)
+   uvc->control_ep->driver_data = NULL;
+   if (uvc->video.ep)
+   uvc->video.ep->driver_data = NULL;
+
+   if (uvc->control_req) {
+   usb_ep_free_request(cdev->gadget->ep0, uvc->control_req);
+   kfree(uvc->control_buf);
+   }
+
+   kfree(f->descriptors);
+   kfree(f->hs_descriptors);
+   kfree(f->ss_descriptors);
return ret;
 }
 
-- 
1.7.10.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


Re: Question regarding kernel 3.5 dropping support for usbfs

2012-09-16 Thread Greg KH
On Sun, Sep 16, 2012 at 01:38:56PM -0400, Unknown wrote:
> On Sun, 2012-09-16 at 07:30 -0700, Greg KH wrote:
> > On Sun, Sep 16, 2012 at 10:03:49AM -0400, Unknown wrote:
> > > Hi,
> > > 
> > > I recently upgraded from 3.3 to 3.5 kernel (gentoo). A USB device
> > > (Midisport2x2) depends on firmware loading using fxload from a udev
> > > rules script. Without usbfs, can someone give me a recommendation for
> > > replacing the udev script to load the firmware?
> > > 
> > > At the moment, I compiled the 3.5 kernel with CONFIG_DEVTMPFS_MOUNT=y
> > > and can manually run /sbin/fxload using the dev path but that is not a
> > > desirable long-term solution.
> > 
> > Why is that not a long-term solution?  It's what all the other distros
> > switched to years ago.
> > 
> 
> To clarify, manually running the fxload command myself is not desirable,
> I'd like the firmware to load when I plugin the device.

I agree, it should just work, and udev should handle it just fine.  What
changed to cause it to break?  Your udev rule?  If so, what distro are
you using that doesn't handle devtmpfs properly?

> > If you don't want to use devtmpfs, then create the device nodes
> > statically, or use udev to create them.
> > 
> 
> If using devtmpfs is the  go-forward solution then should I research how
> to  pass the devtmpfs path to the udev rule?

It should already be working with the default set of udev rules, right?

greg k-h
--
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: [RFC PATCH] drivers: phy: add generic PHY framework

2012-09-16 Thread Chen Peter-B29397
 
> 
> The PHY framework provides a set of API's for the PHY drivers to
> create/remove a PHY and the PHY users to obtain a reference to the PHY
> using or without using phandle. If the PHY users has to obtain a
> reference to
> the PHY without using phandle, the platform specfic intialization code
> (say
> from board file) should have already called phy_bind with the binding
> information. The binding information consists of phy's device name, phy
> user device name and an index. The index is used when the same phy user
> binds to mulitple phys.
> 

What's an example of "the same phy user binds to multiple phys"?
I only remembered that Felipe said there are two phy users for one single phy 
at 
omap5 that is both usb3 and sata uses the same phy.


 


--
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: usb3 writes fail with transcend rdf8 + ASMedia ASM1042 woes

2012-09-16 Thread Alan Stern
On Sun, 16 Sep 2012, Sami Farin wrote:

> On Fri, Sep 14, 2012 at 12:01:36 -0700, Sarah Sharp wrote:
> 
> some logs with the 0x4000 quirk enabled..  I tried to write to a file
> on VFAT fs—the Transcend SDHC again—I got only IO error and
> when mounted on USB2 port, filesystem had 0-byte file.
> 
> sarah-quirk-dmesg.txt
> (action starts at 180 seconds)
> https://docs.google.com/file/d/0B_EMXtsx7o56UDUyVzlBVUpnbzg/edit
> 
> sarah-quirk-usbmon.txt
> https://docs.google.com/file/d/0B_EMXtsx7o56LXZwc19mUU1pWk0/edit

For whatever help it's worth, the usbmon log shows that the second
WRITE command got an error.  The command attempted to write 240 blocks
starting at block 4129904, which is well below the end of the disk.  
The error code was Aborted Command with some sort of low-level hardware
error (possibly a parity error or possibly not; my outdated copy of the
SCSI spec doesn't include this particular code).

Incidentally, the first WRITE command, which did succeed, was for 240 
blocks starting at block 4129664.

There's no way to tell exactly what went wrong with the second WRITE.  
I suspect it is a bug in the Genesys Logic GL3220 interface.  There
does not appear to be any problem with the xHCI driver or hardware, as
far as I can tell.

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


[PATCH 0/2] Some tiny changes for split phy from otg

2012-09-16 Thread Peter Chen
Hi Felipe,

Below are two patches to split some phy related things from
otg.

Peter Chen (2):
  usb: phy: rename enum usb_otg_state to usb_state
  usb: phy: rename otg.c to phy.c

 drivers/usb/otg/Makefile   |3 -
 drivers/usb/otg/isp1301_omap.c |4 +-
 drivers/usb/otg/otg.c  |  237 ---
 drivers/usb/otg/otg_fsm.c  |6 +-
 drivers/usb/phy/Makefile   |3 +
 drivers/usb/phy/phy.c  |  239 
 include/linux/usb/msm_hsusb.h  |2 +-
 include/linux/usb/otg.h|4 +-
 include/linux/usb/phy.h|   18 ++--
 9 files changed, 260 insertions(+), 256 deletions(-)
 delete mode 100644 drivers/usb/otg/otg.c
 create mode 100644 drivers/usb/phy/phy.c


--
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] usb: phy: rename enum usb_otg_state to usb_state

2012-09-16 Thread Peter Chen
These states are not all otg specific, and they stands for
general usb state.

Signed-off-by: Peter Chen 
---
 drivers/usb/otg/isp1301_omap.c |4 ++--
 drivers/usb/otg/otg.c  |   12 +++-
 drivers/usb/otg/otg_fsm.c  |6 +++---
 include/linux/usb/msm_hsusb.h  |2 +-
 include/linux/usb/otg.h|4 ++--
 include/linux/usb/phy.h|   18 ++
 6 files changed, 25 insertions(+), 21 deletions(-)

diff --git a/drivers/usb/otg/isp1301_omap.c b/drivers/usb/otg/isp1301_omap.c
index 7a88667..3169b0e 100644
--- a/drivers/usb/otg/isp1301_omap.c
+++ b/drivers/usb/otg/isp1301_omap.c
@@ -415,7 +415,7 @@ dump_regs(struct isp1301 *isp, const char *label)
 
 static void check_state(struct isp1301 *isp, const char *tag)
 {
-   enum usb_otg_state  state = OTG_STATE_UNDEFINED;
+   enum usb_state  state = OTG_STATE_UNDEFINED;
u8  fsm = omap_readw(OTG_TEST) & 0x0ff;
unsignedextra = 0;
 
@@ -951,7 +951,7 @@ static void isp_update_otg(struct isp1301 *isp, u8 stat)
 {
struct usb_otg  *otg = isp->phy.otg;
u8  isp_stat, isp_bstat;
-   enum usb_otg_state  state = isp->phy.state;
+   enum usb_state  state = isp->phy.state;
 
if (stat & INTR_BDIS_ACON)
pr_debug("OTG:  BDIS_ACON, %s\n", state_name(isp));
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
index a30c041..4a91b18 100644
--- a/drivers/usb/otg/otg.c
+++ b/drivers/usb/otg/otg.c
@@ -201,7 +201,7 @@ void usb_remove_phy(struct usb_phy *x)
 }
 EXPORT_SYMBOL(usb_remove_phy);
 
-const char *otg_state_string(enum usb_otg_state state)
+const char *otg_state_string(enum usb_state state)
 {
switch (state) {
case OTG_STATE_A_IDLE:
@@ -214,8 +214,6 @@ const char *otg_state_string(enum usb_otg_state state)
return "a_host";
case OTG_STATE_A_SUSPEND:
return "a_suspend";
-   case OTG_STATE_A_PERIPHERAL:
-   return "a_peripheral";
case OTG_STATE_A_WAIT_VFALL:
return "a_wait_vfall";
case OTG_STATE_A_VBUS_ERR:
@@ -226,10 +224,14 @@ const char *otg_state_string(enum usb_otg_state state)
return "b_srp_init";
case OTG_STATE_B_PERIPHERAL:
return "b_peripheral";
-   case OTG_STATE_B_WAIT_ACON:
-   return "b_wait_acon";
+#ifdef CONFIG_USB_OTG
+   case OTG_STATE_A_PERIPHERAL:
+   return "a_peripheral";
case OTG_STATE_B_HOST:
return "b_host";
+   case OTG_STATE_B_WAIT_ACON:
+   return "b_wait_acon";
+#endif
default:
return "UNDEFINED";
}
diff --git a/drivers/usb/otg/otg_fsm.c b/drivers/usb/otg/otg_fsm.c
index ade131a..e6c115b 100644
--- a/drivers/usb/otg/otg_fsm.c
+++ b/drivers/usb/otg/otg_fsm.c
@@ -65,7 +65,7 @@ static int otg_set_protocol(struct otg_fsm *fsm, int protocol)
 static int state_changed;
 
 /* Called when leaving a state.  Do state clean up jobs here */
-void otg_leave_state(struct otg_fsm *fsm, enum usb_otg_state old_state)
+void otg_leave_state(struct otg_fsm *fsm, enum usb_state old_state)
 {
switch (old_state) {
case OTG_STATE_B_IDLE:
@@ -114,7 +114,7 @@ void otg_leave_state(struct otg_fsm *fsm, enum 
usb_otg_state old_state)
 }
 
 /* Called when entering a state */
-int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state new_state)
+int otg_set_state(struct otg_fsm *fsm, enum usb_state new_state)
 {
state_changed = 1;
if (fsm->otg->phy->state == new_state)
@@ -228,7 +228,7 @@ int otg_set_state(struct otg_fsm *fsm, enum usb_otg_state 
new_state)
 /* State change judgement */
 int otg_statemachine(struct otg_fsm *fsm)
 {
-   enum usb_otg_state state;
+   enum usb_state state;
unsigned long flags;
 
spin_lock_irqsave(&fsm->lock, flags);
diff --git a/include/linux/usb/msm_hsusb.h b/include/linux/usb/msm_hsusb.h
index 22a396c..4210837 100644
--- a/include/linux/usb/msm_hsusb.h
+++ b/include/linux/usb/msm_hsusb.h
@@ -133,7 +133,7 @@ struct msm_otg_platform_data {
enum otg_control_type otg_control;
enum usb_mode_type default_mode;
enum msm_usb_phy_type phy_type;
-   void (*setup_gpio)(enum usb_otg_state state);
+   void (*setup_gpio)(enum usb_state state);
char *pclk_src_name;
 };
 
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h
index e8a5fe8..556f33c 100644
--- a/include/linux/usb/otg.h
+++ b/include/linux/usb/otg.h
@@ -37,9 +37,9 @@ struct usb_otg {
 };
 
 #ifdef CONFIG_USB_OTG_UTILS
-extern const char *otg_state_string(enum usb_otg_state state);
+extern const char *otg_state_string(enum usb_state state);
 #else
-static inline const char *otg_state_string(enum usb_otg_state state)
+static inline const char *otg_state_string(enum usb_state state)
 {
return NULL;
 }
diff --git a/include/linux/usb/phy.h b/include/linux/usb/phy.

[PATCH 2/2] usb: phy: rename otg.c to phy.c

2012-09-16 Thread Peter Chen
The operations in current otg.c are actually for USB PHY's
Move it from drivers/usb/otg/ to drivers/usb/phy/

Signed-off-by: Peter Chen 
---
 drivers/usb/otg/Makefile |3 -
 drivers/usb/otg/otg.c|  239 --
 drivers/usb/phy/Makefile |3 +
 drivers/usb/phy/phy.c|  239 ++
 4 files changed, 242 insertions(+), 242 deletions(-)

diff --git a/drivers/usb/otg/Makefile b/drivers/usb/otg/Makefile
index a844b8d..6abc453 100644
--- a/drivers/usb/otg/Makefile
+++ b/drivers/usb/otg/Makefile
@@ -5,9 +5,6 @@
 ccflags-$(CONFIG_USB_DEBUG):= -DDEBUG
 ccflags-$(CONFIG_USB_GADGET_DEBUG) += -DDEBUG
 
-# infrastructure
-obj-$(CONFIG_USB_OTG_UTILS)+= otg.o
-
 # transceiver drivers
 obj-$(CONFIG_USB_GPIO_VBUS)+= gpio_vbus.o
 obj-$(CONFIG_ISP1301_OMAP) += isp1301_omap.o
diff --git a/drivers/usb/otg/otg.c b/drivers/usb/otg/otg.c
deleted file mode 100644
index 4a91b18..000
--- a/drivers/usb/otg/otg.c
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * otg.c -- USB OTG utility code
- *
- * Copyright (C) 2004 Texas Instruments
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#include 
-
-static LIST_HEAD(phy_list);
-static DEFINE_SPINLOCK(phy_lock);
-
-static struct usb_phy *__usb_find_phy(struct list_head *list,
-   enum usb_phy_type type)
-{
-   struct usb_phy  *phy = NULL;
-
-   list_for_each_entry(phy, list, head) {
-   if (phy->type != type)
-   continue;
-
-   return phy;
-   }
-
-   return ERR_PTR(-ENODEV);
-}
-
-static void devm_usb_phy_release(struct device *dev, void *res)
-{
-   struct usb_phy *phy = *(struct usb_phy **)res;
-
-   usb_put_phy(phy);
-}
-
-static int devm_usb_phy_match(struct device *dev, void *res, void *match_data)
-{
-   return res == match_data;
-}
-
-/**
- * devm_usb_get_phy - find the USB PHY
- * @dev - device that requests this phy
- * @type - the type of the phy the controller requires
- *
- * Gets the phy using usb_get_phy(), and associates a device with it using
- * devres. On driver detach, release function is invoked on the devres data,
- * then, devres data is freed.
- *
- * For use by USB host and peripheral drivers.
- */
-struct usb_phy *devm_usb_get_phy(struct device *dev, enum usb_phy_type type)
-{
-   struct usb_phy **ptr, *phy;
-
-   ptr = devres_alloc(devm_usb_phy_release, sizeof(*ptr), GFP_KERNEL);
-   if (!ptr)
-   return NULL;
-
-   phy = usb_get_phy(type);
-   if (!IS_ERR(phy)) {
-   *ptr = phy;
-   devres_add(dev, ptr);
-   } else
-   devres_free(ptr);
-
-   return phy;
-}
-EXPORT_SYMBOL(devm_usb_get_phy);
-
-/**
- * usb_get_phy - find the USB PHY
- * @type - the type of the phy the controller requires
- *
- * Returns the phy driver, after getting a refcount to it; or
- * -ENODEV if there is no such phy.  The caller is responsible for
- * calling usb_put_phy() to release that count.
- *
- * For use by USB host and peripheral drivers.
- */
-struct usb_phy *usb_get_phy(enum usb_phy_type type)
-{
-   struct usb_phy  *phy = NULL;
-   unsigned long   flags;
-
-   spin_lock_irqsave(&phy_lock, flags);
-
-   phy = __usb_find_phy(&phy_list, type);
-   if (IS_ERR(phy)) {
-   pr_err("unable to find transceiver of type %s\n",
-   usb_phy_type_string(type));
-   goto err0;
-   }
-
-   get_device(phy->dev);
-
-err0:
-   spin_unlock_irqrestore(&phy_lock, flags);
-
-   return phy;
-}
-EXPORT_SYMBOL(usb_get_phy);
-
-/**
- * devm_usb_put_phy - release the USB PHY
- * @dev - device that wants to release this phy
- * @phy - the phy returned by devm_usb_get_phy()
- *
- * destroys the devres associated with this phy and invokes usb_put_phy
- * to release the phy.
- *
- * For use by USB host and peripheral drivers.
- */
-void devm_usb_put_phy(struct device *dev, struct usb_phy *phy)
-{
-   int r;
-
-   r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy);
-   dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");
-}
-EXPORT_SYMBOL(devm_usb_put_phy);
-
-/**
- * usb_put_phy - release the USB PHY
- * @x: the phy returned by usb_get_phy()
- *
- * Releases a refcount the caller received from usb_get_phy().
- *
- * For use by USB host and peripheral drivers.
- */
-void usb_put_phy(struct usb_phy *x)
-{
-   if (x)
-   put_device(x->dev);
-}
-EXPORT_SYMBOL(usb_put_phy);
-
-/**
- * usb_add_phy - declare the USB PHY
- * @x: the USB phy to be used; or NULL
- * @type - the type of this PHY
- *
- * This call is exclusively for use by phy drivers, which
- * co

Re: [PATCH 2/2] usb: phy: rename otg.c to phy.c

2012-09-16 Thread Fabio Estevam
On Mon, Sep 17, 2012 at 12:18 AM, Peter Chen  wrote:
> The operations in current otg.c are actually for USB PHY's
> Move it from drivers/usb/otg/ to drivers/usb/phy/
>
> Signed-off-by: Peter Chen 
> ---
>  drivers/usb/otg/Makefile |3 -
>  drivers/usb/otg/otg.c|  239 
> --
>  drivers/usb/phy/Makefile |3 +
>  drivers/usb/phy/phy.c|  239 
> ++
>  4 files changed, 242 insertions(+), 242 deletions(-)

You would better use git mv / git format -M to do the renames.

Regards,

Fabio Estevam
--
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/34] i.MX multi-platform support

2012-09-16 Thread Shawn Guo
The series enables multi-platform support for imx.  Since the required
frameworks (clk, pwm) and spare_irq have already been adopted on imx,
the series is all about cleaning up mach/* headers.  Along with the
changes, arch/arm/plat-mxc gets merged into arch/arm/mach-imx.

It's based on a bunch of branches (works from others), Rob's initial
multi-platform series, Arnd's platform-data and smp_ops (Marc's) and
imx 3.7 material (Sascha and myself).

It's available on branch below.

  git://git.linaro.org/people/shawnguo/linux-2.6.git imx/multi-platform

It's been tested on imx5 and imx6, and only compile-tested on imx2 and
imx3, so testing on imx2/3 are appreciated.

Subsystem maintainers,

I plan to send the whole series via arm-soc tree at the end of 3.7
merge window when all dependant bits hit mainline.  Please have a
look at the patches you get copied and provide ACKs if the changes
are good.  Thanks.

Shawn Guo (34):
  ARM: imx: include board headers in the same folder
  ASoC: mx27vis: retrieve gpio numbers from platform_data
  ARM: imx: move iomux drivers and headers into mach-imx
  ARM: imx: remove unnecessary inclusion from device-imx*.h
  ARM: imx: move platform device code into mach-imx
  ARM: imx: merge plat-mxc into mach-imx
  ARM: imx: include common.h rather than mach/common.h
  ARM: imx: ARM: imx: include cpuidle.h rather than mach/cpuidle.h
  ARM: imx: include iim.h rather than mach/iim.h
  ARM: imx: include iram.h rather than mach/iram.h
  ARM: imx: include ulpi.h rather than mach/ulpi.h
  media: mx1_camera: remove the driver
  ARM: imx: remove mach/dma-mx1-mx2.h
  dma: ipu: rename mach/ipu.h to include/linux/dma/ipu-dma.h
  dma: imx-sdma: remove unneeded mach/hardware.h inclusion
  ASoC: imx-ssi: remove unneeded mach/hardware.h inclusion
  usb: ehci-mxc: remove unneeded mach/hardware.h inclusion
  video: mx3fb: remove unneeded mach/hardware.h inclusion
  watchdog: imx2_wdt: remove unneeded mach/hardware.h inclusion
  i2c: imx: remove mach/hardware.h inclusion
  mtd: mxc_nand: remove mach/hardware.h inclusion
  rtc: mxc_rtc: remove mach/hardware.h inclusion
  dma: imx-dma: use devm_kzalloc and devm_request_irq
  dma: imx-dma: retrieve MEM and IRQ from resources
  dma: imx-dma: remove mach/hardware.h inclusion
  media: mx2_camera: remove dead code in mx2_camera_add_device
  media: mx2_camera: use managed functions to clean up code
  media: mx2_camera: remove mach/hardware.h inclusion
  mmc: mxcmmc: remove mach/hardware.h inclusion
  video: imxfb: remove mach/hardware.h inclusion
  ARM: imx: move debug macros to include/debug
  ARM: imx: include hardware.h rather than mach/hardware.h
  ARM: imx: remove header file mach/irqs.h
  ARM: imx: enable multi-platform build

 .../devicetree/bindings/i2c/fsl-imx-i2c.txt|4 +-
 arch/arm/Kconfig   |   15 +-
 arch/arm/Kconfig.debug |8 +
 arch/arm/Makefile  |1 -
 arch/arm/boot/dts/imx27.dtsi   |4 +-
 arch/arm/boot/dts/imx51.dtsi   |4 +-
 arch/arm/boot/dts/imx53.dtsi   |6 +-
 arch/arm/boot/dts/imx6q.dtsi   |6 +-
 .../mach/debug-macro.S => include/debug/imx.S} |   33 +-
 arch/arm/{plat-mxc => mach-imx}/3ds_debugboard.c   |2 +-
 .../include/mach => mach-imx}/3ds_debugboard.h |0
 arch/arm/mach-imx/Kconfig  |   86 ++
 arch/arm/mach-imx/Makefile |   23 +-
 arch/arm/{plat-mxc => mach-imx}/avic.c |5 +-
 .../include/mach => mach-imx}/board-mx31lilly.h|0
 .../include/mach => mach-imx}/board-mx31lite.h |0
 .../include/mach => mach-imx}/board-mx31moboard.h  |0
 .../include/mach => mach-imx}/board-pcm038.h   |0
 arch/arm/mach-imx/clk-imx1.c   |   15 +-
 arch/arm/mach-imx/clk-imx21.c  |   14 +-
 arch/arm/mach-imx/clk-imx25.c  |   26 +-
 arch/arm/mach-imx/clk-imx27.c  |   36 +-
 arch/arm/mach-imx/clk-imx31.c  |   21 +-
 arch/arm/mach-imx/clk-imx35.c  |   13 +-
 arch/arm/mach-imx/clk-imx51-imx53.c|   15 +-
 arch/arm/mach-imx/clk-imx6q.c  |3 +-
 arch/arm/mach-imx/clk-pllv1.c  |4 +-
 .../{plat-mxc/include/mach => mach-imx}/common.h   |0
 arch/arm/mach-imx/cpu-imx25.c  |5 +-
 arch/arm/mach-imx/cpu-imx27.c  |2 +-
 arch/arm/mach-imx/cpu-imx31.c  |7 +-
 arch/arm/mach-imx/cpu-imx35.c  |5 +-
 arch/arm/mach-imx/cpu-imx5.c   |3 +-
 arch/arm/{plat-mxc => mach-imx}/cpu.c  |3 +-
 arch/arm/mach-imx/cpu_op-mx51.c|3 +-
 arch/arm/{plat-mxc => mach-imx}/cpufreq.c  |3 +-
 arch/arm/{plat-mxc => mach-imx}/cpuidle.c  |0
 .

[PATCH 17/34] usb: ehci-mxc: remove unneeded mach/hardware.h inclusion

2012-09-16 Thread Shawn Guo
The inclusion of mach/hardware.h is not used by the driver at all.
Remove it.

Signed-off-by: Shawn Guo 
Cc: Greg Kroah-Hartman 
Cc: linux-usb@vger.kernel.org
---
 drivers/usb/host/ehci-mxc.c |1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index a6e2ea4..e5e9856 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -24,7 +24,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
-- 
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: [RFC PATCH] drivers: phy: add generic PHY framework

2012-09-16 Thread ABRAHAM, KISHON VIJAY
Hi,

On Mon, Sep 17, 2012 at 6:50 AM, Chen Peter-B29397  wrote:
>
>>
>> The PHY framework provides a set of API's for the PHY drivers to
>> create/remove a PHY and the PHY users to obtain a reference to the PHY
>> using or without using phandle. If the PHY users has to obtain a
>> reference to
>> the PHY without using phandle, the platform specfic intialization code
>> (say
>> from board file) should have already called phy_bind with the binding
>> information. The binding information consists of phy's device name, phy
>> user device name and an index. The index is used when the same phy user
>> binds to mulitple phys.
>>
>
> What's an example of "the same phy user binds to multiple phys"?

Single controller using multiple phys..
> I only remembered that Felipe said there are two phy users for one single phy 
> at
> omap5 that is both usb3 and sata uses the same phy.

*index* is used when a single controller uses multiple phys. For
example it could be used for dwc3 (usb3 controller) where it uses usb2
phy and usb3 phy.

Thanks
Kishon
--
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/8] usb/gadget: add some error recovery in afunc_bind()

2012-09-16 Thread Jassi Brar
On Mon, Sep 17, 2012 at 1:28 AM, Sebastian Andrzej Siewior
 wrote:
> In case something goes wrong here, don't leak memory / endpoints.
>
> Cc: Yadwinder Singh 
> Cc: Jaswinder Singh 
> Signed-off-by: Sebastian Andrzej Siewior 
> ---
>  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
> @@ -978,15 +978,19 @@ afunc_bind(struct usb_configuration *cfg, struct 
> usb_function *fn)
> INTF_SET(agdev->as_in_alt, ret);
>
> agdev->out_ep = usb_ep_autoconfig(gadget, &fs_epout_desc);
> -   if (!agdev->out_ep)
> +   if (!agdev->out_ep) {
> dev_err(&uac2->pdev.dev,
> "%s:%d Error!\n", __func__, __LINE__);
> +   goto err;
> +   }
> agdev->out_ep->driver_data = agdev;
>
> agdev->in_ep = usb_ep_autoconfig(gadget, &fs_epin_desc);
> -   if (!agdev->in_ep)
> +   if (!agdev->in_ep) {
> dev_err(&uac2->pdev.dev,
> "%s:%d Error!\n", __func__, __LINE__);
> +   goto err;
> +   }
> agdev->in_ep->driver_data = agdev;
>
> hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
> @@ -1005,6 +1009,7 @@ 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;
> }
>
> prm = &agdev->uac2.p_prm;
> @@ -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;
> +err:
> +   kfree(agdev->uac2.p_prm.rbuf);
> +   kfree(agdev->uac2.c_prm.rbuf);
> +   usb_free_descriptors(fn->hs_descriptors);
> +   usb_free_descriptors(fn->descriptors);
> +   if (agdev->in_ep)
> +   agdev->in_ep->driver_data = NULL;
> +   if (agdev->out_ep)
> +   agdev->out_ep->driver_data = NULL;
> +   return -EINVAL;
>  }
>
Thanks for looking into this.
Though better would be to not refuse IN transfers if an OUT ep isn't
available and vice versa - the sound card might support only either
Playback or Capture, it doesn't have to always support both. The rbuf
should have been allocated only for ep that exists. So I think, while
this patch prevents potential null-pointer dereferencing it also weeds
out the "simplex" capability of the driver.

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


RE: [PATCH 2/2] usb: phy: rename otg.c to phy.c

2012-09-16 Thread Chen Peter-B29397
 
> 
> On Mon, Sep 17, 2012 at 12:18 AM, Peter Chen 
> wrote:
> > The operations in current otg.c are actually for USB PHY's
> > Move it from drivers/usb/otg/ to drivers/usb/phy/
> >
> > Signed-off-by: Peter Chen 
> > ---
> >  drivers/usb/otg/Makefile |3 -
> >  drivers/usb/otg/otg.c|  239 --
> 
> >  drivers/usb/phy/Makefile |3 +
> >  drivers/usb/phy/phy.c|  239
> ++
> >  4 files changed, 242 insertions(+), 242 deletions(-)
> 
> You would better use git mv / git format -M to do the renames.
> 

Thanks, I will send v2.


> Regards,
> 
> Fabio Estevam
> --
> 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