1
0
Fork 0
Commit Graph

400187 Commits (e5eaa0dc4866181aff655ef3f94cd990172b751f)

Author SHA1 Message Date
Andrzej Pietrasiewicz e5eaa0dc48 usb: gadget: f_mass_storage: convert to new function interface with backward compatibility
Converting mass storage to the new function interface requires converting
the USB mass storage's function code and its users.
This patch converts the f_mass_storage.c to the new function interface.
The file is now compiled into a separate usb_f_mass_storage.ko module.
The old function interface is provided by means of a preprocessor conditional
directives. After all users are converted, the old interface can be removed.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:24:04 -05:00
Andrzej Pietrasiewicz 5de862d73b usb: gadget: f_mass_storage: create fsg_common_run_thread for use in fsg_common_init
fsg_common_init is a lengthy function. Factor a portion of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:52 -05:00
Andrzej Pietrasiewicz 23682e3c78 usb: gadget: f_mass_storage: create fsg_common_set_inquiry_string for use in fsg_common_init
fsg_common_init is a lengthy function. Factor a portion of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:51 -05:00
Andrzej Pietrasiewicz b27c08c953 usb: gadget: f_mass_storage: create lun creation helpers for use in fsg_common_init
fsg_common_init is a lengthy function. Factor portions of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:50 -05:00
Andrzej Pietrasiewicz a891d7a32f usb: gadget: f_mass_storage: create fsg_common_set_cdev for use in fsg_common_init
fsg_common_init is a lengthy function. Factor a portion of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:50 -05:00
Andrzej Pietrasiewicz 7063417099 usb: gadget: f_mass_storage: create lun handling helpers for use in fsg_common_init
fsg_common_init is a lengthy function. Factor portions of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:49 -05:00
Andrzej Pietrasiewicz 6313caace5 usb: gadget: f_mass_storage: create fsg_common_set_num_buffers for use in fsg_common_init
fsg_common_init is a lengthy function. Factor a portion of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:48 -05:00
Andrzej Pietrasiewicz b24650df95 usb: gadget: f_mass_storage: create fsg_common_setup for use in fsg_common_init
fsg_common_init is a lengthy function. Factor a portion of it out.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:47 -05:00
Andrzej Pietrasiewicz bd528d4e69 usb: gadget: f_mass_storage: make sysfs interface optional
When configfs is in place, the luns will not be represented in sysfs,
so there will be no struct device associated with a lun.
In order to maintain compatibility and allow configfs adoption
sysfs is made optional in this patch.

As a consequence some debug macros need to be adjusted. Two new
fields are added to struct fsg_lun: name and name_pfx.
The "name" is for storing a string which is presented to the user
instead of the dev_name. The "name_pfx", if non-NULL, is prepended
to the "name" at printing time.

The name_pfx is for a future lun.0, which will be a default group in
mass_storage.<name>. By design at USB function configfs group's creation
time its name is not known (but instead set a bit later in
drivers/usb/gadget/configfs.c:function_make) and it is this name that
serves the purpose of the said name prefix. So instead of copying
a yet-unknown string a pointer to it is stored in struct fsg_lun.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:47 -05:00
Andrzej Pietrasiewicz 8502d66d33 usb: gadget: f_mass_storage: create _fsg_common_free_buffers
When configfs is in place, gadgets will have to be able to free
fsg buffers. Add a helper function.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Michal Nazarewicz <mina86@mina86.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:21:31 -05:00
Robert Baldyga e9edd199d6 usb: gadget: s3c-hsotg: fix set_ep_maxpacket function
This patch fixes max packet size check in s3c_hsotg_set_ep_maxpacket()
function. According USB specification, bits 10..0 of mps specifies maximum
packet size, so there is bitwise AND between mps and 0x7ff value. Also added
check if maxpacket isn't grater than 1024 which is maximum size od single USB
transaction.

In s3c_hsotg_ep_enable() function added s3c_hsotg_set_ep_maxpacket() call
instead of setting ep.maxpacket value directly.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 10:16:43 -05:00
Michael Opdenacker dc807576d2 usb: gadget: mv_u3d_core: remove deprecated IRQF_DISABLED
This patch proposes to remove the use of the IRQF_DISABLED flag

It's a NOOP since 2.6.35 and it will be removed one day.
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 09:40:31 -05:00
David Cohen 7fc031e612 usb: g_ffs: fix compilation warning
If USB_FUNCTIONFS is selected without USB_FUNCTIONFS_ETH and
USB_FUNCTIONFS_RNIS, u_ether.h won't be included and then
USB_ETHERNET_MODULE_PARAMAETERS macro won't be available causing the
following warning compilation:

drivers/usb/gadget/g_ffs.c:81:1: warning: data definition has no type or
storage class [enabled by default]
drivers/usb/gadget/g_ffs.c:81:1: warning: type defaults to ‘int’ in
declaration of ‘USB_ETHERNET_MODULE_PARAMETERS’ [-Wimplicit-int]
drivers/usb/gadget/g_ffs.c:81:1: warning: function declaration isn’t a
prototype [-Wstrict-prototypes]

This patch fixes the warning by making USB_ETHERNET_MODULE_PARAMETERS to
be used iff u_ether.h is included, otherwise it is not needed.

Signed-off-by: David Cohen <david.a.cohen@linux.intel.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-10 09:40:28 -05:00
Robert Baldyga 13613c133b usb: gadget: s3c-hsotg: fix maxpacket size
This patch changes ep maxpacket value from 512 to 1024, because it's needed
to handle interupt and isochronous endpoints in high-speed mode. This change
doesn't affect on driver functioning, because fifo size (3072) is still enough
for the maximum transaction payload (3*1024 for high-speed high-bandwidtch
endpoints).

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:51 -05:00
Anton Tikhomirov 4662e5ef54 usb: phy: Reordering of OTG FSM variables
Reorder variables in struct otg_fsm as they appear in OTG and EH
supplement to USB2.0.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:50 -05:00
Anton Tikhomirov ec04996a08 usb: phy: Add and use missed OTG FSM inputs/outputs
Several input/output variables missed in current FSM implementation.
This patch adds and makes use of them as specified in OTG and EH
supplement to USB2.0.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:49 -05:00
Anton Tikhomirov 68041785d0 usb: phy: Rename "B-device session end SRP" OTG FSM input
In accordance with OTG and EH supplement, the correct name
of the FSM input is b_ssend_srp.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:49 -05:00
Anton Tikhomirov cff4dab4cb usb: phy: Rename OTG FSM informative variables
Mark informative variables with suffix '_inf' to distinguish
them from other non-informative variables with the same name.
If such non-informative varialbes were missed, they are created.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:48 -05:00
Anton Tikhomirov 3294908bc0 usb: phy: Add and use missed OTG FSM timers
a_bidl_adis_tmr and a_wait_vfall_tmr OTG timers missed in
current FSM implementation. This patch adds and makes use
of the timers as speicfied in OTG and EH supplement to USB2.0.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:47 -05:00
Anton Tikhomirov f6de27eed3 usb: phy: Fix OTG FSM timer handling
Get rid of using OTG driver specific timers by passing timer
type to corresponding callbacks.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:46 -05:00
Anton Tikhomirov 425d710172 usb: phy: Add and use missed helper functions
This patch implements missed helper functions for start_gadget() and
start_host() OTG FSM callbacks.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:46 -05:00
Anton Tikhomirov 737cc66eac usb: phy: Check OTG FSM callback existance in helper functions
Existence of callback must be checked to avoid NULL pointer
dereferncing.

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:45 -05:00
Anton Tikhomirov da8cc16724 usb: phy: Pass OTG FSM pointer to callback functions
struct otg_fsm may be embedded to device's context structure.
The callbacks may require pointer to struct otg_fsm to obtain
necessary data for its operation (example: regulator reference
for drv_vbus()).

Signed-off-by: Anton Tikhomirov <av.tikhomirov@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:44 -05:00
Fabio Estevam f8cffc84a2 usb: gadget: udc-core: Do not report -EISNAM error from gadgetfs
When mounting a gadgetfs the following error message is seen:

$ modprobe gadgetfs
gadgetfs: USB Gadget filesystem, version 24 Aug 2004
$ mkdir  /dev/gadget
$ mount -t gadgetfs none /dev/gadget
nop ci_hdrc.0: failed to start (null): -120

The error comes from gadgetfs_probe(), which returns -EISNAM (-120).

As Alan Stern explains[1], this is the normal behavior:

"It is a temporary measure, used only when the file system is set up
initially.  The real bind routine is gadgetfs_bind(), which gets called
when userspace configures the gadget.

In short, this is how it is intended to work.  It isn't a bug."

[1] http://marc.info/?l=linux-usb&m=138029668707075&w=2

So in order to prevent the error message, do not report EISNAM as an error.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:44:43 -05:00
Roger Quadros 33d7be3540 ARM: OMAP2+: usb-host: Adapt to USB phy-nop RESET line changes
The USB phy-nop nop driver expects the RESET line information
to be sent as a GPIO number via platform data. Adapt to that.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:29:11 -05:00
Roger Quadros 67c8d06364 ARM: OMAP2+: omap-usb-host: Get rid of platform_data from struct usbhs_phy_data
The platform data bits can be inferred from the other members of
struct usbhs_phy_data. So get rid of the platform_data member.

Build the platform data for the PHY device in usbhs_init_phys() instead.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:29:10 -05:00
Roger Quadros bd27fa44e1 usb: phy: generic: Don't use regulator framework for RESET line
Modelling the RESET line as a regulator supply wasn't a good idea
as it kind of abuses the regulator framework and also makes adaptation
code more complex.

Instead, manage the RESET gpio line directly in the driver. Update
the device tree binding information.

This also makes us easy to migrate to a dedicated GPIO RESET controller
whenever it becomes available.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:29:03 -05:00
Roger Quadros 8e933359ee usb: phy: generic: Add gpio_reset to platform data
The GPIO number of the RESET line can be passed to the
driver using the gpio_reset member.

Signed-off-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:25:22 -05:00
Sachin Kamat e79c8a06af usb: musb_am335x: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-04 09:25:11 -05:00
Pavel Machek a023da331c usb: gadget: s3c-hsotg: fix CodingStyle issues
checkpatch.pl has some valid complaints about style in s3c-hsotg.c:
- macro with 'if' should be really enclosed in 'do {} while (0)'
- seq_puts() is going to be slightly faster than seq_printf()
- pr_err() is shorter than printk(KERN_ERR ...)

Signed-off-by: Pavel Machek <pavel@denx.de>
[bzolnier: minor fixes]
Signed-off-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-02 08:22:27 -05:00
Daniel Mack a89adb098a usb: musb: ux500: use SIMPLE_DEV_PM_OPS
This removes the DEV_PM_OPS macro and brings this file in line with the
other musb platform drivers.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-02 08:22:19 -05:00
Daniel Mack 0967313b6f usb: musb: blackfin: use SIMPLE_DEV_PM_OPS
This makes bfin_pm_ops const and will stub the struct out in case
CONFIG_PM_SLEEP is not set.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-02 08:21:55 -05:00
Daniel Mack a49be8f231 usb: musb: am35x: use SIMPLE_DEV_PM_OPS
This makes am35x_pm_ops const and will stub the struct out in case
CONFIG_PM_SLEEP is not set.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-02 08:21:23 -05:00
Sachin Kamat 78723920a6 usb: phy: tegra-usb: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: linux-tegra@vger.kernel.org
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:56:26 -05:00
Sachin Kamat b99fffca7d usb: phy: am335x: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:56:25 -05:00
Sachin Kamat c4df9ae0d6 usb: phy: am335x-control: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:56:24 -05:00
Sachin Kamat b432cb8374 usb: musb_dsps: Remove redundant of_match_ptr
The data structure of_match_ptr() protects is always compiled in.
Hence of_match_ptr() is not needed.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Ravi B <ravibabu@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:56:23 -05:00
Andrzej Pietrasiewicz 4610f19b4a usb: gadget: f_mass_storage: use usb_gstrings_attach
Prepare for handling with configfs.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:52:12 -05:00
Andrzej Pietrasiewicz 8b903fd7f9 usb: gadget: f_mass_storage: add a level of indirection for luns storage
This is needed to prepare for configfs integration.

So far the luns have been allocated during gadget's initialization, based
on the nluns module parameter's value; the exact number is known when the
gadget is initialized and that number of luns is allocated in one go; they
all will be used.

When configfs is in place, the luns will be created one-by-one by the user.
Once the user is satisfied with the number of luns, they activate the
gadget. The number of luns must be <= FSG_MAX_LUN (currently 8), but other
than that it is not known up front and the user need not use contiguous
numbering (apart from the default lun #0). On the other hand, the function
code uses lun numbers to identify them and the number needs to be used
as an index into an array.

Given the above, an array needs to be allocated, but it might happen that
7 out of its 8 elements will not be used. On my machine
sizeof(struct fsg_lun) == 462, so > 3k of memory is allocated but not used
in the worst case.

By adding another level of indirection (allocating an array of pointers
to struct fsg_lun and then allocating individual luns instead of an array
of struct fsg_luns) at most 7 pointers are wasted, which is much less.

This patch also changes some for/while loops to cope with the fact
that in the luns array some entries are potentially empty.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:51:33 -05:00
Andrzej Pietrasiewicz f3fed36749 usb: gadget: f_mass_storage: factor out a header file
In order to prepare for the new function interface the f_mass_storage.c
needs to be compiled as a module, and so a header file will be required.

This patch factors out some code to a new f_mass_storage.h.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:51:17 -05:00
Andrzej Pietrasiewicz 6fdc5dd25e usb: gadget: create a utility module for mass_storage
Converting to configfs requires making the f_mass_storage.c a module.

But first we need to get rid of "#include "storage_common.c".

This patch makes storage_common.c a separately compiled file, which is
built as a utility module named u_ms.ko. After all mass storage users are
converted to the new function interface this module can be eliminated
by merging it with the mass storage function's module.

USB descriptors are exported so that they can be accessed from
f_mass_storage.

FSG_VENDOR_ID and FSG_PRODUCT_ID are moved to their only user.

Handling of CONFIG_USB_GADGET_DEBUG_FILES is moved to f_mass_storage.c.
The fsg_num_buffers static is moved to FSG_MODULE_PARAMETER users, so
instead of using a global variable the f_mass_storage introduces
fsg_num_buffers member in fsg_common (and fsg_config).

fsg_strings and fsg_stringtab are moved to f_mass_storage.c.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:50:57 -05:00
Andrzej Pietrasiewicz 092a4bd069 usb: gadget: configfs: add a method to unregister the gadget
Add a method to unregister the gadget using its config_item.

There can be functions (e.g. mass storage), which in some circumstances
need the gadget stopped. Add a method of stopping the gadget.

Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:50:22 -05:00
Duan Jiong a346941152 usb: gadget: Use ERR_CAST inlined function instead of ERR_PTR(PTR_ERR(...))
trivial patch converting ERR_PTR(PTR_ERR()) into ERR_CAST().
No functional changes.

Signed-off-by: Duan Jiong <duanj.fnst@cn.fujitsu.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:46:17 -05:00
Sergei Shtylyov ea78201e2e usb: musb: davinci: fix resources passed to MUSB driver for DM6467
After commit 09fc7d22b0 (usb: musb: fix incorrect
usage of  resource pointer), CPPI DMA driver on DaVinci DM6467 can't detect its
dedicated IRQ and so the MUSB IRQ  is erroneously used instead. This is because
only 2 resources are passed to the MUSB driver from the DaVinci glue layer,  so
fix  this by always copying 3 resources (it's  safe since a placeholder for the
3rd resource is always  there) and passing 'pdev->num_resources' instead of the
size of musb_resources[] to platform_device_add_resources().

Cc: <stable@vger.kernel.org> # 3.11+
Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:44:01 -05:00
Huang Rui 77a3a0aa39 usb: usbtest: bmAttributes would better be masked
When transfer type is isochronous, the other bits (bits 5..2) of
bmAttributes in endpoint descriptor might not be set zero. So it's better
to use usb_endpoint_type routine to mask bmAttributes with
USB_ENDPOINT_XFERTYPE_MASK to judge the transfter type later.

Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Huang Rui <ray.huang@amd.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:39:07 -05:00
Vivek Gautam d9681ee081 usb: dwc3: Remove additional delay of 100ms when resuming
This delay got introduced in:
"7415f17 usb: dwc3: core: add power management support"
which reflected similar code in dwc3_core_soft_reset() function.
However, originally the delay of 100ms in dwc3_core_soft_reset() was
meant to assist USB2PHY and USB3PHY reset, not for usb_phy_init()
sequence.

We should get rid of this delay, since things will still work
fine without this.

Reviewed-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:31:21 -05:00
Valentin Ilie f51a08da6d usb: gadget: mv_u3d_core: fix memory leaks
When trb_hw is NULL, trb should be free'd before return.

Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:31:21 -05:00
Sachin Kamat 161bfa98ba usb: dwc3: Remove redundant pci_set_drvdata
Driver core sets driver data to NULL upon failure or remove.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:31:20 -05:00
Russell King af38487572 usb: musb: use platform_device_register_full() to avoid directly messing with dma masks
Use platform_device_register_full() for those drivers which can, to
avoid messing directly with DMA masks.  This can only be done when
the driver does not need to access the allocated musb platform device
from within its callbacks, which may be called during the musb
device probing.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:31:19 -05:00
Jingoo Han d1d7e3f537 usb: gadget: net2280: remove unnecessary pci_set_drvdata()
The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-01 09:31:18 -05:00