Re: [PATCH 09/11] usb: gadget: Add Configurable Composite Gadget driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, May 10, 2012 at 10:08:05AM +0200, Andrzej Pietrasiewicz wrote:
> From: Mike Lockwood <lockwood@xxxxxxxxxxx>
> 
> 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, mass storage and accessory.
> 
> 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 2d01    > /sys/class/ccg_usb/ccg0/idProduct
> echo 1       > /sys/class/ccg_usb/ccg0/enable

Why is this code still using sysfs and not configfs like people keep
asking for?

Isn't this exactly the case for which configfs was created for, and
exactly how it is to be used?  Why can't it be used here?



> 
> 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@xxxxxxxxxxx>
> Signed-off-by: Benoit Goby <benoit@xxxxxxxxxxx>
> 	[import android.c, implement review comments, remove adb,mtp,ptp,accessory]
> Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@xxxxxxxxxxx>
> Signed-off-by: Kyungmin Park <kyungmin.park@xxxxxxxxxxx>
> ---
>  drivers/usb/gadget/Kconfig  |    9 +
>  drivers/usb/gadget/Makefile |    2 +
>  drivers/usb/gadget/ccg.c    |  994 +++++++++++++++++++++++++++++++++++++++++++

Thanks for renaming this, that's a great step, but I can't accept this
while it still uses sysfs.  Hint, you also forgot to document how this
interface is to be used in Documentation/ABI/ which all new sysfs (or
configfs) files need to be documented in.

Please rework this, as it is, I can not accept it, sorry.

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux