summaryrefslogtreecommitdiff
path: root/drivers/usb/gadget
AgeCommit message (Collapse)Author
2013-11-26usb: gadget: f_sourcesink: add configfs supportAndrzej Pietrasiewicz
Add support for using the sourcesink function in gadgets composed 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-11-26usb: gadget: f_loopback: add configfs supportAndrzej Pietrasiewicz
Add support for using the loopback USB function in gadgets composed 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-11-26usb: gadget: factor out alloc_ep_reqAndrzej Pietrasiewicz
alloc_ep_req() is a function repeated in several modules. Make a common implementation and use it. 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-11-26usb: gadget: composite: redirect setup requestsAndrzej Pietrasiewicz
If there are setup requests not directed to an endpont or an interface, current config's setup() has been attempted so far. This patch, in case the above fails, adds code which tries the setup() of configuration's function if there is only one function in the configuration. This behavior is required to provide equivalent of gadget zero with configfs. The gadget zero has a "config driver" for sourcesink, but all it does is delegating the request to the function proper. So when the equivalent gadget is set up with configfs it needs to handle requests directed to "config driver", but with configfs it is not possible to specify "config drivers". 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-11-26usb: gadget: update some out of date commentsDan Carpenter
These functions used to return negative errror codes but now they return ERR_PTRs. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-26usb: gadget: remove superfluous name castsGeert Uytterhoeven
device_driver.name is "const char *" Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Cc: linux-usb@vger.kernel.org Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-26usb: gadget: goku: remove unused argumentMichal Nazarewicz
The stop_activity function never uses driver argument (even though it modifies it) and thus it is safe to remove it. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-26usb: gadget: epautoconf: switch over to usb_endpoint_type()Felipe Balbi
we have a helper to fetch endpoint type out of a descriptor, let's use it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-26usb: gadget: r8a66597-udc: convert to clk_prepare/unprepareLaurent Pinchart
Turn clk_enable() and clk_disable() calls into clk_prepare_enable() and clk_disable_unprepare() to get ready for the migration to the common clock framework. Cc: Felipe Balbi <balbi@ti.com> Cc: linux-usb@vger.kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: f_mass_storage: call try_to_freeze only when its safeGeorge Cherian
Call try_to_freeze() in sleep_thread() only when it's safe to sleep. do_read() and do_write() calls sleep_thread with lock held. Make sure these won't call try_to_freeze() by passing can_freeze flag to sleep_thread. Calling try_to_freeze() with a lock hold was done since day one in f_mass_storage but since commit 0f9548ca1 ("lockdep: check that no locks held at freeze time") lockdep complains about it. Signed-off-by: George Cherian <george.cherian@ti.com> Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: tcm_usb_gadget: mark bot_cleanup_old_alt staticFelipe Balbi
that symbol is only used inside this function driver, we should mark it static. Fixes sparse's: drivers/usb/gadget/tcm_usb_gadget.c:373:6: warning: symbol \ 'bot_cleanup_old_alt' was not declared. Should it \ be static? Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: ffs: fix sparse warningFelipe Balbi
use NULL instead of 0 as pointer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: zero: module parameters can be staticFengguang Wu
g_zero's module parameters can, and should, be static. This fixes sparse warnings. Cc: Peter Chen <peter.chen@freescale.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: storage: fix sparse warningFelipe Balbi
fsg_common_set_inquiry_string() expects pointers as second and third argument. Let's fix that by passing NULL instead of plain 0 just so we silence sparse's: drivers/usb/gadget/f_mass_storage.c:3114:60: warning: \ Using plain integer as NULL pointer drivers/usb/gadget/f_mass_storage.c:3114:63: warning: \ Using plain integer as NULL pointer Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: mass storage: fix return of delayed statusPratyush Anand
Mass storage gadget returns DELAYED_STATUS in stead of USB_GADGET_DELAYED_STATUS while handling bulk reset request. Since peripheral driver uses USB_GADGET_DELAYED_STATUS for delayed status handling, therefore replace DELAYED_STATUS by USB_GADGET_DELAYED_STATUS in mass storage driver. Since, DELAYED_STATUS and hence EP0_BUFSIZE will no longer be used now, so remove them. Signed-off-by: Pratyush Anand <pratyush.anand@st.com> Cc: Paul Zimmerman <Paul.Zimmerman@synopsys.com> Cc: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: f_mass_storage: fix mass storage dependencyAndrzej Pietrasiewicz
Legacy gadgets supporting mass storage (g_mass_storage, g_acm_ms, g_multi) all depend on BLOCK. Make the standalone compilation of f_mass_storage (without any legacy gadget) dependent no BLOCK, too. 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-11-25usb: gadget: composite: reset delayed_status on reset_configMichael Grzeschik
The delayed_status value is used to keep track of status response packets on ep0. It needs to be reset or the set_config function would still delay the answer, if the usb device got unplugged while waiting for setup_continue to be called. Cc: stable@vger.kernel.org Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: fix pxa25x compilation problemsLinus Walleij
In commit 88f718e3fa4d67f3a8dbe79a2f97d722323e4051 "ARM: pxa: delete the custom GPIO header" we removed the implicit inclusion of <mach/gpio.h> from <linux/gpio.h>. The pxa25x_udc was not using that, but it was relying on <linux/gpio.h> to implictly include <mach/gpio.h> which in turn implicitly included <mach/hardware.h>, which was needed for the driver to compile. Fix this up by explicitly including the necessary <mach/hardware.h> header. Reported-by: Russell King <linux@arm.linux.org.uk> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-11-25usb: gadget: s3c-hsotg: fix disconnect handlingRobert Baldyga
This patch moves s3c_hsotg_disconnect function call from USBSusp interrupt handler to SET_ADDRESS request handler. It's because disconnected state can't be detected directly, because this hardware doesn't support Disconnected interrupt for device mode. For both Suspend and Disconnect events there is one interrupt USBSusp, but calling s3c_hsotg_disconnect from this interrupt handler causes config reset in composite layer, which is not undesirable for Suspended state. For this reason s3c_hsotg_disconnect is called from SET_ADDRESS request handler, which occurs always after disconnection, so we do disconnect immediately before we are connected again. It's probably only way we can do handle disconnection correctly. 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-11-25usb: gadget: s3c-hsotg: fix spinlock lockingRobert Baldyga
This patch adds missing spinlock locking in s3c_hsotg_complete_setup function, and unlocking for gadget setup call. 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-11-22Merge branch 'for-next' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending Pull SCSI target updates from Nicholas Bellinger: "Things have been quiet this round with mostly bugfixes, percpu conversions, and other minor iscsi-target conformance testing changes. The highlights include: - Add demo_mode_discovery attribute for iscsi-target (Thomas) - Convert tcm_fc(FCoE) to use percpu-ida pre-allocation - Add send completion interrupt coalescing for ib_isert - Convert target-core to use percpu-refcounting for se_lun - Fix mutex_trylock usage bug in iscsit_increment_maxcmdsn - tcm_loop updates (Hannes) - target-core ALUA cleanups + prep for v3.14 SCSI Referrals support (Hannes) v3.14 is currently shaping to be a busy development cycle in target land, with initial support for T10 Referrals and T10 DIF currently on the roadmap" * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (40 commits) iscsi-target: chap auth shouldn't match username with trailing garbage iscsi-target: fix extract_param to handle buffer length corner case iscsi-target: Expose default_erl as TPG attribute target_core_configfs: split up ALUA supported states target_core_alua: Make supported states configurable target_core_alua: Store supported ALUA states target_core_alua: Rename ALUA_ACCESS_STATE_OPTIMIZED target_core_alua: spellcheck target core: rename (ex,im)plict -> (ex,im)plicit percpu-refcount: Add percpu-refcount.o to obj-y iscsi-target: Do not reject non-immediate CmdSNs exceeding MaxCmdSN iscsi-target: Convert iscsi_session statistics to atomic_long_t target: Convert se_device statistics to atomic_long_t target: Fix delayed Task Aborted Status (TAS) handling bug iscsi-target: Reject unsupported multi PDU text command sequence ib_isert: Avoid duplicate iscsit_increment_maxcmdsn call iscsi-target: Fix mutex_trylock usage in iscsit_increment_maxcmdsn target: Core does not need blkdev.h target: Pass through I/O topology for block backstores iser-target: Avoid using FRMR for single dma entry requests ...
2013-11-15tree-wide: use reinit_completion instead of INIT_COMPLETIONWolfram Sang
Use this new function to make code more comprehensible, since we are reinitialzing the completion, not initializing. [akpm@linux-foundation.org: linux-next resyncs] Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Acked-by: Linus Walleij <linus.walleij@linaro.org> (personally at LCE13) Cc: Ingo Molnar <mingo@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-11-14Merge branch 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-armLinus Torvalds
Pull DMA mask updates from Russell King: "This series cleans up the handling of DMA masks in a lot of drivers, fixing some bugs as we go. Some of the more serious errors include: - drivers which only set their coherent DMA mask if the attempt to set the streaming mask fails. - drivers which test for a NULL dma mask pointer, and then set the dma mask pointer to a location in their module .data section - which will cause problems if the module is reloaded. To counter these, I have introduced two helper functions: - dma_set_mask_and_coherent() takes care of setting both the streaming and coherent masks at the same time, with the correct error handling as specified by the API. - dma_coerce_mask_and_coherent() which resolves the problem of drivers forcefully setting DMA masks. This is more a marker for future work to further clean these locations up - the code which creates the devices really should be initialising these, but to fix that in one go along with this change could potentially be very disruptive. The last thing this series does is prise away some of Linux's addition to "DMA addresses are physical addresses and RAM always starts at zero". We have ARM LPAE systems where all system memory is above 4GB physical, hence having DMA masks interpreted by (eg) the block layers as describing physical addresses in the range 0..DMAMASK fails on these platforms. Santosh Shilimkar addresses this in this series; the patches were copied to the appropriate people multiple times but were ignored. Fixing this also gets rid of some ARM weirdness in the setup of the max*pfn variables, and brings ARM into line with every other Linux architecture as far as those go" * 'for-linus-dma-masks' of git://git.linaro.org/people/rmk/linux-arm: (52 commits) ARM: 7805/1: mm: change max*pfn to include the physical offset of memory ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit() ARM: DMA-API: better handing of DMA masks for coherent allocations ARM: 7857/1: dma: imx-sdma: setup dma mask DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks DMA-API: dcdbas: update DMA mask handing DMA-API: dma: edma.c: no need to explicitly initialize DMA masks DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks DMA-API: crypto: remove last references to 'static struct device *dev' DMA-API: crypto: fix ixp4xx crypto platform device support DMA-API: others: use dma_set_coherent_mask() DMA-API: staging: use dma_set_coherent_mask() DMA-API: usb: use new dma_coerce_mask_and_coherent() DMA-API: usb: use dma_set_coherent_mask() DMA-API: parport: parport_pc.c: use dma_coerce_mask_and_coherent() DMA-API: net: octeon: use dma_coerce_mask_and_coherent() DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent() ...
2013-11-12Merge tag 'devicetree-for-3.13' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux Pull devicetree updates from Rob Herring: "DeviceTree updates for 3.13. This is a bit larger pull request than usual for this cycle with lots of clean-up. - Cross arch clean-up and consolidation of early DT scanning code. - Clean-up and removal of arch prom.h headers. Makes arch specific prom.h optional on all but Sparc. - Addition of interrupts-extended property for devices connected to multiple interrupt controllers. - Refactoring of DT interrupt parsing code in preparation for deferred probe of interrupts. - ARM cpu and cpu topology bindings documentation. - Various DT vendor binding documentation updates" * tag 'devicetree-for-3.13' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (82 commits) powerpc: add missing explicit OF includes for ppc dt/irq: add empty of_irq_count for !OF_IRQ dt: disable self-tests for !OF_IRQ of: irq: Fix interrupt-map entry matching MIPS: Netlogic: replace early_init_devtree() call of: Add Panasonic Corporation vendor prefix of: Add Chunghwa Picture Tubes Ltd. vendor prefix of: Add AU Optronics Corporation vendor prefix of/irq: Fix potential buffer overflow of/irq: Fix bug in interrupt parsing refactor. of: set dma_mask to point to coherent_dma_mask of: add vendor prefix for PHYTEC Messtechnik GmbH DT: sort vendor-prefixes.txt of: Add vendor prefix for Cadence of: Add empty for_each_available_child_of_node() macro definition arm/versatile: Fix versatile irq specifications. of/irq: create interrupts-extended property microblaze/pci: Drop PowerPC-ism from irq parsing of/irq: Create of_irq_parse_and_map_pci() to consolidate arch code. of/irq: Use irq_of_parse_and_map() ...
2013-11-07Merge remote-tracking branch 'grant/devicetree/next' into for-nextRob Herring
2013-10-31DMA-API: usb: use dma_set_coherent_mask()Russell King
The correct way for a driver to specify the coherent DMA mask is not to directly access the field in the struct device, but to use dma_set_coherent_mask(). Only arch and bus code should access this member directly. Convert all direct write accesses to using the correct API. Acked-by: Felipe Balbi <balbi@ti.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2013-10-25usb/gadget: f_mass_storage: use string literal as format in dev_set_nameAndrzej Pietrasiewicz
Fix commit b27c08c953e994f792a03d9b7cbc5cf3f9844135 where dev_set_name() is used without a string literal as format. Reported-by: Fengguang Wu <fengguang.wu@intel.com> 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> Cc: Kees Cook <keescook@chromium.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-24Merge tag 'usb-for-v3.13' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/balbi/usb into usb-next Felipe writes: usb: patches for v3.13 Final conversions to configfs for mass storage, acm_ms, and multi gadgets. MUSB should now work out of the box on AM335x-based boards (beagle bone white and black) with DMA thanks to Sebastian's work. We can now enable VERBOSE_DEBUG on builds of drivers/usb/gadget/ by selecting CONFIG_USB_GADGET_VERBOSE. s3c-hsotg got quite a few non-critical fixes but also learned a few new tricks (isochronous transfers, multi count support). The Marvel USB3 Controller driver got a memory leak fix. devm_usb_get_phy() learned not to return NULL, ever. Other than these patches, we have the usual set of cleanups ranging from removal of unnecessary *_set_drvdata() to using SIMPLE_DEV_PM_OPS. Signed-of-by: Felipe Balbi <balbi@ti.com>
2013-10-17usb: gadget: f_mass_storage: style corrections, cleanup & simplificationAndrzej Pietrasiewicz
Fix spacing, improve error code returned, remove unused #define, use strtobool() instead of kstrtou8(). Acked-by: Michal Nazarewicz <mina86@mina86.com> 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-16target: Remove TF_CIT_TMPL macroAndy Grover
Remove a lingering macro that just hid a dereference. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andy Grover <agrover@redhat.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
2013-10-15usb: gadget: s3c-hsotg: fix can_write limit for non-periodic endpointsRobert Baldyga
Value of can_write variable in s3c_hsotg_write_fifo function should be limited to 512 only for non-periodic endpoints. There was some discrepancy between comment and code, becouse comment suggests correct behavior, but in the code limit was applied to periodic endpoints too. So there is additional check causing the limitation concerns only non-periodic endpoints. 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-15usb: gadget: s3c-hsotg: fix interrupt configuration in dedicated-fifo modeRobert Baldyga
In dedicated-fifo mode TxFIFOEmpty interrupt should be asserted when TxFIFO for this endpoint is completly empty, so NPTxFEmpLvl and PTxFEmpLvl bits are set in GAHBCFG register. In DIEPMSK register INTknTXFEmpMsk is set, becouse it's needed to indicate FIFO Empty state. 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-15usb: gadget: s3c-hsotg: fix clear feature ENDPOINT_HALTRobert Baldyga
All requests for endpoint are completed when it was halted and the halt was cleared by CLEAR_FEATURE, but not when new state is same as previous. 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-15usb: gadget: s3c-hsotg: fix "halted" property updatingRobert Baldyga
Property "halted" of s3c_hsotg_ep structure is actually initialised when ep enabled, and changed when halt is set/cleared. 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-15usb: gadget: s3c-hsotg: add DAINT maskingRobert Baldyga
In OEPInt/IEPInt interrupts handling added bitwise and of DAINT and DAINTMSK, because we should handle masked interrupts only. 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-15usb: gadget: s3c-hsotg: fix endpoint interrupts handlingRobert Baldyga
When s3c_hsotg_trytx is called for ep without enqueued request, interrupts for this ep are disabled, to prevent interrupt flooding. Interrupts are enabled when new request for this ep is starting. 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-15usb: gadget: s3c-hsotg: fix s3c_hsotg_write_fifo function for dedicated fifo ↵Robert Baldyga
mode In s3c_hsotg_write_fifo function PTxFEmp/NPTxFEmp interrupts are enabled only in shared-fifo mode. In dedicated-fifo mode they should not be used (when enabled then cause interrupt storm). 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-15usb: gadget: s3c-hsotg: fix "protocol stall" handlingRobert Baldyga
After normal handling of SetupDone interrupt, XferCompl interrupt occurs, and then we enqueue new setup request. But when ep0 is stalled, there is no XferCompl, so we have to enqueue setup request immediately after stalling ep. Otherwise incoming control requests won't be processed correctly. 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-15usb: gadget: storage_common: pass filesem to fsg_store_cdromAndrzej Pietrasiewicz
If cdrom flag is set ro flag is implied. Try setting the ro first, and only if it succeeds set the cdrom flag. 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-15usb: gadget: storage_common: use strtobool instead of kstrtouintAndrzej Pietrasiewicz
strtobool is more flexible for the user and is more appropriate in the context. 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-11usb: Remove unnecessary semicolonsJoe Perches
These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-11usb: gadget: Make VERBOSE_DEBUG enableable via KconfigAndreas Larsson
Create a way for VERBOSE_DEBUG to be enabled during drivers/usb/gadget/ build. Signed-off-by: Andreas Larsson <andreas@gaisler.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
2013-10-11usb: gadget: s3c-hsotg: remove unused labelRobert Baldyga
This patch removes unused label. 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-11usb: gadget: s3c-hsotg: add multi count supportRobert Baldyga
This patch adds Multi Count support. It adds few modifications: - Fix s3c_hsotg_set_ep_maxpacket() function. Field wMaxPacketSize of endpoint descriptor is now splitted into maximum packet size value and number of additional transaction per microframe. - Modify s3c_hsotg_write_fifo() function. It actually calculates transfer size, taking into account Multi Count value, which indicates number of transactions per microframe. - Fix s3c_hsotg_start_req() function by setting number of packets to Multi Count field in DIEPTSIZ register for isochronous endpoints. 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-11usb: gadget: s3c-hsotg: add isochronous transfers supportRobert Baldyga
This patch adds isochronous transfer support. It adds few modifications: - Modify s3c_hsotg_epint() function. Some interrupts are ignored for isochronous endpoints, (e.g. INTknTXFEmpMsk) becouse isochronous request is always transfered in single transaction, which ends with XferCompl interrupt. - Add Odd/Even microframe toggle to allow data transfering in each microframe in s3c_hsotg_epint() function. - Fix s3c_hsotg_ep_enable() function by supporting isochronous endpoint type. 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-10usb: gadget: mass_storage: merge usb_f_mass_storage module with u_ms moduleAndrzej Pietrasiewicz
u_ms.ko is needed only together with usb_f_mass_storage.ko. Merge them. 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-10usb: gadget: f_mass_storage: remove compatibility layerAndrzej Pietrasiewicz
There are no more old interface users left. Remove it. 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-10usb: gadget: multi: convert to new interface of f_mass_storageAndrzej Pietrasiewicz
Convert the legacy multi gadget to the new interface of f_mass_storage, so that later the compatibility layer in f_mass_storage can be removed. 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-10usb: gadget: multi: convert to new interface of f_rndisAndrzej Pietrasiewicz
Convert the legacy multi gadget to the new interface of f_rndis, so that later the compatibility layer in f_rndis can be removed. 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-10usb: gadget: multi: convert to new interface of f_ecmAndrzej Pietrasiewicz
Convert the legacy multi gadget to the new interface of f_ecm, so that later the compatibility layer in f_ecm can be removed. 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>