Dan Carpenter [Fri, 7 Mar 2014 11:19:57 +0000 (14:19 +0300)]
usb: dwc3: gadget: cut and paste fixups in suspend/resume
These were cut and paste from the ->disconnect function.
Fixes commit
30d577b9bcc4 ('usb: dwc3: gadget: call gadget driver's
->suspend/->resume')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Roger Quadros [Thu, 6 Mar 2014 14:38:38 +0000 (16:38 +0200)]
phy: omap-control: Update DT binding information
Move omap-control binding information to the right location.
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Michal Nazarewicz [Fri, 28 Feb 2014 11:20:23 +0000 (16:50 +0530)]
usb: gadget: f_fs: Add flags to descriptors block
This reworks the way SuperSpeed descriptors are added and instead of
having a magic after full and high speed descriptors, it reworks the
whole descriptors block to include a flags field which lists which
descriptors are present and makes future extensions possible.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Manu Gautam [Fri, 28 Feb 2014 11:20:22 +0000 (16:50 +0530)]
usb: gadget: f_fs: Add support for SuperSpeed Mode
Allow userspace to pass SuperSpeed descriptors and
handle them in the driver accordingly.
This change doesn't modify existing desc_header and thereby
keeps the ABI changes backward compatible i.e. existing
userspace drivers compiled with old header (functionfs.h)
would continue to work with the updated kernel.
Signed-off-by: Manu Gautam <mgautam@codeaurora.org>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Gregory CLEMENT [Mon, 3 Mar 2014 16:48:34 +0000 (17:48 +0100)]
usb: gadget: atmel_usba: fix crashed during stopping when DEBUG is enabled
commit 511f3c5 (usb: gadget: udc-core: fix a regression during gadget driver
unbinding) introduced a crash when DEBUG is enabled.
The debug trace in the atmel_usba_stop function made the assumption that the
driver pointer passed in parameter was not NULL, but since the commit above,
such assumption was no longer always true.
This commit now uses the driver pointer stored in udc which fixes this
issue.
[ balbi@ti.com : improved commit log a bit ]
Cc: <stable@vger.kernel.org> # v3.2+
Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Alexandre Belloni [Thu, 27 Feb 2014 15:42:13 +0000 (16:42 +0100)]
usb: gadget: atmel_usba: fix crash when no endpoint are specified
If no endpoints are present in the device tree, the kernel will crash with the
following error:
Unable to handle kernel paging request at virtual address
00101008
[...]
[<
c0222ff4>] (composite_dev_prepare) from [<
c022326c>] (composite_bind+0x5c/0x190)
[<
c022326c>] (composite_bind) from [<
c021ff8c>] (udc_bind_to_driver+0x48/0xf0)
[<
c021ff8c>] (udc_bind_to_driver) from [<
c02208e0>] (usb_gadget_probe_driver+0x7c/0xa0)
[<
c02208e0>] (usb_gadget_probe_driver) from [<
c0008970>] (do_one_initcall+0x94/0x140)
[<
c0008970>] (do_one_initcall) from [<
c04b4b50>] (kernel_init_freeable+0xec/0x1b4)
[<
c04b4b50>] (kernel_init_freeable) from [<
c0376cc4>] (kernel_init+0x8/0xe4)
[<
c0376cc4>] (kernel_init) from [<
c0009590>] (ret_from_fork+0x14/0x24)
Code:
e5950014 e1a04001 e5902008 e3a010d0 (
e5922008)
---[ end trace
35c74bdd89b373d0 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
This checks for that case and returns an error, not allowing the driver to be
loaded with no endpoints.
Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:21:04 +0000 (10:21 +0800)]
usb: phy: mxs: Add sync time after controller clear phcd
After clear portsc.phcd, PHY needs 200us stable time for switch
32K clock to AHB clock.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:21:03 +0000 (10:21 +0800)]
usb: phy: mxs: Add system suspend/resume API
We need this to keep PHY's power on or off during the system
suspend mode. If we need to enable USB wakeup, then we
must keep PHY's power being on during the system suspend mode.
Otherwise, we need to keep PHY's power being off to save power.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:21:02 +0000 (10:21 +0800)]
usb: phy: mxs: Add implementation of set_wakeup
When we need the PHY can be waken up by external signals,
we can call this API. Besides, we call mxs_phy_disconnect_line
at this API to close the connection between USB PHY and
controller, after that, the line state from controller is SE0.
Once the PHY is out of power, without calling mxs_phy_disconnect_line,
there are unknown wakeups due to dp/dm floating at device mode.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:21:01 +0000 (10:21 +0800)]
usb: phy: Add set_wakeup API
This API is used to set wakeup enable at PHY registers, in that
case, the PHY can be waken up from suspend due to external events,
like vbus change, dp/dm change and id change.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:21:00 +0000 (10:21 +0800)]
usb: phy: mxs: add controller id
It is used to access un-regulator registers according to
different controllers.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:59 +0000 (10:20 +0800)]
usb: phy: mxs: Enable IC fixes for related SoCs
Two PHY bugs are fixed by IC logic, but these bits are not
enabled by default, so we enable them at driver.
The two bugs are: MXS_PHY_ABNORMAL_IN_SUSPEND and MXS_PHY_SENDING_SOF_TOO_FAST
which are described at code.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:58 +0000 (10:20 +0800)]
usb: phy: mxs: change description of usb device speed
Change "high speed" to "HS"
Change "non-high speed" to "FS/LS"
Implementation of notify_suspend and notify_resume will be different
according to mxs_phy_data->flags.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:57 +0000 (10:20 +0800)]
usb: phy: mxs: Add anatop regmap
It is needed by imx6 SoC series, but not for imx23 and imx28.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:56 +0000 (10:20 +0800)]
usb: doc: phy-mxs: update binding for adding anatop phandle
Add anatop phandle which is used to access anatop registers to
control PHY's power and other USB operations.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:55 +0000 (10:20 +0800)]
usb: phy: mxs: Add auto clock and power setting
The auto setting is used to open related power and clocks
automatically after receiving wakeup signal.
With this feature, the PHY's clock and power can be recovered
correctly from low power mode, it is guaranteed by IC logic.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:54 +0000 (10:20 +0800)]
usb: phy: mxs: Add platform judgement code
The mxs-phy has several bugs and features at different
versions, the driver code can get it through of_device_id.data.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Peter Chen [Mon, 24 Feb 2014 02:20:53 +0000 (10:20 +0800)]
usb: doc: phy-mxs: Add more compatible strings
Add "fsl,imx6q-usbphy" for imx6dq and imx6dl, add
"fsl,imx6sl-usbphy" for imx6sl, and "fsl,imx23-usbphy"
is still a fallback for other strings.
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Marek Szyprowski [Fri, 28 Feb 2014 12:06:11 +0000 (13:06 +0100)]
usb: gadget: s3c-hsotg: add proper suspend/resume support
This patch adds suspend/resume support to s3c-hsotg driver. It makes UDC
driver more power efficient.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Tested-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
George Cherian [Thu, 27 Feb 2014 05:14:41 +0000 (10:44 +0530)]
usb: musb: musb_cppi41: Dont reprogram DMA if tear down is initiated
Reprogramming the DMA after tear down is initiated leads to warning.
This is mainly seen with ISOCH since we do a delayed completion for
ISOCH transfers. In ISOCH transfers dma_completion should not reprogram
if the channel tear down is initiated.
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Kishon Vijay Abraham I [Mon, 3 Mar 2014 11:38:11 +0000 (17:08 +0530)]
usb: dwc3: adapt dwc3 core to use Generic PHY Framework
Adapted dwc3 core to use the Generic PHY Framework. So for init, exit,
power_on and power_off the following APIs are used phy_init(), phy_exit(),
phy_power_on() and phy_power_off().
However using the old USB phy library wont be removed till the PHYs of all
other SoC's using dwc3 core is adapted to the Generic PHY Framework.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Kishon Vijay Abraham I [Mon, 3 Mar 2014 11:38:10 +0000 (17:08 +0530)]
usb: dwc3: core: support optional PHYs
Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3
should be programmed), do not return from probe if the USB PHY library
returns -ENODEV as that indicates the platform does not have a
programmable PHY.
While this can be considered as a temporary fix, a long term solution
would be to add 'nop' PHY for platforms that does not have programmable
PHY.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Reviewed-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Kishon Vijay Abraham I [Mon, 25 Nov 2013 10:01:26 +0000 (15:31 +0530)]
Documentation: dt bindings: move ..usb/usb-phy.txt to ..phy/ti-phy.txt
Since now we have a separate folder for phy, move the PHY dt binding
documentation of TI to that folder.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 4 Mar 2014 15:35:02 +0000 (09:35 -0600)]
usb: dwc3: define more revisions
few new revisions of the core have been released,
add them to our list of revisions so we can apply
workarounds if necessary.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 4 Mar 2014 15:23:50 +0000 (09:23 -0600)]
usb: dwc3: fix randconfig build errors
commit 388e5c5 (usb: dwc3: remove dwc3 dependency
on host AND gadget.) created the possibility for
host-only and peripheral-only dwc3 builds but
left a possible randconfig build error when host-only
builds are selected.
Cc: <stable@vger.kernel.org> # v3.8+
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 26 Jul 2012 10:26:50 +0000 (13:26 +0300)]
usb: dwc3: gadget: pre-start Stream transfers when they're queued
we need to pre-start stream transfers otherwise we
will never know when to start them.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Wed, 26 Feb 2014 16:17:07 +0000 (10:17 -0600)]
usb: dwc3: gadget: call gadget driver's ->suspend/->resume
When going into bus suspend/resume we _must_
call gadget driver's ->suspend/->resume callbacks
accordingly. This patch implements that very feature
which has been missing forever.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Fri, 27 Apr 2012 11:17:35 +0000 (14:17 +0300)]
usb: dwc3: gadget: add 'force' argument to stop_active_transfer
It's not always we need to force a transfer to be removed
from the core's internal cache. This extra argument will
help differentiating those two cases.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 22:37:05 +0000 (16:37 -0600)]
usb: dwc3: gadget: make sure HIRD threshold is 0 in superspeed
During superspeed, HIRD threshold should always
be zero. Curent driver wasn't making sure that
was the case.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 19:43:19 +0000 (13:43 -0600)]
usb: dwc3: gadget: set KEEP_CONNECT in case of hibernation
if we have hibernation configured, Databook
instructs us to set KEEP_CONNECT bit together
with RUN_STOP bit, in step 9 of section 12.3.6.1
Initialization for Hibernation Support.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 20:02:53 +0000 (14:02 -0600)]
usb: dwc3: core: fix indentation
no functional changes, just converting spaces
into tab.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 19:04:28 +0000 (13:04 -0600)]
usb: dwc3: core: allocate scratch buffers
We must read HWPARAMS4 register to figure out
how many scratch buffers we should allocate.
Later patch will use "Set Scratchpad Buffer
Array" command to pass the pointer to the
IP so it can be used during hibernation.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Thu, 19 Dec 2013 18:38:49 +0000 (12:38 -0600)]
usb: dwc3: gadget: add a 'restore' argument to set_ep_config
That argument will be used in later patches when we
have working hibernation support. For now, always
pass it as false.
The idea of this patch is to decrease to size of
following patches and slowly add hibernation building
blocks to the gadget side of dwc3 so that it becomes
very easy to review the actual hibernation code.
[ balbi@ti.com : rewrote patch on top of current
tree. Added commit log. ]
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Fri, 27 Apr 2012 10:35:15 +0000 (13:35 +0300)]
usb: dwc3: gadget: implement dwc3_gadget_get_link_state
This function will be used during hibernation to get
the current link state. It will be needed at least
for Hibernation support.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Paul Zimmerman [Fri, 27 Apr 2012 10:56:23 +0000 (13:56 +0300)]
usb: dwc3: add 'saved_state' field to dwc3_ep structure
This extra field will save endpoint state when we're
about to enter hibernation. It will be used later
to restore the endpoint state when resuming.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 18:14:29 +0000 (12:14 -0600)]
usb: dwc3: add has_hibernation flag
this will tell driver that this version
of the core was configured with hibernation
feature enabled.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Thu, 19 Dec 2013 18:12:37 +0000 (12:12 -0600)]
usb: dwc3: cleanup struct dwc3
move 1-bit flags to the bottom of the structure,
sort all bit flags alphabetically, add documentation
which was missing.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 25 Feb 2014 20:47:54 +0000 (14:47 -0600)]
usb: dwc3: workaround: bogus hibernation events
Revision 2.20a of the core has a known issue
which would generate bogus hibernation events
_and_ random failures on USB CV TD.9.23 test
case.
The suggested workaround is to ignore hibernation
events which don't match currently connected
speed.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 25 Feb 2014 20:00:13 +0000 (14:00 -0600)]
usb: dwc3: workaround: clock gating issues
Revisions between 2.10a and 2.50a (included) have
a known issue which may cause xHCI compliance tests
to fail and/or quality issues with Isochronous
transactions.
Note that this issue only impacts certain configurations
of those revisions, namely the ones which have clock
gating enabled.
The suggested workaround is to disable clock gating in
known broken revisions, make sure HW LPM is disabled
and set GCTL.SOFITPSYNC to 1.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 25 Feb 2014 20:08:51 +0000 (14:08 -0600)]
usb: dwc3: core: define bit 10 of GCTL register
This bit is necessary for implemeting workaround
for known issue with some revisions of this core.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Fri, 13 Dec 2013 20:19:33 +0000 (14:19 -0600)]
usb: dwc3: gadget: always enable IOC on bulk/interrupt transfers
by setting IOC always, we can recycle TRBs a
lot sooner at the expense of some increased
CPU load.
The extra load seems to be quite minimal on
OMAP5 devices (instead of 1 IRQ for one MSC
transfer, we get
CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS).
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga [Thu, 20 Feb 2014 08:26:25 +0000 (09:26 +0100)]
usb: gadget: at91_udc: fix ep maxpacket initialisation
This patch fixes problem with unnecessary usb_ep_set_maxpacket_limit() usage.
It should not be used in at91udc_probe() function, where maxpacket values are
set for field "maxpacket" of struct at91_ep, which is representation of
endpoint in driver internals. Function usb_ep_set_maxpacket_limit() is called
in udc_reinit() function, where struct usb_ep instances are initialised with
values set previously in struct at91_ep instances. So it's very important to
initialise it properly.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Geert Uytterhoeven [Fri, 21 Feb 2014 19:49:53 +0000 (20:49 +0100)]
usb: musb: USB_MUSB_DUAL_ROLE/USB_MUSB_GADGET should depend on HAS_DMA
If NO_DMA=y:
drivers/built-in.o: In function `txstate':
musb_gadget.c:(.text+0x35955a): undefined reference to `dma_unmap_single'
musb_gadget.c:(.text+0x35957e): undefined reference to `dma_sync_single_for_cpu'
drivers/built-in.o: In function `musb_g_giveback':
(.text+0x359672): undefined reference to `dma_mapping_error'
drivers/built-in.o: In function `musb_g_giveback':
(.text+0x3596ba): undefined reference to `dma_unmap_single'
drivers/built-in.o: In function `musb_g_giveback':
(.text+0x3596e0): undefined reference to `dma_sync_single_for_cpu'
drivers/built-in.o: In function `rxstate':
musb_gadget.c:(.text+0x3599d0): undefined reference to `dma_unmap_single'
musb_gadget.c:(.text+0x3599f6): undefined reference to `dma_sync_single_for_cpu'
drivers/built-in.o: In function `musb_gadget_queue':
musb_gadget.c:(.text+0x35a8c0): undefined reference to `dma_map_single'
musb_gadget.c:(.text+0x35a8d0): undefined reference to `dma_mapping_error'
musb_gadget.c:(.text+0x35a906): undefined reference to `dma_sync_single_for_cpu'
musb_gadget.c:(.text+0x35a9a0): undefined reference to `dma_unmap_single'
musb_gadget.c:(.text+0x35a9c8): undefined reference to `dma_sync_single_for_cpu'
Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Sergei Shtylyov [Sat, 22 Feb 2014 01:29:15 +0000 (04:29 +0300)]
usb: phy: rcar-gen2-usb: always use 'dev' variable in probe() method
The probe() method has the 'dev' local variable declared and used but strangely
not in all cases where it should be...
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Felipe Balbi [Tue, 25 Feb 2014 16:58:43 +0000 (10:58 -0600)]
usb: musb: avoid NULL pointer dereference
instead of relying on the otg pointer, which
can be NULL in certain cases, we can use the
gadget and host pointers we already hold inside
struct musb.
Cc: <stable@vger.kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Markus Pargmann [Fri, 17 Jan 2014 09:22:35 +0000 (10:22 +0100)]
usb: musb: dsps, debugfs files
debugfs files to show the contents of important dsps registers.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Huang Rui [Tue, 7 Jan 2014 09:45:50 +0000 (17:45 +0800)]
usb: dwc3: fix wrong bit mask in dwc3_event_devt
Around DWC USB3 2.30a release another bit has been added to the
Device-Specific Event (DEVT) Event Information (EvtInfo) bitfield.
Because of that, what used to be 8 bits long, has become 9 bits long.
Per dwc3 2.30a+ spec in the Device-Specific Event (DEVT), the field of
Event Information Bits(EvtInfo) uses [24:16] bits, and it has 9 bits
not 8 bits. And the following reserved field uses [31:25] bits not
[31:24] bits, and it has 7 bits.
So in dwc3_event_devt, the bit mask should be:
event_info [24:16] 9 bits
reserved31_25 [31:25] 7 bits
This patch makes sure that newer core releases will work fine with
Linux and that we will decode the event information properly on new
core releases.
[ balbi@ti.com : improve commit log a bit ]
Cc: <stable@vger.kernel.org>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Dan Carpenter [Fri, 17 Jan 2014 13:34:11 +0000 (16:34 +0300)]
usb: gadget: gr_udc: remove some unneeded error handling
Debugfs function return an ERR_PTR if they compiled out. We don't need
to test for that here because if the debugfs file are compiled out then
it is ok to pass an ERR_PTR to debugfs_create_file() since it will just
be a no-op stub.
Debugfs return NULLs on error, but we don't need to test for that either
because debugfs_create_file() will accept NULL pointers.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Bo Shen [Wed, 19 Feb 2014 02:07:44 +0000 (10:07 +0800)]
usb: gadget: at91: using USBA_NR_DMAS for DMA channels
The SoCs earlier than sama5d3, they have the same number endpoints
and DMA channels. In driver code, they use the same definition
USBA_NR_ENDPOINTS for both endpoints and dma channels. However,
in sama5d3, it has different number for endpoints and DMA channels.
So, define a new macro USBA_NR_DMAs for DMA channels. And the
USBA_NR_ENDPOINS is not used anymore, remove it at the same time.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Bo Shen [Wed, 19 Feb 2014 02:07:43 +0000 (10:07 +0800)]
usb: gadget: at91: fix the number of endpoint parameter
In sama5d3 SoC, there are 16 endpoints, which is different with
earlier SoCs (only have 7 endpoints). The USBA_NR_ENDPOINTS macro
is not suitable for sama5d3. So, get the endpoints number through
the udc->num_ep, which get from platform data for non-dt kernel,
or parse from dt node.
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga [Mon, 10 Feb 2014 09:42:44 +0000 (10:42 +0100)]
usb: gadget: f_fs: add aio support
This patch adds asynchronous I/O support for FunctionFS endpoint files.
It adds ffs_epfile_aio_write() and ffs_epfile_aio_read() functions responsible
for preparing AIO operations.
It also modifies ffs_epfile_io() function, adding aio handling code. Instead
of extending list of parameters of this function, there is new struct
ffs_io_data which contains all information needed to perform I/O operation.
Pointer to this struct replaces "buf" and "len" parameters of ffs_epfile_io()
function. Allocated buffer is freed immediately only after sync operation,
because in async IO it's freed in complete funcion. For each async operation
an USB request is allocated, because it allows to have more than one request
queued on single endpoint.
According to changes in ffs_epfile_io() function, functions ffs_epfile_write()
and ffs_epfile_read() are updated to use new API.
For asynchronous I/O operations there is new request complete function named
ffs_epfile_async_io_complete(), which completes AIO operation, and frees
used memory.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga [Mon, 10 Feb 2014 09:42:43 +0000 (10:42 +0100)]
usb: gadget: f_fs: add poll for endpoint 0
This patch adds poll function for file representing ep0.
Ability of read from or write to ep0 file is related with actual state of ffs:
- When desctiptors or strings are not written yet, POLLOUT flag is set.
- If there is any event to read, POLLIN flag is set.
- If setup request was read, POLLIN and POLLOUT flag is set, to allow
send response (by performing I/O operation consistent with setup request
direction) or set stall (by performing I/O operation opposite setup
request direction).
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga [Mon, 10 Feb 2014 09:42:42 +0000 (10:42 +0100)]
usb: gadget: f_fs: fix setup request handling
This patch fixes __ffs_ep0_queue_wait() function, which now returns number of
bytes transferred in USB request or error code in case of failure. This is
needed by ffs_ep0_read() function, when read data is copied to userspace.
It also cleans up code by removing usused variable ep0req_status.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Michal Nazarewicz [Mon, 10 Feb 2014 09:42:41 +0000 (10:42 +0100)]
usb: gadget: functionfs: replace FFS_SETUP_STATUS with an inline function
The FFS_SETUP_STATUS macro could be trivialy replaced with an static
inline function but more importantly its name was tad confusing.
The name suggested it was a simple accessor macro but it actually
did change the state of the ffs_data structure perfomring
a FFS_SETUP_CANCELLED -> FFS_NO_SETUP transition. The name of the
function -- ffs_setup_state_clear_cancelled -- should better
describe what the function actually does.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Michal Nazarewicz [Mon, 10 Feb 2014 09:42:40 +0000 (10:42 +0100)]
usb: gadget: functionfs: fix typo in the enum variable
Since “cancelled” is spelled with two “l”s, rename FFS_SETUP_CANCELED
to FFS_SETUP_CANCELLED.
Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz [Mon, 13 Jan 2014 15:49:38 +0000 (16:49 +0100)]
usb: gadget: FunctionFS: use consistent naming with regard to ffs_lock
Consistently prefix function name with underscore if the function has to
be called with ffs_lock taken.
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz [Mon, 13 Jan 2014 15:49:37 +0000 (16:49 +0100)]
usb: gadget: FunctionFS: staticize functions used only in f_fs.c
ffs_alloc_dev and ffs_free_dev are used only in f_fs.c,
so make them static.
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz [Mon, 13 Jan 2014 15:49:36 +0000 (16:49 +0100)]
usb: gadget: code cleanup
Remove trailing whitespace
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Andrzej Pietrasiewicz [Mon, 13 Jan 2014 15:49:35 +0000 (16:49 +0100)]
usb: gadget: FunctionFS: dereference ffs_dev conditionally
ffs_dev->ffs_release_dev_callback should be accessed only if ffs_dev
is not NULL.
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Markus Pargmann [Fri, 17 Jan 2014 09:22:36 +0000 (10:22 +0100)]
usb: musb: dsps, use devm_kzalloc
Replace kzalloc by devm_kzalloc and remove the kfree() calls.
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Wolfram Sang [Tue, 14 Jan 2014 11:58:56 +0000 (12:58 +0100)]
usb: dwc3: omap: don't check resource with devm_ioremap_resource
devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Robert Baldyga [Tue, 14 Jan 2014 07:36:00 +0000 (08:36 +0100)]
usb: gadget: s3c-hsotg: stall ep0 in set_halt function
When s3c_hsotg_ep_sethalt() function is called for ep0 it should be stalled
in the same way that it is in s3c_hsotg_process_control() function, because
SET_HALT for ep0 is delayed response for setup request. Endpoint 0, if
halted, it doesn't need CLEAR_HALT because it clears "stalled" state
automatically when next setup request is received.
For this reason this patch moves code setting ep0 to "stalled" state to new
function named s3c_hsotg_stall_ep0() which is called in
s3c_hsotg_process_control() function as an immediate response for setup
request, and in s3c_hsotg_ep_sethalt() function as a delayed response for
setup request.
Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
wenlin.kang [Wed, 8 Jan 2014 06:22:12 +0000 (14:22 +0800)]
usb: gadget: printer: fix memory leak
When read data from g_printer, we see a Segmentation fault. eg:
Unable to handle kernel paging request at virtual address
bf048000 pgd
=
cf038000 [
bf048000] *pgd=
8e8cf811, *pte=
00000000, *ppte=
00000000
Internal error: Oops: 7 [#1] PREEMPT ARM Modules linked in: bluetooth
rfcomm g_printer
CPU: 0 Not tainted (3.4.43-WR5.0.1.9_standard #1)
PC is at __copy_to_user_std+0x310/0x3a8 LR is at 0x4c808010
pc : [<
c036e990>] lr : [<
4c808010>] psr:
20000013
sp :
cf883ea8 ip :
80801018 fp :
cf883f24
r10:
bf04706c r9 :
18a21205 r8 :
21953888
r7 :
201588aa r6 :
5109aa16 r5 :
0705aaa2 r4 :
5140aa8a
r3 :
0000004c r2 :
00000fdc r1 :
bf048000 r0 :
bef5fc3c
Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user
Control:
10c5387d Table:
8f038019 DAC:
00000015 Process
g_printer_test. (pid: 661, stack limit = 0xcf8822e8)
Stack: (0xcf883ea8 to 0xcf884000)
3ea0:
bf047068 00001fff bef5ecb9 cf882000 00001fff bef5ecb9
3ec0:
00001fff 00000000 cf2e8724 bf044d3c 80000013 80000013 00000001
bf04706c
3ee0:
cf883f24 cf883ef0 c012e5ac c0324388 c007c8ac c0046298 00008180
cf29b900
3f00:
00002000 bef5ecb8 cf883f68 00000003 cf882000 cf29b900 cf883f54
cf883f28
3f20:
c012ea08 bf044b0c c000eb88 00000000 cf883f7c 00000000 00000000
00002000
3f40:
bef5ecb8 00000003 cf883fa4 cf883f58 c012eae8 c012e960 00000001
bef60cb8
3f60:
000000a8 c000eb88 00000000 00000000 cf883fa4 00000000 c014329c
00000000
3f80:
000000d4 41af63f0 00000003 c000eb88 cf882000 00000000 00000000
cf883fa8
3fa0:
c000e920 c012eaa4 00000000 000000d4 00000003 bef5ecb8 00002000
bef5ecb8
3fc0:
00000000 000000d4 41af63f0 00000003 b6f534c0 00000000 419f9000
00000000
3fe0:
00000000 bef5ecac 000086d9 41a986bc 60000010 00000003 0109608a
0088828a
Code:
f5d1f07c e8b100f0 e1a03c2e e2522020 (
e8b15300) ---[ end trace
97e2618e250e3377 ]--- Segmentation fault
The root cause is the dev->rx_buffers list has been broken.
When we call printer_read(), the following call tree is triggered:
printer_read()
|
+---setup_rx_reqs(req)
| |
| +---usb_ep_queue(req)
| | |
| | +---...
| | |
| | +---rx_complete(req).
| |
| +---add the req to dev->rx_reqs_active
|
+---while(!list_empty(&dev->rx_buffers)))
The route happens when we don't use DMA or fail to start DMA in USB
driver. We can see: in the case, in rx_complete() it will add the req
to dev->rx_buffers. meanwhile we see that we will also add the req to
dev->rx_reqs_active after usb_ep_queue() return, so this adding will
break the dev->rx_buffers out.
After, when we call list_empty() to check dev->rx_buffers in while(),
due to can't check correctly dev->rx_buffers, so the Segmentation fault
occurs when copy_to_user() is called.
Signed-off-by: wenlin.kang <wenlin.kang@windriver.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
wenlin.kang [Wed, 8 Jan 2014 06:22:11 +0000 (14:22 +0800)]
usb: gadget: printer: fix possible deadlock
The problem occurs in follow path.
printer_read()
|
+---setup_rx_reqs()
|
+---usb_ep_queue()
|
+---...
|
+---rx_complete()
Although it is clear from code, we can't get it normally.
only when we enable some spin_lock debug config option, we can find it.
eg:
BUG: spinlock lockup on CPU#0, g_printer_test_/584
lock:
bf05e158, .magic:
dead4ead, .owner: g_printer_test_/584, .owner_cpu: 0
[<
c0016e1c>] (unwind_backtrace+0x0/0x104) from [<
c067aef8>] (dump_stack+0x20/0x24)
[<
c067aef8>] (dump_stack+0x20/0x24) from [<
c0680bec>] (spin_dump+0x8c/0x94)
[<
c0680bec>] (spin_dump+0x8c/0x94) from [<
c039071c>] (do_raw_spin_lock+0x128/0x154)
[<
c039071c>] (do_raw_spin_lock+0x128/0x154) from [<
c0685618>] (_raw_spin_lock_irqsave+0x64/0x70)
[<
c0685618>] (_raw_spin_lock_irqsave+0x64/0x70) from [<
bf05b4e8>] (rx_complete+0x54/0x10c [g_printer])
[<
bf05b4e8>] (rx_complete+0x54/0x10c [g_printer]) from [<
c0480478>] (musb_g_giveback+0x78/0x88)
[<
c0480478>] (musb_g_giveback+0x78/0x88) from [<
c048060c>] (rxstate+0xa0/0x10c)
[<
c048060c>] (rxstate+0xa0/0x10c) from [<
c0480d50>] (musb_ep_restart+0x44/0x70)
[<
c0480d50>] (musb_ep_restart+0x44/0x70) from [<
c0480fe4>] (musb_gadget_queue+0xe8/0xf8)
[<
c0480fe4>] (musb_gadget_queue+0xe8/0xf8) from [<
bf05b2b0>] (setup_rx_reqs+0xa4/0x178 [g_printer])
[<
bf05b2b0>] (setup_rx_reqs+0xa4/0x178 [g_printer]) from [<
bf05bb58>] (printer_read+0x9c/0x3f4 [g_printer])
[<
bf05bb58>] (printer_read+0x9c/0x3f4 [g_printer]) from [<
c01387f0>] (vfs_read+0xb4/0x144)
[<
c01387f0>] (vfs_read+0xb4/0x144) from [<
c01388d0>] (sys_read+0x50/0x124)
[<
c01388d0>] (sys_read+0x50/0x124) from [<
c000e900>] (ret_fast_syscall+0x0/0x3c)
The root cause is that we use the same lock two time in a path, so to avoid
the deadlock, we need to unlock in setup_rx_reqs(), and only unlock.
Signed-off-by: wenlin.kang <wenlin.kang@windriver.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Sachin Kamat [Fri, 3 Jan 2014 05:29:00 +0000 (10:59 +0530)]
usb: gadget: s3c-hsudc: remove unused label
Fixes the following compilation warning:
drivers/usb/gadget/s3c-hsudc.c: In function ‘s3c_hsudc_probe’:
drivers/usb/gadget/s3c-hsudc.c:1347:1: warning: label ‘err_add_device’
defined but not used [-Wunused-label]
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Sachin Kamat [Fri, 3 Jan 2014 05:28:59 +0000 (10:58 +0530)]
usb: gadget: s3c2410_udc: Fix build error
Pass value instead of address as expected by 'usb_ep_set_maxpacket_limit'.
Fixes the following compilation error introduced by commit
e117e742d310
("usb: gadget: add "maxpacket_limit" field to struct usb_ep"):
drivers/usb/gadget/s3c2410_udc.c: In function ‘s3c2410_udc_reinit’:
drivers/usb/gadget/s3c2410_udc.c:1632:3: error:
cannot take address of bit-field ‘maxpacket’
usb_ep_set_maxpacket_limit(&ep->ep, &ep->ep.maxpacket);
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Reviewed-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Julia Lawall [Sun, 29 Dec 2013 22:47:25 +0000 (23:47 +0100)]
usb: gadget: fix error return code
Set the return variable to an error code as done elsewhere in the function.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
(
if@p1 (\(ret < 0\|ret != 0\))
{ ... return ret; }
|
ret@p1 = 0
)
... when != ret = e1
when != &ret
*if(...)
{
... when != ret = e2
when forall
return ret;
}
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Jingoo Han [Tue, 4 Feb 2014 05:25:29 +0000 (14:25 +0900)]
usb: gadget: s3c-hsotg: use %pad for dma_addr_t
Use %pad for dma_addr_t to avoid the following build warnings
in printks.
drivers/usb/gadget/s3c-hsotg.c: In function 's3c_hsotg_start_req'
drivers/usb/gadget/s3c-hsotg.c:722:3: warning: format '%x' expects argument of type 'unsigned int' but argument 6 has type
'dma_addr_t' [-Wformat]
drivers/usb/gadget/s3c-hsotg.c:792:3: warning: format '%x' expects argument of type 'unsigned int' but argument 5 has type
'dma_addr_t' [-Wformat]
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Matt Porter [Mon, 3 Feb 2014 15:29:09 +0000 (10:29 -0500)]
usb: gadget: s3c-hsotg: fix build on x86 and other architectures
The readsl and writesl I/O accessors are only defined on some
architectures. The driver currently depends on CONFIG_ARM because
the build breaks on x86, in particular. Switch to use of ioread32_rep
and iowrite32_rep to fix build on all architectures and remove the
CONFIG_ARM dependency.
Also update printk formatting to handle a long long dma_addr_t to avoid
warnings on !32-bit architectures.
Signed-off-by: Matt Porter <mporter@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
George Cherian [Mon, 27 Jan 2014 09:37:26 +0000 (15:07 +0530)]
usb: musb: musb_cppi41: Handle ISOCH differently and not use the hrtimer.
In case of ISOCH transfers the hrtimer workaround for the hardware issue
is not very reliable. Instead of checking musb_is_tx_fifo_empty() in hrtimer
routine, schedule a completion work and check the same in completion work.
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
George Cherian [Mon, 27 Jan 2014 09:37:25 +0000 (15:07 +0530)]
usb: musb: musb_cppi41: Make CPPI aware of high bandwidth transfers
Enable CPPI to handle high bandwidth transfers, especially to support
webcam captures. Use a single bd to get the whole of the data in case of
high bandwidth transfers.
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
George Cherian [Mon, 27 Jan 2014 09:37:24 +0000 (15:07 +0530)]
usb: musb: musb_host: Enable ISOCH IN handling for AM335x host
Enable the isochrounous IN handling for AM335x HOST.
Reprogram CPPI to receive consecutive ISOCH frames in the same URB.
Signed-off-by: George Cherian <george.cherian@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Hans de Goede [Tue, 11 Feb 2014 16:03:51 +0000 (17:03 +0100)]
phy-core: Don't allow building phy-core as a module
include/phy/phy.h has stub code in there for when building without the
phy-core enabled. This is useful for generic drivers such as ahci-platform,
ehci-platoform and ohci-platform which have support for driving an optional
phy passed to them through the devicetree.
Since on some boards this phy functionality is not needed, being able to
disable the phy subsystem without needing a lot of #ifdef magic in the
driver using it is quite useful.
However this breaks when the module using the phy subsystem is build-in and
the phy-core is not, which leads to the build failing with missing symbol
errors in the linking stage of the zImage.
Which leads to gems such as this being added to the Kconfig for achi_platform:
depends on GENERIC_PHY || !GENERIC_PHY
Rather then duplicating this code in a lot of places using the phy-core,
I believe it is better to simply not allow the phy-core to be built as a
module. The phy core is quite small and has no external dependencies, so
always building it in when enabling it should not be an issue.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Vogel [Wed, 12 Feb 2014 19:56:00 +0000 (20:56 +0100)]
usbhid/quirks: Ignore Riso Kagaku Webmail Notifier
The "Webmail Notifier" is a USB controlled LED that appears as a HID
device. When trying to change the LED via hidraw it returns malformed
reports. As "usbled" supports it, we blacklist it in usbhid.
Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Thu, 13 Feb 2014 01:44:35 +0000 (17:44 -0800)]
usb: dwc2: fix dereference before NULL check
In a couple of places, we were checking qtd->urb for NULL after
we had already dereferenced it. Fix this by moving the check to
before the dereference.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Tue, 11 Feb 2014 16:54:46 +0000 (17:54 +0100)]
xhci-platform: Change compatible string from xhci-platform to generic-xhci
This brings the xhci-platform bindings in sync with what we've done for
the ohci- and ehci-platform drivers. As discussed there using platform as a
postfix is a bit weird as the platform bus is a Linux specific thing and
the bindings are supposed to be OS agnostic.
Note that the old xhci-platform compatible string is kept around for, well,
compatibility reasons.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Tue, 11 Feb 2014 16:54:45 +0000 (17:54 +0100)]
uhci-platform: Change compatible string from platform-uhci to generic-uhci
This brings the uhci-platform bindings in sync with what we've done for
the ohci- and ehci-platform drivers. As discussed there using platform as a
prefix is a bit weird as the platform bus is a Linux specific thing and
the bindings are supposed to be OS agnostic.
Note that the old platform-uhci compatible string is kept around for, well,
compatibility reasons.
While at it rename the bindings txt file to match the name of all the
other ?hci-platform bindings docs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Christian Vogel [Mon, 10 Feb 2014 17:49:43 +0000 (18:49 +0100)]
usb/misc/usbled: Add Riso Kagaku Webmail Notifier
Add support for the "Webmail Notifier" (USB powered LED for signaling
new emails) made by Riso Kagaku Corp. which displays 7 distinct colors.
USB Protocol initially reverse engineered by
https://code.google.com/p/usbmailnotifier/.
Signed-off-by: Christian Vogel <vogelchr@vogel.cx>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Bolle [Tue, 11 Feb 2014 12:23:07 +0000 (13:23 +0100)]
USB: ELAN: Remove useless "default M" lines
The Kconfig entries for USB_U132_HCD and USB_FTDI_ELAN default to
(uppercase) "M". But in Kconfig (lowercase) "m" is a magic symbol. "M"
is an ordinary symbol. As "M" is never set these Kconfig symbols will
also not be set by default.
Since I'm not aware of a reason why these driver should be set by
default, let's just drop these lines (that basically do nothing).
Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Richard Weinberger [Sun, 9 Feb 2014 18:48:01 +0000 (19:48 +0100)]
Remove MACH_OMAP_H4_OTG
The symbol is an orphan, get rid of it.
Signed-off-by: Richard Weinberger <richard@nod.at>
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Stern [Tue, 11 Feb 2014 16:26:00 +0000 (11:26 -0500)]
USB: ohci-platform: check for platform data misconfiguration
The ohci-platform driver checks for misconfigurations in cases where
the Device Tree data specifies big-endian registers or descriptors but
the corresponding driver config settings have not been enabled. As
Jonas Gorski suggested, we may as well apply the same check to general
platform data too.
This requires moving the code that sets the big-endian quirk flags
from the ohci_platform_reset() routine into ohci_platform_probe(), and
moving the checks out of the DT-specific "if" statement clause.
The patch also changes the text of the error messages in an attempt to
make the nature of the error more clear.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Stern [Tue, 11 Feb 2014 16:26:10 +0000 (11:26 -0500)]
USB: ehci-platform: check for platform data misconfiguration
The ehci-platform driver checks for misconfigurations in cases where
the Device Tree data specifies big-endian registers or descriptors but
the corresponding driver config settings have not been enabled. As
Jonas Gorski suggested, we may as well apply the same check to general
platform data too.
This requires moving the code that sets the big-endian quirk flags
from the ehci_platform_reset() routine into ehci_platform_probe(), and
moving the checks out of the DT-specific "if" statement clause.
The patch also changes the text of the error messages in an attempt to
make the nature of the error more clear.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Jonas Gorski <jogo@openwrt.org>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Tue, 11 Feb 2014 16:35:29 +0000 (17:35 +0100)]
ehci-platform: Change compatible string from usb-ehci to generic-ehci
The initial versions of the devicetree enablement patches for ehci-platform
used "ehci-platform" as compatible string. However this was disliked by various
reviewers because the platform bus is a Linux invention and devicetree is
supposed to be OS agnostic. After much discussion I gave up, added a:
"depends on !PPC_OF" to Kconfig to avoid a known conflict with PPC-OF platforms
and went with the generic usb-ehci as requested.
In retro-spect I should have chosen something different, the dts files for many
existing boards already claim to be compatible with "usb-ehci", ie they have:
compatible = "ti,ehci-omap", "usb-ehci";
In theory this should not be a problem since the "ti,ehci-omap" entry takes
presedence, but in practice using a conflicting compatible string is an issue,
because it makes which driver gets used depend on driver registration order.
This patch changes the compatible string claimed by ehci-platform to
"generic-ehci", avoiding the driver registration / module loading ordering
problems, and removes the "depends on !PPC_OF" workaround.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Tested-by: Kevin Hilman <khilman@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Tue, 11 Feb 2014 16:35:28 +0000 (17:35 +0100)]
ohci-platform: Change compatible string from usb-ohci to generic-ohci
The initial versions of the devicetree enablement patches for ohci-platform
used "ohci-platform" as compatible string. However this was disliked by various
reviewers because the platform bus is a Linux invention and devicetree is
supposed to be OS agnostic. After much discussion I gave up and went with
the generic usb-ohci as requested.
In retro-spect I should have chosen something different, the dts files for many
existing boards already claim to be compatible with "usb-ohci", ie they have:
compatible = "ti,ohci-omap3", "usb-ohci";
In theory this should not be a problem since the "ti,ohci-omap3" entry takes
presedence, but in practice using a conflicting compatible string is an issue,
because it makes which driver gets used depend on driver registration order.
This patch changes the compatible string claimed by ohci-platform to
"generic-ohci", avoiding the driver registration / module loading ordering
problems.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Kevin Hilman <khilman@linaro.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Shaibal Dutta [Sun, 2 Feb 2014 03:16:46 +0000 (19:16 -0800)]
usb: move hub init and LED blink work to power efficient workqueue
Allow the scheduler to select the best CPU to handle hub initalization
and LED blinking work. This extends idle residency times on idle CPUs
and conserves power.
This functionality is enabled when CONFIG_WQ_POWER_EFFICIENT is selected.
[zoran.markovic@linaro.org: Rebased to latest kernel. Added commit message.
Changed reference from system to power efficient workqueue for LEDs in
check_highspeed() and hub_port_connect_change().]
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Cc: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: Xenia Ragiadakou <burzalodowa@gmail.com>
Cc: Julius Werner <jwerner@chromium.org>
Cc: Krzysztof Mazur <krzysiek@podlesie.net>
Cc: Matthias Beyer <mail@beyermatthias.de>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Mathias Nyman <mathias.nyman@linux.intel.com>
Cc: Thomas Pugliese <thomas.pugliese@gmail.com>
Signed-off-by: Shaibal Dutta <shaibal.dutta@broadcom.com>
Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dan Carpenter [Tue, 21 Jan 2014 06:50:51 +0000 (09:50 +0300)]
usb: phy: msm: tiny leak on error in probe()
Free "motog" on error. This is more to appease the static checkers than
a real worry.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Dinh Nguyen [Tue, 4 Feb 2014 23:19:40 +0000 (15:19 -0800)]
usb: dwc2: handle the Host Port Interrupt when it occurs in device mode
According to the spec for the DWC2 controller, when the PRTINT interrupt fires,
the application must clear the appropriate status bit in the Host Port Control
and Status register to clear this bit.
When disconnecting an A-cable when the dwc2 host driver, the PRTINT fires, but
only the GINTSTS_PRTINT status is cleared, no action is done with the HPRT0
register. The HPRT0_ENACHG bit in the HPRT0 must also be poked to correctly
clear the GINTSTS_PRTINT interrupt.
I am seeing this behavoir on v2.93 of the DWC2 IP. When I disconnect an OTG
A-cable adapter, the PRTINT interrupt fires when the DWC2 is in device mode
and is never cleared.
This patch adds the function to read the HPRT0 register when the PRTINT fires
and the dwc2 IP has already transitioned to device mode. This function is only
clearing the HPRT0_ENACHG bit for now, but can be modified to handle more.
Signed-off-by: Dinh Nguyen <dinguyen@altera.com>
[ paulz: modified patch to preserve HPRT0_ENA bit ]
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Fri, 7 Feb 2014 15:36:43 +0000 (16:36 +0100)]
ehci-platform: Add support for controllers with big-endian regs / descriptors
This uses the already documented devicetree booleans for this, see:
Documentation/devicetree/bindings/usb/usb-ehci.txt
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Fri, 7 Feb 2014 15:36:42 +0000 (16:36 +0100)]
ohci-platform: Add support for controllers with big-endian regs / descriptors
Note this commit uses the same devicetree booleans for this as the ones
already existing in the usb-ehci bindings, see:
Documentation/devicetree/bindings/usb/usb-ehci.txt
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Fri, 7 Feb 2014 15:36:41 +0000 (16:36 +0100)]
ehci-platform: Add support for clks and phy passed through devicetree
Currently ehci-platform is only used in combination with devicetree when used
with some Via socs. By extending it to (optionally) get clks and a phy from
devicetree, and enabling / disabling those on power_on / off, it can be used
more generically. Specifically after this commit it can be used for the
ehci controller on Allwinner sunxi SoCs.
Since ehci-platform is intended to handle any generic enough non pci ehci
device, add a "usb-ehci" compatibility string.
There already is a usb-ehci device-tree bindings document, update this
with clks and phy bindings info.
Although actually quite generic so far the via,vt8500 compatibilty string
had its own bindings document. Somehow we even ended up with 2 of them. Since
these provide no extra information over the generic usb-ehci documentation,
this patch removes them.
The ehci-ppc-of.c driver also claims the usb-ehci compatibility string,
even though it mostly is ibm,usb-ehci-440epx specific. ehci-platform.c is
not needed on ppc platforms, so add a !PPC_OF dependency to it to avoid
2 drivers claiming the same compatibility string getting build on ppc.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Hans de Goede [Fri, 7 Feb 2014 15:36:40 +0000 (16:36 +0100)]
ohci-platform: Add support for devicetree instantiation
Add support for ohci-platform instantiation from devicetree, including
optionally getting clks and a phy from devicetree, and enabling / disabling
those on power_on / off.
This should allow using ohci-platform from devicetree in various cases.
Specifically after this commit it can be used for the ohci controller found
on Allwinner sunxi SoCs.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bjørn Mork [Sat, 11 Jan 2014 01:04:00 +0000 (02:04 +0100)]
usb: core: let dynamic ids override static ids
This modifies the probing order so that any matching
dynamic entry always will be used, even if the driver
has a matching static entry.
It is sometimes useful to dynamically update existing
device entries. With the new ability to set the dynamic
entry driver_info field, this can be used to test new
additions to class driver exception lists or proposed
changes to existing static per-device driver_info
entries.
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Stern [Thu, 30 Jan 2014 15:43:22 +0000 (10:43 -0500)]
usb-storage: enable multi-LUN scanning when needed
People sometimes create their own custom-configured kernels and forget
to enable CONFIG_SCSI_MULTI_LUN. This causes problems when they plug
in a USB storage device (such as a card reader) with more than one
LUN.
Fortunately, we can tell fairly easily when a storage device claims to
have more than one LUN. When that happens, this patch asks the SCSI
layer to probe all the LUNs automatically, regardless of the config
setting.
The patch also updates the Kconfig help text for usb-storage,
explaining that CONFIG_SCSI_MULTI_LUN may be necessary.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Thomas Raschbacher <lordvan@lordvan.com>
CC: Matthew Dharm <mdharm-usb@one-eyed-alien.net>
CC: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Kristóf Ralovich [Fri, 24 Jan 2014 11:18:35 +0000 (12:18 +0100)]
USB: simple: add Dynastream ANT USB-m Stick device support
Add support for ANT USB-m Stick from Dynastream Innovations, by listing
USB pid
[34366.944805] usb 6-1: New USB device found, idVendor=0fcf, idProduct=1009
[34366.944817] usb 6-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[34366.944824] usb 6-1: Product: ANT USB-m Stick
[34366.944831] usb 6-1: Manufacturer: Dynastream Innovations
Device reported (https://code.google.com/p/antpm/issues/detail?id=5) to
work through:
$ modprobe usbserial vendor=0x0fcf product=0x1009
Signed-off-by: Kristóf Ralovich <kristof.ralovich@gmail.com>
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Stern [Tue, 21 Jan 2014 15:38:45 +0000 (10:38 -0500)]
usb-storage: add unusual-devs entry for BlackBerry 9000
This patch adds an unusual-devs entry for the BlackBerry 9000. This
fixes Bugzilla #22442.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-by: Moritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de>
Tested-by: Moritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de>
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Alan Stern [Thu, 30 Jan 2014 15:20:29 +0000 (10:20 -0500)]
usb-storage: restrict bcdDevice range for Super Top in Cypress ATACB
The Cypress ATACB unusual-devs entry for the Super Top SATA bridge
causes problems. Although it was originally reported only for
bcdDevice = 0x160, its range was much larger. This resulted in a bug
report for bcdDevice 0x220, so the range was capped at 0x219. Now
Milan reports errors with bcdDevice 0x150.
Therefore this patch restricts the range to just 0x160.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Reported-and-tested-by: Milan Svoboda <milan.svoboda@centrum.cz>
CC: <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Josh Boyer [Tue, 28 Jan 2014 14:53:50 +0000 (09:53 -0500)]
usb: phy: move some error messages to debug
the PHY layer is supposed to be optional,
considering some PHY have no control bus
for SW to poke around.
After commit 1ae5799 (usb: hcd: Initialize
USB phy if needed) any HCD which didn't provide
a PHY driver would emit annoying error messages.
In this patch we're decreasing those messages
to debugging only and we also add a PHY prefix
or use dev_dbg so we know where they're coming from.
Reported-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Josh Boyer <jwboyer@fedoraproject.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Bjørn Mork [Tue, 14 Jan 2014 17:56:54 +0000 (18:56 +0100)]
usb: ftdi_sio: add Mindstorms EV3 console adapter
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Tue, 4 Feb 2014 19:21:24 +0000 (11:21 -0800)]
usb: dwc2: fix memory corruption in dwc2 driver
The move from the staging tree to the main tree exposed a
longstanding memory corruption bug in the dwc2 driver. The
reordering of the driver initialization caused the dwc2 driver
to corrupt the initialization data of the sdhci driver on the
Raspberry Pi platform, which made the bug show up.
The error is in calling to_usb_device(hsotg->dev), since ->dev
is not a member of struct usb_device. The easiest fix is to
just remove the offending code, since it is not really needed.
Thanks to Stephen Warren for tracking down the cause of this.
Reported-by: Andre Heider <a.heider@gmail.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Paul Zimmerman [Tue, 4 Feb 2014 19:42:15 +0000 (11:42 -0800)]
usb: dwc2: fix role switch breakage
Commit
beb7e592bc "staging: dwc2: add check on dwc2_core_reset
return" broke the B -> A role switching on OTG-enabled platforms.
This commit fixes it.
Reported-by: Dinh Nguyen <dinguyen@altera.com>
Tested-by: Dinh Nguyen <dinguyen@altera.com>
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>