diff options
author | Li Jun <B47624@freescale.com> | 2014-04-23 15:56:47 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-04-24 12:56:35 -0700 |
commit | 95f5555fa0f0176da338e8f42bca08f236032832 (patch) | |
tree | 1d6d5d977af68534f641dac84c0a2404779fb95a /drivers/usb/chipidea/udc.c | |
parent | 0698b9b384d39ae8e855bbffac180ad5773efa72 (diff) | |
download | linux-stable-95f5555fa0f0176da338e8f42bca08f236032832.tar.gz linux-stable-95f5555fa0f0176da338e8f42bca08f236032832.tar.bz2 linux-stable-95f5555fa0f0176da338e8f42bca08f236032832.zip |
usb: chipidea: udc: driver update for OTG HNP
Add b_hnp_enable request handling and enable gadget->is_otg
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Acked-by: Peter Chen <peter.chen@freescale.com>
Signed-off-by: Li Jun <b47624@freescale.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/chipidea/udc.c')
-rw-r--r-- | drivers/usb/chipidea/udc.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c index f58857d45050..cba7fd63d6e3 100644 --- a/drivers/usb/chipidea/udc.c +++ b/drivers/usb/chipidea/udc.c @@ -20,6 +20,7 @@ #include <linux/pm_runtime.h> #include <linux/usb/ch9.h> #include <linux/usb/gadget.h> +#include <linux/usb/otg-fsm.h> #include <linux/usb/chipidea.h> #include "ci.h" @@ -1052,6 +1053,14 @@ __acquires(ci->lock) default: break; } + break; + case USB_DEVICE_B_HNP_ENABLE: + if (ci_otg_is_fsm_mode(ci)) { + ci->gadget.b_hnp_enable = 1; + err = isr_setup_status_phase( + ci); + } + break; default: goto delegate; } @@ -1759,7 +1768,7 @@ static int udc_start(struct ci_hdrc *ci) ci->gadget.ops = &usb_gadget_ops; ci->gadget.speed = USB_SPEED_UNKNOWN; ci->gadget.max_speed = USB_SPEED_HIGH; - ci->gadget.is_otg = 0; + ci->gadget.is_otg = ci->is_otg ? 1 : 0; ci->gadget.name = ci->platdata->name; INIT_LIST_HEAD(&ci->gadget.ep_list); |