Commit Graph

11 Commits (8d85fce77edfc22f1d6dbf78e3af723b4b556f3d)

Author SHA1 Message Date
Constantine Shulyupin 8d64c32b9b staging: ccg: rename ccg init and exit functions to conventional names
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-22 15:50:07 -07:00
Linus Torvalds d9a807461f USB merge for 3.7-rc1
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>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iEYEABECAAYFAlBp3+AACgkQMUfUDdst+ym5vwCfe93FyJyXn/RDkGz7iBemvWFd
 vrwAoIxjaOa4/yWZWcgrWc5bP4aO3ssc
 =jYDr
 -----END PGP SIGNATURE-----

Merge tag 'usb-3.6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb

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-10-01 13:23:01 -07:00
Devendra Naga 7505817603 staging:ccg: cleanup a bit of binding
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-13 20:20:28 -07:00
Devendra Naga 99d4b1a6cb staging:ccg: fix a class_destroy when kmalloc fails after the class_create
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-13 20:20:28 -07:00
Sebastian Andrzej Siewior e220ff75db staging: ccg: include all sourced files
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-10 15:35:35 +03:00
Sebastian Andrzej Siewior 03e42bd593 usb: gadget: move bind() callback back to struct usb_composite_driver
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-10 15:34:48 +03:00
Marek Belisko e996f9de85 staging:ccg: Fix missing brackets for sizeof (found by sparse).
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-08-13 19:19:23 -07:00
Andy Shevchenko 0932966b1c staging: ccg: print MAC addresses via %pM
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-06 16:24:00 -07:00
David Murray e97e6c4f9a Drivers: Staging: ccg: Made checkpatch.pl clean
Fixed a tiny checkpatch.pl warning.

Signed-off-by: David Murray <therealcykey@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:21:55 -07:00
Andrzej Pietrasiewicz 450279822f staging: usb: gadget: Add FunctionFS support to Configurable Composite 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-16 05:32:20 -07:00
Mike Lockwood 332bb43f7c staging: usb: gadget: Add Configurable Composite Gadget driver
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>
2012-05-16 05:31:42 -07:00