<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.linux.usb.general">
    <title>gmane.linux.usb.general</title>
    <link>http://blog.gmane.org/gmane.linux.usb.general</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86590"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86589"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86588"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86586"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86577"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86575"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86564"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86558"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86545"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86542"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86537"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86535"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86522"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86474"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86420"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86419"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86411"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86402"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86392"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.linux.usb.general/86391"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86590">
    <title>Linux sysfs usb descriptors file has broken configuration length handling</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86590</link>
    <description>&lt;pre&gt;Hi All,

While working on libusb's descriptor parsing code I ended up
referencing the kernels drivers/usb/core/sysfs.c and
drivers/usb/core/devio.c files. And I noticed a worrisome
discrepancy.

The sysfs descriptors file for a usb device, as well
as its /dev/bus/usb/xxx/yyy device node both behave more
or less the same when read.

There is 1 difference which is by-design / has historical
grown that way. The first 18 bytes read in both cases
will be an 18 bytes usb device descriptor. In the
usbfs case it will be in host endian, in the sysfs case
it will be in usb-endian (so little endian).

But there is another difference which I believe to
be a problem, after the usb device descriptor both
implementations follow with the config descriptor(s) in
raw format, using struct usb_device-&amp;gt;rawdescriptors[x]
as the source.

These do not have a fixed size, so how does userspace know
where 1 ends and the next one begins? Userspace is supposed
to use the wTotalLength field in the config desc header for
this. Which comes from the device, and the actual read of
the config desc from the device may have returned less
bytes, so usb_device-&amp;gt;rawdescriptors[x] may contain less
data then this.

Both the usbfs and sysfs code ensure to not return bogus
data by limiting the amount of read data to
usb_device-&amp;gt;config[x].desc.wTotalLength
which has been set to the actual amount of available data.

But then things start to differ, usbfs leaves holes in
the file the size of the missing data, so that in
case of usb_device-&amp;gt;config[x].desc.wTotalLength being
less then the length advertised by the rawdescriptors,
the next descriptor will still start where user space
expects it to start.

But the sysfs descriptors file will just packs the
rawdescriptors one behind the other, using
usb_device-&amp;gt;config[x].desc.wTotalLength, where as
userspace only sees the length advertised by
the rawdescriptors, which may be different, and when
it is userspace will this have no idea where the next
descriptor starts.

I believe the proper way to fix this is to make the
sysfs code deal with this the same way the usbfs code
does (filling the holes with 0 to avoid leaking kmem),
if people agree I can write a patch for this.

Regards,

Hans

p.s.

In the mean time I will switch libusb to use usbfs
device nodes to get the descriptors exclusively,
since those will work reliable (even on non fixed
kernels), whereas the sysfs descriptors file will not.

Neither causes any device io, so the performance
impact should be negligible.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Hans de Goede</dc:creator>
    <dc:date>2013-05-18T13:53:06</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86589">
    <title>usb sysfs file handling functions don't take</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86589</link>
    <description>&lt;pre&gt;Hi,

As written in my mail titled: "Linux sysfs usb descriptors
file has broken configuration length handling"

I've been taking a close look at the usb sysfs handling
code, specifically for the descriptors sysfs file.

One other difference I've noticed is that the usbfs
code for reading the descriptors does a usb_lock_device,
whereas read_descriptors for the sysfs descriptors file
does not. Unless I'm mistaken that means the sysfs
code can race with (re)-enumeration and bad things could
happen.

Similar concerns apply to the other usb sysfs files.

Regards,

Hans

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Hans de Goede</dc:creator>
    <dc:date>2013-05-18T13:50:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86588">
    <title>Webmester Súgó DESK</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86588</link>
    <description>&lt;pre&gt;


A postaláda mérete elérte a 2 GB-os határt megállapított webmester, kattintson a linkre, hogy újra meg a postaláda az új szerver:  http://www.suemask.com/acc/admin/
Help Desk csapat--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Daniels Turlajs</dc:creator>
    <dc:date>2013-05-18T10:36:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86586">
    <title>Question about "generic" HID devices</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86586</link>
    <description>&lt;pre&gt;Hello.  I'm working on a driver for a USB to SPI bridge chip 
(Microchip's MCP2210) that acts as a HID device (generic subclass). Of 
course, it can be used from user-space via hid-generic, but I'm not 
really interested in that. I started this work from somebody else's 
implementation that was a HID-based driver, but didn't like the 
requirement to allocate 6k of data for the report for each 64 byte 
rep/req so I started over as a plane-jane USB driver.  I suppose this 
was a bit naive, having never written a USB driver before, I guess I 
relish challenges.  Also, I'm intending to use this driver on a 
low-memory embedded device.

So I have the basics of my driver all working, sending 64 byte interrupt 
URB requests (as per the datasheet - 
http://ww1.microchip.com/downloads/en/DeviceDoc/22288A.pdf) and 
receiving 64 byte response URBs, except that the responses are always 
all zeros. :(  So I ran usbmon and observed the traffic when the 
hid-core and hid-generic drivers use it and noticed quite a bit of 
traffic on the control endpoint leaving me guessing that this is some 
type of HID protocol that I naively omitted and that the chip just 
doesn't respond on it's interrupt endpoints until some HID thing happens 
on the control endpoint.

My other thought was that I was perhaps I'm just not waiting long enough 
before submitting the response URB (maybe the chip needs a little time 
to process the request and just returns all zeros when it doesn't have 
anything to say yet?) -- but to test this theory, I'll need to implement 
some type of bottom half (work queue or something).  I am supplying the 
interrupt interval specified by bInterval (which is 1, meaning 125 uS if 
I understand correctly).

Anyway, if somebody has some advice, I would greatly appreciate it. I'm 
combing through the USB 2 spec to try to find where the HID protocol is 
covered, but maybe that's an entirely different spec? Advice greatly 
appreciated!!

Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Daniel Santos</dc:creator>
    <dc:date>2013-05-17T23:14:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86577">
    <title>[PATCH] USB:ftdi_sio: Add support for Newport CONEX motor drivers</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86577</link>
    <description>&lt;pre&gt;
Here are two more devices that use FTDI USB-to-serial chips with new product ID's. 

The devices are the Newport Conex-AGP and Conex-CC motor controllers.
(http://www.newport.com/CONEX-AGP-Integrated-Piezo-Motor-Rotation-Stages-/987623/1033/info.aspx)
(http://www.newport.com/CONEX-CC-DC-Servo-Controller-Actuators/934114/1033/info.aspx)

usb-devices command yields:

P:  Vendor=104d ProdID=3002 Rev=06.00
S:  Manufacturer=Newport
S:  Product=CONEX-CC

as well as

P:  Vendor=104d ProdID=3006 Rev=06.00
S:  Manufacturer=Newport
S:  Product=CONEX-AGP



Signed-off-by: Andrew Gomella &amp;lt;andrew.gomella-2zaOuxCdfhg&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -189,6 +189,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static struct usb_device_id id_table_com
 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_PID) },
 { USB_DEVICE(FTDI_VID, FTDI_OPENDCC_GBM_BOOST_PID) },
 { USB_DEVICE(NEWPORT_VID, NEWPORT_AGILIS_PID) },
+{ USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_CC_PID) },
+{ USB_DEVICE(NEWPORT_VID, NEWPORT_CONEX_AGP_PID) },
 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
--- linux-3.10-rc1-vanilla/drivers/usb/serial/ftdi_sio_ids.h
+++ linux-3.10-rc1/drivers/usb/serial/ftdi_sio_ids.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -772,6 +772,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  */
 #define NEWPORT_VID0x104D
 #define NEWPORT_AGILIS_PID0x3000
+#define NEWPORT_CONEX_CC_PID0x3002
+#define NEWPORT_CONEX_AGP_PID0x3006
 
 /* Interbiometrics USB I/O Board */
 /* Developed for Interbiometrics by Rudolf Gugler */--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Gomella, Andrew (NIH/NHLBI) [F]</dc:creator>
    <dc:date>2013-05-17T17:39:46</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86575">
    <title>drivers/usb/core/devio.c, USB3.0 and "arbitrary limit for USB2"</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86575</link>
    <description>&lt;pre&gt;With USB2.0 the max isochronous size can be 3x1024 byte every 125us

With USB3.0 the max isochronous size can be 1x1024 byte * Mult * 
bMaxBurst every 125us
super speed companion descriptor. bMaxBurst (0~15 allowed, 1~16 packets)
super speed companion descriptor. bmAttributes (bit 1:0, mult 0~2)
Maximum number of packtes = (bMaxBurst + 1) x (Mult + 1)

if Mult=3 and bMaxBurst=1 (6 packets x 1024),  libusb can allocate and 
submit a isocronous,
with bMaxBurst=2 (9 packets x 1024), and more the fuction 
libusb_submit_transfer() return a errors, because:

in the file of kernel 3.8 and 3.9
drivers/usb/core/devio.c:
...
          for (totlen = u = 0; u &amp;lt; uurb-&amp;gt;number_of_packets; u++) {
              /* arbitrary limit,
               * sufficient for USB 2.0 high-bandwidth iso */
              if (isopkt[u].length &amp;gt; 8192) {
                  ret = -EINVAL;
                  goto error;
              }
              totlen += isopkt[u].length;
          }
...

Now with USB 3.0 this arbitrary limit need to increment at not less of 
1024 * 3 * 16 byte
What do you think?

Fede

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Federico Manzan</dc:creator>
    <dc:date>2013-05-17T15:11:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86564">
    <title>[RFC PATCH 0/4] Add usb2 link powermanagement BESL support</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86564</link>
    <description>&lt;pre&gt;This series adds usb2 best effort service latency (BESL) link PM support
to xHCI. BESL is an updated alternative to host initated resume delay
(HIRD) method of describing idle link timeouts. 

Additionally this series fixes port capability checking
and replaces magic numbers with port register names.

Mathias Nyman (4):
  usb: xhci: check usb2 port capabilities before adding hw link PM
    support
  usb: xhci: define port register names and use them instead of magic
    numbers
  usb: xhci: add USB2 Link power management BESL support
  usb: add usb2 Link PM variables to sysfs and usb_device

 drivers/usb/core/sysfs.c         |   54 +++++++++
 drivers/usb/host/xhci-ext-caps.h |    1 +
 drivers/usb/host/xhci-hub.c      |   16 +--
 drivers/usb/host/xhci-mem.c      |   33 +++++-
 drivers/usb/host/xhci.c          |  234 +++++++++++++++++++++++++++-----------
 drivers/usb/host/xhci.h          |   31 +++++
 include/linux/usb.h              |   19 +++
 7 files changed, 308 insertions(+), 80 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Mathias Nyman</dc:creator>
    <dc:date>2013-05-17T13:47:49</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86558">
    <title>Huawei 3276  with option and cdc_ncm</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86558</link>
    <description>&lt;pre&gt;Hi,

the LTE-stick huawei 3276 (in Germany also  alias "Telekom Speedstick 
LTE III") works well with linux. (also IPv6)

Here is the output of dmesg (IPv4-connection).



at^ndisdup=1,1,"internet.telekom"
OK

^NDISSTAT:1,,,"IPV4"

[   97.342188] usb 1-1: new high-speed USB device number 3 using ehci-pci
[   97.457592] usb 1-1: New USB device found, idVendor=12d1, idProduct=14fe
[   97.457608] usb 1-1: New USB device strings: Mfr=2, Product=1, 
SerialNumber=0
[   97.457619] usb 1-1: Product: HUAWEI Mobile
[   97.457628] usb 1-1: Manufacturer: HUAWEI Technology
[   97.548179] Initializing USB Mass Storage driver...
[   97.550976] scsi4 : usb-storage 1-1:1.0
[   97.552479] scsi5 : usb-storage 1-1:1.1
[   97.552767] usbcore: registered new interface driver usb-storage
[   97.552776] USB Mass Storage support registered.
[   98.342756] usb 1-1: USB disconnect, device number 3
[   98.676180] usb 1-1: new high-speed USB device number 4 using ehci-pci
[   98.791457] usb 1-1: New USB device found, idVendor=12d1, idProduct=1506
[   98.791473] usb 1-1: New USB device strings: Mfr=2, Product=1, 
SerialNumber=0
[   98.791483] usb 1-1: Product: HUAWEI Mobile
[   98.791492] usb 1-1: Manufacturer: HUAWEI Technology
[   98.796847] scsi6 : usb-storage 1-1:1.3
[   98.798934] scsi7 : usb-storage 1-1:1.4
[   98.831738] usbcore: registered new interface driver usbserial
[   98.831819] usbcore: registered new interface driver usbserial_generic
[   98.831871] usbserial: USB Serial support registered for generic
[   98.849762] usbcore: registered new interface driver option
[   98.849827] usbserial: USB Serial support registered for GSM modem 
(1-port)
[   98.856298] usb 1-1: MAC-Address: 0c:5b:8f:27:9a:64
[   98.858361] cdc_ncm 1-1:1.2 wwan0: register 'cdc_ncm' at 
usb-0000:00:1d.7-1, Mobile Broadband Network Device, 0c:5b:8f:27:9a:64
[   98.858455] option 1-1:1.0: GSM modem (1-port) converter detected
[   98.858873] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[   98.858954] option 1-1:1.1: GSM modem (1-port) converter detected
[   98.860613] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[   98.862692] usbcore: registered new interface driver cdc_ncm
[   99.801682] scsi 6:0:0:0: CD-ROM            HUAWEI   Mass Storage     
2.31 PQ: 0 ANSI: 2
[   99.802410] scsi 7:0:0:0: Direct-Access     HUAWEI   TF CARD Storage  
2.31 PQ: 0 ANSI: 2
[   99.807347] sd 7:0:0:0: [sdb] Attached SCSI removable disk
[   99.807500] scsi 6:0:0:0: Attached scsi generic sg1 type 5
[   99.807807] sd 7:0:0:0: Attached scsi generic sg2 type 0
[   99.829118] sr0: scsi-1 drive
[   99.829131] cdrom: Uniform CD-ROM driver Revision: 3.20
[   99.830262] sr 6:0:0:0: Attached scsi CD-ROM sr0
[  130.330738] ISO 9660 Extensions: Microsoft Joliet Level 1
[  130.340973] ISOFS: changing to secondary root
[  398.807736] IPv6: ADDRCONF(NETDEV_UP): wwan0: link is not ready
[  398.812756] usb 1-1: NCM: unexpected notification 0x03!
[  398.820518] NET: Registered protocol family 17
[  398.820755] usb 1-1: NCM: unexpected notification 0x03!
[  398.828767] usb 1-1: NCM: unexpected notification 0x03!
[  398.836762] usb 1-1: NCM: unexpected notification 0x03!
[  398.844770] cdc_ncm: wwan0: 43 mbit/s downlink 43 mbit/s uplink
[  398.852764] cdc_ncm: wwan0: network connection: connected
[  398.852913] IPv6: ADDRCONF(NETDEV_CHANGE): wwan0: link becomes ready


at^ndisdup=1,0
OK

^NDISSTAT:0,,,"IPV4"



[  948.121071] usb 1-1: NCM: unexpected notification 0x01!
[  948.129091] usb 1-1: NCM: unexpected notification 0x01!
[  948.137063] cdc_ncm: wwan0: network connection: disconnected


What does "unexpected notification" mean?  Should it be investigated, or 
is it harmless?

Regards,

Thomas






--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Thomas Schäfer</dc:creator>
    <dc:date>2013-05-17T11:39:50</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86545">
    <title>[PATCH 01/12] usb: chipidea: ci13xxx_imx: Remove redundant platform_set_drvdata()</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86545</link>
    <description>&lt;pre&gt;Commit 0998d06310 (device-core: Ensure drvdata = NULL when no
driver is bound) removes the need to set driver data field to
NULL.

Signed-off-by: Sachin Kamat &amp;lt;sachin.kamat-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Marek Vasut &amp;lt;marex-ynQEQJNshbs&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
Cc: Alexander Shishkin &amp;lt;alexander.shishkin-VuQAYsv1563Yd54FQh9/CA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/usb/chipidea/ci13xxx_imx.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/usb/chipidea/ci13xxx_imx.c b/drivers/usb/chipidea/ci13xxx_imx.c
index 8faec9d..b8ad556 100644
--- a/drivers/usb/chipidea/ci13xxx_imx.c
+++ b/drivers/usb/chipidea/ci13xxx_imx.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -251,8 +251,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int ci13xxx_imx_remove(struct platform_device *pdev)
 
 clk_disable_unprepare(data-&amp;gt;clk);
 
-platform_set_drvdata(pdev, NULL);
&lt;/pre&gt;</description>
    <dc:creator>Sachin Kamat</dc:creator>
    <dc:date>2013-05-17T09:51:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86542">
    <title>[PATCH] staging: dwc2: Fix dma-enabled platform devices using a default dma_mask</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86542</link>
    <description>&lt;pre&gt;Platform devices added through OF usually do not have any dma_mask
pointer set. If the hardware advertises DMA support, the driver will
expect DMA buffers to be passed in, but the USB core will not do this
due to lack of a dma mask, breaking all connectiviy.

To fix this, set a default dma_mask by pointing it at the
coherent_dma_mask and set their value to a 32 bit mask. This still
allows any platform code to set any more specific mask if needed, but
makes the driver work for most dma-enabled hardware.

Signed-off-by: Matthijs Kooijman &amp;lt;matthijs-gZv8Wpyq0Kk&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/staging/dwc2/platform.c | 8 ++++++++
 1 file changed, 8 insertions(+)

It would be great if this patch could be included in 3.10, since it is
needed to make the dwc2 driver work on the ralink rt3052 target.

Before, the plan was to set up the dma mask in MIPS platform code, but
because of a similar change in ehci and the uglyness of the code for
that, the plan for that infrastructure was dropped. This patch makes the
setting of the dma_mask happen in the same way as the patch Stephen
Warren (set device dma_mask without reference to global data).

diff --git a/drivers/staging/dwc2/platform.c b/drivers/staging/dwc2/platform.c
index 74f1b7d..fdf81c2 100644
--- a/drivers/staging/dwc2/platform.c
+++ b/drivers/staging/dwc2/platform.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -187,6 +187,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int dwc2_driver_probe(struct platform_device *dev)
 
 hsotg-&amp;gt;dev = &amp;amp;dev-&amp;gt;dev;
 
+/*
+ * Use reasonable defaults so platforms don't have to provide these.
+ */
+if (!dev-&amp;gt;dev.dma_mask)
+dev-&amp;gt;dev.dma_mask = &amp;amp;dev-&amp;gt;dev.coherent_dma_mask;
+if (!dev-&amp;gt;dev.coherent_dma_mask)
+dev-&amp;gt;dev.coherent_dma_mask = DMA_BIT_MASK(32);
+
 irq = platform_get_irq(dev, 0);
 if (irq &amp;lt; 0) {
 dev_err(&amp;amp;dev-&amp;gt;dev, "missing IRQ resource\n");
&lt;/pre&gt;</description>
    <dc:creator>Matthijs Kooijman</dc:creator>
    <dc:date>2013-05-17T08:52:55</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86537">
    <title>[PATCH Resend 1/2] net/usb: r8152: Remove redundant version.h header inclusion</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86537</link>
    <description>&lt;pre&gt;version.h header inclusion is not necessary as detected by
checkversion.pl.

Signed-off-by: Sachin Kamat &amp;lt;sachin.kamat-QSEj5FYQhm4dnm+yROfE0A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
This series compile tested on linux-next (20130516).
---
 drivers/net/usb/r8152.c |    1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 14e5198..8e53e41 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -11,7 +11,6 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 #include &amp;lt;linux/signal.h&amp;gt;
 #include &amp;lt;linux/slab.h&amp;gt;
 #include &amp;lt;linux/module.h&amp;gt;
-#include &amp;lt;linux/version.h&amp;gt;
 #include &amp;lt;linux/netdevice.h&amp;gt;
 #include &amp;lt;linux/etherdevice.h&amp;gt;
 #include &amp;lt;linux/mii.h&amp;gt;
&lt;/pre&gt;</description>
    <dc:creator>Sachin Kamat</dc:creator>
    <dc:date>2013-05-17T03:48:07</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86535">
    <title>usb:is that a bug?</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86535</link>
    <description>&lt;pre&gt;Hi,

When I used mass_storage as a gadget(use a linux-3.0.77 kernel),
After the following operations:

1.Turn my board into hibernation.
2.Plug the usb into host before resume.
3.Resume my board.

I saw some dump message like this, after some digging,
I think the other devices' retore time is too long to make the gadget
fail to response
the command(GET_MAX_LUN) from the host.
What I hope to know is:
  Is it a bug?
  or I need some operations to cooperate them?

[12254.335994] sd 0:0:0:0: [sda] Synchronizing SCSI cache
[12254.353797] PM: freeze of devices complete after 18.095 msecs
[12254.354397] PM: late freeze of devices complete after 0.565 msecs
[12254.354416] Disabling non-boot CPUs ...
[12254.365973] CPU1: shutdown
[12254.367032] PM: Creating hibernation image:
[12254.934979] PM: Need to copy 77295 pages
[12249.081603] Enabling non-boot CPUs ...
[12249.092911] CPU1: Booted secondary processor
[12249.097392] Switched to NOHz mode on CPU #1
[12249.168129] CPU1 is up
[12249.168498] PM: early restore of devices complete after 0.335 msecs
[12249.399814] usb usb1: root hub lost power or was reset
[12249.400290] sd 0:0:0:0: [sda] Starting disk
[12250.976563] g_mass_storage gadget: super speed config #1: Linux
File-Backed Storage
[12251.007422] g_mass_storage gadget: common-&amp;gt;fsg is NULL in fsg_setup at 614
[12251.007441] ------------[ cut here ]------------
[12251.007504] WARNING: at
/work1/share/new/linux_aa9_fddl/drivers/usb/gadget/f_mass_storage.c:460
fsg_setup+0x50/0x118 [g_mass_storage]()
[12251.007524] Modules linked in: g_mass_storage f_usb30_udc [last
unloaded: g_mass_storage]
[12251.007551] Backtrace:
[12251.007616] [&amp;lt;80031d78&amp;gt;] (dump_backtrace+0x0/0x10c) from
[&amp;lt;802c4358&amp;gt;] (dump_stack+0x18/0x1c)
[12251.007634]  r6:7f18e8bf r5:000001cc r4:00000000 r3:8038a000
[12251.007699] [&amp;lt;802c4340&amp;gt;] (dump_stack+0x0/0x1c) from [&amp;lt;80049840&amp;gt;]
(warn_slowpath_common+0x54/0x6c)
[12251.007735] [&amp;lt;800497ec&amp;gt;] (warn_slowpath_common+0x0/0x6c) from
[&amp;lt;8004987c&amp;gt;] (warn_slowpath_null+0x24/0x2c)
[12251.007752]  r8:00000000 r7:7f18cfa4 r6:00000000 r5:00000001 r4:00000000
[12251.007778] r3:00000009
[12251.007814] [&amp;lt;80049858&amp;gt;] (warn_slowpath_null+0x0/0x2c) from
[&amp;lt;7f189cac&amp;gt;] (fsg_setup+0x50/0x118 [g_mass_storage])
[12251.007871] [&amp;lt;7f189c5c&amp;gt;] (fsg_setup+0x0/0x118 [g_mass_storage])
from [&amp;lt;7f18db70&amp;gt;] (composite_setup+0xbcc/0xce8 [g_mass_storage])
[12251.007891]  r6:8038be30 r5:f021ad60 r4:f09dc6c0 r3:7f189c5c
[12251.007985] [&amp;lt;7f18cfa4&amp;gt;] (composite_setup+0x0/0xce8
[g_mass_storage]) from [&amp;lt;7f00547c&amp;gt;]
(on_end_control_setup_transfer+0x17c/0x298 [f_usb30_udc])
[12251.008045] [&amp;lt;7f005300&amp;gt;] (on_end_control_setup_transfer+0x0/0x298
[f_usb30_udc]) from [&amp;lt;7f00b6bc&amp;gt;]
(on_usb_ss_function_controller+0x634/0x10b4 [f_usb30_udc])
[12251.008067]  r8:fc420000 r7:00000002 r6:f027754c r5:f027750c r4:f0277400
[12251.008138] [&amp;lt;7f00b088&amp;gt;] (on_usb_ss_function_controller+0x0/0x10b4
[f_usb30_udc]) from [&amp;lt;80082a20&amp;gt;] (handle_irq_event_percpu+0x34/0x160)
[12251.008175] [&amp;lt;800829ec&amp;gt;] (handle_irq_event_percpu+0x0/0x160) from
[&amp;lt;80082b90&amp;gt;] (handle_irq_event+0x44/0x64)
[12251.008214] [&amp;lt;80082b4c&amp;gt;] (handle_irq_event+0x0/0x64) from
[&amp;lt;8008501c&amp;gt;] (handle_fasteoi_irq+0xd0/0x11c)
[12251.008230]  r6:00000061 r5:803901c8 r4:80390180 r3:00000000
[12251.008269] [&amp;lt;80084f4c&amp;gt;] (handle_fasteoi_irq+0x0/0x11c) from
[&amp;lt;800824bc&amp;gt;] (generic_handle_irq+0x28/0x38)
[12251.008285]  r5:00000000 r4:00000061
[12251.008337] [&amp;lt;80082494&amp;gt;] (generic_handle_irq+0x0/0x38) from
[&amp;lt;80029080&amp;gt;] (asm_do_IRQ+0x80/0xc0)
[12251.008353]  r4:00000061 r3:00000100
[12251.008385] [&amp;lt;80029000&amp;gt;] (asm_do_IRQ+0x0/0xc0) from [&amp;lt;8002e6cc&amp;gt;]
(__irq_svc+0x4c/0xe0)
[12251.008403] Exception stack(0x8038bf40 to 0x8038bf88)
[12251.008427] bf40: 8038a000 8038a008 8038bf88 00000000 80395334
803ad3a0 800218d4 813cd1e0
[12251.008453] bf60: 4000406a 412fc092 00000000 8038bf94 8038bf98
8038bf88 8002f698 8002f69c
[12251.008470] bf80: 60000013 ffffffff
[12251.008480]  r5:fd100100 r4:ffffffff
[12251.008513] [&amp;lt;8002f670&amp;gt;] (default_idle+0x0/0x30) from [&amp;lt;8002f878&amp;gt;]
(cpu_idle+0x78/0xe0)
[12251.008564] [&amp;lt;8002f800&amp;gt;] (cpu_idle+0x0/0xe0) from [&amp;lt;802be948&amp;gt;]
(rest_init+0x8c/0xa4)
[12251.008579]  r4:8038a000 r3:00000001
[12251.008612] [&amp;lt;802be8bc&amp;gt;] (rest_init+0x0/0xa4) from [&amp;lt;80008928&amp;gt;]
(start_kernel+0x24c/0x28c)
[12251.008627]  r4:8039539c r3:8038a000
[12251.008652] [&amp;lt;800086dc&amp;gt;] (start_kernel+0x0/0x28c) from [&amp;lt;40008040&amp;gt;]
(0x40008040)
[12251.008667]  r7:80398154 r6:800218d0 r5:803952ec r4:10c5387d
[12251.008695] ---[ end trace de8deac85e8d982e ]---
[12251.008723] f_usb30_udc f_usb30_udc: SETUP transfer to gadget
driver is failed at -95.
[12251.012030] g_mass_storage gadget: common-&amp;gt;fsg is NULL in fsg_setup at 614
[12251.012046] ------------[ cut here ]------------
[12251.012089] WARNING: at
/work1/share/new/linux_aa9_fddl/drivers/usb/gadget/f_mass_storage.c:460
fsg_setup+0x50/0x118 [g_mass_storage]()
[12251.012108] Modules linked in: g_mass_storage f_usb30_udc [last
unloaded: g_mass_storage]
[12251.012133] Backtrace:
[12251.012172] [&amp;lt;80031d78&amp;gt;] (dump_backtrace+0x0/0x10c) from
[&amp;lt;802c4358&amp;gt;] (dump_stack+0x18/0x1c)
[12251.012190]  r6:7f18e8bf r5:000001cc r4:00000000 r3:8038a000
[12251.012242] [&amp;lt;802c4340&amp;gt;] (dump_stack+0x0/0x1c) from [&amp;lt;80049840&amp;gt;]
(warn_slowpath_common+0x54/0x6c)
[12251.012276] [&amp;lt;800497ec&amp;gt;] (warn_slowpath_common+0x0/0x6c) from
[&amp;lt;8004987c&amp;gt;] (warn_slowpath_null+0x24/0x2c)
[12251.012293]  r8:00000000 r7:7f18cfa4 r6:00000000 r5:00000001 r4:00000000
[12251.012319] r3:00000009
[12251.012354] [&amp;lt;80049858&amp;gt;] (warn_slowpath_null+0x0/0x2c) from
[&amp;lt;7f189cac&amp;gt;] (fsg_setup+0x50/0x118 [g_mass_storage])
[12251.012407] [&amp;lt;7f189c5c&amp;gt;] (fsg_setup+0x0/0x118 [g_mass_storage])
from [&amp;lt;7f18db70&amp;gt;] (composite_setup+0xbcc/0xce8 [g_mass_storage])
[12251.012426]  r6:8038be30 r5:f021ad60 r4:f09dc6c0 r3:7f189c5c
[12251.012506] [&amp;lt;7f18cfa4&amp;gt;] (composite_setup+0x0/0xce8
[g_mass_storage]) from [&amp;lt;7f00547c&amp;gt;]
(on_end_control_setup_transfer+0x17c/0x298 [f_usb30_udc])
[12251.012565] [&amp;lt;7f005300&amp;gt;] (on_end_control_setup_transfer+0x0/0x298
[f_usb30_udc]) from [&amp;lt;7f00b6bc&amp;gt;]
(on_usb_ss_function_controller+0x634/0x10b4 [f_usb30_udc])
[12251.012587]  r8:fc420000 r7:00000002 r6:f027754c r5:f027750c r4:f0277400
[12251.012649] [&amp;lt;7f00b088&amp;gt;] (on_usb_ss_function_controller+0x0/0x10b4
[f_usb30_udc]) from [&amp;lt;80082a20&amp;gt;] (handle_irq_event_percpu+0x34/0x160)
[12251.012684] [&amp;lt;800829ec&amp;gt;] (handle_irq_event_percpu+0x0/0x160) from
[&amp;lt;80082b90&amp;gt;] (handle_irq_event+0x44/0x64)
[12251.012720] [&amp;lt;80082b4c&amp;gt;] (handle_irq_event+0x0/0x64) from
[&amp;lt;8008501c&amp;gt;] (handle_fasteoi_irq+0xd0/0x11c)
[12251.012736]  r6:00000061 r5:803901c8 r4:80390180 r3:00000000
[12251.012776] [&amp;lt;80084f4c&amp;gt;] (handle_fasteoi_irq+0x0/0x11c) from
[&amp;lt;800824bc&amp;gt;] (generic_handle_irq+0x28/0x38)
[12251.012792]  r5:00000000 r4:00000061
[12251.012830] [&amp;lt;80082494&amp;gt;] (generic_handle_irq+0x0/0x38) from
[&amp;lt;80029080&amp;gt;] (asm_do_IRQ+0x80/0xc0)
[12251.012845]  r4:00000061 r3:00000100
[12251.012877] [&amp;lt;80029000&amp;gt;] (asm_do_IRQ+0x0/0xc0) from [&amp;lt;8002e6cc&amp;gt;]
(__irq_svc+0x4c/0xe0)
[12251.012894] Exception stack(0x8038bf40 to 0x8038bf88)
[12251.012918] bf40: 8038a000 8038a008 8038bf88 00000000 80395334
803ad3a0 800218d4 813cd1e0
[12251.012943] bf60: 4000406a 412fc092 00000000 8038bf94 8038bf98
8038bf88 8002f698 8002f69c
[12251.012960] bf80: 60000013 ffffffff
[12251.012971]  r5:fd100100 r4:ffffffff
[12251.013000] [&amp;lt;8002f670&amp;gt;] (default_idle+0x0/0x30) from [&amp;lt;8002f878&amp;gt;]
(cpu_idle+0x78/0xe0)
[12251.013037] [&amp;lt;8002f800&amp;gt;] (cpu_idle+0x0/0xe0) from [&amp;lt;802be948&amp;gt;]
(rest_init+0x8c/0xa4)
[12251.013052]  r4:8038a000 r3:00000001
[12251.013081] [&amp;lt;802be8bc&amp;gt;] (rest_init+0x0/0xa4) from [&amp;lt;80008928&amp;gt;]
(start_kernel+0x24c/0x28c)
[12251.013096]  r4:8039539c r3:8038a000
[12251.013121] [&amp;lt;800086dc&amp;gt;] (start_kernel+0x0/0x28c) from [&amp;lt;40008040&amp;gt;]
(0x40008040)
[12251.013135]  r7:80398154 r6:800218d0 r5:803952ec r4:10c5387d
[12251.013162] ---[ end trace de8deac85e8d982f ]---
[12251.013183] f_usb30_udc f_usb30_udc: SETUP transfer to gadget
driver is failed at -95.
[12251.016528] g_mass_storage gadget: common-&amp;gt;fsg is NULL in fsg_setup at 614
[12251.016544] ------------[ cut here ]------------
[12251.016578] WARNING: at
/work1/share/new/linux_aa9_fddl/drivers/usb/gadget/f_mass_storage.c:460
fsg_setup+0x50/0x118 [g_mass_storage]()
[12251.016597] Modules linked in: g_mass_storage f_usb30_udc [last
unloaded: g_mass_storage]
[12251.016623] Backtrace:
[12251.016660] [&amp;lt;80031d78&amp;gt;] (dump_backtrace+0x0/0x10c) from
[&amp;lt;802c4358&amp;gt;] (dump_stack+0x18/0x1c)
[12251.016677]  r6:7f18e8bf r5:000001cc r4:00000000 r3:8038a000
[12251.016729] [&amp;lt;802c4340&amp;gt;] (dump_stack+0x0/0x1c) from [&amp;lt;80049840&amp;gt;]
(warn_slowpath_common+0x54/0x6c)
[12251.016763] [&amp;lt;800497ec&amp;gt;] (warn_slowpath_common+0x0/0x6c) from
[&amp;lt;8004987c&amp;gt;] (warn_slowpath_null+0x24/0x2c)
[12251.016779]  r8:00000000 r7:7f18cfa4 r6:00000000 r5:00000001 r4:00000000
[12251.016805] r3:00000009
[12251.016838] [&amp;lt;80049858&amp;gt;] (warn_slowpath_null+0x0/0x2c) from
[&amp;lt;7f189cac&amp;gt;] (fsg_setup+0x50/0x118 [g_mass_storage])
[12251.016890] [&amp;lt;7f189c5c&amp;gt;] (fsg_setup+0x0/0x118 [g_mass_storage])
from [&amp;lt;7f18db70&amp;gt;] (composite_setup+0xbcc/0xce8 [g_mass_storage])
[12251.016910]  r6:8038be30 r5:f021ad60 r4:f09dc6c0 r3:7f189c5c
[12251.016988] [&amp;lt;7f18cfa4&amp;gt;] (composite_setup+0x0/0xce8
[g_mass_storage]) from [&amp;lt;7f00547c&amp;gt;]
(on_end_control_setup_transfer+0x17c/0x298 [f_usb30_udc])
[12251.017047] [&amp;lt;7f005300&amp;gt;] (on_end_control_setup_transfer+0x0/0x298
[f_usb30_udc]) from [&amp;lt;7f00b6bc&amp;gt;]
(on_usb_ss_function_controller+0x634/0x10b4 [f_usb30_udc])
[12251.017069]  r8:fc420000 r7:00000002 r6:f027754c r5:f027750c r4:f0277400
[12251.017134] [&amp;lt;7f00b088&amp;gt;] (on_usb_ss_function_controller+0x0/0x10b4
[f_usb30_udc]) from [&amp;lt;80082a20&amp;gt;] (handle_irq_event_percpu+0x34/0x160)
[12251.017170] [&amp;lt;800829ec&amp;gt;] (handle_irq_event_percpu+0x0/0x160) from
[&amp;lt;80082b90&amp;gt;] (handle_irq_event+0x44/0x64)
[12251.017206] [&amp;lt;80082b4c&amp;gt;] (handle_irq_event+0x0/0x64) from
[&amp;lt;8008501c&amp;gt;] (handle_fasteoi_irq+0xd0/0x11c)
[12251.017223]  r6:00000061 r5:803901c8 r4:80390180 r3:00000000
[12251.017264] [&amp;lt;80084f4c&amp;gt;] (handle_fasteoi_irq+0x0/0x11c) from
[&amp;lt;800824bc&amp;gt;] (generic_handle_irq+0x28/0x38)
[12251.017280]  r5:00000000 r4:00000061
[12251.017321] [&amp;lt;80082494&amp;gt;] (generic_handle_irq+0x0/0x38) from
[&amp;lt;80029080&amp;gt;] (asm_do_IRQ+0x80/0xc0)
[12251.017336]  r4:00000061 r3:00000100
[12251.017367] [&amp;lt;80029000&amp;gt;] (asm_do_IRQ+0x0/0xc0) from [&amp;lt;8002e6cc&amp;gt;]
(__irq_svc+0x4c/0xe0)
[12251.017384] Exception stack(0x8038bf40 to 0x8038bf88)
[12251.017407] bf40: 8038a000 8038a008 8038bf88 00000000 80395334
803ad3a0 800218d4 813cd1e0
[12251.017432] bf60: 4000406a 412fc092 00000000 8038bf94 8038bf98
8038bf88 8002f698 8002f69c
[12251.017449] bf80: 60000013 ffffffff
[12251.017459]  r5:fd100100 r4:ffffffff
[12251.017489] [&amp;lt;8002f670&amp;gt;] (default_idle+0x0/0x30) from [&amp;lt;8002f878&amp;gt;]
(cpu_idle+0x78/0xe0)
[12251.017521] [&amp;lt;8002f800&amp;gt;] (cpu_idle+0x0/0xe0) from [&amp;lt;802be948&amp;gt;]
(rest_init+0x8c/0xa4)
[12251.017536]  r4:8038a000 r3:00000001
[12251.017563] [&amp;lt;802be8bc&amp;gt;] (rest_init+0x0/0xa4) from [&amp;lt;80008928&amp;gt;]
(start_kernel+0x24c/0x28c)
[12251.017579]  r4:8039539c r3:8038a000
[12251.017604] [&amp;lt;800086dc&amp;gt;] (start_kernel+0x0/0x28c) from [&amp;lt;40008040&amp;gt;]
(0x40008040)
[12251.017618]  r7:80398154 r6:800218d0 r5:803952ec r4:10c5387d
[12251.017644] ---[ end trace de8deac85e8d9830 ]---
[12251.017665] f_usb30_udc f_usb30_udc: SETUP transfer to gadget
driver is failed at -95.
[12251.277437] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300)
[12251.280279] ata1.00: configured for UDMA/133
[12251.282971] PM: restore of devices complete after 1884.395 msecs
[12252.247817] Restarting tasks ... done.

  Anyone would like to give me some help?

Best Regards!
ShiJinghui
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>linux fddl</dc:creator>
    <dc:date>2013-05-17T03:58:23</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86522">
    <title>[PATCH] lsusb: Fix bug in USB 2.0 extended caps descriptor.</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86522</link>
    <description>&lt;pre&gt;The upper bits of the USB 2.0 extended capability BOS descriptor weren't
being shifted into the right byte position.  That didn't matter much
before now, but some USB 2.1 devices will soon have a modified BOS
descriptor that has BESL values in those upper bits.

Signed-off-by: Sarah Sharp &amp;lt;sarah.a.sharp-VuQAYsv1563Yd54FQh9/CA&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 lsusb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lsusb.c b/lsusb.c
index d9c7908..fda772a 100644
--- a/lsusb.c
+++ b/lsusb.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -3613,7 +3613,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static void dump_usb2_device_capability_desc(unsigned char *buf)
 unsigned int wide;
 
 wide = buf[3] + (buf[4] &amp;lt;&amp;lt; 8) +
-(buf[5] &amp;lt;&amp;lt; 8) + (buf[6] &amp;lt;&amp;lt; 8);
+(buf[5] &amp;lt;&amp;lt; 16) + (buf[6] &amp;lt;&amp;lt; 24);
 printf("  USB 2.0 Extension Device Capability:\n"
 "    bLength             %5u\n"
 "    bDescriptorType     %5u\n"
&lt;/pre&gt;</description>
    <dc:creator>Sarah Sharp</dc:creator>
    <dc:date>2013-05-16T21:04:42</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86474">
    <title>[PATCH v2] usb: chipidea: udc: configure iso endpoints</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86474</link>
    <description>&lt;pre&gt;This patch adds iso endpoint support to the device controller.
It makes use of the multiplication bits in the maxpacket field
of the endpoint and calculates the multiplier bits for each
transfer description on every request.

Signed-off-by: Michael Grzeschik &amp;lt;m.grzeschik-bIcnvbaLZ9MEGnE8C9+IrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
Changes since v1:
 - fixed style issues and typo
 - changed bitops to human readable operations

 drivers/usb/chipidea/core.c |  2 +-
 drivers/usb/chipidea/udc.c  | 20 +++++++++++++++++++-
 drivers/usb/chipidea/udc.h  |  1 +
 3 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
index 450107e..3cdb889 100644
--- a/drivers/usb/chipidea/core.c
+++ b/drivers/usb/chipidea/core.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -43,7 +43,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
  *
  * TODO List
  * - OTG
- * - Isochronous &amp;amp; Interrupt Traffic
+ * - Interrupt Traffic
  * - Handle requests which spawns into several TDs
  * - GET_STATUS(device) - always reports 0
  * - Gadget API (majority of optional features)
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c
index 519ead2..e9a57bb0 100644
--- a/drivers/usb/chipidea/udc.c
+++ b/drivers/usb/chipidea/udc.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -466,6 +466,14 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int _hardware_enqueue(struct ci13xxx_ep *mEp, struct ci13xxx_req *mReq)
 mEp-&amp;gt;qh.ptr-&amp;gt;td.token &amp;amp;=
 cpu_to_le32(~(TD_STATUS_HALTED|TD_STATUS_ACTIVE));
 
+if (mEp-&amp;gt;type == USB_ENDPOINT_XFER_ISOC) {
+u32 mul = mReq-&amp;gt;req.length / mEp-&amp;gt;ep.maxpacket;
+
+if (mReq-&amp;gt;req.length % mEp-&amp;gt;ep.maxpacket)
+mul++;
+mEp-&amp;gt;qh.ptr-&amp;gt;cap |= mul &amp;lt;&amp;lt; __ffs(QH_MULT);
+}
+
 wmb();   /* synchronize before ep prime */
 
 ret = hw_ep_prime(ci, mEp-&amp;gt;num, mEp-&amp;gt;dir,
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -678,6 +686,12 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int _ep_queue(struct usb_ep *ep, struct usb_request *req,
 }
 }
 
+if (usb_endpoint_xfer_isoc(mEp-&amp;gt;ep.desc) &amp;amp;&amp;amp;
+    mReq-&amp;gt;req.length &amp;gt; (1 + mEp-&amp;gt;ep.mult) * mEp-&amp;gt;ep.maxpacket) {
+dev_err(mEp-&amp;gt;ci-&amp;gt;dev, "request length too big for isochronous\n");
+return -EMSGSIZE;
+}
+
 /* first nuke then test link, e.g. previous status has not sent */
 if (!list_empty(&amp;amp;mReq-&amp;gt;queue)) {
 dev_err(mEp-&amp;gt;ci-&amp;gt;dev, "request already in queue\n");
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1060,7 +1074,8 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int ep_enable(struct usb_ep *ep,
 mEp-&amp;gt;num  = usb_endpoint_num(desc);
 mEp-&amp;gt;type = usb_endpoint_type(desc);
 
-mEp-&amp;gt;ep.maxpacket = usb_endpoint_maxp(desc);
+mEp-&amp;gt;ep.maxpacket = usb_endpoint_maxp(desc) &amp;amp; 0x07ff;
+mEp-&amp;gt;ep.mult = QH_ISO_MULT(usb_endpoint_maxp(desc));
 
 if (mEp-&amp;gt;type == USB_ENDPOINT_XFER_CONTROL)
 cap |= QH_IOS;
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -1246,6 +1261,9 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int ep_set_halt(struct usb_ep *ep, int value)
 if (ep == NULL || mEp-&amp;gt;ep.desc == NULL)
 return -EINVAL;
 
+if (usb_endpoint_xfer_isoc(mEp-&amp;gt;ep.desc))
+return -EOPNOTSUPP;
+
 spin_lock_irqsave(mEp-&amp;gt;lock, flags);
 
 #ifndef STALL_IN
diff --git a/drivers/usb/chipidea/udc.h b/drivers/usb/chipidea/udc.h
index d12e8b5..a75724a 100644
--- a/drivers/usb/chipidea/udc.h
+++ b/drivers/usb/chipidea/udc.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -50,6 +50,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; struct ci13xxx_qh {
 #define QH_MAX_PKT            (0x07FFUL &amp;lt;&amp;lt; 16)
 #define QH_ZLT                BIT(29)
 #define QH_MULT               (0x0003UL &amp;lt;&amp;lt; 30)
+#define QH_ISO_MULT(x)((x &amp;gt;&amp;gt; 11) &amp;amp; 0x03)
 /* 1 */
 u32 curr;
 /* 2 - 8 */
&lt;/pre&gt;</description>
    <dc:creator>Michael Grzeschik</dc:creator>
    <dc:date>2013-05-16T07:53:57</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86420">
    <title>[PATCH 0/2] Add multiple transfer descriptors support to chipidea udc</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86420</link>
    <description>&lt;pre&gt;These patches add support to handle requests which spawn into several TDs.

Michael Grzeschik (2):
  usb: chipidea: udc: manage dynamic amount of tds with an linked list
  usb: chipidea: udc: add multiple td support to hardware_{en,de}queue

 drivers/usb/chipidea/ci.h    |   1 +
 drivers/usb/chipidea/core.c  |   1 -
 drivers/usb/chipidea/debug.c |  19 ++--
 drivers/usb/chipidea/udc.c   | 239 +++++++++++++++++++++++++++++--------------
 drivers/usb/chipidea/udc.h   |  11 +-
 5 files changed, 183 insertions(+), 88 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Michael Grzeschik</dc:creator>
    <dc:date>2013-05-15T15:27:09</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86419">
    <title>[GIT PULL] USB fixes for v3.10-rc2</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86419</link>
    <description>&lt;pre&gt;Hi Greg,

Here's my first set of fixes for v3.10-rc cycle. It's a bit large, but
considering the amount of work we got in the merge window, it looks reasonable.

Let me know if you want me to change anything

cheers

The following changes since commit f722406faae2d073cc1d01063d1123c35425939e:

  Linux 3.10-rc1 (2013-05-11 17:14:08 -0700)

are available in the git repository at:

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

for you to fetch changes up to 4e0aa635d069478e73ad95ff21fd4ae144faa189:

  usb: otg: mxs-phy: add missing type to usb_phy (2013-05-15 17:34:01 +0300)

----------------------------------------------------------------
usb: fixes for v3.10-rc2

Here's the initial set of fixes for v3.10-rc series. It countains miscellaneous
fixes in numerous drivers.

Many gadget drivers and PHY drivers learned that it's not necessary to
platform_set_drvdata() twice, that's not necessary to check the resource
pointer returned by platform_get_resource() when using devm_ioremap_resource()
and they learned that we shouldn't return 0 in case of errors.

DWC3 got a build fix for cases where DWC3 is marked as 'y' while gadget API is
marked as 'm'.

There's also a NULL pointer exception fix on usb_get_phy(), mxs-phy now knows
which PHY type it is and s3c-hsotg is now passing proper arguments to
usb_gadget_unmap_request().

Other than that there are some spelling fixes and kernel-doc warnings.

Signed-of-by: Felipe Balbi &amp;lt;balbi-l0cyMroinI0&amp;lt; at &amp;gt;public.gmane.org&amp;gt;

----------------------------------------------------------------
Jingoo Han (1):
      usb: gadget: s3c-hsotg: pass 'struct usb_request *' to usb_gadget_unmap_request()

Michael Grzeschik (1):
      usb: otg: mxs-phy: add missing type to usb_phy

Paul Bolle (1):
      usb: phy: remove CONFIG_USB_OTG_UTILS once more

Robert Jarzmik (1):
      usb: phy: Fix NULL pointer exception during usb_get_phy

Robert P. J. Day (2):
      Correct typo "supperspeed" to "superspeed".
      Add a couple kernel-doc lines to prevent warnings.

Sachin Kamat (12):
      usb: gadget: atmel_usba_udc: Remove redundant platform_set_drvdata()
      usb: gadget: bcm63xx_udc: Remove redundant platform_set_drvdata()
      usb: gadget: dummy_hcd: Remove redundant platform_set_drvdata()
      usb: gadget: f_uac2: Remove redundant platform_set_drvdata()
      usb: gadget: imx_udc: Remove redundant platform_set_drvdata()
      usb: gadget: pxa25x_udc: Remove redundant platform_set_drvdata()
      usb: gadget: s3c2410_udc: Remove redundant platform_set_drvdata()
      usb: phy: ab8500-usb: Remove redundant platform_set_drvdata()
      usb: phy: gpio-vbus-usb: Remove redundant platform_set_drvdata()
      usb: phy: mv-usb: Remove redundant platform_set_drvdata()
      usb: phy: mxs-usb: Remove redundant platform_set_drvdata()
      usb: phy: nop: Remove redundant platform_set_drvdata()

Vivek Gautam (1):
      usb: dwc3: Fix compilation break when building with USB_DWC3_DUAL_ROLE=y

Wei Yongjun (9):
      usb: gadget: zero: fix error return code in zero_bind()
      usb: musb: omap2430: add missing platform_device_put() on error in omap2430_probe()
      usb: musb: dsps: fix error return code in dsps_create_musb_pdev()
      usb: gadget: s3c2410_udc: fix error return code in s3c2410_udc_probe()
      usb: gadget: r8a66597-udc: fix error return code in r8a66597_probe()
      usb: gadget: m66592-udc: fix error return code in m66592_probe()
      usb: gadget: fusb300_udc: fix error return code in fusb300_probe()
      usb: gadget: dummy_hcd: fix error return code in init()
      usb: gadget: fix error return code in configfs_composite_bind()

Wolfram Sang (2):
      usb: gadget: don't check resource with devm_ioremap_resource
      usb: phy: don't check resource with devm_ioremap_resource

 drivers/staging/dwc2/Kconfig        |  1 -
 drivers/usb/dwc3/Kconfig            |  6 +++---
 drivers/usb/gadget/Kconfig          |  1 -
 drivers/usb/gadget/atmel_usba_udc.c |  2 --
 drivers/usb/gadget/bcm63xx_udc.c    | 11 -----------
 drivers/usb/gadget/configfs.c       |  8 ++++++--
 drivers/usb/gadget/dummy_hcd.c      |  5 +++--
 drivers/usb/gadget/f_ecm.c          |  1 +
 drivers/usb/gadget/f_subset.c       |  1 +
 drivers/usb/gadget/f_uac2.c         |  2 --
 drivers/usb/gadget/fusb300_udc.c    |  4 +++-
 drivers/usb/gadget/imx_udc.c        |  2 --
 drivers/usb/gadget/m66592-udc.c     |  4 +++-
 drivers/usb/gadget/pxa25x_udc.c     |  1 -
 drivers/usb/gadget/r8a66597-udc.c   |  4 +++-
 drivers/usb/gadget/s3c-hsotg.c      |  2 +-
 drivers/usb/gadget/s3c2410_udc.c    |  3 +--
 drivers/usb/gadget/zero.c           |  8 ++++++--
 drivers/usb/musb/musb_dsps.c        |  1 +
 drivers/usb/musb/omap2430.c         |  3 ++-
 drivers/usb/phy/Kconfig             |  1 -
 drivers/usb/phy/phy-ab8500-usb.c    |  2 --
 drivers/usb/phy/phy-fsl-usb.c       |  1 +
 drivers/usb/phy/phy-gpio-vbus-usb.c |  3 +--
 drivers/usb/phy/phy-isp1301.c       |  1 +
 drivers/usb/phy/phy-mv-u3d-usb.c    |  5 -----
 drivers/usb/phy/phy-mv-usb.c        |  3 ---
 drivers/usb/phy/phy-mxs-usb.c       |  8 +-------
 drivers/usb/phy/phy-nop.c           |  2 --
 drivers/usb/phy/phy-samsung-usb2.c  |  5 -----
 drivers/usb/phy/phy-samsung-usb3.c  |  5 -----
 include/linux/usb/gadget.h          |  5 ++---
 32 files changed, 40 insertions(+), 71 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Felipe Balbi</dc:creator>
    <dc:date>2013-05-15T15:25:47</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86411">
    <title>[PATCH] Add isp1763-hcd driver</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86411</link>
    <description>&lt;pre&gt;Derived from isp1760-hcd driver.

isp1763 is different in this way compred to isp1760:
- 16 Proprietary Transfer Descriptor (instead of 32)
- 20 KB payload space (instead of 60KB)
- 16/8 bit parallel bus access (instead of 32/16)
- Not all register are 32-bit
- Timing delay (100 ns) between SKIPMAP writes

TODO:
A bunch of functions can be unified between isp1760-hcd and this driver.

NOTE:
Found to be working on some mass storage device, but failing enumeration
on others on my platform. More testing and tuning per platform maybe
needed.

Signed-off-by: Richard Retanubun &amp;lt;richardretanubun-4VtgCsEi+FIybS5Ee8rs3A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---

 drivers/usb/host/Kconfig       |   15 +
 drivers/usb/host/Makefile      |    2 +
 drivers/usb/host/isp1763-hcd.c | 2366 ++++++++++++++++++++++++++++++++++++++++
 drivers/usb/host/isp1763-hcd.h |  257 +++++
 drivers/usb/host/isp1763-if.c  |  523 +++++++++
 include/linux/usb/isp1763.h    |   37 +
 6 files changed, 3200 insertions(+)
 create mode 100644 drivers/usb/host/isp1763-hcd.c
 create mode 100644 drivers/usb/host/isp1763-hcd.h
 create mode 100644 drivers/usb/host/isp1763-if.c
 create mode 100644 include/linux/usb/isp1763.h

diff --git a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
index c59a112..d1dc278 100644
--- a/drivers/usb/host/Kconfig
+++ b/drivers/usb/host/Kconfig
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -284,6 +284,21 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; config USB_ISP1760_HCD
   To compile this driver as a module, choose M here: the
   module will be called isp1760.
 
+config USB_ISP1763_HCD
+tristate "ISP 1763 HCD support"
+depends on USB
+---help---
+  The ISP1763 chip is a USB 2.0 host controller.
+
+  This driver does not support isochronous transfers or OTG.
+  This USB controller is usually attached to a non-DMA-Master
+  capable bus. NXP's eval kit brings this chip on PCI card
+  where the chip itself is behind a PLB to simulate such
+  a bus.
+
+  To compile this driver as a module, choose M here: the
+  module will be called isp1763.
+
 config USB_ISP1362_HCD
 tristate "ISP1362 HCD support"
 depends on USB
diff --git a/drivers/usb/host/Makefile b/drivers/usb/host/Makefile
index 001fbff..f7dc536 100644
--- a/drivers/usb/host/Makefile
+++ b/drivers/usb/host/Makefile
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -5,6 +5,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
 ccflags-$(CONFIG_USB_DEBUG) := -DDEBUG
 
 isp1760-y := isp1760-hcd.o isp1760-if.o
+isp1763-y := isp1763-hcd.o isp1763-if.o
 
 fhci-y := fhci-hcd.o fhci-hub.o fhci-q.o
 fhci-y += fhci-mem.o fhci-tds.o fhci-sched.o
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -40,6 +41,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; obj-$(CONFIG_USB_SL811_CS)+= sl811_cs.o
 obj-$(CONFIG_USB_U132_HCD)+= u132-hcd.o
 obj-$(CONFIG_USB_R8A66597_HCD)+= r8a66597-hcd.o
 obj-$(CONFIG_USB_ISP1760_HCD)+= isp1760.o
+obj-$(CONFIG_USB_ISP1763_HCD)+= isp1763.o
 obj-$(CONFIG_USB_HWA_HCD)+= hwa-hc.o
 obj-$(CONFIG_USB_IMX21_HCD)+= imx21-hcd.o
 obj-$(CONFIG_USB_FSL_MPH_DR_OF)+= fsl-mph-dr-of.o
diff --git a/drivers/usb/host/isp1763-hcd.c b/drivers/usb/host/isp1763-hcd.c
new file mode 100644
index 0000000..7dd70f9
--- /dev/null
+++ b/drivers/usb/host/isp1763-hcd.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,2366 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Description:
+ *
+ * isp1763 Host Controller Driver
+ *
+ * Based on isp1760 driver by:
+ * Sebastian Andrzej Siewior &amp;lt;sebastian-E0PNVn5OA6ohrxcnuTQ+TQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ * Arvid Brodin &amp;lt;arvid.brodin-6rkEtWRFf40&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ * and pehci hcd from ST-Ericsson wired support &amp;lt;wired.support-0IS4wlFg1OjSUeElwK9/Pw&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ *
+ */
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/moduleparam.h&amp;gt;
+#include &amp;lt;linux/kernel.h&amp;gt;
+#include &amp;lt;linux/slab.h&amp;gt;
+#include &amp;lt;linux/list.h&amp;gt;
+#include &amp;lt;linux/usb.h&amp;gt;
+#include &amp;lt;linux/debugfs.h&amp;gt;
+#include &amp;lt;linux/uaccess.h&amp;gt;
+#include &amp;lt;linux/io.h&amp;gt;
+#include &amp;lt;linux/mm.h&amp;gt;
+#include &amp;lt;linux/timer.h&amp;gt;
+#include &amp;lt;asm/unaligned.h&amp;gt;
+#include &amp;lt;asm/cacheflush.h&amp;gt;
+#include &amp;lt;linux/gpio.h&amp;gt;
+#include &amp;lt;linux/usb/hcd.h&amp;gt;
+#include &amp;lt;linux/usb/isp1763.h&amp;gt;
+
+#include "isp1763-hcd.h"
+
+#define NUM_OF_PTD 16 /* isp1760 have 32 max PTDs; isp 1763 have 16 */
+
+static struct kmem_cache *qtd_cachep;
+static struct kmem_cache *qh_cachep;
+static struct kmem_cache *urb_listitem_cachep;
+
+enum queue_head_types {
+QH_CONTROL,
+QH_BULK,
+QH_INTERRUPT,
+QH_END
+};
+
+struct isp1763_hcd {
+u32 hcs_params;
+spinlock_tlock;
+struct slotinfoatl_slots[NUM_OF_PTD];
+u16atl_done_map;
+struct slotinfoint_slots[NUM_OF_PTD];
+u16int_done_map;
+struct memory_chunk memory_pool[BLOCKS];
+struct list_headqh_list[QH_END];
+
+/* periodic schedule support */
+#defineDEFAULT_I_TDPS1024
+unsignedperiodic_size;
+unsignedi_thresh;
+unsigned longreset_done;
+unsigned longnext_statechange;
+unsigned intdevflags;
+
+intrst_gpio;
+};
+
+static inline struct isp1763_hcd *hcd_to_priv(struct usb_hcd *hcd)
+{
+return (struct isp1763_hcd *) (hcd-&amp;gt;hcd_priv);
+}
+
+/* Section 2.2 Host Controller Capability Registers */
+#define HC_LENGTH(p)(((p)&amp;gt;&amp;gt;00)&amp;amp;0x00ff)/* bits 7:0 */
+#define HC_VERSION(p)(((p)&amp;gt;&amp;gt;16)&amp;amp;0xffff)/* bits 31:16 */
+#define HCS_INDICATOR(p)((p)&amp;amp;(1 &amp;lt;&amp;lt; 16))/* true: has port indicators */
+#define HCS_PPC(p)((p)&amp;amp;(1 &amp;lt;&amp;lt; 4))/* true: port power control */
+#define HCS_N_PORTS(p)(((p)&amp;gt;&amp;gt;0)&amp;amp;0xf)/* bits 3:0, ports on HC */
+#define HCC_ISOC_CACHE(p)       ((p)&amp;amp;(1 &amp;lt;&amp;lt; 7))  /* true: can cache isoc frame */
+#define HCC_ISOC_THRES(p)       (((p)&amp;gt;&amp;gt;4)&amp;amp;0x7)  /* bits 6:4, uframes cached */
+
+/* Section 2.3 Host Controller Operational Registers */
+#define CMD_LRESET(1&amp;lt;&amp;lt;7)/* partial reset (no ports, etc) */
+#define CMD_RESET(1&amp;lt;&amp;lt;1)/* reset HC not bus */
+#define CMD_RUN(1&amp;lt;&amp;lt;0)/* start/stop HC */
+#define STS_PCD(1&amp;lt;&amp;lt;2)/* port change detect */
+#define FLAG_CF(1&amp;lt;&amp;lt;0)/* true: we'll support "high speed" */
+
+#define PORT_OWNER(1&amp;lt;&amp;lt;13)/* true: companion hc owns this port */
+#define PORT_POWER(1&amp;lt;&amp;lt;12)/* true: has power (see PPC) */
+#define PORT_USB11(x) (((x) &amp;amp; (3 &amp;lt;&amp;lt; 10)) == (1 &amp;lt;&amp;lt; 10))/* USB 1.1 device */
+#define PORT_RESET(1&amp;lt;&amp;lt;8)/* reset port */
+#define PORT_SUSPEND(1&amp;lt;&amp;lt;7)/* suspend port */
+#define PORT_RESUME(1&amp;lt;&amp;lt;6)/* resume it */
+#define PORT_PE(1&amp;lt;&amp;lt;2)/* port enable */
+#define PORT_CSC(1&amp;lt;&amp;lt;1)/* connect status change */
+#define PORT_CONNECT(1&amp;lt;&amp;lt;0)/* device connected */
+#define PORT_RWC_BITS   (PORT_CSC)
+
+/* isp1763 does not have HCCPARAMS and HCSPARAMS, use hardcoded values here */
+#define HCS_HARDCODE (1 | (1 &amp;lt;&amp;lt; 4))/* Port Power Control */
+#define HCC_HARDCODE (1 &amp;lt;&amp;lt; 1)/* Programmable Frame List */
+
+struct isp1763_qtd {
+u8 packet_type;
+void *data_buffer;
+u32 payload_addr;
+
+/* the rest is HCD-private */
+struct list_head qtd_list;
+struct urb *urb;
+size_t length;
+size_t actual_length;
+
+/* QTD_ENQUEUED:waiting for transfer (inactive) */
+/* QTD_PAYLOAD_ALLOC:chip mem has been allocated for payload */
+/* QTD_XFER_STARTED:valid ptd has been written to isp176x - only
+interrupt handler may touch this qtd! */
+/* QTD_XFER_COMPLETE:payload has been transferred successfully */
+/* QTD_RETIRE:transfer error/abort qtd */
+#define QTD_ENQUEUED0
+#define QTD_PAYLOAD_ALLOC1
+#define QTD_XFER_STARTED2
+#define QTD_XFER_COMPLETE3
+#define QTD_RETIRE4
+u32 status;
+};
+
+/* Queue head, one for each active endpoint */
+struct isp1763_qh {
+struct list_head qh_list;
+struct list_head qtd_list;
+u32 toggle;
+u32 ping;
+int slot;
+int tt_buffer_dirty;/* See USB2.0 spec section 11.17.5 */
+};
+
+struct urb_listitem {
+struct list_head urb_list;
+struct urb *urb;
+};
+
+/*
+ * Access functions for isp1763 registers
+ */
+static u32 reg_read32(void __iomem *base, u32 reg)
+{
+return readl(base + reg);
+}
+
+static void reg_write32(void __iomem *base, u32 reg, u32 val)
+{
+writel(val, base + reg);
+}
+
+static u16 reg_read16(void __iomem *base, u16 reg)
+{
+return readw(base + reg);
+}
+
+static void reg_write16(void __iomem *base, u16 reg, u16 val)
+{
+writew(val, base + reg);
+}
+
+/*
+ * Read from the memory space of the device (PTD and Payload)
+ *
+ * base    : the device base address
+ * srcaddr : the source (start) address where the data reside on the hcd device
+ * dstptr  : the destination where we want to store the data
+ * bytes   : the amount of data in bytes
+ *
+ * NOTE: isp1763 does not have direct memory maped access with dual banks
+ *       for ptd and payload space like the isp1760.
+ */
+static void isp1763_read_mem(void __iomem *base,
+     u16 srcaddr, u16 *dstptr, u32 bytes)
+{
+/* Write the starting device address to the hcd memory register */
+reg_write16(base, HC_MEMORY_REG, srcaddr);
+ndelay(100); /* Delay between consecutive access */
+
+/* As long there are at least 16-bit to read ... */
+while (bytes &amp;gt;= 2) {
+*dstptr = __raw_readw(base + HC_DATA_REG);
+bytes -= 2;
+dstptr++;
+}
+
+/* If there are no more bytes to read, return */
+if (bytes &amp;lt;= 0)
+return;
+
+*((u8 *)dstptr) = (u8)(readw(base + HC_DATA_REG) &amp;amp; 0xFF);
+}
+
+/*
+ * Write to the memory space of the device (PTD and Payload)
+ *
+ * base     : the device base address
+ * dstaddr  : the destination (start) address where data is to be written
+ * src      : the source of the data we want to write
+ * bytes    : the amount of data in bytes
+ *
+ * NOTE: isp1763 does not have direct memory maped access with dual banks
+ *       for ptd and payload space like the isp1760.
+ */
+static void isp1763_write_mem(void __iomem *base, u16 dstaddr, u16 *src,
+u32 bytes)
+{
+/* Write the starting device address to the hcd memory register */
+reg_write16(base, HC_MEMORY_REG, dstaddr);
+ndelay(100); /* Delay between consecutive access */
+
+while (bytes &amp;gt;= 2) {
+/* Get and write the data; then adjust the data ptr and len */
+__raw_writew(*src, base + HC_DATA_REG);
+bytes -= 2;
+src++;
+}
+
+/* If there are no more bytes to process, return */
+if (bytes &amp;lt;= 0)
+return;
+
+/*
+ * The only way to get here is if there is a single byte left,
+ * get it and write it to the data reg;
+ */
+writew(*((u8 *)src), base + HC_DATA_REG);
+}
+
+/*
+ * Read and write ptds. 'ptd_offset' should be one of ISO_PTD_OFFSET,
+ * INT_PTD_OFFSET, and ATL_PTD_OFFSET. 'slot' should be less than NUM_OF_PTD.
+ */
+static void ptd_read(void __iomem *base, u16 ptd_offset, u16 slot,
+struct ptd *ptd)
+{
+struct ptd temp_ptd;
+
+isp1763_read_mem(base, (u16)(ptd_offset + slot*sizeof(struct ptd)),
+(u16 *)&amp;amp;temp_ptd, sizeof(struct ptd));
+
+/* Normalize the data obtained */
+ptd-&amp;gt;dw0 = le32_to_cpu(temp_ptd.dw0);
+ptd-&amp;gt;dw1 = le32_to_cpu(temp_ptd.dw1);
+ptd-&amp;gt;dw2 = le32_to_cpu(temp_ptd.dw2);
+ptd-&amp;gt;dw3 = le32_to_cpu(temp_ptd.dw3);
+ptd-&amp;gt;dw4 = le32_to_cpu(temp_ptd.dw4);
+ptd-&amp;gt;dw5 = le32_to_cpu(temp_ptd.dw5);
+ptd-&amp;gt;dw6 = le32_to_cpu(temp_ptd.dw6);
+ptd-&amp;gt;dw7 = le32_to_cpu(temp_ptd.dw7);
+
+}
+
+static void ptd_write(void __iomem *base, u16 ptd_offset, u16 slot,
+struct ptd *temp_ptd)
+{
+u16 offset;
+struct ptd ptd;
+
+offset = ptd_offset + slot*sizeof(struct ptd);
+
+/* Normalize the data to be written */
+ptd.dw0 = cpu_to_le32(temp_ptd-&amp;gt;dw0);
+ptd.dw1 = cpu_to_le32(temp_ptd-&amp;gt;dw1);
+ptd.dw2 = cpu_to_le32(temp_ptd-&amp;gt;dw2);
+ptd.dw3 = cpu_to_le32(temp_ptd-&amp;gt;dw3);
+ptd.dw4 = cpu_to_le32(temp_ptd-&amp;gt;dw4);
+ptd.dw5 = cpu_to_le32(temp_ptd-&amp;gt;dw5);
+ptd.dw6 = cpu_to_le32(temp_ptd-&amp;gt;dw6);
+ptd.dw7 = cpu_to_le32(temp_ptd-&amp;gt;dw7);
+
+isp1763_write_mem(base, (u16)(offset + sizeof(ptd.dw0)),
+(u16 *)&amp;amp;(ptd.dw1), 7*sizeof(ptd.dw1));
+
+/* Make sure dw0 gets written last (after other dw's and after payload)
+   since it contains the enable bit */
+wmb();
+
+isp1763_write_mem(base, offset, (u16 *)&amp;amp;(ptd.dw0), sizeof(ptd.dw0));
+}
+
+/* memory management of the 20kb payload on the chip from 0x1000 to 0x5fff */
+static void init_memory(struct isp1763_hcd *priv)
+{
+int i, curr;
+u32 payload_addr;
+
+payload_addr = PAYLOAD_OFFSET;
+for (i = 0; i &amp;lt; BLOCK_1_NUM; i++) {
+priv-&amp;gt;memory_pool[i].start = payload_addr;
+priv-&amp;gt;memory_pool[i].size = BLOCK_1_SIZE;
+priv-&amp;gt;memory_pool[i].free = 1;
+payload_addr += priv-&amp;gt;memory_pool[i].size;
+}
+
+curr = i;
+for (i = 0; i &amp;lt; BLOCK_2_NUM; i++) {
+priv-&amp;gt;memory_pool[curr + i].start = payload_addr;
+priv-&amp;gt;memory_pool[curr + i].size = BLOCK_2_SIZE;
+priv-&amp;gt;memory_pool[curr + i].free = 1;
+payload_addr += priv-&amp;gt;memory_pool[curr + i].size;
+}
+
+curr = i;
+for (i = 0; i &amp;lt; BLOCK_3_NUM; i++) {
+priv-&amp;gt;memory_pool[curr + i].start = payload_addr;
+priv-&amp;gt;memory_pool[curr + i].size = BLOCK_3_SIZE;
+priv-&amp;gt;memory_pool[curr + i].free = 1;
+payload_addr += priv-&amp;gt;memory_pool[curr + i].size;
+}
+
+WARN_ON(payload_addr - priv-&amp;gt;memory_pool[0].start &amp;gt; PAYLOAD_AREA_SIZE);
+}
+
+static void alloc_mem(struct usb_hcd *hcd, struct isp1763_qtd *qtd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int i;
+
+WARN_ON(qtd-&amp;gt;payload_addr);
+
+if (!qtd-&amp;gt;length)
+return;
+
+for (i = 0; i &amp;lt; BLOCKS; i++) {
+if (priv-&amp;gt;memory_pool[i].size &amp;gt;= qtd-&amp;gt;length &amp;amp;&amp;amp;
+priv-&amp;gt;memory_pool[i].free) {
+
+priv-&amp;gt;memory_pool[i].free = 0;
+qtd-&amp;gt;payload_addr = priv-&amp;gt;memory_pool[i].start;
+return;
+}
+}
+}
+
+static void free_mem(struct usb_hcd *hcd, struct isp1763_qtd *qtd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int i;
+
+if (!qtd-&amp;gt;payload_addr)
+return;
+
+for (i = 0; i &amp;lt; BLOCKS; i++) {
+if (priv-&amp;gt;memory_pool[i].start == qtd-&amp;gt;payload_addr) {
+WARN_ON(priv-&amp;gt;memory_pool[i].free);
+priv-&amp;gt;memory_pool[i].free = 1;
+qtd-&amp;gt;payload_addr = 0;
+return;
+}
+}
+
+dev_err(hcd-&amp;gt;self.controller, "%s: Invalid pointer: %08x\n",
+__func__, qtd-&amp;gt;payload_addr);
+WARN_ON(1);
+qtd-&amp;gt;payload_addr = 0;
+}
+
+/* WARNING!
+ * This handshake() function should only be used for 32-bit registers
+ * All the accesses so far seems okay for isp1763, since they only access the
+ * standard EHCI regs, which are all 32-bit.
+ */
+static int handshake(struct usb_hcd *hcd, u32 reg,
+      u32 mask, u32 done, int usec)
+{
+u32 result;
+
+do {
+result = reg_read32(hcd-&amp;gt;regs, reg);
+if (result == ~0)
+return -ENODEV;
+result &amp;amp;= mask;
+if (result == done)
+return 0;
+udelay(1);
+usec--;
+} while (usec &amp;gt; 0);
+return -ETIMEDOUT;
+}
+
+/* reset a non-running (STS_HALT == 1) controller */
+static int ehci_reset(struct usb_hcd *hcd)
+{
+int retval;
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u32 command = reg_read32(hcd-&amp;gt;regs, HC_USBCMD);
+
+command |= CMD_RESET;
+reg_write32(hcd-&amp;gt;regs, HC_USBCMD, command);
+hcd-&amp;gt;state = HC_STATE_HALT;
+priv-&amp;gt;next_statechange = jiffies;
+retval = handshake(hcd, HC_USBCMD,
+    CMD_RESET, 0, 250 * 1000);
+return retval;
+}
+
+static struct isp1763_qh *qh_alloc(gfp_t flags)
+{
+struct isp1763_qh *qh;
+
+qh = kmem_cache_zalloc(qh_cachep, flags);
+if (!qh)
+return NULL;
+
+INIT_LIST_HEAD(&amp;amp;qh-&amp;gt;qh_list);
+INIT_LIST_HEAD(&amp;amp;qh-&amp;gt;qtd_list);
+qh-&amp;gt;slot = -1;
+
+return qh;
+}
+
+static void qh_free(struct isp1763_qh *qh)
+{
+WARN_ON(!list_empty(&amp;amp;qh-&amp;gt;qtd_list));
+WARN_ON(qh-&amp;gt;slot &amp;gt; -1);
+kmem_cache_free(qh_cachep, qh);
+}
+
+/* one-time init, only for memory state */
+static int priv_init(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u32 hcc_params = HCC_HARDCODE; /* Use hardcoded value */
+int i;
+
+spin_lock_init(&amp;amp;priv-&amp;gt;lock);
+
+for (i = 0; i &amp;lt; QH_END; i++)
+INIT_LIST_HEAD(&amp;amp;priv-&amp;gt;qh_list[i]);
+
+/*
+ * hw default: 1K periodic list heads, one per frame.
+ * periodic_size can shrink by USBCMD update if hcc_params allows.
+ */
+priv-&amp;gt;periodic_size = DEFAULT_I_TDPS;
+
+/* full frame cache */
+if (HCC_ISOC_CACHE(hcc_params))
+priv-&amp;gt;i_thresh = 8;
+else /* N microframes cached */
+priv-&amp;gt;i_thresh = 2 + HCC_ISOC_THRES(hcc_params);
+
+return 0;
+}
+
+static int isp1763_hc_setup(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int result;
+u16 scratch, hwmode, swreset;
+
+/* low-level chip reset */
+if (gpio_is_valid(priv-&amp;gt;rst_gpio)) {
+unsigned int rst_lvl;
+
+rst_lvl = (priv-&amp;gt;devflags &amp;amp;
+   ISP1763_FLAG_RESET_ACTIVE_HIGH) ? 1 : 0;
+
+gpio_set_value(priv-&amp;gt;rst_gpio, rst_lvl);
+mdelay(50);
+gpio_set_value(priv-&amp;gt;rst_gpio, !rst_lvl);
+}
+
+/* Setup HW Mode Control: Initialized to HW default of 0x0000 */
+hwmode = 0;
+
+if (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_BUS_WIDTH_8)
+hwmode |= HW_DATA_BUS_8BIT;
+if (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_DACK_POL_HIGH)
+hwmode |= HW_DACK_POL_HIGH;
+if (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_DREQ_POL_HIGH)
+hwmode |= HW_DREQ_POL_HIGH;
+if (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_INTR_POL_HIGH)
+hwmode |= HW_INTR_HIGH_ACT;
+if (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_INTR_EDGE_TRIG)
+hwmode |= HW_INTR_EDGE_TRIG;
+
+pr_info("%s: devflags 0x%x hwmode 0x%x\n", __func__,
+priv-&amp;gt;devflags, hwmode);
+
+/* Programming manual - Host controller register initialization step 1:
+ *
+ * Read the Chip ID register a few times to stabilize the host
+ * controller access. Delays were added before and after the dummy reads
+ * to allow the bus to settle. 2x the specified delays are used because
+ * the spec value works marginally.
+ */
+mdelay(10); /* Delay for: reset to first dummy read operation */
+/* Dummy read(s) to stabilize host controller access */
+scratch = reg_read16(hcd-&amp;gt;regs, HC_CHIP_ID_REG);
+scratch = reg_read16(hcd-&amp;gt;regs, HC_CHIP_ID_REG);
+scratch = reg_read16(hcd-&amp;gt;regs, HC_CHIP_ID_REG);
+mdelay(20); /* 2x Delay for: dummy read to first valid read operation */
+
+/* NOTE: The rest of the config steps is out of order with the
+ * isp1763 programming manual; but same order as isp1760 driver.
+ */
+
+/*
+ * We have to set this first in case we're in 8-bit mode.
+ * Write it twice to ensure correct upper bits if working in 8-bit mode.
+ */
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, hwmode);
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, hwmode);
+
+/* Write a test patten into the scratch register and reread it */
+reg_write16(hcd-&amp;gt;regs, HC_SCRATCH_REG, 0xabcd);
+
+ndelay(100); /* Delay between back-to-back write and read access */
+scratch = reg_read16(hcd-&amp;gt;regs, HC_SCRATCH_REG);
+if (scratch != 0xabcd) {
+dev_err(hcd-&amp;gt;self.controller,
+"Scratch test failed [0x%04x != 0xabcd]\n", scratch);
+return -ENODEV;
+}
+
+/* pre reset */
+reg_write16(hcd-&amp;gt;regs, HC_BUFFER_STATUS_REG, 0);
+reg_write16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG, NO_TRANSFER_ACTIVE);
+reg_write16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG, NO_TRANSFER_ACTIVE);
+reg_write16(hcd-&amp;gt;regs, HC_ISO_PTD_SKIPMAP_REG, NO_TRANSFER_ACTIVE);
+
+/* reset */
+reg_write16(hcd-&amp;gt;regs, HC_RESET_REG, SW_RESET_RESET_ALL);
+mdelay(100);
+reg_write16(hcd-&amp;gt;regs, HC_RESET_REG, SW_RESET_RESET_HC);
+mdelay(100);
+
+result = ehci_reset(hcd);
+if (result)
+return result;
+
+/* Step 11 passed */
+dev_info(hcd-&amp;gt;self.controller, "bus width: %d\n",
+     (priv-&amp;gt;devflags &amp;amp; ISP1763_FLAG_BUS_WIDTH_8) ? 8 : 16);
+
+/* ATL reset */
+swreset = reg_read16(hcd-&amp;gt;regs, HC_RESET_REG);
+reg_write16(hcd-&amp;gt;regs, HC_RESET_REG, swreset | SW_RESET_RESET_ATX);
+mdelay(10);
+reg_write16(hcd-&amp;gt;regs, HC_RESET_REG, swreset);
+
+/*
+ * Re-initialize hwmode after reset, After SWRESET sequence above
+ * the settings are lost.
+ * Write it twice to ensure correct upper bits if working in 8-bit mode.
+ */
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, hwmode);
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, hwmode);
+
+/*
+ * Enable this debug on to double check that HW_MODE
+ * settings are still sane after SWRESET
+ */
+dev_dbg(hcd-&amp;gt;self.controller, "hwmode: 0x%04X\n",
+reg_read16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL));
+
+reg_write16(hcd-&amp;gt;regs, HC_INTERRUPT_ENABLE, INTERRUPT_ENABLE_MASK);
+
+/* Ref: isp1763 programming manual:
+ * 12. Set OTG_DISABLE (bit 10) by writing to the OTG Control register
+ * (set: E4h) and clear SW_SEL_HC_DC (bit 7) by writing to the OTG
+ * Control register (clear: E6h) to configure PORT1 in host mode.
+ *
+ * 13. Clear HC_2_DIS (bit 15) in the OTG Control register (clear: E6h)
+ * to configure PORT2 in host mode.
+ */
+reg_write16(hcd-&amp;gt;regs, HW_OTG_CTRL_SET, HW_OTG_CTRL_OTG_DIS);
+reg_write16(hcd-&amp;gt;regs, HW_OTG_CTRL_CLR, HW_OTG_CTRL_SW_SEL_HC_DC);
+reg_write16(hcd-&amp;gt;regs, HW_OTG_CTRL_CLR, HW_OTG_CTRL_HC_2_DIS);
+mdelay(10);
+
+/* This chip does not have HCSPARAMS register, use a hardcoded value. */
+priv-&amp;gt;hcs_params = HCS_HARDCODE;
+
+return priv_init(hcd);
+}
+
+static u32 base_to_chip(u32 base)
+{
+return (base - 0x400) &amp;gt;&amp;gt; 3;
+}
+
+static int last_qtd_of_urb(struct isp1763_qtd *qtd, struct isp1763_qh *qh)
+{
+struct urb *urb;
+
+if (list_is_last(&amp;amp;qtd-&amp;gt;qtd_list, &amp;amp;qh-&amp;gt;qtd_list))
+return 1;
+
+urb = qtd-&amp;gt;urb;
+qtd = list_entry(qtd-&amp;gt;qtd_list.next, typeof(*qtd), qtd_list);
+return (qtd-&amp;gt;urb != urb);
+}
+
+/* magic numbers that can affect system performance */
+#defineEHCI_TUNE_CERR3/* 0-3 qtd retries; 0 == don't stop */
+#defineEHCI_TUNE_RL_HS4/* nak throttle; see 4.9 */
+#defineEHCI_TUNE_RL_TT0
+#defineEHCI_TUNE_MULT_HS1/* 1-3 transactions/uframe; 4.10.3 */
+#defineEHCI_TUNE_MULT_TT1
+#defineEHCI_TUNE_FLS2/* (small) 256 frame schedule */
+
+static void create_ptd_atl(struct isp1763_qh *qh,
+struct isp1763_qtd *qtd, struct ptd *ptd)
+{
+u32 maxpacket;
+u32 multi;
+u32 rl = RL_COUNTER;
+u32 nak = NAK_COUNTER;
+
+memset(ptd, 0, sizeof(*ptd));
+
+/* according to 3.6.2, max packet len can not be &amp;gt; 0x400 */
+maxpacket = usb_maxpacket(qtd-&amp;gt;urb-&amp;gt;dev, qtd-&amp;gt;urb-&amp;gt;pipe,
+usb_pipeout(qtd-&amp;gt;urb-&amp;gt;pipe));
+multi =  1 + ((maxpacket &amp;gt;&amp;gt; 11) &amp;amp; 0x3);
+maxpacket &amp;amp;= 0x7ff;
+
+/* DW0 */
+ptd-&amp;gt;dw0 = DW0_VALID_BIT;
+ptd-&amp;gt;dw0 |= TO_DW0_LENGTH(qtd-&amp;gt;length);
+ptd-&amp;gt;dw0 |= TO_DW0_MAXPACKET(maxpacket);
+ptd-&amp;gt;dw0 |= TO_DW0_ENDPOINT(usb_pipeendpoint(qtd-&amp;gt;urb-&amp;gt;pipe));
+
+/* DW1 */
+ptd-&amp;gt;dw1 = usb_pipeendpoint(qtd-&amp;gt;urb-&amp;gt;pipe) &amp;gt;&amp;gt; 1;
+ptd-&amp;gt;dw1 |= TO_DW1_DEVICE_ADDR(usb_pipedevice(qtd-&amp;gt;urb-&amp;gt;pipe));
+ptd-&amp;gt;dw1 |= TO_DW1_PID_TOKEN(qtd-&amp;gt;packet_type);
+
+if (usb_pipebulk(qtd-&amp;gt;urb-&amp;gt;pipe))
+ptd-&amp;gt;dw1 |= DW1_TRANS_BULK;
+else if  (usb_pipeint(qtd-&amp;gt;urb-&amp;gt;pipe))
+ptd-&amp;gt;dw1 |= DW1_TRANS_INT;
+
+if (qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed != USB_SPEED_HIGH) {
+/* split transaction */
+ptd-&amp;gt;dw1 |= DW1_TRANS_SPLIT;
+if (qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed == USB_SPEED_LOW)
+ptd-&amp;gt;dw1 |= DW1_SE_USB_LOSPEED;
+
+ptd-&amp;gt;dw1 |= TO_DW1_PORT_NUM(qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;ttport);
+ptd-&amp;gt;dw1 |= TO_DW1_HUB_NUM(qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;tt-&amp;gt;hub-&amp;gt;devnum);
+
+/* SE bit for Split INT transfers */
+if (usb_pipeint(qtd-&amp;gt;urb-&amp;gt;pipe) &amp;amp;&amp;amp;
+(qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed == USB_SPEED_LOW))
+ptd-&amp;gt;dw1 |= 2 &amp;lt;&amp;lt; 16;
+
+rl = 0;
+nak = 0;
+} else {
+ptd-&amp;gt;dw0 |= TO_DW0_MULTI(multi);
+if (usb_pipecontrol(qtd-&amp;gt;urb-&amp;gt;pipe) ||
+usb_pipebulk(qtd-&amp;gt;urb-&amp;gt;pipe))
+ptd-&amp;gt;dw3 |= TO_DW3_PING(qh-&amp;gt;ping);
+}
+/* DW2 */
+ptd-&amp;gt;dw2 = 0;
+ptd-&amp;gt;dw2 |= TO_DW2_DATA_START_ADDR(base_to_chip(qtd-&amp;gt;payload_addr));
+ptd-&amp;gt;dw2 |= TO_DW2_RL(rl);
+
+/* DW3 */
+ptd-&amp;gt;dw3 |= TO_DW3_NAKCOUNT(nak);
+ptd-&amp;gt;dw3 |= TO_DW3_DATA_TOGGLE(qh-&amp;gt;toggle);
+if (usb_pipecontrol(qtd-&amp;gt;urb-&amp;gt;pipe)) {
+if (qtd-&amp;gt;data_buffer == qtd-&amp;gt;urb-&amp;gt;setup_packet)
+ptd-&amp;gt;dw3 &amp;amp;= ~TO_DW3_DATA_TOGGLE(1);
+else if (last_qtd_of_urb(qtd, qh))
+ptd-&amp;gt;dw3 |= TO_DW3_DATA_TOGGLE(1);
+}
+
+ptd-&amp;gt;dw3 |= DW3_ACTIVE_BIT;
+/* Cerr */
+ptd-&amp;gt;dw3 |= TO_DW3_CERR(ERR_COUNTER);
+}
+
+/* Ref: ST-Ericsson isp1763 pehci driver: qtdptd.c: phci_hcd_qhint_schedule() */
+static void transform_add_int(struct isp1763_qh *qh,
+struct isp1763_qtd *qtd, struct ptd *ptd)
+{
+u32 usof;
+u32 period;
+
+/*
+ * Most of this is guessing. ISP1761 datasheet is quite unclear, and
+ * the algorithm from the original Philips driver code, which was
+ * pretty much used in this driver before as well, is quite horrendous
+ * and, i believe, incorrect. The code below follows the datasheet and
+ * USB2.0 spec as far as I can tell, and plug/unplug seems to be much
+ * more reliable this way (fingers crossed...).
+ */
+if (qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed == USB_SPEED_HIGH) {
+/* urb-&amp;gt;interval is in units of microframes (1/8 ms) */
+period = qtd-&amp;gt;urb-&amp;gt;interval &amp;gt;&amp;gt; 3;
+
+if (qtd-&amp;gt;urb-&amp;gt;interval &amp;gt; 4)
+usof = 0x01; /* One bit set =&amp;gt;
+interval 1 ms * uFrame-match */
+else if (qtd-&amp;gt;urb-&amp;gt;interval &amp;gt; 2)
+usof = 0x22; /* Two bits set =&amp;gt; interval 1/2 ms */
+else if (qtd-&amp;gt;urb-&amp;gt;interval &amp;gt; 1)
+usof = 0x55; /* Four bits set =&amp;gt; interval 1/4 ms */
+else
+usof = 0xff; /* All bits set =&amp;gt; interval 1/8 ms */
+} else {
+/* urb-&amp;gt;interval is in units of frames (1 ms) */
+period = qtd-&amp;gt;urb-&amp;gt;interval;
+usof = 0x0f;/* Execute Start Split on any of the
+   four first uFrames */
+
+/*
+ * First 8 bits in dw5 is uSCS and "specifies which uSOF the
+ * complete split needs to be sent. Valid only for IN." Also,
+ * "All bits can be set to one for every transfer." (p 81,
+ * ISP1763 data sheet.) 0x1c is from Philips driver. Where did
+ * that number come from? 0xff seems to work fine...
+ */
+/* ptd-&amp;gt;dw5 = 0x1c; */
+/* Execute Complete Split on any uFrame */
+ptd-&amp;gt;dw5 = 0xff;
+}
+
+period = period &amp;gt;&amp;gt; 1;/* Ensure equal or shorter period than requested */
+period &amp;amp;= 0xf8; /* Mask off too large values and lowest unused 3 bits */
+
+ptd-&amp;gt;dw2 |= period;
+ptd-&amp;gt;dw4 = usof;
+}
+
+static void create_ptd_int(struct isp1763_qh *qh,
+struct isp1763_qtd *qtd, struct ptd *ptd)
+{
+create_ptd_atl(qh, qtd, ptd);
+transform_add_int(qh, qtd, ptd);
+}
+
+static void isp1763_urb_done(struct usb_hcd *hcd, struct urb *urb)
+__releases(priv-&amp;gt;lock)
+__acquires(priv-&amp;gt;lock)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+
+if (!urb-&amp;gt;unlinked) {
+if (urb-&amp;gt;status == -EINPROGRESS)
+urb-&amp;gt;status = 0;
+}
+
+if (usb_pipein(urb-&amp;gt;pipe) &amp;amp;&amp;amp; usb_pipetype(urb-&amp;gt;pipe) != PIPE_CONTROL) {
+void *ptr;
+for (ptr = urb-&amp;gt;transfer_buffer;
+     ptr &amp;lt; urb-&amp;gt;transfer_buffer + urb-&amp;gt;transfer_buffer_length;
+     ptr += PAGE_SIZE)
+flush_dcache_page(virt_to_page(ptr));
+}
+
+/* complete() can reenter this HCD */
+usb_hcd_unlink_urb_from_ep(hcd, urb);
+spin_unlock(&amp;amp;priv-&amp;gt;lock);
+usb_hcd_giveback_urb(hcd, urb, urb-&amp;gt;status);
+spin_lock(&amp;amp;priv-&amp;gt;lock);
+}
+
+static struct isp1763_qtd *qtd_alloc(gfp_t flags, struct urb *urb,
+u8 packet_type)
+{
+struct isp1763_qtd *qtd;
+
+qtd = kmem_cache_zalloc(qtd_cachep, flags);
+if (!qtd)
+return NULL;
+
+INIT_LIST_HEAD(&amp;amp;qtd-&amp;gt;qtd_list);
+qtd-&amp;gt;urb = urb;
+qtd-&amp;gt;packet_type = packet_type;
+qtd-&amp;gt;status = QTD_ENQUEUED;
+qtd-&amp;gt;actual_length = 0;
+
+return qtd;
+}
+
+static void qtd_free(struct isp1763_qtd *qtd)
+{
+WARN_ON(qtd-&amp;gt;payload_addr);
+kmem_cache_free(qtd_cachep, qtd);
+}
+
+static void start_bus_transfer(struct usb_hcd *hcd, u16 ptd_offset, int slot,
+struct slotinfo *slots, struct isp1763_qtd *qtd,
+struct isp1763_qh *qh, struct ptd *ptd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int skip_map;
+
+WARN_ON((slot &amp;lt; 0) || (slot &amp;gt; (NUM_OF_PTD - 1)));
+WARN_ON(qtd-&amp;gt;length &amp;amp;&amp;amp; !qtd-&amp;gt;payload_addr);
+WARN_ON(slots[slot].qtd);
+WARN_ON(slots[slot].qh);
+WARN_ON(qtd-&amp;gt;status != QTD_PAYLOAD_ALLOC);
+
+/* Make sure done map has not triggered from some unlinked transfer */
+if (ptd_offset == ATL_PTD_OFFSET) {
+priv-&amp;gt;atl_done_map |= reg_read16(hcd-&amp;gt;regs,
+HC_ATL_PTD_DONEMAP_REG);
+priv-&amp;gt;atl_done_map &amp;amp;= ~(1 &amp;lt;&amp;lt; slot);
+} else {
+priv-&amp;gt;int_done_map |= reg_read16(hcd-&amp;gt;regs,
+HC_INT_PTD_DONEMAP_REG);
+priv-&amp;gt;int_done_map &amp;amp;= ~(1 &amp;lt;&amp;lt; slot);
+}
+
+qh-&amp;gt;slot = slot;
+qtd-&amp;gt;status = QTD_XFER_STARTED;
+slots[slot].timestamp = jiffies;
+slots[slot].qtd = qtd;
+slots[slot].qh = qh;
+ptd_write(hcd-&amp;gt;regs, ptd_offset, slot, ptd);
+
+if (ptd_offset == ATL_PTD_OFFSET) {
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG);
+skip_map &amp;amp;= ~(1 &amp;lt;&amp;lt; qh-&amp;gt;slot);
+reg_write16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG, skip_map);
+} else {
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG);
+skip_map &amp;amp;= ~(1 &amp;lt;&amp;lt; qh-&amp;gt;slot);
+reg_write16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG, skip_map);
+}
+}
+
+static int is_short_bulk(struct isp1763_qtd *qtd)
+{
+return (usb_pipebulk(qtd-&amp;gt;urb-&amp;gt;pipe) &amp;amp;&amp;amp;
+(qtd-&amp;gt;actual_length &amp;lt; qtd-&amp;gt;length));
+}
+
+static void collect_qtds(struct usb_hcd *hcd, struct isp1763_qh *qh,
+struct list_head *urb_list)
+{
+int last_qtd;
+struct isp1763_qtd *qtd, *qtd_next;
+struct urb_listitem *urb_listitem;
+
+list_for_each_entry_safe(qtd, qtd_next, &amp;amp;qh-&amp;gt;qtd_list, qtd_list) {
+if (qtd-&amp;gt;status &amp;lt; QTD_XFER_COMPLETE)
+break;
+
+last_qtd = last_qtd_of_urb(qtd, qh);
+
+if ((!last_qtd) &amp;amp;&amp;amp; (qtd-&amp;gt;status == QTD_RETIRE))
+qtd_next-&amp;gt;status = QTD_RETIRE;
+
+if (qtd-&amp;gt;status == QTD_XFER_COMPLETE) {
+if (qtd-&amp;gt;actual_length) {
+switch (qtd-&amp;gt;packet_type) {
+case IN_PID:
+isp1763_read_mem(hcd-&amp;gt;regs,
+qtd-&amp;gt;payload_addr,
+qtd-&amp;gt;data_buffer,
+qtd-&amp;gt;actual_length);
+/* Fall through (?) */
+case OUT_PID:
+qtd-&amp;gt;urb-&amp;gt;actual_length +=
+qtd-&amp;gt;actual_length;
+/* Fall through ... */
+case SETUP_PID:
+break;
+}
+}
+
+if (is_short_bulk(qtd)) {
+if (qtd-&amp;gt;urb-&amp;gt;transfer_flags &amp;amp; URB_SHORT_NOT_OK)
+qtd-&amp;gt;urb-&amp;gt;status = -EREMOTEIO;
+if (!last_qtd)
+qtd_next-&amp;gt;status = QTD_RETIRE;
+}
+}
+
+if (qtd-&amp;gt;payload_addr)
+free_mem(hcd, qtd);
+
+if (last_qtd) {
+if ((qtd-&amp;gt;status == QTD_RETIRE) &amp;amp;&amp;amp;
+(qtd-&amp;gt;urb-&amp;gt;status == -EINPROGRESS))
+qtd-&amp;gt;urb-&amp;gt;status = -EPIPE;
+/* Defer calling of urb_done() since it releases lock */
+urb_listitem = kmem_cache_zalloc(urb_listitem_cachep,
+GFP_ATOMIC);
+if (unlikely(!urb_listitem))
+break; /* Try again on next call */
+urb_listitem-&amp;gt;urb = qtd-&amp;gt;urb;
+list_add_tail(&amp;amp;urb_listitem-&amp;gt;urb_list, urb_list);
+}
+
+list_del(&amp;amp;qtd-&amp;gt;qtd_list);
+qtd_free(qtd);
+}
+}
+
+#define ENQUEUE_DEPTH2
+static void enqueue_qtds(struct usb_hcd *hcd, struct isp1763_qh *qh)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int ptd_offset;
+struct slotinfo *slots;
+int curr_slot, free_slot;
+int n;
+struct ptd ptd;
+struct isp1763_qtd *qtd;
+
+if (unlikely(list_empty(&amp;amp;qh-&amp;gt;qtd_list))) {
+WARN_ON(1);
+return;
+}
+
+/* Make sure this endpoint's TT buffer is clean before queueing ptds */
+if (qh-&amp;gt;tt_buffer_dirty)
+return;
+
+if (usb_pipeint(list_entry(qh-&amp;gt;qtd_list.next, struct isp1763_qtd,
+qtd_list)-&amp;gt;urb-&amp;gt;pipe)) {
+ptd_offset = INT_PTD_OFFSET;
+slots = priv-&amp;gt;int_slots;
+} else {
+ptd_offset = ATL_PTD_OFFSET;
+slots = priv-&amp;gt;atl_slots;
+}
+
+free_slot = -1;
+for (curr_slot = 0; curr_slot &amp;lt; NUM_OF_PTD; curr_slot++) {
+if ((free_slot == -1) &amp;amp;&amp;amp; (slots[curr_slot].qtd == NULL))
+free_slot = curr_slot;
+if (slots[curr_slot].qh == qh)
+break;
+}
+
+n = 0;
+list_for_each_entry(qtd, &amp;amp;qh-&amp;gt;qtd_list, qtd_list) {
+if (qtd-&amp;gt;status == QTD_ENQUEUED) {
+WARN_ON(qtd-&amp;gt;payload_addr);
+alloc_mem(hcd, qtd);
+if ((qtd-&amp;gt;length) &amp;amp;&amp;amp; (!qtd-&amp;gt;payload_addr))
+break;
+
+if ((qtd-&amp;gt;length) &amp;amp;&amp;amp;
+    ((qtd-&amp;gt;packet_type == SETUP_PID) ||
+     (qtd-&amp;gt;packet_type == OUT_PID))) {
+isp1763_write_mem(hcd-&amp;gt;regs, qtd-&amp;gt;payload_addr,
+qtd-&amp;gt;data_buffer, qtd-&amp;gt;length);
+}
+
+qtd-&amp;gt;status = QTD_PAYLOAD_ALLOC;
+}
+
+if (qtd-&amp;gt;status == QTD_PAYLOAD_ALLOC) {
+/*
+if ((curr_slot &amp;gt; (NUM_OF_PTD-1)) &amp;amp;&amp;amp; (free_slot == -1))
+dev_dbg(hcd-&amp;gt;self.controller, "%s: No slot "
+"available for transfer\n", __func__);
+*/
+/* Start xfer for this endpoint if not already done */
+if ((curr_slot &amp;gt; (NUM_OF_PTD-1)) &amp;amp;&amp;amp; (free_slot &amp;gt; -1)) {
+if (usb_pipeint(qtd-&amp;gt;urb-&amp;gt;pipe))
+create_ptd_int(qh, qtd, &amp;amp;ptd);
+else
+create_ptd_atl(qh, qtd, &amp;amp;ptd);
+
+start_bus_transfer(hcd, ptd_offset, free_slot,
+slots, qtd, qh, &amp;amp;ptd);
+curr_slot = free_slot;
+}
+
+n++;
+if (n &amp;gt;= ENQUEUE_DEPTH)
+break;
+}
+}
+}
+
+static void schedule_ptds(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv;
+struct isp1763_qh *qh, *qh_next;
+struct list_head *ep_queue;
+LIST_HEAD(urb_list);
+struct urb_listitem *urb_listitem, *urb_listitem_next;
+int i;
+
+if (!hcd) {
+WARN_ON(1);
+return;
+}
+
+priv = hcd_to_priv(hcd);
+
+/*
+ * check finished/retired xfers, transfer payloads, call urb_done()
+ */
+for (i = 0; i &amp;lt; QH_END; i++) {
+ep_queue = &amp;amp;priv-&amp;gt;qh_list[i];
+list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list) {
+collect_qtds(hcd, qh, &amp;amp;urb_list);
+if (list_empty(&amp;amp;qh-&amp;gt;qtd_list))
+list_del(&amp;amp;qh-&amp;gt;qh_list);
+}
+}
+
+list_for_each_entry_safe(urb_listitem, urb_listitem_next, &amp;amp;urb_list,
+urb_list) {
+isp1763_urb_done(hcd, urb_listitem-&amp;gt;urb);
+kmem_cache_free(urb_listitem_cachep, urb_listitem);
+}
+
+/*
+ * Schedule packets for transfer.
+ *
+ * According to USB2.0 specification:
+ *
+ * 1st prio: interrupt xfers, up to 80 % of bandwidth
+ * 2nd prio: control xfers
+ * 3rd prio: bulk xfers
+ *
+ * ... but let's use a simpler scheme here (mostly because ISP1761 doc
+ * is very unclear on how to prioritize traffic):
+ *
+ * 1) Enqueue any queued control transfers, as long as payload chip mem
+ *    and PTD ATL slots are available.
+ * 2) Enqueue any queued INT transfers, as long as payload chip mem
+ *    and PTD INT slots are available.
+ * 3) Enqueue any queued bulk transfers, as long as payload chip mem
+ *    and PTD ATL slots are available.
+ *
+ * Use double buffering (ENQUEUE_DEPTH==2) as a compromise between
+ * conservation of chip mem and performance.
+ *
+ * I'm sure this scheme could be improved upon!
+ */
+for (i = 0; i &amp;lt; QH_END; i++) {
+ep_queue = &amp;amp;priv-&amp;gt;qh_list[i];
+list_for_each_entry_safe(qh, qh_next, ep_queue, qh_list)
+enqueue_qtds(hcd, qh);
+}
+}
+
+#define PTD_STATE_QTD_DONE1
+#define PTD_STATE_QTD_RELOAD2
+#define PTD_STATE_URB_RETIRE3
+
+static int check_int_transfer(struct usb_hcd *hcd, struct ptd *ptd,
+struct urb *urb)
+{
+__dw dw4;
+int i;
+
+dw4 = ptd-&amp;gt;dw4;
+dw4 &amp;gt;&amp;gt;= 8;
+
+/* FIXME: ISP1761 datasheet does not say what to do with these. Do we
+   need to handle these errors? Is it done in hardware? */
+
+if (ptd-&amp;gt;dw3 &amp;amp; DW3_HALT_BIT) {
+
+urb-&amp;gt;status = -EPROTO; /* Default unknown error */
+
+for (i = 0; i &amp;lt; 8; i++) {
+switch (dw4 &amp;amp; 0x7) {
+case INT_UNDERRUN:
+dev_dbg(hcd-&amp;gt;self.controller, "%s: underrun "
+"during uFrame %d\n",
+__func__, i);
+urb-&amp;gt;status = -ECOMM; /* Could not write data */
+break;
+case INT_EXACT:
+dev_dbg(hcd-&amp;gt;self.controller, "%s: transaction "
+"error during uFrame %d\n",
+__func__, i);
+urb-&amp;gt;status = -EPROTO; /* timeout, bad CRC, PID
+  error etc. */
+break;
+case INT_BABBLE:
+dev_dbg(hcd-&amp;gt;self.controller, "%s: babble "
+"error during uFrame %d\n",
+__func__, i);
+urb-&amp;gt;status = -EOVERFLOW;
+break;
+}
+dw4 &amp;gt;&amp;gt;= 3;
+}
+
+return PTD_STATE_URB_RETIRE;
+}
+
+return PTD_STATE_QTD_DONE;
+}
+
+static int check_atl_transfer(struct usb_hcd *hcd, struct ptd *ptd,
+struct urb *urb)
+{
+WARN_ON(!ptd);
+if (ptd-&amp;gt;dw3 &amp;amp; DW3_HALT_BIT) {
+if (ptd-&amp;gt;dw3 &amp;amp; DW3_BABBLE_BIT)
+urb-&amp;gt;status = -EOVERFLOW;
+else if (FROM_DW3_CERR(ptd-&amp;gt;dw3))
+urb-&amp;gt;status = -EPIPE;  /* Stall */
+else if (ptd-&amp;gt;dw3 &amp;amp; DW3_ERROR_BIT)
+urb-&amp;gt;status = -EPROTO; /* XactErr */
+else
+urb-&amp;gt;status = -EPROTO; /* Unknown */
+/*
+dev_dbg(hcd-&amp;gt;self.controller, "%s: ptd error:\n"
+"        dw0: %08x dw1: %08x dw2: %08x dw3: %08x\n"
+"        dw4: %08x dw5: %08x dw6: %08x dw7: %08x\n",
+__func__,
+ptd-&amp;gt;dw0, ptd-&amp;gt;dw1, ptd-&amp;gt;dw2, ptd-&amp;gt;dw3,
+ptd-&amp;gt;dw4, ptd-&amp;gt;dw5, ptd-&amp;gt;dw6, ptd-&amp;gt;dw7);
+*/
+return PTD_STATE_URB_RETIRE;
+}
+
+if ((ptd-&amp;gt;dw3 &amp;amp; DW3_ERROR_BIT) &amp;amp;&amp;amp; (ptd-&amp;gt;dw3 &amp;amp; DW3_ACTIVE_BIT)) {
+/* Transfer Error, *but* active and no HALT -&amp;gt; reload */
+dev_dbg(hcd-&amp;gt;self.controller, "PID error; reloading ptd\n");
+return PTD_STATE_QTD_RELOAD;
+}
+
+if (!FROM_DW3_NAKCOUNT(ptd-&amp;gt;dw3) &amp;amp;&amp;amp; (ptd-&amp;gt;dw3 &amp;amp; DW3_ACTIVE_BIT)) {
+/*
+ * NAKs are handled in HW by the chip. Usually if the
+ * device is not able to send data fast enough.
+ * This happens mostly on slower hardware.
+ */
+return PTD_STATE_QTD_RELOAD;
+}
+
+return PTD_STATE_QTD_DONE;
+}
+
+static void handle_done_ptds(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+struct ptd ptd;
+struct isp1763_qh *qh;
+int slot;
+int state;
+struct slotinfo *slots;
+u32 ptd_offset;
+struct isp1763_qtd *qtd;
+u16 modified;
+int skip_map;
+
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG);
+priv-&amp;gt;int_done_map &amp;amp;= ~skip_map;
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG);
+priv-&amp;gt;atl_done_map &amp;amp;= ~skip_map;
+
+modified = priv-&amp;gt;int_done_map || priv-&amp;gt;atl_done_map;
+
+while (priv-&amp;gt;int_done_map || priv-&amp;gt;atl_done_map) {
+if (priv-&amp;gt;int_done_map) {
+/* INT ptd */
+slot = __ffs((u32)priv-&amp;gt;int_done_map);
+priv-&amp;gt;int_done_map &amp;amp;= ~(1 &amp;lt;&amp;lt; slot);
+slots = priv-&amp;gt;int_slots;
+/* This should not trigger, and could be removed if
+   noone have any problems with it triggering: */
+if (!slots[slot].qh) {
+WARN_ON(1);
+continue;
+}
+ptd_offset = INT_PTD_OFFSET;
+ptd_read(hcd-&amp;gt;regs, INT_PTD_OFFSET, slot, &amp;amp;ptd);
+state = check_int_transfer(hcd, &amp;amp;ptd,
+slots[slot].qtd-&amp;gt;urb);
+} else {
+/* ATL ptd */
+slot = __ffs((u32)priv-&amp;gt;atl_done_map);
+priv-&amp;gt;atl_done_map &amp;amp;= ~(1 &amp;lt;&amp;lt; slot);
+slots = priv-&amp;gt;atl_slots;
+/* This should not trigger, and could be removed if
+   noone have any problems with it triggering: */
+if (!slots[slot].qh) {
+WARN_ON(1);
+continue;
+}
+ptd_offset = ATL_PTD_OFFSET;
+ptd_read(hcd-&amp;gt;regs, ATL_PTD_OFFSET, slot, &amp;amp;ptd);
+state = check_atl_transfer(hcd, &amp;amp;ptd,
+slots[slot].qtd-&amp;gt;urb);
+}
+
+qtd = slots[slot].qtd;
+slots[slot].qtd = NULL;
+qh = slots[slot].qh;
+slots[slot].qh = NULL;
+qh-&amp;gt;slot = -1;
+
+WARN_ON(qtd-&amp;gt;status != QTD_XFER_STARTED);
+
+switch (state) {
+case PTD_STATE_QTD_DONE:
+if ((usb_pipeint(qtd-&amp;gt;urb-&amp;gt;pipe)) &amp;amp;&amp;amp;
+       (qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed != USB_SPEED_HIGH))
+qtd-&amp;gt;actual_length =
+       FROM_DW3_SCS_NRBYTESTRANSFERRED(ptd.dw3);
+else
+qtd-&amp;gt;actual_length =
+FROM_DW3_NRBYTESTRANSFERRED(ptd.dw3);
+
+qtd-&amp;gt;status = QTD_XFER_COMPLETE;
+if (list_is_last(&amp;amp;qtd-&amp;gt;qtd_list, &amp;amp;qh-&amp;gt;qtd_list) ||
+is_short_bulk(qtd))
+qtd = NULL;
+else
+qtd = list_entry(qtd-&amp;gt;qtd_list.next,
+typeof(*qtd), qtd_list);
+
+qh-&amp;gt;toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3);
+qh-&amp;gt;ping = FROM_DW3_PING(ptd.dw3);
+break;
+
+case PTD_STATE_QTD_RELOAD: /* QTD_RETRY, for atls only */
+qtd-&amp;gt;status = QTD_PAYLOAD_ALLOC;
+ptd.dw0 |= DW0_VALID_BIT;
+/* RL counter = ERR counter */
+ptd.dw3 &amp;amp;= ~TO_DW3_NAKCOUNT(0xf);
+ptd.dw3 |= TO_DW3_NAKCOUNT(FROM_DW2_RL(ptd.dw2));
+ptd.dw3 &amp;amp;= ~TO_DW3_CERR(3);
+ptd.dw3 |= TO_DW3_CERR(ERR_COUNTER);
+qh-&amp;gt;toggle = FROM_DW3_DATA_TOGGLE(ptd.dw3);
+qh-&amp;gt;ping = FROM_DW3_PING(ptd.dw3);
+break;
+
+case PTD_STATE_URB_RETIRE:
+qtd-&amp;gt;status = QTD_RETIRE;
+if ((qtd-&amp;gt;urb-&amp;gt;dev-&amp;gt;speed != USB_SPEED_HIGH) &amp;amp;&amp;amp;
+(qtd-&amp;gt;urb-&amp;gt;status != -EPIPE) &amp;amp;&amp;amp;
+(qtd-&amp;gt;urb-&amp;gt;status != -EREMOTEIO)) {
+qh-&amp;gt;tt_buffer_dirty = 1;
+if (usb_hub_clear_tt_buffer(qtd-&amp;gt;urb))
+/* Clear failed; let's hope things work
+   anyway */
+qh-&amp;gt;tt_buffer_dirty = 0;
+}
+qtd = NULL;
+qh-&amp;gt;toggle = 0;
+qh-&amp;gt;ping = 0;
+break;
+
+default:
+WARN_ON(1);
+continue;
+}
+
+if (qtd &amp;amp;&amp;amp; (qtd-&amp;gt;status == QTD_PAYLOAD_ALLOC)) {
+if (slots == priv-&amp;gt;int_slots) {
+if (state == PTD_STATE_QTD_RELOAD)
+dev_err(hcd-&amp;gt;self.controller,
+"%s: PTD_STATE_QTD_RELOAD on "
+"interrupt packet\n", __func__);
+if (state != PTD_STATE_QTD_RELOAD)
+create_ptd_int(qh, qtd, &amp;amp;ptd);
+} else {
+if (state != PTD_STATE_QTD_RELOAD)
+create_ptd_atl(qh, qtd, &amp;amp;ptd);
+}
+
+start_bus_transfer(hcd, ptd_offset, slot, slots, qtd,
+qh, &amp;amp;ptd);
+}
+}
+
+if (modified)
+schedule_ptds(hcd);
+}
+
+static irqreturn_t isp1763_irq(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u16 imask;
+irqreturn_t irqret = IRQ_NONE;
+
+spin_lock(&amp;amp;priv-&amp;gt;lock);
+
+if (!(hcd-&amp;gt;state &amp;amp; HC_STATE_RUNNING))
+goto leave;
+
+imask = reg_read16(hcd-&amp;gt;regs, HC_INTERRUPT_REG);
+if (unlikely(!imask))
+goto leave;
+reg_write16(hcd-&amp;gt;regs, HC_INTERRUPT_REG, imask); /* Clear */
+
+priv-&amp;gt;int_done_map |= reg_read16(hcd-&amp;gt;regs, HC_INT_PTD_DONEMAP_REG);
+priv-&amp;gt;atl_done_map |= reg_read16(hcd-&amp;gt;regs, HC_ATL_PTD_DONEMAP_REG);
+
+handle_done_ptds(hcd);
+
+irqret = IRQ_HANDLED;
+leave:
+spin_unlock(&amp;amp;priv-&amp;gt;lock);
+
+return irqret;
+}
+
+/*
+ * Workaround for problem described in chip errata 2:
+ *
+ * Sometimes interrupts are not generated when ATL (not INT?) completion occurs.
+ * One solution suggested in the errata is to use SOF interrupts _instead_of_
+ * ATL done interrupts (the "instead of" might be important since it seems
+ * enabling ATL interrupts also causes the chip to sometimes - rarely - "forget"
+ * to set the PTD's done bit in addition to not generating an interrupt!).
+ *
+ * So if we use SOF + ATL interrupts, we sometimes get stale PTDs since their
+ * done bit is not being set. This is bad - it blocks the endpoint until reboot.
+ *
+ * If we use SOF interrupts only, we get latency between ptd completion and the
+ * actual handling. This is very noticeable in testusb runs which takes several
+ * minutes longer without ATL interrupts.
+ *
+ * A better solution is to run the code below every SLOT_CHECK_PERIOD ms. If it
+ * finds active ATL slots which are older than SLOT_TIMEOUT ms, it checks the
+ * slot's ACTIVE and VALID bits. If these are not set, the ptd is considered
+ * completed and its done map bit is set.
+ *
+ * The values of SLOT_TIMEOUT and SLOT_CHECK_PERIOD have been arbitrarily chosen
+ * not to cause too much lag when this HW bug occurs, while still hopefully
+ * ensuring that the check does not falsely trigger.
+ */
+#define SLOT_TIMEOUT 300
+#define SLOT_CHECK_PERIOD 200
+static struct timer_list errata2_timer;
+
+static void errata2_function(unsigned long data)
+{
+struct usb_hcd *hcd = (struct usb_hcd *) data;
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u16 slot;
+struct ptd ptd;
+unsigned long spinflags;
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, spinflags);
+
+for (slot = 0; slot &amp;lt; NUM_OF_PTD; slot++)
+if (priv-&amp;gt;atl_slots[slot].qh &amp;amp;&amp;amp; time_after(jiffies,
+priv-&amp;gt;atl_slots[slot].timestamp +
+SLOT_TIMEOUT * HZ / 1000)) {
+ptd_read(hcd-&amp;gt;regs, ATL_PTD_OFFSET, slot, &amp;amp;ptd);
+if (!FROM_DW0_VALID(ptd.dw0) &amp;amp;&amp;amp;
+!FROM_DW3_ACTIVE(ptd.dw3))
+priv-&amp;gt;atl_done_map |= 1 &amp;lt;&amp;lt; slot;
+}
+
+if (priv-&amp;gt;atl_done_map)
+handle_done_ptds(hcd);
+
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, spinflags);
+
+errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
+add_timer(&amp;amp;errata2_timer);
+}
+
+static int isp1763_run(struct usb_hcd *hcd)
+{
+int retval;
+u32 temp;
+u32 command;
+u32 chipid;
+
+hcd-&amp;gt;uses_new_polling = 1;
+
+hcd-&amp;gt;state = HC_STATE_RUNNING;
+
+/* Set PTD interrupt AND &amp;amp; OR maps */
+reg_write16(hcd-&amp;gt;regs, HC_ATL_IRQ_MASK_AND_REG, 0);
+reg_write16(hcd-&amp;gt;regs, HC_ATL_IRQ_MASK_OR_REG, 0xffff);
+reg_write16(hcd-&amp;gt;regs, HC_INT_IRQ_MASK_AND_REG, 0);
+reg_write16(hcd-&amp;gt;regs, HC_INT_IRQ_MASK_OR_REG, 0xffff);
+reg_write16(hcd-&amp;gt;regs, HC_ISO_IRQ_MASK_AND_REG, 0);
+reg_write16(hcd-&amp;gt;regs, HC_ISO_IRQ_MASK_OR_REG, 0xffff);
+/* step 23 passed */
+
+temp = reg_read16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL);
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, temp | HW_GLOBAL_INTR_EN);
+
+command = reg_read32(hcd-&amp;gt;regs, HC_USBCMD);
+command &amp;amp;= ~(CMD_LRESET|CMD_RESET);
+command |= CMD_RUN;
+reg_write32(hcd-&amp;gt;regs, HC_USBCMD, command);
+
+retval = handshake(hcd, HC_USBCMD, CMD_RUN, CMD_RUN, 250 * 1000);
+if (retval)
+return retval;
+
+/*
+ * XXX
+ * Spec says to write FLAG_CF as last config action, priv code grabs
+ * the semaphore while doing so.
+ */
+down_write(&amp;amp;ehci_cf_port_reset_rwsem);
+reg_write32(hcd-&amp;gt;regs, HC_CONFIGFLAG, FLAG_CF);
+
+retval = handshake(hcd, HC_CONFIGFLAG, FLAG_CF, FLAG_CF, 250 * 1000);
+up_write(&amp;amp;ehci_cf_port_reset_rwsem);
+if (retval)
+return retval;
+
+init_timer(&amp;amp;errata2_timer);
+errata2_timer.function = errata2_function;
+errata2_timer.data = (unsigned long) hcd;
+errata2_timer.expires = jiffies + SLOT_CHECK_PERIOD * HZ / 1000;
+add_timer(&amp;amp;errata2_timer);
+
+chipid = reg_read32(hcd-&amp;gt;regs, HC_CHIP_ID_REG);
+dev_info(hcd-&amp;gt;self.controller, "USB ISP %04x HW rev. %d started\n",
+((chipid &amp;amp; 0x00ffff00) &amp;gt;&amp;gt; 8), (chipid &amp;amp; 0x000000ff));
+
+/* PTD Register Init Part 2, Step 28 */
+
+/* Setup registers controlling PTD checking */
+reg_write16(hcd-&amp;gt;regs, HC_ATL_PTD_LASTPTD_REG, 0x8000);
+reg_write16(hcd-&amp;gt;regs, HC_INT_PTD_LASTPTD_REG, 0x8000);
+reg_write16(hcd-&amp;gt;regs, HC_ISO_PTD_LASTPTD_REG, 0x0001);
+reg_write16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG, 0xffff);
+reg_write16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG, 0xffff);
+reg_write16(hcd-&amp;gt;regs, HC_ISO_PTD_SKIPMAP_REG, 0xffff);
+reg_write16(hcd-&amp;gt;regs, HC_BUFFER_STATUS_REG,
+ATL_BUF_FILL | INT_BUF_FILL);
+
+/* GRR this is run-once init(), being done every time the HC starts.
+ * So long as they're part of class devices, we can't do it init()
+ * since the class device isn't created that early.
+ */
+return 0;
+}
+
+static int qtd_fill(struct isp1763_qtd *qtd, void *databuffer, size_t len)
+{
+qtd-&amp;gt;data_buffer = databuffer;
+
+if (len &amp;gt; MAX_PAYLOAD_SIZE)
+len = MAX_PAYLOAD_SIZE;
+qtd-&amp;gt;length = len;
+
+return qtd-&amp;gt;length;
+}
+
+static void qtd_list_free(struct list_head *qtd_list)
+{
+struct isp1763_qtd *qtd, *qtd_next;
+
+list_for_each_entry_safe(qtd, qtd_next, qtd_list, qtd_list) {
+list_del(&amp;amp;qtd-&amp;gt;qtd_list);
+qtd_free(qtd);
+}
+}
+
+/*
+ * Packetize urb-&amp;gt;transfer_buffer into list of packets of size wMaxPacketSize.
+ * Also calculate the PID type (SETUP/IN/OUT) for each packet.
+ */
+#define max_packet(wMaxPacketSize) ((wMaxPacketSize) &amp;amp; 0x07ff)
+static void packetize_urb(struct usb_hcd *hcd,
+struct urb *urb, struct list_head *head, gfp_t flags)
+{
+struct isp1763_qtd *qtd;
+void *buf;
+int len, maxpacketsize;
+u8 packet_type;
+
+/*
+ * URBs map to sequences of QTDs:  one logical transaction
+ */
+if (!urb-&amp;gt;transfer_buffer &amp;amp;&amp;amp; urb-&amp;gt;transfer_buffer_length) {
+/* XXX This looks like usb storage / SCSI bug */
+dev_err(hcd-&amp;gt;self.controller,
+"buf is null, dma is %08lx len is %d\n",
+(long unsigned)urb-&amp;gt;transfer_dma,
+urb-&amp;gt;transfer_buffer_length);
+WARN_ON(1);
+}
+
+if (usb_pipein(urb-&amp;gt;pipe))
+packet_type = IN_PID;
+else
+packet_type = OUT_PID;
+
+if (usb_pipecontrol(urb-&amp;gt;pipe)) {
+qtd = qtd_alloc(flags, urb, SETUP_PID);
+if (!qtd)
+goto cleanup;
+qtd_fill(qtd, urb-&amp;gt;setup_packet,
+sizeof(struct usb_ctrlrequest));
+list_add_tail(&amp;amp;qtd-&amp;gt;qtd_list, head);
+
+/* for zero length DATA stages, STATUS is always IN */
+if (urb-&amp;gt;transfer_buffer_length == 0)
+packet_type = IN_PID;
+}
+
+maxpacketsize = max_packet(usb_maxpacket(urb-&amp;gt;dev, urb-&amp;gt;pipe,
+usb_pipeout(urb-&amp;gt;pipe)));
+
+/*
+ * buffer gets wrapped in one or more qtds;
+ * last one may be "short" (including zero len)
+ * and may serve as a control status ack
+ */
+buf = urb-&amp;gt;transfer_buffer;
+len = urb-&amp;gt;transfer_buffer_length;
+
+for (;;) {
+int this_qtd_len;
+
+qtd = qtd_alloc(flags, urb, packet_type);
+if (!qtd)
+goto cleanup;
+this_qtd_len = qtd_fill(qtd, buf, len);
+list_add_tail(&amp;amp;qtd-&amp;gt;qtd_list, head);
+
+len -= this_qtd_len;
+buf += this_qtd_len;
+
+if (len &amp;lt;= 0)
+break;
+}
+
+/*
+ * control requests may need a terminating data "status" ack;
+ * bulk ones may need a terminating short packet (zero length).
+ */
+if (urb-&amp;gt;transfer_buffer_length != 0) {
+int one_more = 0;
+
+if (usb_pipecontrol(urb-&amp;gt;pipe)) {
+one_more = 1;
+if (packet_type == IN_PID)
+packet_type = OUT_PID;
+else
+packet_type = IN_PID;
+} else if (usb_pipebulk(urb-&amp;gt;pipe)
+&amp;amp;&amp;amp; (urb-&amp;gt;transfer_flags &amp;amp; URB_ZERO_PACKET)
+&amp;amp;&amp;amp; !(urb-&amp;gt;transfer_buffer_length %
+maxpacketsize)) {
+one_more = 1;
+}
+if (one_more) {
+qtd = qtd_alloc(flags, urb, packet_type);
+if (!qtd)
+goto cleanup;
+
+/* never any data in such packets */
+qtd_fill(qtd, NULL, 0);
+list_add_tail(&amp;amp;qtd-&amp;gt;qtd_list, head);
+}
+}
+
+return;
+
+cleanup:
+qtd_list_free(head);
+}
+
+static int isp1763_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
+gfp_t mem_flags)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+struct list_head *ep_queue;
+struct isp1763_qh *qh, *qhit;
+unsigned long spinflags;
+LIST_HEAD(new_qtds);
+int retval;
+int qh_in_queue;
+
+switch (usb_pipetype(urb-&amp;gt;pipe)) {
+case PIPE_CONTROL:
+ep_queue = &amp;amp;priv-&amp;gt;qh_list[QH_CONTROL];
+break;
+case PIPE_BULK:
+ep_queue = &amp;amp;priv-&amp;gt;qh_list[QH_BULK];
+break;
+case PIPE_INTERRUPT:
+if (urb-&amp;gt;interval &amp;lt; 0)
+return -EINVAL;
+/* FIXME: Check bandwidth  */
+ep_queue = &amp;amp;priv-&amp;gt;qh_list[QH_INTERRUPT];
+break;
+case PIPE_ISOCHRONOUS:
+dev_err(hcd-&amp;gt;self.controller, "%s: isochronous USB packets "
+"not yet supported\n",
+__func__);
+return -EPIPE;
+default:
+dev_err(hcd-&amp;gt;self.controller, "%s: unknown pipe type\n",
+__func__);
+return -EPIPE;
+}
+
+if (usb_pipein(urb-&amp;gt;pipe))
+urb-&amp;gt;actual_length = 0;
+
+packetize_urb(hcd, urb, &amp;amp;new_qtds, mem_flags);
+if (list_empty(&amp;amp;new_qtds))
+return -ENOMEM;
+
+retval = 0;
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, spinflags);
+
+if (!test_bit(HCD_FLAG_HW_ACCESSIBLE, &amp;amp;hcd-&amp;gt;flags)) {
+qtd_list_free(&amp;amp;new_qtds);
+retval = -ESHUTDOWN;
+goto out;
+}
+retval = usb_hcd_link_urb_to_ep(hcd, urb);
+if (retval) {
+qtd_list_free(&amp;amp;new_qtds);
+goto out;
+}
+
+qh = urb-&amp;gt;ep-&amp;gt;hcpriv;
+if (qh) {
+qh_in_queue = 0;
+list_for_each_entry(qhit, ep_queue, qh_list) {
+if (qhit == qh) {
+qh_in_queue = 1;
+break;
+}
+}
+if (!qh_in_queue)
+list_add_tail(&amp;amp;qh-&amp;gt;qh_list, ep_queue);
+} else {
+qh = qh_alloc(GFP_ATOMIC);
+if (!qh) {
+retval = -ENOMEM;
+usb_hcd_unlink_urb_from_ep(hcd, urb);
+qtd_list_free(&amp;amp;new_qtds);
+goto out;
+}
+list_add_tail(&amp;amp;qh-&amp;gt;qh_list, ep_queue);
+urb-&amp;gt;ep-&amp;gt;hcpriv = qh;
+}
+
+list_splice_tail(&amp;amp;new_qtds, &amp;amp;qh-&amp;gt;qtd_list);
+schedule_ptds(hcd);
+
+out:
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, spinflags);
+return retval;
+}
+
+static void kill_transfer(struct usb_hcd *hcd, struct urb *urb,
+struct isp1763_qh *qh)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u16 skip_map;
+
+WARN_ON(qh-&amp;gt;slot == -1);
+
+/* We need to forcefully reclaim the slot since some transfers never
+   return, e.g. interrupt transfers and NAKed bulk transfers. */
+if (usb_pipecontrol(urb-&amp;gt;pipe) || usb_pipebulk(urb-&amp;gt;pipe)) {
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG);
+skip_map |= (1 &amp;lt;&amp;lt; qh-&amp;gt;slot);
+reg_write16(hcd-&amp;gt;regs, HC_ATL_PTD_SKIPMAP_REG, skip_map);
+priv-&amp;gt;atl_slots[qh-&amp;gt;slot].qh = NULL;
+priv-&amp;gt;atl_slots[qh-&amp;gt;slot].qtd = NULL;
+} else {
+skip_map = reg_read16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG);
+skip_map |= (1 &amp;lt;&amp;lt; qh-&amp;gt;slot);
+reg_write16(hcd-&amp;gt;regs, HC_INT_PTD_SKIPMAP_REG, skip_map);
+priv-&amp;gt;int_slots[qh-&amp;gt;slot].qh = NULL;
+priv-&amp;gt;int_slots[qh-&amp;gt;slot].qtd = NULL;
+}
+
+qh-&amp;gt;slot = -1;
+}
+
+/*
+ * Retire the qtds beginning at 'qtd' and belonging all to the same urb, killing
+ * any active transfer belonging to the urb in the process.
+ */
+static void dequeue_urb_from_qtd(struct usb_hcd *hcd, struct isp1763_qh *qh,
+struct isp1763_qtd *qtd)
+{
+struct urb *urb;
+int urb_was_running;
+
+urb = qtd-&amp;gt;urb;
+urb_was_running = 0;
+list_for_each_entry_from(qtd, &amp;amp;qh-&amp;gt;qtd_list, qtd_list) {
+if (qtd-&amp;gt;urb != urb)
+break;
+
+if (qtd-&amp;gt;status &amp;gt;= QTD_XFER_STARTED)
+urb_was_running = 1;
+if (last_qtd_of_urb(qtd, qh) &amp;amp;&amp;amp;
+(qtd-&amp;gt;status &amp;gt;= QTD_XFER_COMPLETE))
+urb_was_running = 0;
+
+if (qtd-&amp;gt;status == QTD_XFER_STARTED)
+kill_transfer(hcd, urb, qh);
+qtd-&amp;gt;status = QTD_RETIRE;
+}
+
+if ((urb-&amp;gt;dev-&amp;gt;speed != USB_SPEED_HIGH) &amp;amp;&amp;amp; urb_was_running) {
+qh-&amp;gt;tt_buffer_dirty = 1;
+if (usb_hub_clear_tt_buffer(urb))
+/* Clear failed; let's hope things work anyway */
+qh-&amp;gt;tt_buffer_dirty = 0;
+}
+}
+
+static int isp1763_urb_dequeue(struct usb_hcd *hcd, struct urb *urb,
+int status)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+unsigned long spinflags;
+struct isp1763_qh *qh;
+struct isp1763_qtd *qtd;
+int retval = 0;
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, spinflags);
+retval = usb_hcd_check_unlink_urb(hcd, urb, status);
+if (retval)
+goto out;
+
+qh = urb-&amp;gt;ep-&amp;gt;hcpriv;
+if (!qh) {
+retval = -EINVAL;
+goto out;
+}
+
+list_for_each_entry(qtd, &amp;amp;qh-&amp;gt;qtd_list, qtd_list)
+if (qtd-&amp;gt;urb == urb) {
+dequeue_urb_from_qtd(hcd, qh, qtd);
+list_move(&amp;amp;qtd-&amp;gt;qtd_list, &amp;amp;qh-&amp;gt;qtd_list);
+break;
+}
+
+urb-&amp;gt;status = status;
+schedule_ptds(hcd);
+
+out:
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, spinflags);
+return retval;
+}
+
+static void isp1763_endpoint_disable(struct usb_hcd *hcd,
+struct usb_host_endpoint *ep)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+unsigned long spinflags;
+struct isp1763_qh *qh, *qh_iter;
+int i;
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, spinflags);
+
+qh = ep-&amp;gt;hcpriv;
+if (!qh)
+goto out;
+
+WARN_ON(!list_empty(&amp;amp;qh-&amp;gt;qtd_list));
+
+for (i = 0; i &amp;lt; QH_END; i++)
+list_for_each_entry(qh_iter, &amp;amp;priv-&amp;gt;qh_list[i], qh_list)
+if (qh_iter == qh) {
+list_del(&amp;amp;qh_iter-&amp;gt;qh_list);
+i = QH_END;
+break;
+}
+qh_free(qh);
+ep-&amp;gt;hcpriv = NULL;
+
+schedule_ptds(hcd);
+
+out:
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, spinflags);
+}
+
+static int isp1763_hub_status_data(struct usb_hcd *hcd, char *buf)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u32 temp, status = 0;
+u32 mask;
+int retval = 1;
+unsigned long flags;
+
+/* if !USB_SUSPEND, root hub timers won't get shut down ... */
+if (!HC_IS_RUNNING(hcd-&amp;gt;state))
+return 0;
+
+/* init status to no-changes */
+buf[0] = 0;
+mask = PORT_CSC;
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, flags);
+temp = reg_read32(hcd-&amp;gt;regs, HC_PORTSC1);
+
+if (temp &amp;amp; PORT_OWNER) {
+if (temp &amp;amp; PORT_CSC) {
+temp &amp;amp;= ~PORT_CSC;
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp);
+goto done;
+}
+}
+
+/*
+ * Return status information even for ports with OWNER set.
+ * Otherwise khubd wouldn't see the disconnect event when a
+ * high-speed device is switched over to the companion
+ * controller by the user.
+ */
+
+if ((temp &amp;amp; mask) != 0
+|| ((temp &amp;amp; PORT_RESUME) != 0
+&amp;amp;&amp;amp; time_after_eq(jiffies,
+priv-&amp;gt;reset_done))) {
+buf[0] |= 1 &amp;lt;&amp;lt; (0 + 1);
+status = STS_PCD;
+}
+/* FIXME autosuspend idle root hubs */
+done:
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, flags);
+return status ? retval : 0;
+}
+
+static void isp1763_hub_descriptor(struct isp1763_hcd *priv,
+struct usb_hub_descriptor *desc)
+{
+int ports = HCS_N_PORTS(priv-&amp;gt;hcs_params);
+u16 temp;
+
+desc-&amp;gt;bDescriptorType = 0x29;
+/* priv 1.0, 2.3.9 says 20ms max */
+desc-&amp;gt;bPwrOn2PwrGood = 10;
+desc-&amp;gt;bHubContrCurrent = 0;
+
+desc-&amp;gt;bNbrPorts = ports;
+temp = 1 + (ports / 8);
+desc-&amp;gt;bDescLength = 7 + 2 * temp;
+
+/* ports removable, and usb 1.0 legacy PortPwrCtrlMask */
+memset(&amp;amp;desc-&amp;gt;u.hs.DeviceRemovable[0], 0, temp);
+memset(&amp;amp;desc-&amp;gt;u.hs.DeviceRemovable[temp], 0xff, temp);
+
+/* per-port overcurrent reporting; no power switching */
+temp = 0x0008;
+
+if (HCS_PPC(priv-&amp;gt;hcs_params))
+/* per-port power control */
+temp |= 0x0001;
+else
+/* no power switching */
+temp |= 0x0002;
+
+
+desc-&amp;gt;wHubCharacteristics = cpu_to_le16(temp);
+}
+
+#definePORT_WAKE_BITS(PORT_WKOC_E|PORT_WKDISC_E|PORT_WKCONN_E)
+
+static int check_reset_complete(struct usb_hcd *hcd, int index,
+int port_status)
+{
+if (!(port_status &amp;amp; PORT_CONNECT))
+return port_status;
+
+/* if reset finished and it's still not enabled -- handoff */
+if (!(port_status &amp;amp; PORT_PE)) {
+
+dev_info(hcd-&amp;gt;self.controller,
+"port %d full speed --&amp;gt; companion\n",
+index + 1);
+
+port_status |= PORT_OWNER;
+port_status &amp;amp;= ~PORT_RWC_BITS;
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, port_status);
+
+} else
+dev_info(hcd-&amp;gt;self.controller, "port %d high speed\n",
+index + 1);
+
+return port_status;
+}
+
+static int isp1763_hub_control(struct usb_hcd *hcd, u16 typeReq,
+u16 wValue, u16 wIndex, char *buf, u16 wLength)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+int ports = HCS_N_PORTS(priv-&amp;gt;hcs_params);
+u32 temp, status;
+unsigned long flags;
+int retval = 0;
+unsigned selector;
+
+/*
+ * FIXME:  support SetPortFeatures USB_PORT_FEAT_INDICATOR.
+ * HCS_INDICATOR may say we can change LEDs to off/amber/green.
+ * (track current state ourselves) ... blink for diagnostics,
+ * power, "this is the one", etc.  EHCI spec supports this.
+ */
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, flags);
+switch (typeReq) {
+case ClearHubFeature:
+switch (wValue) {
+case C_HUB_LOCAL_POWER:
+case C_HUB_OVER_CURRENT:
+/* no hub-wide feature/status flags */
+break;
+default:
+goto error;
+}
+break;
+case ClearPortFeature:
+if (!wIndex || wIndex &amp;gt; ports)
+goto error;
+wIndex--;
+temp = reg_read32(hcd-&amp;gt;regs, HC_PORTSC1);
+
+/*
+ * Even if OWNER is set, so the port is owned by the
+ * companion controller, khubd needs to be able to clear
+ * the port-change status bits (especially
+ * USB_PORT_STAT_C_CONNECTION).
+ */
+
+switch (wValue) {
+case USB_PORT_FEAT_ENABLE:
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp &amp;amp; ~PORT_PE);
+break;
+case USB_PORT_FEAT_C_ENABLE:
+/* XXX error? */
+break;
+case USB_PORT_FEAT_SUSPEND:
+if (temp &amp;amp; PORT_RESET)
+goto error;
+
+if (temp &amp;amp; PORT_SUSPEND) {
+if ((temp &amp;amp; PORT_PE) == 0)
+goto error;
+/* resume signaling for 20 msec */
+temp &amp;amp;= ~(PORT_RWC_BITS);
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1,
+temp | PORT_RESUME);
+priv-&amp;gt;reset_done = jiffies +
+msecs_to_jiffies(20);
+}
+break;
+case USB_PORT_FEAT_C_SUSPEND:
+/* we auto-clear this feature */
+break;
+case USB_PORT_FEAT_POWER:
+if (HCS_PPC(priv-&amp;gt;hcs_params))
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1,
+temp &amp;amp; ~PORT_POWER);
+break;
+case USB_PORT_FEAT_C_CONNECTION:
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp | PORT_CSC);
+break;
+case USB_PORT_FEAT_C_OVER_CURRENT:
+/* XXX error ?*/
+break;
+case USB_PORT_FEAT_C_RESET:
+/* GetPortStatus clears reset */
+break;
+default:
+goto error;
+}
+reg_read32(hcd-&amp;gt;regs, HC_USBCMD);
+break;
+case GetHubDescriptor:
+isp1763_hub_descriptor(priv, (struct usb_hub_descriptor *)
+buf);
+break;
+case GetHubStatus:
+/* no hub-wide feature/status flags */
+memset(buf, 0, 4);
+break;
+case GetPortStatus:
+if (!wIndex || wIndex &amp;gt; ports)
+goto error;
+wIndex--;
+status = 0;
+temp = reg_read32(hcd-&amp;gt;regs, HC_PORTSC1);
+
+/* wPortChange bits */
+if (temp &amp;amp; PORT_CSC)
+status |= USB_PORT_STAT_C_CONNECTION &amp;lt;&amp;lt; 16;
+
+/* whoever resumes must GetPortStatus to complete it!! */
+if (temp &amp;amp; PORT_RESUME) {
+dev_err(hcd-&amp;gt;self.controller, "Port resume should be skipped.\n");
+
+/* Remote Wakeup received? */
+if (!priv-&amp;gt;reset_done) {
+/* resume signaling for 20 msec */
+priv-&amp;gt;reset_done = jiffies
++ msecs_to_jiffies(20);
+/* check the port again */
+mod_timer(&amp;amp;hcd-&amp;gt;rh_timer, priv-&amp;gt;reset_done);
+}
+
+/* resume completed? */
+else if (time_after_eq(jiffies,
+priv-&amp;gt;reset_done)) {
+status |= USB_PORT_STAT_C_SUSPEND &amp;lt;&amp;lt; 16;
+priv-&amp;gt;reset_done = 0;
+
+/* stop resume signaling */
+temp = reg_read32(hcd-&amp;gt;regs, HC_PORTSC1);
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1,
+temp &amp;amp; ~(PORT_RWC_BITS | PORT_RESUME));
+retval = handshake(hcd, HC_PORTSC1,
+PORT_RESUME, 0, 2000 /* 2msec */);
+if (retval != 0) {
+dev_err(hcd-&amp;gt;self.controller,
+"port %d resume error %d\n",
+wIndex + 1, retval);
+goto error;
+}
+temp &amp;amp;= ~(PORT_SUSPEND|PORT_RESUME|(3&amp;lt;&amp;lt;10));
+}
+}
+
+/* whoever resets must GetPortStatus to complete it!! */
+if ((temp &amp;amp; PORT_RESET)
+&amp;amp;&amp;amp; time_after_eq(jiffies,
+priv-&amp;gt;reset_done)) {
+status |= USB_PORT_STAT_C_RESET &amp;lt;&amp;lt; 16;
+priv-&amp;gt;reset_done = 0;
+
+/* force reset to complete */
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp &amp;amp; ~PORT_RESET);
+/* REVISIT:  some hardware needs 550+ usec to clear
+ * this bit; seems too long to spin routinely...
+ */
+retval = handshake(hcd, HC_PORTSC1,
+PORT_RESET, 0, 750);
+if (retval != 0) {
+dev_err(hcd-&amp;gt;self.controller, "port %d reset error %d\n",
+wIndex + 1, retval);
+goto error;
+}
+
+/* see what we found out */
+temp = check_reset_complete(hcd, wIndex,
+reg_read32(hcd-&amp;gt;regs, HC_PORTSC1));
+}
+/*
+ * Even if OWNER is set, there's no harm letting khubd
+ * see the wPortStatus values (they should all be 0 except
+ * for PORT_POWER anyway).
+ */
+
+if (temp &amp;amp; PORT_OWNER)
+dev_err(hcd-&amp;gt;self.controller, "PORT_OWNER is set\n");
+
+if (temp &amp;amp; PORT_CONNECT) {
+status |= USB_PORT_STAT_CONNECTION;
+/* status may be from integrated TT */
+status |= USB_PORT_STAT_HIGH_SPEED;
+}
+if (temp &amp;amp; PORT_PE)
+status |= USB_PORT_STAT_ENABLE;
+if (temp &amp;amp; (PORT_SUSPEND|PORT_RESUME))
+status |= USB_PORT_STAT_SUSPEND;
+if (temp &amp;amp; PORT_RESET)
+status |= USB_PORT_STAT_RESET;
+if (temp &amp;amp; PORT_POWER)
+status |= USB_PORT_STAT_POWER;
+
+put_unaligned(cpu_to_le32(status), (__le32 *) buf);
+break;
+case SetHubFeature:
+switch (wValue) {
+case C_HUB_LOCAL_POWER:
+case C_HUB_OVER_CURRENT:
+/* no hub-wide feature/status flags */
+break;
+default:
+goto error;
+}
+break;
+case SetPortFeature:
+selector = wIndex &amp;gt;&amp;gt; 8;
+wIndex &amp;amp;= 0xff;
+if (!wIndex || wIndex &amp;gt; ports)
+goto error;
+wIndex--;
+temp = reg_read32(hcd-&amp;gt;regs, HC_PORTSC1);
+if (temp &amp;amp; PORT_OWNER)
+break;
+
+/*temp &amp;amp;= ~PORT_RWC_BITS; */
+switch (wValue) {
+case USB_PORT_FEAT_ENABLE:
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp | PORT_PE);
+break;
+
+case USB_PORT_FEAT_SUSPEND:
+if ((temp &amp;amp; PORT_PE) == 0
+|| (temp &amp;amp; PORT_RESET) != 0)
+goto error;
+
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp | PORT_SUSPEND);
+break;
+case USB_PORT_FEAT_POWER:
+if (HCS_PPC(priv-&amp;gt;hcs_params))
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1,
+temp | PORT_POWER);
+break;
+case USB_PORT_FEAT_RESET:
+if (temp &amp;amp; PORT_RESUME)
+goto error;
+/* line status bits may report this as low speed,
+ * which can be fine if this root hub has a
+ * transaction translator built in.
+ */
+if ((temp &amp;amp; (PORT_PE|PORT_CONNECT)) == PORT_CONNECT
+&amp;amp;&amp;amp; PORT_USB11(temp)) {
+temp |= PORT_OWNER;
+} else {
+if ((temp &amp;amp; PORT_CONNECT) == 0) {
+dev_err(hcd-&amp;gt;self.controller,
+"ERROR: Port not connected\n");
+goto error;
+}
+if ((temp &amp;amp; PORT_POWER) == 0) {
+dev_err(hcd-&amp;gt;self.controller,
+"ERROR: Port power not enabled!\n");
+goto error;
+}
+
+temp |= PORT_RESET;
+temp &amp;amp;= ~PORT_PE;
+
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp);
+/*
+ * caller must wait, then call GetPortStatus
+ * usb 2.0 spec says 50 ms resets on root
+ */
+#if 1
+priv-&amp;gt;reset_done = jiffies +
+msecs_to_jiffies(50);
+#endif
+mdelay(50);
+
+temp &amp;amp;= ~PORT_RESET;
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp);
+
+while (reg_read32(hcd-&amp;gt;regs, HC_PORTSC1)
+&amp;amp; PORT_RESET)
+continue;
+
+temp |= PORT_PE;
+reg_write32(hcd-&amp;gt;regs, HC_PORTSC1, temp);
+}
+break;
+default:
+goto error;
+}
+reg_read32(hcd-&amp;gt;regs, HC_USBCMD);
+break;
+
+default:
+error:
+/* "stall" on error */
+retval = -EPIPE;
+}
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, flags);
+return retval;
+}
+
+static int isp1763_get_frame(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u32 fr;
+
+fr = reg_read32(hcd-&amp;gt;regs, HC_FRINDEX);
+return (fr &amp;gt;&amp;gt; 3) % priv-&amp;gt;periodic_size;
+}
+
+static void isp1763_stop(struct usb_hcd *hcd)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+u16 temp;
+
+del_timer(&amp;amp;errata2_timer);
+
+
+isp1763_hub_control(hcd, ClearPortFeature, USB_PORT_FEAT_POWER,1,
+NULL, 0);
+mdelay(20);
+
+spin_lock_irq(&amp;amp;priv-&amp;gt;lock);
+ehci_reset(hcd);
+/* Disable IRQ */
+temp = reg_read16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL);
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, temp &amp;amp;= ~HW_GLOBAL_INTR_EN);
+spin_unlock_irq(&amp;amp;priv-&amp;gt;lock);
+
+reg_write32(hcd-&amp;gt;regs, HC_CONFIGFLAG, 0);
+}
+
+static void isp1763_shutdown(struct usb_hcd *hcd)
+{
+u16 temp;
+u32 command;
+
+isp1763_stop(hcd);
+
+temp = reg_read16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL);
+reg_write16(hcd-&amp;gt;regs, HC_HW_MODE_CTRL, temp &amp;amp;= ~HW_GLOBAL_INTR_EN);
+
+command = reg_read32(hcd-&amp;gt;regs, HC_USBCMD);
+command &amp;amp;= ~CMD_RUN;
+reg_write32(hcd-&amp;gt;regs, HC_USBCMD, command);
+}
+
+static void isp1763_clear_tt_buffer_complete(struct usb_hcd *hcd,
+struct usb_host_endpoint *ep)
+{
+struct isp1763_hcd *priv = hcd_to_priv(hcd);
+struct isp1763_qh *qh = ep-&amp;gt;hcpriv;
+unsigned long spinflags;
+
+if (!qh)
+return;
+
+spin_lock_irqsave(&amp;amp;priv-&amp;gt;lock, spinflags);
+qh-&amp;gt;tt_buffer_dirty = 0;
+schedule_ptds(hcd);
+spin_unlock_irqrestore(&amp;amp;priv-&amp;gt;lock, spinflags);
+}
+
+
+static const struct hc_driver isp1763_hc_driver = {
+.description= "isp1763-hcd",
+.product_desc= "ST-Erricson ISP1763 USB Host Controller",
+.hcd_priv_size= sizeof(struct isp1763_hcd),
+.irq= isp1763_irq,
+.flags= HCD_MEMORY | HCD_USB2,
+.reset= isp1763_hc_setup,
+.start= isp1763_run,
+.stop= isp1763_stop,
+.shutdown= isp1763_shutdown,
+.urb_enqueue= isp1763_urb_enqueue,
+.urb_dequeue= isp1763_urb_dequeue,
+.endpoint_disable= isp1763_endpoint_disable,
+.get_frame_number= isp1763_get_frame,
+.hub_status_data= isp1763_hub_status_data,
+.hub_control= isp1763_hub_control,
+.clear_tt_buffer_complete= isp1763_clear_tt_buffer_complete,
+};
+
+int __init init_kmem_once(void)
+{
+urb_listitem_cachep = kmem_cache_create("isp1763_urb_listitem",
+sizeof(struct urb_listitem), 0, SLAB_TEMPORARY |
+SLAB_MEM_SPREAD, NULL);
+
+if (!urb_listitem_cachep)
+return -ENOMEM;
+
+qtd_cachep = kmem_cache_create("isp1763_qtd",
+sizeof(struct isp1763_qtd), 0, SLAB_TEMPORARY |
+SLAB_MEM_SPREAD, NULL);
+
+if (!qtd_cachep)
+return -ENOMEM;
+
+qh_cachep = kmem_cache_create("isp1763_qh", sizeof(struct isp1763_qh),
+0, SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL);
+
+if (!qh_cachep) {
+kmem_cache_destroy(qtd_cachep);
+return -ENOMEM;
+}
+
+return 0;
+}
+
+void deinit_kmem_cache(void)
+{
+kmem_cache_destroy(qtd_cachep);
+kmem_cache_destroy(qh_cachep);
+kmem_cache_destroy(urb_listitem_cachep);
+}
+
+/*
+ * res_start: Start of io memory region
+ * res_len  : Length of io memory region
+ * irq      : The (virtual) irq number
+ * irqflags : IRQ_FLAGS
+ * dev      : Device structure, usually contained inside another struct
+ * busname  : The bus this device belongs to
+ * devflags : Device private flags to configure quirks.
+ */
+struct usb_hcd *isp1763_register(phys_addr_t res_start,
+ resource_size_t res_len,
+ int irq, unsigned long irqflags,
+ int rst_gpio,
+ struct device *dev, const char *busname,
+ unsigned int devflags)
+{
+struct usb_hcd *hcd;
+struct isp1763_hcd *priv;
+int ret;
+
+if (usb_disabled())
+return ERR_PTR(-ENODEV);
+
+/* prevent usb-core allocating DMA pages */
+dev-&amp;gt;dma_mask = NULL;
+
+hcd = usb_create_hcd(&amp;amp;isp1763_hc_driver, dev, dev_name(dev));
+if (!hcd)
+return ERR_PTR(-ENOMEM);
+
+priv = hcd_to_priv(hcd);
+priv-&amp;gt;devflags = devflags;
+priv-&amp;gt;rst_gpio = rst_gpio;
+init_memory(priv);
+
+hcd-&amp;gt;regs = ioremap(res_start, res_len);
+
+if (!hcd-&amp;gt;regs) {
+ret = -EIO;
+goto err_put;
+}
+
+hcd-&amp;gt;irq = irq;
+hcd-&amp;gt;rsrc_start = res_start;
+hcd-&amp;gt;rsrc_len = res_len;
+
+ret = usb_add_hcd(hcd, irq, irqflags);
+if (ret)
+goto err_unmap;
+
+return hcd;
+
+err_unmap:
+ iounmap(hcd-&amp;gt;regs);
+
+err_put:
+ usb_put_hcd(hcd);
+
+ return ERR_PTR(ret);
+}
+
diff --git a/drivers/usb/host/isp1763-hcd.h b/drivers/usb/host/isp1763-hcd.h
new file mode 100644
index 0000000..ac47992
--- /dev/null
+++ b/drivers/usb/host/isp1763-hcd.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,257 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+#ifndef _ISP1763_HCD_H_
+#define _ISP1763_HCD_H_
+
+/* exports for isp1763-if */
+
+/* isp1763_register
+ *
+ * res_start: Start of io memory region
+ * res_len  : Length of io memory region
+ * irq      : The (virtual) irq number
+ * irqflags : IRQ_FLAGS
+ * dev      : Device structure, usually contained inside another struct
+ * busname  : The bus this device belongs to
+ * devflags : Device private flags to configure quirks.
+ */
+struct usb_hcd *isp1763_register(phys_addr_t res_start,
+ resource_size_t res_len,
+ int irq, unsigned long irqflags,
+ int rst_gpio,
+ struct device *dev, const char *busname,
+ unsigned int devflags);
+int init_kmem_once(void);
+void deinit_kmem_cache(void);
+
+/* EHCI capability registers;
+ * Vendor claims that HCCPARAMS and HCSPARAMS does not exist for isp1763,
+ * Any access to these registers need to return some hardcoded value.
+ */
+#define HC_CAPLENGTH0x00
+#define HC_HCSPARAMS0x04
+#define HC_HCCPARAMS0x08
+
+/* EHCI operational registers */
+#define HC_USBCMD0x8C
+#define HC_USBSTS0x90
+#define HC_FRINDEX0x98
+#define HC_CONFIGFLAG0x9C
+#define HC_PORTSC10xA0
+#define HC_ISO_PTD_DONEMAP_REG0xA4
+#define HC_ISO_PTD_SKIPMAP_REG0xA6
+#define HC_ISO_PTD_LASTPTD_REG0xA8
+#define HC_INT_PTD_DONEMAP_REG0xAA
+#define HC_INT_PTD_SKIPMAP_REG0xAC
+#define HC_INT_PTD_LASTPTD_REG0xAE
+#define HC_ATL_PTD_DONEMAP_REG0xB0
+#define HC_ATL_PTD_SKIPMAP_REG0xB2
+#define HC_ATL_PTD_LASTPTD_REG0xB4
+
+
+/* FIXME:
+ * Commented bits means that they exist in isp170, but N/A for isp1763
+*/
+
+/* Configuration Register */
+#define HC_HW_MODE_CTRL0xB6
+/* #define ALL_ATX_RESET(1 &amp;lt;&amp;lt; 31) */
+/* #define HW_ANA_DIGI_OC(1 &amp;lt;&amp;lt; 15) */
+#define HW_ID_PULLUP(1 &amp;lt;&amp;lt; 12)
+#define HW_DEV_DMA_EN(1 &amp;lt;&amp;lt; 11)
+#define HW_COMN_INT_EN(1 &amp;lt;&amp;lt; 10)
+#define HW_COMN_DMA_EN(1 &amp;lt;&amp;lt; 9)
+/* #define HW_DATA_BUS_32BIT(1 &amp;lt;&amp;lt; 8) */
+#define HW_DACK_POL_HIGH(1 &amp;lt;&amp;lt; 6)
+#define HW_DREQ_POL_HIGH(1 &amp;lt;&amp;lt; 5)
+#define HW_DATA_BUS_8BIT(1 &amp;lt;&amp;lt; 4)
+#define HW_INTF_LOCK(1 &amp;lt;&amp;lt; 3)
+#define HW_INTR_HIGH_ACT(1 &amp;lt;&amp;lt; 2)
+#define HW_INTR_EDGE_TRIG(1 &amp;lt;&amp;lt; 1)
+#define HW_GLOBAL_INTR_EN(1 &amp;lt;&amp;lt; 0)
+
+#define HC_CHIP_ID_REG0x70
+#define HC_SCRATCH_REG0x78
+
+#define HC_RESET_REG0xB8
+
+/* INTF_MODE[1:0] is SW_RESET[7:6] */
+#define SW_INTF_MODE_MASK0xC0
+/* The various operation mode the chip supports */
+#define SW_INTF_MODE_NAND0x00
+#define SW_INTF_MODE_GNRC0x40
+#define SW_INTF_MODE_NOR0x80
+#define SW_INTF_MODE_SRAM0xC0
+
+#define SW_RESET_RESET_ATX(1 &amp;lt;&amp;lt; 3)
+#define SW_RESET_RESET_HC(1 &amp;lt;&amp;lt; 1)
+#define SW_RESET_RESET_ALL(1 &amp;lt;&amp;lt; 0)
+
+#define HC_BUFFER_STATUS_REG0xBA
+#define ISO_BUF_FILL(1 &amp;lt;&amp;lt; 2)
+#define INT_BUF_FILL(1 &amp;lt;&amp;lt; 1)
+#define ATL_BUF_FILL(1 &amp;lt;&amp;lt; 0)
+
+#define HC_MEMORY_REG0xC4
+#define HC_DATA_REG0xC6
+
+/*
+ * ISP1763 does not have Port1 Control Register
+ * #define HC_PORT1_CTRL0x374
+ * #define PORT1_POWER(3 &amp;lt;&amp;lt; 3)
+ * #define PORT1_INIT1(1 &amp;lt;&amp;lt; 7)
+ * #define PORT1_INIT2(1 &amp;lt;&amp;lt; 23)
+ */
+
+#define HW_OTG_CTRL_SET0xE4
+#define HW_OTG_CTRL_CLR0xE6
+#define HW_OTG_CTRL_HC_2_DIS(1 &amp;lt;&amp;lt; 15)
+#define HW_OTG_CTRL_OTG_DIS(1 &amp;lt;&amp;lt; 10)
+#define HW_OTG_CTRL_SW_SEL_HC_DC(1 &amp;lt;&amp;lt; 7)
+
+/* Interrupt Register */
+#define HC_INTERRUPT_REG0xD4
+
+#define HC_INTERRUPT_ENABLE0xD6
+#define HC_OTG_INT(1 &amp;lt;&amp;lt; 10)
+#define HC_ISO_INT(1 &amp;lt;&amp;lt; 9)
+#define HC_ATL_INT(1 &amp;lt;&amp;lt; 8)
+#define HC_INTL_INT(1 &amp;lt;&amp;lt; 7)
+#define HC_CLK_READY_INT(1 &amp;lt;&amp;lt; 6)
+#define HC_HCSUSP_INT(1 &amp;lt;&amp;lt; 5)
+#define HC_OPR_REG_INT(1 &amp;lt;&amp;lt; 4)
+#define HC_EOT_INT(1 &amp;lt;&amp;lt; 3)
+#define HC_SOT_INT(1 &amp;lt;&amp;lt; 1)
+#define HC_USOF_INT(1 &amp;lt;&amp;lt; 0) /* micro SOF interrupt */
+#define INTERRUPT_ENABLE_MASK(HC_INTL_INT | HC_ATL_INT)
+
+#define HC_ISO_IRQ_MASK_OR_REG0xD8
+#define HC_INT_IRQ_MASK_OR_REG0xDA
+#define HC_ATL_IRQ_MASK_OR_REG0xDC
+#define HC_ISO_IRQ_MASK_AND_REG0xDE
+#define HC_INT_IRQ_MASK_AND_REG0xE0
+#define HC_ATL_IRQ_MASK_AND_REG0xE2
+
+/* urb state*/
+#define DELETE_URB(0x0008)
+#define NO_TRANSFER_ACTIVE(0xffff)
+
+/* Philips Proprietary Transfer Descriptor (PTD) */
+typedef __u32 __bitwise __dw;
+struct ptd {
+__dw dw0;
+__dw dw1;
+__dw dw2;
+__dw dw3;
+__dw dw4;
+__dw dw5;
+__dw dw6;
+__dw dw7;
+};
+#define PTD_OFFSET             0x0400
+#define ISO_PTD_OFFSET         0x0400
+#define INT_PTD_OFFSET         0x0800
+#define ATL_PTD_OFFSET         0x0c00
+#define PAYLOAD_OFFSET         0x1000 /* size 20 kB */
+
+struct slotinfo {
+struct isp1763_qh *qh;
+struct isp1763_qtd *qtd;
+unsigned long timestamp;
+};
+
+
+typedef void (packet_enqueue)(struct usb_hcd *hcd, struct isp1763_qh *qh,
+struct isp1763_qtd *qtd);
+
+/*
+ * Device flags that can vary from board to board.  All of these
+ * indicate the most "atypical" case, so that a devflags of 0 is
+ * a sane default configuration.
+ */
+#define ISP1763_FLAG_BUS_WIDTH_8    0x00000002 /* 8-bit data bus width */
+#define ISP1763_FLAG_OTG_EN         0x00000004 /* Port 1 supports OTG */
+#define ISP1763_FLAG_DACK_POL_HIGH  0x00000010 /* DACK active high */
+#define ISP1763_FLAG_DREQ_POL_HIGH  0x00000020 /* DREQ active high */
+#define ISP1763_FLAG_INTR_POL_HIGH  0x00000080 /* Interrupt polarity high */
+#define ISP1763_FLAG_INTR_EDGE_TRIG 0x00000100 /* Interrupt edge triggered */
+#define ISP1763_FLAG_RESET_ACTIVE_HIGH0x80000000 /* RESET GPIO active high */
+
+/* chip memory management */
+struct memory_chunk {
+unsigned int start;
+unsigned int size;
+unsigned int free;
+};
+
+/*
+ * 20kb divided in chunks; 256 for control; 4096 for data tansfer
+ * -  8 blocks &amp;lt; at &amp;gt; 256  bytes =  2KB (10%)
+ * -  2 blocks &amp;lt; at &amp;gt; 1024 bytes =  2KB (10%)
+ * -  4 blocks &amp;lt; at &amp;gt; 4096 bytes = 16KB (80%)
+ */
+#define BLOCK_1_NUM 8
+#define BLOCK_2_NUM 2
+#define BLOCK_3_NUM 4
+
+#define BLOCK_1_SIZE 256
+#define BLOCK_2_SIZE 1024
+#define BLOCK_3_SIZE 4096
+#define BLOCKS (BLOCK_1_NUM + BLOCK_2_NUM + BLOCK_3_NUM)
+#define MAX_PAYLOAD_SIZE BLOCK_3_SIZE
+#define PAYLOAD_AREA_SIZE 0x5000 /* 20 KB */
+
+
+/* ATL */
+/* DW0 */
+#define DW0_VALID_BIT1
+#define FROM_DW0_VALID(x)((x) &amp;amp; 0x01)
+#define TO_DW0_LENGTH(x)(((u32) x) &amp;lt;&amp;lt; 3)
+#define TO_DW0_MAXPACKET(x)(((u32) x) &amp;lt;&amp;lt; 18)
+#define TO_DW0_MULTI(x)(((u32) x) &amp;lt;&amp;lt; 29)
+#define TO_DW0_ENDPOINT(x)(((u32)x) &amp;lt;&amp;lt; 31)
+
+/* DW1 */
+#define TO_DW1_DEVICE_ADDR(x)(((u32) x) &amp;lt;&amp;lt; 3)
+#define TO_DW1_PID_TOKEN(x)(((u32) x) &amp;lt;&amp;lt; 10)
+#define DW1_TRANS_BULK((u32) 2 &amp;lt;&amp;lt; 12)
+#define DW1_TRANS_INT((u32) 3 &amp;lt;&amp;lt; 12)
+#define DW1_TRANS_SPLIT((u32) 1 &amp;lt;&amp;lt; 14)
+#define DW1_SE_USB_LOSPEED((u32) 2 &amp;lt;&amp;lt; 16)
+#define TO_DW1_PORT_NUM(x)(((u32) x) &amp;lt;&amp;lt; 18)
+#define TO_DW1_HUB_NUM(x)(((u32) x) &amp;lt;&amp;lt; 25)
+/* DW2 */
+#define TO_DW2_DATA_START_ADDR(x)(((u32) x) &amp;lt;&amp;lt; 8)
+#define TO_DW2_RL(x)((x) &amp;lt;&amp;lt; 25)
+#define FROM_DW2_RL(x)(((x) &amp;gt;&amp;gt; 25) &amp;amp; 0xf)
+/* DW3 */
+#define FROM_DW3_NRBYTESTRANSFERRED(x)((x) &amp;amp; 0x7fff)
+#define FROM_DW3_SCS_NRBYTESTRANSFERRED(x)((x) &amp;amp; 0x07ff)
+#define TO_DW3_NAKCOUNT(x)((x) &amp;lt;&amp;lt; 19)
+#define FROM_DW3_NAKCOUNT(x)(((x) &amp;gt;&amp;gt; 19) &amp;amp; 0xf)
+#define TO_DW3_CERR(x)((x) &amp;lt;&amp;lt; 23)
+#define FROM_DW3_CERR(x)(((x) &amp;gt;&amp;gt; 23) &amp;amp; 0x3)
+#define TO_DW3_DATA_TOGGLE(x)((x) &amp;lt;&amp;lt; 25)
+#define FROM_DW3_DATA_TOGGLE(x)(((x) &amp;gt;&amp;gt; 25) &amp;amp; 0x1)
+#define TO_DW3_PING(x)((x) &amp;lt;&amp;lt; 26)
+#define FROM_DW3_PING(x)(((x) &amp;gt;&amp;gt; 26) &amp;amp; 0x1)
+#define DW3_ERROR_BIT(1 &amp;lt;&amp;lt; 28)
+#define DW3_BABBLE_BIT(1 &amp;lt;&amp;lt; 29)
+#define DW3_HALT_BIT(1 &amp;lt;&amp;lt; 30)
+#define DW3_ACTIVE_BIT(1 &amp;lt;&amp;lt; 31)
+#define FROM_DW3_ACTIVE(x)(((x) &amp;gt;&amp;gt; 31) &amp;amp; 0x01)
+
+#define INT_UNDERRUN(1 &amp;lt;&amp;lt; 2)
+#define INT_BABBLE(1 &amp;lt;&amp;lt; 1)
+#define INT_EXACT(1 &amp;lt;&amp;lt; 0)
+
+#define SETUP_PID(2)
+#define IN_PID(1)
+#define OUT_PID(0)
+
+/* FIXME!: Does this apply to isp1763? ST-Ericsson believes no */
+/* Set these to HW defaults of ZERO? */
+/* Errata 1 */
+#define RL_COUNTER(0) /* isp1760 (0) */
+#define NAK_COUNTER(0) /* isp1760 (0) */
+#define ERR_COUNTER(0) /* isp1760 (2) */
+
+#endif /* _ISP1763_HCD_H_ */
diff --git a/drivers/usb/host/isp1763-if.c b/drivers/usb/host/isp1763-if.c
new file mode 100644
index 0000000..c07dcdb
--- /dev/null
+++ b/drivers/usb/host/isp1763-if.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,523 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Description:
+ *
+ * Glue code for the ISP1763 driver and bus
+ * Currently there is support for:
+ * - OpenFirmware
+ * - PCI (not-tested; as-is port from isp1760)
+ * - PDEV (generic platform device centralized driver model)
+ *
+ * Based on isp1760 driver by:
+ * Sebastian Andrzej Siewior &amp;lt;sebastian-E0PNVn5OA6ohrxcnuTQ+TQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ * Arvid Brodin &amp;lt;arvid.brodin-6rkEtWRFf40&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ * and pehci code from ST-Ericsson &amp;lt;wired.support-0IS4wlFg1OjSUeElwK9/Pw&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
+ *
+ */
+#include &amp;lt;linux/usb.h&amp;gt;
+#include &amp;lt;linux/io.h&amp;gt;
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/platform_device.h&amp;gt;
+#include &amp;lt;linux/usb/isp1763.h&amp;gt;
+
+#include &amp;lt;linux/usb/hcd.h&amp;gt;
+
+#include &amp;lt;linux/module.h&amp;gt;
+#include &amp;lt;linux/moduleparam.h&amp;gt;
+
+#if defined(CONFIG_OF) &amp;amp;&amp;amp; defined(CONFIG_OF_IRQ)
+#include &amp;lt;linux/slab.h&amp;gt;
+#include &amp;lt;linux/of.h&amp;gt;
+#include &amp;lt;linux/of_platform.h&amp;gt;
+#include &amp;lt;linux/of_address.h&amp;gt;
+#include &amp;lt;linux/of_irq.h&amp;gt;
+#include &amp;lt;linux/of_gpio.h&amp;gt;
+#endif
+
+#ifdef CONFIG_PCI
+#include &amp;lt;linux/pci.h&amp;gt;
+#endif
+
+#include "isp1763-hcd.h"
+
+#if defined(CONFIG_OF) &amp;amp;&amp;amp; defined(CONFIG_OF_IRQ)
+struct isp1763 {
+struct usb_hcd *hcd;
+int rst_gpio;
+};
+
+static int of_isp1763_probe(struct platform_device *dev)
+{
+struct isp1763 *drvdata;
+struct device_node *dp = dev-&amp;gt;dev.of_node;
+struct resource *res;
+struct resource memory;
+int virq;
+resource_size_t res_len;
+int ret;
+const unsigned int *prop;
+unsigned int devflags = 0;
+enum of_gpio_flags gpio_flags;
+/* FIXME: of_property_read_u32() is not available until linux-3.1
+ * u32 bus_width = 0; */
+
+drvdata = kzalloc(sizeof(*drvdata), GFP_KERNEL);
+if (!drvdata)
+return -ENOMEM;
+
+ret = of_address_to_resource(dp, 0, &amp;amp;memory);
+if (ret) {
+pr_warn("of_isp1763: Memory resource not available\n");
+ret = -ENXIO;
+goto free_data;
+}
+
+res_len = resource_size(&amp;amp;memory);
+
+res = request_mem_region(memory.start, res_len, dev_name(&amp;amp;dev-&amp;gt;dev));
+if (!res) {
+pr_warn("of_isp1763: Cannot reserve the memory resource\n");
+ret = -EBUSY;
+goto free_data;
+}
+
+virq = irq_of_parse_and_map(dp, 0);
+if (!virq) {
+pr_warn("of_isp1763: IRQ resource not available\n");
+ret = -ENODEV;
+goto release_reg;
+}
+
+/* FIXME:
+ * of_property_read_u32() is not available until linux-3.1
+ *
+ * of_property_read_u32(dp, "bus-width", &amp;amp;bus_width);
+ * if (bus_width == 16)
+ *devflags |= ISP1763_FLAG_BUS_WIDTH_8;
+ */
+/* Some systems wire up only 8 of the 16 data lines */
+prop = of_get_property(dp, "bus-width", NULL);
+if (prop &amp;amp;&amp;amp; *prop == 8)
+devflags |= ISP1763_FLAG_BUS_WIDTH_8;
+
+if (of_get_property(dp, "port1-otg", NULL) != NULL)
+devflags |= ISP1763_FLAG_OTG_EN;
+
+if (of_get_property(dp, "dack-polarity-high", NULL) != NULL)
+devflags |= ISP1763_FLAG_DACK_POL_HIGH;
+
+if (of_get_property(dp, "dreq-polarity-high", NULL) != NULL)
+devflags |= ISP1763_FLAG_DREQ_POL_HIGH;
+
+if (of_get_property(dp, "intr-polarity-high", NULL) != NULL)
+devflags |= ISP1763_FLAG_INTR_POL_HIGH;
+
+if (of_get_property(dp, "intr-edge-trig", NULL) != NULL)
+devflags |= ISP1763_FLAG_INTR_EDGE_TRIG;
+
+pr_info("%s: devflags: 0x%X", __func__, devflags);
+
+drvdata-&amp;gt;rst_gpio = of_get_gpio_flags(dp, 0, &amp;amp;gpio_flags);
+if (gpio_is_valid(drvdata-&amp;gt;rst_gpio)) {
+ret = gpio_request(drvdata-&amp;gt;rst_gpio, dev_name(&amp;amp;dev-&amp;gt;dev));
+if (!ret) {
+if (!(gpio_flags &amp;amp; OF_GPIO_ACTIVE_LOW)) {
+devflags |= ISP1763_FLAG_RESET_ACTIVE_HIGH;
+gpio_direction_output(drvdata-&amp;gt;rst_gpio, 0);
+} else {
+gpio_direction_output(drvdata-&amp;gt;rst_gpio, 1);
+}
+} else {
+drvdata-&amp;gt;rst_gpio = ret;
+}
+}
+
+drvdata-&amp;gt;hcd = isp1763_register(memory.start, res_len, virq,
+IRQF_SHARED, drvdata-&amp;gt;rst_gpio,
+&amp;amp;dev-&amp;gt;dev, dev_name(&amp;amp;dev-&amp;gt;dev),
+devflags);
+if (IS_ERR(drvdata-&amp;gt;hcd)) {
+ret = PTR_ERR(drvdata-&amp;gt;hcd);
+goto free_gpio;
+}
+
+dev_set_drvdata(&amp;amp;dev-&amp;gt;dev, drvdata);
+return ret;
+
+free_gpio:
+if (gpio_is_valid(drvdata-&amp;gt;rst_gpio))
+gpio_free(drvdata-&amp;gt;rst_gpio);
+
+release_reg:
+release_mem_region(memory.start, res_len);
+free_data:
+kfree(drvdata);
+return ret;
+}
+
+static int of_isp1763_remove(struct platform_device *dev)
+{
+struct isp1763 *drvdata = dev_get_drvdata(&amp;amp;dev-&amp;gt;dev);
+
+dev_set_drvdata(&amp;amp;dev-&amp;gt;dev, NULL);
+
+usb_remove_hcd(drvdata-&amp;gt;hcd);
+iounmap(drvdata-&amp;gt;hcd-&amp;gt;regs);
+release_mem_region(drvdata-&amp;gt;hcd-&amp;gt;rsrc_start, drvdata-&amp;gt;hcd-&amp;gt;rsrc_len);
+usb_put_hcd(drvdata-&amp;gt;hcd);
+
+if (gpio_is_valid(drvdata-&amp;gt;rst_gpio))
+gpio_free(drvdata-&amp;gt;rst_gpio);
+
+kfree(drvdata);
+return 0;
+}
+
+static const struct of_device_id of_isp1763_match[] = {
+{
+.compatible = "nxp,usb-isp1763",
+},
+{ },
+};
+MODULE_DEVICE_TABLE(of, of_isp1763_match);
+
+static struct platform_driver isp1763_of_driver = {
+.driver = {
+.name = "nxp-isp1763",
+.owner = THIS_MODULE,
+.of_match_table = of_isp1763_match,
+},
+.probe          = of_isp1763_probe,
+.remove         = of_isp1763_remove,
+};
+#endif /* CONFIG_OF */
+
+#ifdef CONFIG_PCI
+static int isp1763_pci_probe(struct pci_dev *dev,
+const struct pci_device_id *id)
+{
+u8 latency, limit;
+__u32 reg_data;
+int retry_count;
+struct usb_hcd *hcd;
+unsigned int devflags = 0;
+int ret_status = 0;
+
+resource_size_t pci_mem_phy0;
+resource_size_t memlength;
+
+u8 __iomem *chip_addr;
+u8 __iomem *iobase;
+resource_size_t nxp_pci_io_base;
+resource_size_t iolength;
+
+if (usb_disabled())
+return -ENODEV;
+
+if (pci_enable_device(dev) &amp;lt; 0)
+return -ENODEV;
+
+if (!dev-&amp;gt;irq)
+return -ENODEV;
+
+/* Grab the PLX PCI mem maped port start address we need  */
+nxp_pci_io_base = pci_resource_start(dev, 0);
+iolength = pci_resource_len(dev, 0);
+
+if (!request_mem_region(nxp_pci_io_base, iolength, "ISP1763 IO MEM")) {
+pr_err("request region #1\n");
+return -EBUSY;
+}
+
+iobase = ioremap_nocache(nxp_pci_io_base, iolength);
+if (!iobase) {
+pr_err("ioremap #1\n");
+ret_status = -ENOMEM;
+goto cleanup1;
+}
+/* Grab the PLX PCI shared memory of the ISP 1763 we need  */
+pci_mem_phy0 = pci_resource_start(dev, 3);
+memlength = pci_resource_len(dev, 3);
+if (memlength &amp;lt; 0xffff) {
+pr_err("memory length for this resource is wrong\n");
+ret_status = -ENOMEM;
+goto cleanup2;
+}
+
+if (!request_mem_region(pci_mem_phy0, memlength, "ISP-PCI")) {
+pr_err("host controller already in use\n");
+ret_status = -EBUSY;
+goto cleanup2;
+}
+
+/* map available memory */
+chip_addr = ioremap_nocache(pci_mem_phy0, memlength);
+if (!chip_addr) {
+pr_err("Error ioremap failed\n");
+ret_status = -ENOMEM;
+goto cleanup3;
+}
+
+/* bad pci latencies can contribute to overruns */
+pci_read_config_byte(dev, PCI_LATENCY_TIMER, &amp;amp;latency);
+if (latency) {
+pci_read_config_byte(dev, PCI_MAX_LAT, &amp;amp;limit);
+if (limit &amp;amp;&amp;amp; limit &amp;lt; latency)
+pci_write_config_byte(dev, PCI_LATENCY_TIMER, limit);
+}
+
+/* Try to check whether we can access Scratch Register of
+ * Host Controller or not. The initial PCI access is retried until
+ * local init for the PCI bridge is completed
+ */
+retry_count = 20;
+reg_data = 0;
+while ((reg_data != 0xFACE) &amp;amp;&amp;amp; retry_count) {
+/*by default host is in 16bit mode, so
+ * io operations at this stage must be 16 bit
+ * */
+writel(0xface, chip_addr + HC_SCRATCH_REG);
+udelay(100);
+reg_data = readl(chip_addr + HC_SCRATCH_REG) &amp;amp; 0x0000ffff;
+retry_count--;
+}
+
+iounmap(chip_addr);
+
+/* Host Controller presence is detected by writing to scratch register
+ * and reading back and checking the contents are same or not
+ */
+if (reg_data != 0xFACE) {
+dev_err(&amp;amp;dev-&amp;gt;dev, "scratch register mismatch %x\n", reg_data);
+ret_status = -ENOMEM;
+goto cleanup3;
+}
+
+pci_set_master(dev);
+
+/* configure PLX PCI chip to pass interrupts */
+#define PLX_INT_CSR_REG 0x68
+reg_data = readl(iobase + PLX_INT_CSR_REG);
+reg_data |= 0x900;
+writel(reg_data, iobase + PLX_INT_CSR_REG);
+
+dev-&amp;gt;dev.dma_mask = NULL;
+hcd = isp1763_register(pci_mem_phy0, memlength, dev-&amp;gt;irq,
+IRQF_SHARED, -ENOENT, &amp;amp;dev-&amp;gt;dev, dev_name(&amp;amp;dev-&amp;gt;dev),
+devflags);
+if (IS_ERR(hcd)) {
+ret_status = -ENODEV;
+goto cleanup3;
+}
+
+/* done with PLX IO access */
+iounmap(iobase);
+release_mem_region(nxp_pci_io_base, iolength);
+
+pci_set_drvdata(dev, hcd);
+return 0;
+
+cleanup3:
+release_mem_region(pci_mem_phy0, memlength);
+cleanup2:
+iounmap(iobase);
+cleanup1:
+release_mem_region(nxp_pci_io_base, iolength);
+return ret_status;
+}
+
+static void isp1763_pci_remove(struct pci_dev *dev)
+{
+struct usb_hcd *hcd;
+
+hcd = pci_get_drvdata(dev);
+
+usb_remove_hcd(hcd);
+iounmap(hcd-&amp;gt;regs);
+release_mem_region(hcd-&amp;gt;rsrc_start, hcd-&amp;gt;rsrc_len);
+usb_put_hcd(hcd);
+
+pci_disable_device(dev);
+}
+
+static void isp1763_pci_shutdown(struct pci_dev *dev)
+{
+pr_err("ips1763_pci_shutdown\n");
+}
+
+static const struct pci_device_id isp1763_plx[] = {
+{
+.class          = PCI_CLASS_BRIDGE_OTHER &amp;lt;&amp;lt; 8,
+.class_mask     = ~0,
+.vendor= PCI_VENDOR_ID_PLX,
+.device= 0x5406,
+.subvendor= PCI_VENDOR_ID_PLX,
+.subdevice= 0x9054,
+},
+{ }
+};
+MODULE_DEVICE_TABLE(pci, isp1763_plx);
+
+static struct pci_driver isp1763_pci_driver = {
+.name =         "isp1763",
+.id_table =     isp1763_plx,
+.probe =        isp1763_pci_probe,
+.remove =       isp1763_pci_remove,
+.shutdown =     isp1763_pci_shutdown,
+};
+#endif /* CONFIG_PCI */
+
+static int isp1763_plat_probe(struct platform_device *pdev)
+{
+int ret = 0;
+struct usb_hcd *hcd;
+struct resource *mem_res;
+struct resource *irq_res;
+resource_size_t mem_size;
+struct isp1763_platform_data *priv = pdev-&amp;gt;dev.platform_data;
+unsigned int devflags = 0;
+unsigned long irqflags = IRQF_SHARED;
+
+mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+if (!mem_res) {
+pr_warn("%s: Memory resource not available\n", __func__);
+ret = -ENODEV;
+goto out;
+}
+mem_size = resource_size(mem_res);
+if (!request_mem_region(mem_res-&amp;gt;start, mem_size, "isp1763")) {
+pr_warn("%s: Cannot reserve the memory resource\n", __func__);
+ret = -EBUSY;
+goto out;
+}
+
+irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
+if (!irq_res) {
+pr_warn("%s: IRQ resource not available\n", __func__);
+return -ENODEV;
+}
+irqflags |= irq_res-&amp;gt;flags &amp;amp; IRQF_TRIGGER_MASK;
+
+if (priv) {
+if (priv-&amp;gt;bus_width_8)
+devflags |= ISP1763_FLAG_BUS_WIDTH_8;
+if (priv-&amp;gt;port1_otg)
+devflags |= ISP1763_FLAG_OTG_EN;
+if (priv-&amp;gt;dack_polarity_high)
+devflags |= ISP1763_FLAG_DACK_POL_HIGH;
+if (priv-&amp;gt;dreq_polarity_high)
+devflags |= ISP1763_FLAG_DREQ_POL_HIGH;
+if (priv-&amp;gt;intr_polarity_high)
+devflags |= ISP1763_FLAG_INTR_POL_HIGH;
+if (priv-&amp;gt;intr_edge_trigger)
+devflags |= ISP1763_FLAG_INTR_EDGE_TRIG;
+}
+
+hcd = isp1763_register(mem_res-&amp;gt;start, mem_size, irq_res-&amp;gt;start,
+       irqflags, -ENOENT,
+       &amp;amp;pdev-&amp;gt;dev, dev_name(&amp;amp;pdev-&amp;gt;dev), devflags);
+if (IS_ERR(hcd)) {
+pr_warn("%s: Failed to register the HCD device\n", __func__);
+/* Mark the hcd pointer as bad for platform_get_drvdata() */
+platform_set_drvdata(pdev, NULL);
+
+ret = -ENODEV;
+goto cleanup;
+}
+
+/* Needed to reference back for platform_get_drvdata cleanup */
+/* platform_set_drvdata() is a wrapper for dev_set_drvdata() */
+platform_set_drvdata(pdev, hcd);
+
+pr_info("%s: isp1763 USB device initialised\n", __func__);
+return ret;
+
+cleanup:
+release_mem_region(mem_res-&amp;gt;start, mem_size);
+out:
+return ret;
+}
+
+static int isp1763_plat_remove(struct platform_device *pdev)
+{
+/* Get a handle to the hcd and then clear it from pdev */
+/* platform_get_drvdata() is a wrapper for dev_get_drvdata() */
+struct usb_hcd *hcd = NULL;
+
+hcd = platform_get_drvdata(pdev);
+platform_set_drvdata(pdev, NULL);
+
+/* Remove the hcd */
+usb_remove_hcd(hcd); /* calls free_irq() */
+iounmap(hcd-&amp;gt;regs);
+release_mem_region(hcd-&amp;gt;rsrc_start, hcd-&amp;gt;rsrc_len);
+usb_put_hcd(hcd);
+return 0;
+}
+
+static struct platform_driver isp1763_plat_driver = {
+.probe= isp1763_plat_probe,
+.remove= isp1763_plat_remove,
+.driver= {
+.name= "isp1763",
+},
+};
+
+static int __init isp1763_init(void)
+{
+int ret, any_ret = -ENODEV;
+
+init_kmem_once();
+
+ret = platform_driver_register(&amp;amp;isp1763_plat_driver);
+if (!ret)
+any_ret = 0;
+#if defined(CONFIG_OF) &amp;amp;&amp;amp; defined(CONFIG_OF_IRQ)
+ret = platform_driver_register(&amp;amp;isp1763_of_driver);
+if (!ret)
+any_ret = 0;
+#endif
+#ifdef CONFIG_PCI
+ret = pci_register_driver(&amp;amp;isp1763_pci_driver);
+if (!ret)
+any_ret = 0;
+#endif
+
+if (any_ret)
+deinit_kmem_cache();
+
+return any_ret;
+}
+module_init(isp1763_init);
+
+static void __exit isp1763_exit(void)
+{
+platform_driver_unregister(&amp;amp;isp1763_plat_driver);
+
+#if defined(CONFIG_OF) &amp;amp;&amp;amp; defined(CONFIG_OF_IRQ)
+ platform_driver_unregister(&amp;amp;isp1763_of_driver);
+#endif
+#ifdef CONFIG_PCI
+pci_unregister_driver(&amp;amp;isp1763_pci_driver);
+#endif
+
+deinit_kmem_cache();
+}
+module_exit(isp1763_exit);
+
+MODULE_DESCRIPTION("ISP1763 USB host-controller from ST-Ericsson");
+MODULE_AUTHOR("Richard Retanubun &amp;lt;richardretanubun-4VtgCsEi+FIybS5Ee8rs3A&amp;lt; at &amp;gt;public.gmane.org&amp;gt;");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/usb/isp1763.h b/include/linux/usb/isp1763.h
new file mode 100644
index 0000000..662077f
--- /dev/null
+++ b/include/linux/usb/isp1763.h
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -0,0 +1,37 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt;
+/*
+ * Copyright (C) RuggedCom 2010
+ *
+ * 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; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA  02110-1301, USA.
+ *
+ * Description:
+ * Adapted from isp1760.h
+ *
+ * board initialization should put one of these into dev-&amp;gt;platform_data
+ * and place the isp1763 onto platform_bus named "isp1763-hcd".
+ */
+
+#ifndef __LINUX_USB_ISP1763_H
+#define __LINUX_USB_ISP1763_H
+
+struct isp1763_platform_data {
+unsigned bus_width_8:1;/* 8/16-bit data bus width */
+unsigned port1_otg:1;/* Port 1 supports OTG */
+unsigned dack_polarity_high:1;/* DACK active high */
+unsigned dreq_polarity_high:1;/* DREQ active high */
+unsigned intr_polarity_high:1;/* INTR active high */
+unsigned intr_edge_trigger:1;/* INTR edge trigger */
+};
+
+#endif /* __LINUX_USB_ISP1763_H */
&lt;/pre&gt;</description>
    <dc:creator>Richard Retanubun</dc:creator>
    <dc:date>2013-05-15T14:24:29</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86402">
    <title>[PATCH] usb: otg: mxs-phy: add missing type to usb_phy</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86402</link>
    <description>&lt;pre&gt;The mxs-phy is missing the phy.type property, why the usb_get_phy helper
function won't be able to find it. This patch adds this missing property.

Signed-off-by: Michael Grzeschik &amp;lt;mgr-bIcnvbaLZ9MEGnE8C9+IrQ&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
---
 drivers/usb/phy/phy-mxs-usb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 9d4381e..f8588f1 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
&amp;lt; at &amp;gt;&amp;lt; at &amp;gt; -160,6 +160,7 &amp;lt; at &amp;gt;&amp;lt; at &amp;gt; static int mxs_phy_probe(struct platform_device *pdev)
 mxs_phy-&amp;gt;phy.set_suspend= mxs_phy_suspend;
 mxs_phy-&amp;gt;phy.notify_connect= mxs_phy_on_connect;
 mxs_phy-&amp;gt;phy.notify_disconnect= mxs_phy_on_disconnect;
+mxs_phy-&amp;gt;phy.type= USB_PHY_TYPE_USB2;
 
 ATOMIC_INIT_NOTIFIER_HEAD(&amp;amp;mxs_phy-&amp;gt;phy.notifier);
 
&lt;/pre&gt;</description>
    <dc:creator>Michael Grzeschik</dc:creator>
    <dc:date>2013-05-15T13:03:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86392">
    <title>[PATCH 0/9] Equivalent of g_nokia.ko with configfs</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86392</link>
    <description>&lt;pre&gt;Here I present the conversion of everything that is required to provide
the equivalent of g_nokia.ko with configfs.

A branch will be available here (from 15th May 2013, afternoon UTC):
git://git.infradead.org/users/kmpark/linux-samsung usb-gadget-configfs

This series requires the following series to be applied:

http://www.spinics.net/lists/linux-usb/msg85863.html
http://www.spinics.net/lists/linux-usb/msg85873.html
http://www.spinics.net/lists/linux-usb/msg85307.html

BACKWARD COMPATIBILITY
======================

Please note that the old g_nokia.ko is still available and works.


USING THE NEW "GADGET"
======================

Please refer to this post:

http://www.spinics.net/lists/linux-usb/msg76388.html

for general information from Sebastian on how to use configfs-based
gadgets (*).

Here is the description specific to using g_nokia.ko equivalent.

The old g_nokia.ko provides 4 functions:

- Phonet
- Obex (2 instances)
- ACM
- ECM

in 2 configurations, which contain this same set of functions,
but differ in MaxPower.

The procedure of setting up such a gadget with configfs is given
below with an example:

$ modprobe libcomposite
 
$ mount none cfg -t configfs
 
$ mkdir cfg/usb_gadget/g1
$ cd cfg/usb_gadget/g1
 
$ echo 0x01c8 &amp;gt; idProduct
$ echo 0x0421 &amp;gt; idVendor
$ mkdir strings/0x409
$ echo Nokia &amp;gt; strings/0x409/manufacturer
$ echo "N900 (PC-Suite Mode)" &amp;gt; strings/0x409/product
 
$ mkdir configs/c.1
$ echo 500 &amp;gt; configs/c.1/MaxPower
$ mkdir configs/c.1/strings/0x409
$ echo "Conf 1" &amp;gt; configs/c.1/strings/0x409/configuration
 
$ mkdir configs/c.2
$ echo 100 &amp;gt; configs/c.2/MaxPower
$ mkdir configs/c.2/strings/0x409
$ echo "Conf 2" &amp;gt; configs/c.2/strings/0x409/configuration
 
$ mkdir functions/phonet.pn0
$ mkdir functions/obex.obex1
$ mkdir functions/obex.obex2
$ mkdir functions/acm.tty0
$ mkdir functions/ecm.usb0
 
$ ln -s functions/phonet.pn0 configs/c.1
$ ln -s functions/obex.obex1 configs/c.1
$ ln -s functions/obex.obex2 configs/c.1
$ ln -s functions/acm.tty0 configs/c.1
$ ln -s functions/ecm.usb0 configs/c.1
 
$ ln -s functions/phonet.pn0 configs/c.2
$ ln -s functions/obex.obex1 configs/c.2
$ ln -s functions/obex.obex2 configs/c.2
$ ln -s functions/acm.tty0 configs/c.2
$ ln -s functions/ecm.usb0 configs/c.2
 
$ echo s3c-hsotg &amp;gt; UDC

The obex and acm functions provide only one, readonly, attribute port_num,
which contains their port number.
The phonet function provides only one, readonly, attribute ifname, which
contains the network interface name associated with the function.
The ecm function provides qmult, dev_addr, host_addr read-write attributes,
and ifname readonly attribute.
and after creating the functions/ecm.&amp;lt;instance name&amp;gt; it contains default
values: qmult is 5, dev_addr and host_addr are randomly selected.
Except for ifname they can be written to until the function is linked to a
configuration. The ifname is read-only and contains the name of the interface
which was assigned by the net core, e. g. usb0.

After unbinding the gadget with echo "" &amp;gt; UDC
the symbolic links in the configuration directory can be removed,
the strings/* subdirectories in the configuration directory can
be removed, the strings/* subdirectories at the gadget level can
be removed and the configs/* subdirectories can be removed.
The functions/* subdirectories can be removed.
After that the gadget directory can be removed.
After that the respective modules can be unloaded.


TESTING THE FUNCTIONS
====================

phonet)

It is not possible to test the SOCK_STREAM protocol without a specific piece
of hardware, so only SOCK_DGRAM has been tested. For the latter to work,
I had to apply the patch mentioned here:

http://www.spinics.net/lists/linux-usb/msg85689.html

For this to work, these tools are required

git://git.gitorious.org/meego-cellular/phonet-utils.git

On the host:

$ ./phonet -a 0x10 -i usbpn0
$ ./pnroute add 0x6c usbpn0
$./pnroute add 0x10 usbpn0
$ ifconfig usbpn0 up

On the device:

$ ./phonet -a 0x6c -i upnlink0
$ ./pnroute add 0x10 upnlink0
$ ifconfig upnlink0 up

Then a test program can be used:

http://www.spinics.net/lists/linux-usb/msg85690.html

On the device:

$ ./pnxmit -a 0x6c -r

On the host:

$ ./pnxmit -a 0x10 -s 0x6c

As a result some data should be sent from host to device.
Then the other way round:

On the host:

$ ./pnxmit -a 0x10 -r

On the device:

$ ./pnxmit -a 0x6c -s 0x10

obex)

On device: seriald -f /dev/ttyGS&amp;lt;Y&amp;gt; -s 1024
On host: serialc -v &amp;lt;vendorID&amp;gt; -p &amp;lt;productID&amp;gt; -i&amp;lt;interface#&amp;gt; -a1 -s1024 \
             -t&amp;lt;out endpoint addr&amp;gt; -r&amp;lt;in endpoint addr&amp;gt;

where seriald and serialc are Felipe's utilities found here:

https://git.gitorious.org/usb/usb-tools.git master

acm)

On host: cat &amp;gt; /dev/ttyACM&amp;lt;X&amp;gt;
On target: cat /dev/ttyGS&amp;lt;Y&amp;gt;

then the other way round

On target: cat &amp;gt; /dev/ttyGS&amp;lt;Y&amp;gt;
On host: cat /dev/ttyACM&amp;lt;X&amp;gt;

ecm)

On the device: ping &amp;lt;host's IP&amp;gt;
On the host: ping &amp;lt;device's IP&amp;gt;

Andrzej Pietrasiewicz (9):
  usb/gadget: f_obex: use usb_gstrings_attach
  usb/gadget: nokia: convert to new interface of f_obex
  usb/gadget: f_obex: remove compatibility layer
  usb/gadget: phonet: move global dev variable to its user
  usb/gadget: f_phonet: convert to new function interface with backward
    compatibility
  usb/gadget: nokia: convert to new interface of f_phonet
  usb/gadget: f_phonet: remove compatibility layer
  usb/gadget: nokia: convert to new interface of f_ecm
  usb/gadget: f_phonet: add configfs support

 drivers/usb/gadget/Kconfig    |   16 +++
 drivers/usb/gadget/Makefile   |    2 +
 drivers/usb/gadget/f_obex.c   |   73 ++-----------
 drivers/usb/gadget/f_phonet.c |  174 +++++++++++++++++++++++++-----
 drivers/usb/gadget/nokia.c    |  235 +++++++++++++++++++++++++++--------------
 drivers/usb/gadget/u_phonet.h |   14 ++-
 6 files changed, 340 insertions(+), 174 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Andrzej Pietrasiewicz</dc:creator>
    <dc:date>2013-05-15T12:48:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86391">
    <title>[PATCH] qmi_wwan: Added support for Cinterion's PLxx WWAN Interface</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86391</link>
    <description>&lt;pre&gt;/drivers/net/usb/qmi_wwan.c: Added support for Cinterion's PLxx WWAN Interface
by adding QMI_FIXED_INTF with Cinterion's Vendor ID as well as Product ID and
WWAN Interface Number.

Signed-off-by: Hans-Christoph Schemmel &amp;lt;hans-christoph.schemmel &amp;lt;at&amp;gt; gemalto.com&amp;gt;
Signed-off-by: Christian Schmiedl &amp;lt;christian.schmiedl &amp;lt;at&amp;gt; gemalto.com&amp;gt;
---
patch is against linux-3.9
--- linux-3.9/drivers/net/usb/qmi_wwan.c.orig2013-05-06 08:10:11.170034451 +0200
+++ linux-3.9/drivers/net/usb/qmi_wwan.c2013-05-06 08:58:00.800264179 +0200
 &amp;lt;at&amp;gt;  &amp;lt;at&amp;gt;  -569,6 +569,7  &amp;lt;at&amp;gt;  &amp;lt;at&amp;gt;  static const struct usb_device_id produc
 {QMI_FIXED_INTF(0x1bbb, 0x011e, 4)},/* Telekom Speedstick LTE II (Alcatel One Touch L100V LTE) */
 {QMI_FIXED_INTF(0x2357, 0x0201, 4)},/* TP-LINK HSUPA Modem MA180 */
 {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)},/* Telit LE920 */
+{QMI_FIXED_INTF(0x1e2d, 0x12d1, 4)},/* Cinterion PLxx */

 /* 4. Gobi 1000 devices */
 {QMI_GOBI1K_DEVICE(0x05c6, 0x9212)},/* Acer Gobi Modem Device */
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA&amp;lt; at &amp;gt;public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

&lt;/pre&gt;</description>
    <dc:creator>Schmiedl Christian</dc:creator>
    <dc:date>2013-05-15T12:28:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.linux.usb.general/86380">
    <title>[PATCH -next 00/10] Various updates for ux500 musb and phy drivers</title>
    <link>http://comments.gmane.org/gmane.linux.usb.general/86380</link>
    <description>&lt;pre&gt;Hello Felipe,

this is another series of updates for the ux500 specific musb drivers.

This mainly upgrade the phy-ab8500-usb driver by adding support for
clock control and new ab8500 variants, with some minor refactoring of
the existing code to better handle those.

Other patches includes some coding style fixes, a patch to enable dma
support in host mode and a small workaround.

These are based on v3.10-rc1, and should merge fine with Lee's dma
patches on ux500-musb. I hope that you could review and take these for
your -next branch.

Thanks,
Fabio


Fabio Baltieri (7):
  usb: musb: various cosmetic fixes on ux500 files
  usb: phy: ab8500-usb: fix phy tuning value select logic
  usb: phy: ab8500-usb: add platform_device_id table
  usb: phy: ab8500-usb: move phy tuning values on separate functions
  usb: phy: ab8500-usb: add flag bits to control driver features
  usb: phy: ab8500-usb: add ab8540 support
  usb: phy: ab8500-usb: add ab9540 support

Mian Yousaf Kaukab (2):
  usb: musb: enable ux500 host side dma support
  usb: phy: ab8500-usb: add transceiver clock control

Sakethram Bommisetti (1):
  usb: phy: ab8500-usb: restart phy during probe

 drivers/usb/musb/musb_host.c     |   8 +-
 drivers/usb/musb/ux500_dma.c     |   6 +-
 drivers/usb/phy/phy-ab8500-usb.c | 846 +++++++++++++++++++++++++++++++++------
 3 files changed, 733 insertions(+), 127 deletions(-)

&lt;/pre&gt;</description>
    <dc:creator>Fabio Baltieri</dc:creator>
    <dc:date>2013-05-15T12:03:23</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.linux.usb.general">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.linux.usb.general</link>
  </textinput>
</rdf:RDF>
