Commit 0b8b1a1f authored by Jayshri Pawar's avatar Jayshri Pawar Committed by Felipe Balbi

usb: gadget: f_tcm: Provide support to get alternate setting in tcm function

Providing tcm_get_alt in tcm function to support Bulk only protocol and
USB Attached SCSI protocol
Signed-off-by: default avatarJayshri Pawar <jpawar@cadence.com>
Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
parent 75eaa498
...@@ -846,7 +846,7 @@ static void uasp_set_alt(struct f_uas *fu) ...@@ -846,7 +846,7 @@ static void uasp_set_alt(struct f_uas *fu)
fu->flags = USBG_IS_UAS; fu->flags = USBG_IS_UAS;
if (gadget->speed == USB_SPEED_SUPER) if (gadget->speed >= USB_SPEED_SUPER)
fu->flags |= USBG_USE_STREAMS; fu->flags |= USBG_USE_STREAMS;
config_ep_by_speed(gadget, f, fu->ep_in); config_ep_by_speed(gadget, f, fu->ep_in);
...@@ -2093,6 +2093,16 @@ static void tcm_delayed_set_alt(struct work_struct *wq) ...@@ -2093,6 +2093,16 @@ static void tcm_delayed_set_alt(struct work_struct *wq)
usb_composite_setup_continue(fu->function.config->cdev); usb_composite_setup_continue(fu->function.config->cdev);
} }
static int tcm_get_alt(struct usb_function *f, unsigned intf)
{
if (intf == bot_intf_desc.bInterfaceNumber)
return USB_G_ALT_INT_BBB;
if (intf == uasp_intf_desc.bInterfaceNumber)
return USB_G_ALT_INT_UAS;
return -EOPNOTSUPP;
}
static int tcm_set_alt(struct usb_function *f, unsigned intf, unsigned alt) static int tcm_set_alt(struct usb_function *f, unsigned intf, unsigned alt)
{ {
struct f_uas *fu = to_f_uas(f); struct f_uas *fu = to_f_uas(f);
...@@ -2300,6 +2310,7 @@ static struct usb_function *tcm_alloc(struct usb_function_instance *fi) ...@@ -2300,6 +2310,7 @@ static struct usb_function *tcm_alloc(struct usb_function_instance *fi)
fu->function.bind = tcm_bind; fu->function.bind = tcm_bind;
fu->function.unbind = tcm_unbind; fu->function.unbind = tcm_unbind;
fu->function.set_alt = tcm_set_alt; fu->function.set_alt = tcm_set_alt;
fu->function.get_alt = tcm_get_alt;
fu->function.setup = tcm_setup; fu->function.setup = tcm_setup;
fu->function.disable = tcm_disable; fu->function.disable = tcm_disable;
fu->function.free_func = tcm_free; fu->function.free_func = tcm_free;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment