summaryrefslogtreecommitdiff
path: root/drivers/staging/ccg
AgeCommit message (Collapse)Author
2013-03-14Staging: ccg: delete it from the treeGreg Kroah-Hartman
Now that it isn't in the build, just delete the ccg driver from the tree entirely. Cc: John Stultz <john.stultz@linaro.org> Cc: Paul Bolle <pebolle@tiscali.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-27Merge branch 'for-linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs Pull vfs pile (part one) from Al Viro: "Assorted stuff - cleaning namei.c up a bit, fixing ->d_name/->d_parent locking violations, etc. The most visible changes here are death of FS_REVAL_DOT (replaced with "has ->d_weak_revalidate()") and a new helper getting from struct file to inode. Some bits of preparation to xattr method interface changes. Misc patches by various people sent this cycle *and* ocfs2 fixes from several cycles ago that should've been upstream right then. PS: the next vfs pile will be xattr stuff." * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (46 commits) saner proc_get_inode() calling conventions proc: avoid extra pde_put() in proc_fill_super() fs: change return values from -EACCES to -EPERM fs/exec.c: make bprm_mm_init() static ocfs2/dlm: use GFP_ATOMIC inside a spin_lock ocfs2: fix possible use-after-free with AIO ocfs2: Fix oops in ocfs2_fast_symlink_readpage() code path get_empty_filp()/alloc_file() leave both ->f_pos and ->f_version zero target: writev() on single-element vector is pointless export kernel_write(), convert open-coded instances fs: encode_fh: return FILEID_INVALID if invalid fid_type kill f_vfsmnt vfs: kill FS_REVAL_DOT by adding a d_weak_revalidate dentry op nfsd: handle vfs_getattr errors in acl protocol switch vfs_getattr() to struct path default SET_PERSONALITY() in linux/elf.h ceph: prepopulate inodes only when request is aborted d_hash_and_lookup(): export, switch open-coded instances 9p: switch v9fs_set_create_acl() to inode+fid, do it before d_instantiate() 9p: split dropping the acls from v9fs_set_create_acl() ...
2013-02-23new helper: file_inode(file)Al Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2013-02-21Merge tag 'tty-3.9-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull tty/serial patches from Greg Kroah-Hartman: "Here's the big tty/serial driver patches for 3.9-rc1. More tty port rework and fixes from Jiri here, as well as lots of individual serial driver updates and fixes. All of these have been in the linux-next tree for a while." * tag 'tty-3.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (140 commits) tty: mxser: improve error handling in mxser_probe() and mxser_module_init() serial: imx: fix uninitialized variable warning serial: tegra: assume CONFIG_OF TTY: do not update atime/mtime on read/write lguest: select CONFIG_TTY to build properly. ARM defconfigs: add missing inclusions of linux/platform_device.h fb/exynos: include platform_device.h ARM: sa1100/assabet: include platform_device.h directly serial: imx: Fix recursive locking bug pps: Fix build breakage from decoupling pps from tty tty: Remove ancient hardpps() pps: Additional cleanups in uart_handle_dcd_change pps: Move timestamp read into PPS code proper pps: Don't crash the machine when exiting will do pps: Fix a use-after free bug when unregistering a source. pps: Use pps_lookup_dev to reduce ldisc coupling pps: Add pps_lookup_dev() function tty: serial: uartlite: Support uartlite on big and little endian systems tty: serial: uartlite: Fix sparse and checkpatch warnings serial/arc-uart: Miscll DT related updates (Grant's review comments) ... Fix up trivial conflicts, mostly just due to the TTY config option clashing with the EXPERIMENTAL removal.
2013-01-19tty: Added a CONFIG_TTY option to allow removal of TTYJoe Millenbach
The option allows you to remove TTY and compile without errors. This saves space on systems that won't support TTY interfaces anyway. bloat-o-meter output is below. The bulk of this patch consists of Kconfig changes adding "depends on TTY" to various serial devices and similar drivers that require the TTY layer. Ideally, these dependencies would occur on a common intermediate symbol such as SERIO, but most drivers "select SERIO" rather than "depends on SERIO", and "select" does not respect dependencies. bloat-o-meter output comparing our previous minimal to new minimal by removing TTY. The list is filtered to not show removed entries with awk '$3 != "-"' as the list was very long. add/remove: 0/226 grow/shrink: 2/14 up/down: 6/-35356 (-35350) function old new delta chr_dev_init 166 170 +4 allow_signal 80 82 +2 static.__warned 143 142 -1 disallow_signal 63 62 -1 __set_special_pids 95 94 -1 unregister_console 126 121 -5 start_kernel 546 541 -5 register_console 593 588 -5 copy_from_user 45 40 -5 sys_setsid 128 120 -8 sys_vhangup 32 19 -13 do_exit 1543 1526 -17 bitmap_zero 60 40 -20 arch_local_irq_save 137 117 -20 release_task 674 652 -22 static.spin_unlock_irqrestore 308 260 -48 Signed-off-by: Joe Millenbach <jmillenbach@gmail.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-16TTY: switch tty_flip_buffer_pushJiri Slaby
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. Now, the one where most of tty_port_tty_get gets removed: tty_flip_buffer_push. IOW we also closed all the races in drivers not using tty_port_tty_get at all yet. Also we move tty_flip_buffer_push declaration from include/linux/tty.h to include/linux/tty_flip.h to all others while we are changing it anyway. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-16TTY: switch tty_insert_flip_stringJiri Slaby
Now, we start converting tty buffer functions to actually use tty_port. This will allow us to get rid of the need of tty in many call sites. Only tty_port will needed and hence no more tty_port_tty_get in those paths. tty_insert_flip_string this time. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07ethtool: fix drvinfo strings set in driversJiri Pirko
Use strlcpy where possible to ensure the string is \0 terminated. Use always sizeof(string) instead of 32, ETHTOOL_BUSINFO_LEN and custom defines. Use snprintf instead of sprint. Remove unnecessary inits of ->fw_version Remove unnecessary inits of drvinfo struct. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
2012-12-11Merge tag 'tty-3.8-rc1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty Pull TTY/Serial merge from Greg Kroah-Hartman: "Here's the big tty/serial tree set of changes for 3.8-rc1. Contained in here is a bunch more reworks of the tty port layer from Jiri and bugfixes from Alan, along with a number of other tty and serial driver updates by the various driver authors. Also, Jiri has been coerced^Wconvinced to be the co-maintainer of the TTY layer, which is much appreciated by me. All of these have been in the linux-next tree for a while. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fixed up some trivial conflicts in the staging tree, due to the fwserial driver having come in both ways (but fixed up a bit in the serial tree), and the ioctl handling in the dgrp driver having been done slightly differently (staging tree got that one right, and removed both TIOCGSOFTCAR and TIOCSSOFTCAR). * tag 'tty-3.8-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty: (146 commits) staging: sb105x: fix potential NULL pointer dereference in mp_chars_in_buffer() staging/fwserial: Remove superfluous free staging/fwserial: Use WARN_ONCE when port table is corrupted staging/fwserial: Destruct embedded tty_port on teardown staging/fwserial: Fix build breakage when !CONFIG_BUG staging: fwserial: Add TTY-over-Firewire serial driver drivers/tty/serial/serial_core.c: clean up HIGH_BITS_OFFSET usage staging: dgrp: dgrp_tty.c: Audit the return values of get/put_user() staging: dgrp: dgrp_tty.c: Remove the TIOCSSOFTCAR ioctl handler from dgrp driver serial: ifx6x60: Add modem power off function in the platform reboot process serial: mxs-auart: unmap the scatter list before we copy the data serial: mxs-auart: disable the Receive Timeout Interrupt when DMA is enabled serial: max310x: Setup missing "can_sleep" field for GPIO tty/serial: fix ifx6x60.c declaration warning serial: samsung: add devicetree properties for non-Exynos SoCs serial: samsung: fix potential soft lockup during uart write tty: vt: Remove redundant null check before kfree. tty/8250 Add check for pci_ioremap_bar failure tty/8250 Add support for Commtech's Fastcom Async-335 and Fastcom Async-PCIe cards tty/8250 Add XR17D15x devices to the exar_handle_irq override ...
2012-11-16TTY: call tty_port_destroy in the rest of driversJiri Slaby
After commit "TTY: move tty buffers to tty_port", the tty buffers are not freed in some drivers. This is because tty_port_destructor is not called whenever a tty_port is freed. This was an assumption I counted with but was unfortunately untrue. So fix the drivers to fulfil this assumption. To be sure, the TTY buffers (and later some stuff) are gone along with the tty_port, we have to call tty_port_destroy at tear-down places. This is mostly where the structure containing a tty_port is freed. This patch does exactly that -- put tty_port_destroy at those places. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: ccg: rename ccg init and exit functions to conventional namesConstantine Shulyupin
Previous names of init and exit functions "init" and "cleanup" are unconventional and are not friendly for source navigation with tags. New names "ccg_init" and "ccg_exit" are conveninal and source navigation friendly. Signed-off-by: Constantine Shulyupin <const@MakeLinux.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-02Merge branch 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wqLinus Torvalds
Pull workqueue changes from Tejun Heo: "This is workqueue updates for v3.7-rc1. A lot of activities this round including considerable API and behavior cleanups. * delayed_work combines a timer and a work item. The handling of the timer part has always been a bit clunky leading to confusing cancelation API with weird corner-case behaviors. delayed_work is updated to use new IRQ safe timer and cancelation now works as expected. * Another deficiency of delayed_work was lack of the counterpart of mod_timer() which led to cancel+queue combinations or open-coded timer+work usages. mod_delayed_work[_on]() are added. These two delayed_work changes make delayed_work provide interface and behave like timer which is executed with process context. * A work item could be executed concurrently on multiple CPUs, which is rather unintuitive and made flush_work() behavior confusing and half-broken under certain circumstances. This problem doesn't exist for non-reentrant workqueues. While non-reentrancy check isn't free, the overhead is incurred only when a work item bounces across different CPUs and even in simulated pathological scenario the overhead isn't too high. All workqueues are made non-reentrant. This removes the distinction between flush_[delayed_]work() and flush_[delayed_]_work_sync(). The former is now as strong as the latter and the specified work item is guaranteed to have finished execution of any previous queueing on return. * In addition to the various bug fixes, Lai redid and simplified CPU hotplug handling significantly. * Joonsoo introduced system_highpri_wq and used it during CPU hotplug. There are two merge commits - one to pull in IRQ safe timer from tip/timers/core and the other to pull in CPU hotplug fixes from wq/for-3.6-fixes as Lai's hotplug restructuring depended on them." Fixed a number of trivial conflicts, but the more interesting conflicts were silent ones where the deprecated interfaces had been used by new code in the merge window, and thus didn't cause any real data conflicts. Tejun pointed out a few of them, I fixed a couple more. * 'for-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: (46 commits) workqueue: remove spurious WARN_ON_ONCE(in_irq()) from try_to_grab_pending() workqueue: use cwq_set_max_active() helper for workqueue_set_max_active() workqueue: introduce cwq_set_max_active() helper for thaw_workqueues() workqueue: remove @delayed from cwq_dec_nr_in_flight() workqueue: fix possible stall on try_to_grab_pending() of a delayed work item workqueue: use hotcpu_notifier() for workqueue_cpu_down_callback() workqueue: use __cpuinit instead of __devinit for cpu callbacks workqueue: rename manager_mutex to assoc_mutex workqueue: WORKER_REBIND is no longer necessary for idle rebinding workqueue: WORKER_REBIND is no longer necessary for busy rebinding workqueue: reimplement idle worker rebinding workqueue: deprecate __cancel_delayed_work() workqueue: reimplement cancel_delayed_work() using try_to_grab_pending() workqueue: use mod_delayed_work() instead of __cancel + queue workqueue: use irqsafe timer for delayed_work workqueue: clean up delayed_work initializers and add missing one workqueue: make deferrable delayed_work initializer names consistent workqueue: cosmetic whitespace updates for macro definitions workqueue: deprecate system_nrt[_freezable]_wq workqueue: deprecate flush[_delayed]_work_sync() ...
2012-10-01Merge tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usbLinus Torvalds
Pull USB changes from Greg Kroah-Hartman: "Here is the big USB pull request for 3.7-rc1 There are lots of gadget driver changes (including copying a bunch of files into the drivers/staging/ccg/ directory so that the other gadget drivers can be fixed up properly without breaking that driver), and we remove the old obsolete ub.c driver from the tree. There are also the usual XHCI set of updates, and other various driver changes and updates. We also are trying hard to remove the old dbg() macro, but the final bits of that removal will be coming in through the networking tree before we can delete it for good. All of these patches have been in the linux-next tree. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>" Fix up several annoying - but fairly mindless - conflicts due to the termios structure having moved into the tty device, and often clashing with dbg -> dev_dbg conversion. * tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (339 commits) USB: ezusb: move ezusb.c from drivers/usb/serial to drivers/usb/misc USB: uas: fix gcc warning USB: uas: fix locking USB: Fix race condition when removing host controllers USB: uas: add locking USB: uas: fix abort USB: uas: remove aborted field, replace with status bit. USB: uas: fix task management USB: uas: keep track of command urbs xhci: Intel Panther Point BEI quirk. powerpc/usb: remove checking PHY_CLK_VALID for UTMI PHY USB: ftdi_sio: add TIAO USB Multi-Protocol Adapter (TUMPA) support Revert "usb : Add sysfs files to control port power." USB: serial: remove vizzini driver usb: host: xhci: Fix Null pointer dereferencing with 71c731a for non-x86 systems Increase XHCI suspend timeout to 16ms USB: ohci-at91: fix null pointer in ohci_hcd_at91_overcurrent_irq USB: sierra_ms: don't keep unused variable fsl/usb: Add support for USB controller version 2.4 USB: qcaux: add Pantech vendor class match ...
2012-09-14staging:ccg: cleanup a bit of bindingDevendra Naga
the ccg_bind_function uses ret variable and a logic around the ccg_bind_enabled_functions to return a value other than 0 if bind function fail, other wise returns 0, this can be achieved with just a return ccg_bind_enabled_functions(dev, c); Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-14staging:ccg: fix a class_destroy when kmalloc fails after the class_createDevendra Naga
we do class_create and call kmalloc to allocate dev pointer, and if kmalloc fail we forget destoying class Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10staging: fix ccg build when NET is not enabledRandy Dunlap
Fix build errors in ccg when CONFIG_NET is not enabled by adding "depends on NET": ERROR: "netif_carrier_on" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "netif_carrier_off" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_realloc_headroom" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_trim" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "netif_rx" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "ethtool_op_get_link" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "free_netdev" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "register_netdev" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_push" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_pull" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "dev_kfree_skb_any" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_queue_tail" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "__alloc_skb" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "eth_type_trans" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "eth_validate_addr" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_dequeue" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "unregister_netdev" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "__netif_schedule" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "skb_put" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "eth_mac_addr" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "dev_get_stats" [drivers/staging/ccg/g_ccg.ko] undefined! ERROR: "alloc_etherdev_mqs" [drivers/staging/ccg/g_ccg.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Cc: Mike Lockwood <lockwood@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-10usb: gadget: remove global variable composite in composite.cSebastian Andrzej Siewior
This patch removes the global variable composite in composite.c. The private data which was saved there is now passed via an additional argument to the bind() function in struct usb_gadget_driver. Only the "old-style" UDC drivers have to be touched here, new style are doing it right because this change is made in udc-core. Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-10staging: ccg: include all sourced filesSebastian Andrzej Siewior
This Android gadget includes a bunch of .c files. Fixing normal gadgets is not the real problem but this gadget is not always fixable since the problem here are fundumential / design. *I* wanted to get this removed but other people want to keep it even though there were reports that Android itself is not using it. Some poeple think that it is better to have this instead of nothing and other argue that they need sdb and mass storage gadget. The sdb function is not provided by ccg so I don't see the point of this. I don't see any logical reasoning behind it and I decided that it is time for retreat. This patch brings all dependencies of ccg into staging so I can do whatever I want in drivers/usb/gadget without breaking ccg. Cc: devel@driverdev.osuosl.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-10usb: gadget: move bind() callback back to struct usb_composite_driverSebastian Andrzej Siewior
This partly reverts 07a18bd7 ("usb gadget: don't save bind callback in struct usb_composite_driver") and fixes new drivers. The section missmatch problems was solved by whitelisting structs in question via __ref. Cc: devel@driverdev.osuosl.org Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-09-10staging: ccg: Add a note about compatibility issues.Sebastian Andrzej Siewior
The first item on the todo list is a new user interface. Put this information into Kconfig's help entry to people are not too confusing once an user API changes which does not happen in kernel otherwise. Cc: devel@driverdev.osuosl.org Acked-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com>
2012-08-14staging:ccg: Fix missing brackets for sizeof (found by sparse).Marek Belisko
Fix following: WARNING: sizeof fsg should be sizeof(fsg) + memset(&fsg, 0, sizeof fsg); Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Reviewed-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06staging: ccg: print MAC addresses via %pMAndy Shevchenko
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Cc: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06Drivers: Staging: ccg: Made checkpatch.pl cleanDavid Murray
Fixed a tiny checkpatch.pl warning. Signed-off-by: David Murray <therealcykey@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-12staging: usb: gadget: Configurable Composite Gadget depends on BLOCKAndrzej Pietrasiewicz
Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16staging: usb: gadget: Add FunctionFS support to Configurable Composite ↵Andrzej Pietrasiewicz
Gadget driver Add FunctionFS support. It allows certain USB functions to be provided from userspace, e.g. MTP, PTP, adb. The functions provided by the gadget itself are enumerated in /sys/class/ccg0/functions. The functions which can be supplied from userspace must be enumerated in /sys/class/ccg0/f_fs/user_functions. No other userspace functions can be used than specified in the above mentioned file, but just specifying them there is not enough to activate them. The userspace functions in order to be activated need also be enumerated in /sys/class/ccg0/functions. An example sequence of operations can be as follows: $ echo 0 > /sys/class/ccg_usb/ccg0/enable $ echo -n 0x2d01 > /sys/module/g_ccg/parameters/idProduct $ echo -n MyDevice > /sys/module/g_ccg/parameters/iSerialNumber $ echo -n 0x1d6b > /sys/module/g_ccg/parameters/idVendor $ echo -n Manufacturer > /sys/module/g_ccg/parameters/iManufacturer $ echo -n Product > /sys/module/g_ccg/parameters/iProduct $ echo -n bcdDevice > /sys/module/g_ccg/parameters/bcdDevice $ echo adb,mtp,ptp > /sys/class/ccg_usb/ccg0/f_fs/user_functions $ echo mass_storage,ptp > /sys/class/ccg_usb/ccg0/functions $ echo /file.img > /sys/class/ccg_usb/ccg0/f_mass_storage/lun/file $ mkdir -p /dev/usbgadget/ptp $ mount -t functionfs ptp /dev/usbgadget/ptp $ ./ptp & $ echo 1 > /sys/class/ccg_usb/ccg0/enable The above example declares that adb, mtp and ptp functions can be supplied from userspace through FunctionFS. But of them all only ptp is actually activated, together with mass_storage, the latter being implemented in the gadget itself (in kernel, not in userspace). The list of functions can be modified at runtime while the gadget is not enabled, that is, after $ echo 0 > /sys/class/ccg_usb/ccg0/enable The FunctionFS function is implicitly handled by the gadget, that is, if a userspace function name is provided in /sys/class/ccg_usb/ccg0/functions, then the FunctionFS function is activated. 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-16staging: usb: gadget: Add Configurable Composite Gadget driverMike Lockwood
The Configurable Gadget driver is a composite driver that allows userspace to change at runtime the list of functions enabled in its configuration and to configure these functions. It supports multiple functions: acm, rndis, and mass storage. It is usually controlled by a daemon that changes the configuration based on user settings. For example, rndis is enabled when the user enables sharing the phone data connection. As an example on how to use it, the following shell commands will make the gadget disconnect from the host and make it be re-enumerated as a composite with 1 rndis and 2 acm interfaces, and a different product id: echo 0 > /sys/class/ccg_usb/ccg0/enable echo rndis,acm > /sys/class/ccg_usb/ccg0/functions echo 2 > /sys/class/ccg_usb/ccg0/f_acm/instances echo -n 0x2d01 > /sys/module/g_ccg/parameters/idProduct echo 1 > /sys/class/ccg_usb/ccg0/enable The driver requires a gadget controller that supports software control of the D+ pullup and the controller driver must support disabling the pullup during composite_bind. Signed-off-by: Mike Lockwood <lockwood@android.com> Signed-off-by: Benoit Goby <benoit@android.com> [import from android.c, implement review comments, remove adb,mtp,ptp,accessory] Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>