Re: [RFC 2/2] usb: core: allow a reference device for new_id

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

 



On Fri, Jan 10, 2014 at 07:36:42PM +0100, Wolfram Sang wrote:
> Often, usb drivers need some driver_info to get a device to work. To
> have access to driver_info when using new_id, allow to pass a reference
> vendor:product tuple from which new_id will inherit driver_info.
> 
> Signed-off-by: Wolfram Sang <wsa@xxxxxxxxxxxxx>
> ---
>  Documentation/ABI/testing/sysfs-bus-usb | 10 ++++++++--
>  drivers/usb/core/driver.c               | 18 +++++++++++++++---
>  drivers/usb/serial/bus.c                |  4 +++-
>  include/linux/usb.h                     |  1 +
>  4 files changed, 27 insertions(+), 6 deletions(-)
> 
> diff --git a/Documentation/ABI/testing/sysfs-bus-usb b/Documentation/ABI/testing/sysfs-bus-usb
> index 1430f584b..614d451 100644
> --- a/Documentation/ABI/testing/sysfs-bus-usb
> +++ b/Documentation/ABI/testing/sysfs-bus-usb
> @@ -50,13 +50,19 @@ Description:
>  		This may allow the driver to support more hardware than
>  		was included in the driver's static device ID support
>  		table at compile time. The format for the device ID is:
> -		idVendor idProduct bInterfaceClass.
> +		idVendor idProduct bInterfaceClass RefIdVendor RefIdProduct
>  		The vendor ID and device ID fields are required, the
> -		interface class is optional.
> +		rest is optional. The Ref* tuple can be used to tell the
> +		driver to use the same driver_data for the new device as
> +		it is used for the reference device.
>  		Upon successfully adding an ID, the driver will probe
>  		for the device and attempt to bind to it.  For example:
>  		# echo "8086 10f5" > /sys/bus/usb/drivers/foo/new_id
>  
> +		Here add a new device (0458:7045) using driver_data from
> +		an already supported device (0458:704c):
> +		# echo "0458 7045 0 0458 704c" > /sys/bus/usb/drivers/foo/new_id

Very nice, I like this a lot!

We've always had the problem of how to do this before, I don't think
anyone's thought of using a "reference" device in tha past, this should
solve the driver_data issue just fine.

I see you marked both of these RFC, they look great to me, any objection
for me taking these for 3.14?

Oh, and PCI could also use this same mechanism for driver_data :)

thanks,

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