Re: [PATCH v4 2/3] usb: gadget: introduce gadget state tracking

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

 



Hi,

On Fri, Jan 25, 2013 at 11:12:41AM +0200, Felipe Balbi wrote:
> that's useful information to expose to userland.
> 
> Signed-off-by: Felipe Balbi <balbi@xxxxxx>
> ---
>  drivers/usb/gadget/udc-core.c | 23 +++++++++++++++++++++++
>  include/linux/usb/gadget.h    |  9 +++++++++
>  2 files changed, 32 insertions(+)
> 
> diff --git a/drivers/usb/gadget/udc-core.c b/drivers/usb/gadget/udc-core.c
> index 40b1d88..8a1eeb2 100644
> --- a/drivers/usb/gadget/udc-core.c
> +++ b/drivers/usb/gadget/udc-core.c
> @@ -101,6 +101,16 @@ EXPORT_SYMBOL_GPL(usb_gadget_unmap_request);
>  
>  /* ------------------------------------------------------------------------- */
>  
> +void usb_gadget_set_state(struct usb_gadget *gadget,
> +		enum usb_device_state state)
> +{
> +	gadget->state = state;
> +	sysfs_notify(&gadget->dev.kobj, NULL, "status");
> +}
> +EXPORT_SYMBOL_GPL(usb_gadget_set_state);

I guess it would be good to have a:

enum usb_gadget_state usb_gadget_get_state(struct usb_gadget *gadget)
{
	return gadget->state;
}

right ?? At least dwc3 can make use of it.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


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

  Powered by Linux