finally getting rid of the old ->start()/->stop() methods
in favor of the better and improved ->udc_start()/->udc_stop().
There were surprisingly quite a few users left, but all of them
have been converted.
f_mass_storage removed some dead code, which is always great ;-)
There's also a big cleanup to the gadget framework from Sebastian
which gets us a lot closer to having only function drivers in
kernel and move over to configfs-based binding.
Other than these, there's the usual set of cleanups: s3c UDCs are
moving over to devm_regulator_bulk_get() API, at91_udc removed
an unnecessary check for work_pending() before scheduling and
there's the removal of an unused variable from uac2_pcm_trigger().
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJRAqbFAAoJEIaOsuA1yqREkXsQAInuD5h4OE4gMQSFWJbYY+it
BWN3JAIxm5NTKD9cez7d0vQ45v+9qDygBpHP4lsGGjhI0tkOr+nQ/g/sfSi3xbHM
HQ6/z7Y68pNz9k57ans9NfIt0AuIsHE79tlOx3g+QVvryLHmQSAUzk9ru0VUHw4D
rSI3Czk3yCA4UnRITxJYpsnmEAZw/M7DwyMANqdNFzZaruMB77phsCWGIM2O0h1T
lw3sgcBoFcvYodWCzi90NWMA8FccQLMxBg6G+7ViaqGvAPqSuYwNTHJxxUwPHdbI
o28gQY7gkxZY9MwbnFZ+7jSbpcmzRpYtpgBflubf4iAkv+197lG6I5XyVgfdEZSF
AF3qi7asrXX/jjFoXASpmphBdCazz6G9bTmtdT3RpV3MKC6fnS1tXImBgreveIWh
sjhPQCleCCZI2+KLpVOujk3kUVHc9aJ5zbqcNLu03Ux1qqqK0VlZ9bahtip6HQ8H
GYhEdOmgIAe83CcJeWBdWAoz2c7fzEEvCj+TxxbyB7nE8TRsOYooKrBcfEM1plVy
qWcXULlhTdD4aWpQLanL8XSamKFvyDk+lEn4803of0eaVpE9gUxKi0fwD+j6UOMV
iBa7mEx5zIym7gJI4+SlvXIn8fPHfcHGX4BPLASd+G4ndkLIPc2wAb/KqVyIUCXt
I5K8UNYb0DiuQtxKXg8R
=PCP4
-----END PGP SIGNATURE-----
Merge tag 'gadget-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: gadget: patches for v3.9 merge window
finally getting rid of the old ->start()/->stop() methods
in favor of the better and improved ->udc_start()/->udc_stop().
There were surprisingly quite a few users left, but all of them
have been converted.
f_mass_storage removed some dead code, which is always great ;-)
There's also a big cleanup to the gadget framework from Sebastian
which gets us a lot closer to having only function drivers in
kernel and move over to configfs-based binding.
Other than these, there's the usual set of cleanups: s3c UDCs are
moving over to devm_regulator_bulk_get() API, at91_udc removed
an unnecessary check for work_pending() before scheduling and
there's the removal of an unused variable from uac2_pcm_trigger().
We're saving some extra memory now by being a lot
more conservative when allocating our event buffers.
Our default HIRD threshold value was mistakenly set
as one of the unsupported which would cause undefined
behavior. Turns out that it broke OMAP5 ES2.0, so we're
fixing it now by setting the maximum allowed HIRD
threshold (12).
Quite a few fixes to Isochronous transfers and scatter/gather
support from Pratyush.
We're also starting to support devicetree-based probe with
the latest changes from Kishon.
The usual set of cleanups also available: converting debugfs
regdump utility to regsets, better "compatible" strings for
Exynos platforms and the removal of the dependency for
Host and Gadget; now dwc3 can be compiled host-only, device-only,
and/or Dual-Role.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJRAqfLAAoJEIaOsuA1yqRExJ4P/jzWWpIos3bDSvWyzyP/HbL+
3EQ+jfERFsZRtpuZ/V/YAsiGkA3SAKSnougMKFHjsiX835KSLNKcaYAz4uaeg2ki
CtrrZF59NvLefiAL7aE/vILllHPPMwt3l8ojiDhpGghvQjYVKD9EYd3A1lYW4kpI
u/nXoJIs3++DcTmgIAfhaqYZnSEoO1rhoPYUGaJRBGlO3YYD6UiT//LhAnGIGSDM
ZZW69feoCogqUxSx6x4cbhV9W/FD3jKxO8Cn/3poyag8Ou+91lhbAL+7EZm+WnZ5
0+aslV9LYAzRJBBT/dvoD/3hwXNRS7/0L/OcYjrhqnUoQReWZppHQO1mFBgf/gOk
bool4uIH8sNvmsDqh8Lm9pzG101vnOHSKr15e2fH+h8Z2nM8cNsKCIvP7JZ1Tnyf
cehXGkE5PSEm0ViRQxqjbdRpqNlNp03wshh5J1HWiToTf0wxFGhgmOdxIquwO7cR
eBVFz2zQexyiMW0Plr0GBtjDm3LaojzvK1YEjHTesMdWx/yVXaLLu38Qv05sG7Nd
g4tRJOLrem03eqvv0zFbtGEPziilb/p7o699AHtiDJk330SHZUDvcoTQrIlXqsy1
nPBdjrOauZRRYYmhzS2I9RE8e4tj02uwb3mNyiHFdomZLTXS47fn3SrK/mL+iU6K
gpzStpT3xlvyzfHdP7of
=JJ6/
-----END PGP SIGNATURE-----
Merge tag 'dwc3-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: dwc3: patches for v3.9 merge window
We're saving some extra memory now by being a lot
more conservative when allocating our event buffers.
Our default HIRD threshold value was mistakenly set
as one of the unsupported which would cause undefined
behavior. Turns out that it broke OMAP5 ES2.0, so we're
fixing it now by setting the maximum allowed HIRD
threshold (12).
Quite a few fixes to Isochronous transfers and scatter/gather
support from Pratyush.
We're also starting to support devicetree-based probe with
the latest changes from Kishon.
The usual set of cleanups also available: converting debugfs
regdump utility to regsets, better "compatible" strings for
Exynos platforms and the removal of the dependency for
Host and Gadget; now dwc3 can be compiled host-only, device-only,
and/or Dual-Role.
Mostly fixes all over which weren't urgent enough for
the late -rc cycle.
There is a Double Buffering fix for Host Mode TX,
a dependency fix for the transceiver driver, some
fixes to the error path and a fix for the use of
omap_musb_maibox.
Other than these fixes, there a removal duplicate
headers from the dsps glue layer and removal of
redundant assignments in omap2430_probe().
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJRAqSpAAoJEIaOsuA1yqRE1VEQALCzApuKqj5V3VV3kVQLVdUc
Sk6i/EJRxebcV6TjHOqbojISNUURAAGbBx7PSzdFFbZT54jaj0qdZgvUaAhEOQk8
FiJJt1u8qdFoz0MRfHX32HWh3L7M62PXZeDjcAxDE7+1bg/xBqUm1sc3VEq63Qd7
nyq+h7Ov7AxF19gVm5LLjal1qc5BQsUB5Cx2bYOrpnceW7LPCSaJmWQEqP6o97Yi
6seSp4Q4GW5TK7WEKXW8pwLYXxr/1X84dOg+OWcTct3kGrg98rhVfwBBYEbSQI/6
UccWWn65sufym0Gj/CWd6mgTiOdjbBw70P+j3qX+/eZhuv37hNKTaLPTzZhkGyRP
+pTs/ROEDGnM3BEMxT3jzg2qFR4F3rU7OP3fa4kuf1iGdbnoJbJV8jI9PElZmI5F
bxN0F1v0+7QJUlJ4IcQhTlcT7GYsP+UZDbax18AMApsWqE5TbBtDqPhhHKGfWCkd
FnfGTZP8onKjnIan4kdh4usLSzE5+OPCklRAyQQNorZw6t3mgBU3Lr811kXGtg6J
GMzvXVQ6QZo5aVxWq3dJ39AQTp/Lrs4QFJRzmt0Krdwm9ND5HbnNSJUPntoeztOx
D3GCLbyUmJ/eDY1wk6TZTx3pMdXVy94NdGf/ZRZyST1k/QX5JNU7EfLDqrvQS6Yp
mW+nVB7gAOXWzaYir9KL
=dDY3
-----END PGP SIGNATURE-----
Merge tag 'musb-for-v3.9' of git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next
Felipe writes:
usb: musb: patches for v3.9 merge window
Mostly fixes all over which weren't urgent enough for
the late -rc cycle.
There is a Double Buffering fix for Host Mode TX,
a dependency fix for the transceiver driver, some
fixes to the error path and a fix for the use of
omap_musb_maibox.
Other than these fixes, there a removal duplicate
headers from the dsps glue layer and removal of
redundant assignments in omap2430_probe().
Multiple dwc3 controllers will try to allocate multiple xhci-hcd
interfaces.
Changing platform device IDs from NONE to AUTO to support
such cases.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Multiple dwc3 probe calls try to allocate no_op_xceive platform
device. Having static IDs for these will throw sysfs error -EEXIST.
Changing these static platform device IDs to AUTO to enable
multiple dwc3 controller support on a SoC.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
No functional change. Stray statements where removed from dwc3 core.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Enabled the USB2 and USB3 PHY in probe by calling usb_phy_set_suspend
and disabled the PHYs on driver removal. When PM is implemented this
will be optimized to enable the PHYs only when needed.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Add an API in the omap glue layer to write to the mailbox register which
can be used by comparator driver(twl). To pass the detection of the attached
device (signified by VBUS, ID) to the dwc3 core, dwc3 core has to write
to the mailbox regiter.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The runtime API's takes care of setting the SYSCONFIG register with
appropriate values. Hence explicit writes to SYSCONFIG register is
removed.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Before accessing any register, runtime API's should be invoked to enable
the clocks. runtime API's are added here to prevent abort during register
access.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Used of_platform_populate() to create dwc3 core platform_device
from device tree data.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Used device_for_each_child() to handle child device (dwc3 core) removal
during devexit of dwc3 omap. This is in preparation for creating the child
devices from subnode of dwc3 omap glue using of_platform_populate.
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Using specific chip in compatible strings. Newer SOCs can claim
device by using older string in the compatible list.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Using specific chip in compatible strings. Newer SOCs can claim
device by using older string in the compatible list.
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Reviewed-by: Doug Anderson <dianders@chromium.org>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This patch (as1646) fixes a long-standing bug in the USB hub driver.
Upon conversion from char to unsigned long, the bytes in the status
buffer are subject to unwanted sign extension. The bytes should be
declared as u8 rather than char, to prevent this.
This effects of this bug are minimal. The hub driver may end up doing
a little unnecessary extra work because it thinks events have occurred
on some ports when they really haven't.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
get rid of the line breaks in string constants.
let comments within 80 with limitation.
delete ' \' at the end of a statement.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Adding three currently unsupported modems based on information
from .inf driver files:
Diag VID_1BBB&PID_0052&MI_00
AGPS VID_1BBB&PID_0052&MI_01
VOICE VID_1BBB&PID_0052&MI_02
AT VID_1BBB&PID_0052&MI_03
Modem VID_1BBB&PID_0052&MI_05
wwan VID_1BBB&PID_0052&MI_06
Diag VID_1BBB&PID_00B6&MI_00
AT VID_1BBB&PID_00B6&MI_01
Modem VID_1BBB&PID_00B6&MI_02
wwan VID_1BBB&PID_00B6&MI_03
Diag VID_1BBB&PID_00B7&MI_00
AGPS VID_1BBB&PID_00B7&MI_01
VOICE VID_1BBB&PID_00B7&MI_02
AT VID_1BBB&PID_00B7&MI_03
Modem VID_1BBB&PID_00B7&MI_04
wwan VID_1BBB&PID_00B7&MI_05
Updating the blacklist info for the X060S_X200 and X220_X500D,
reserving interfaces for a wwan driver, based on
wwan VID_1BBB&PID_0000&MI_04
wwan VID_1BBB&PID_0017&MI_06
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Added device tree support for usb3503 driver and add new document with device tree binding information.
Signed-off-by: Dongjin Kim <tobetter@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
for function uhci_sprint_schedule:
the buffer len is MAX_OUTPUT: 64 * 1024, which may not be enough:
may loop UHCI_NUMFRAMES times (UHCI_NUMFRAMES is 1024)
each time of loop may get more than 64 bytes
so need check the buffer length to avoid memory overflow
this patch fix it like this:
at first, make enough room for buffering the exceeding contents
judge the contents which written whether bigger than buffer length
if bigger (the exceeding contents will be in the exceeding buffer)
break current work flow, and return.
Signed-off-by: Chen Gang <gang.chen@asianux.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
usally we will use udc->tranceiver == NULL or
udc->tranceiver != NULL.
So when failed to get the udc->tranceiver by usb_get_phy(), we
directly set udc->tranceiver to be NULL.
Then the source code will not need macro IS_ERR_OR_NULL() for
udc->tranceiver judgement. It can reduce the line size and make
the judgement simple.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
use devm_xxx for otg driver probe. So we do need care about
the resources release in driver remove or failure handling
in driver probe.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The __exit_p() will be NULL if MODULE is no defined.
It will cause the warning. Removing __exit_p to remove
the warning.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
use devm_xxx for udc driver probe. So we do need care about
the resources release in driver remove or failure handling
in driver probe.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Those have been deprecated for a long time and
previous patches just converted all remaining
users of those.
Since there are no in-tree users and we don't
want any new users for them, let's obliterate
every piece of code related to those calls.
Signed-off-by: Felipe Balbi <balbi@ti.com>
First of all, that 28 value makes no sense as
HIRD threshold is a 4-bit value, second of all
it's causing issues for OMAP5.
Using 12 because commit cbc725b3 (usb: dwc3:
keep default hird threshold value as 4b1100)
had the intention of setting the maximum allowed
value of 0xc.
Also, original code has been wrong forever, so
this should be backported as far back as
possible.
Cc: <stable@vger.kernel.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This patches converts the driver into the new style start/stop
interface. As a result the driver no longer uses the static
global the_conroller variable.
Signed-off-by: Chao Xie <chao.xie@marvell.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
ACPI provide "_PLD" and "_UPC" aml methods to describe usb port
visibility and connectability. This patch is to add usb_hub_adjust_DeviceRemovable()
to adjust usb hub port's DeviceRemovable according ACPI information and invoke it in
the rh_call_control(). When hub descriptor request is issued at first time,
usb port device isn't created and usb port is not bound with acpi. So first
hub descriptor request is not changed based on ACPI information. After usb
port devices being created, call usb_hub_adjust_DeviceRemovable in the hub_configure()
and then set hub port's DeviceRemovable according ACPI information and this also works
for non-root hub.
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Lan Tianyu <tianyu.lan@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Delete successive tests to the same location. In this case res has already
been tested for being NULL, and calling devm_request_and_ioremap will not
make it NULL. On the other hand, devm_request_and_ioremap can return NULL
on failure.
A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)
// <smpl>
@s exists@
local idexpression y;
expression x,e;
@@
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
... when != \(y = e\|y += e\|y -= e\|y |= e\|y &= e\|y++\|y--\|&y\)
when != \(XT_GETPAGE(...,y)\|WMI_CMD_BUF(...)\)
*if ( \(x == NULL\|IS_ERR(x)\|y != 0\) )
{ ... when forall
return ...; }
// </smpl>
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/u_serial.c:1291:5: sparse: symbol \
'userial_init' was not declared. Should it be static?
drivers/usb/gadget/zero.c:66:25: sparse: symbol \
'gzero_options' was not declared. Should it be static?
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
Use usb_gstrings_attach() to assign strings in f_acm to assign strings
ids.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The USB strings don't (yet) fully work in multiple configs/gadget
environment. The string id is assigned to the descriptor and the struct
usb_strings. We create a copy of the individual descriptor so we don't
clash if we use a function more than once. However, we have only one
struct usb_string for each string.
Currently each function which is used multiple times checks for
"id != 0" and only assigns string ids if it did not happen yet. This
works well if we use the same function multiple times as long as we do
it within the "one" gadget we have. Trouble starts once we use the same
function in a second gadget.
In order to solve this I introduce usb_gstrings_attach(). This function will
crate a copy all structs except for the strings which are not copied.
After the copy it will assign USB ids and attach it to cdev.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
The configfs can't use all of composite's hooks because ->bind() and
->unbind() has to be done a little differently. ->disconnect() and
->setup() on the hand can be recycled.
This patch exports them both so configfs can use them.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This patch factors out two helper functions from composite_bind()
that is composite_dev_prepare() and its counterpart
composite_dev_cleanup().
This will be used by the configfs which requries a slightly different
bind/setup code because part of its configurations (i.e. config
descripts, cdev, …) are setup in advance and VID/PID and so one should
not be overwritten. Also the setup of ep0 endpoint can be delayed until
the UDC is assigned.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This patch adds udc_attach_driver() which allows to bind an UDC which is
specified by name to a driver. The name of available UDCs can be
obtained from /sys/class/udc. This interface is intended for configfs
interface.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
We can have multiple usb_functions which origin is the same "instance".
Within one USB configuration there should be only one function of an
instance. This back pointer helps configfs to recoginze to which
instance a given usb_function belongs.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>
This patch converts the acm_ms gadget to make use of the function
framework to request the ACM function.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Felipe Balbi <balbi@ti.com>