usb: chipidea: otg: enable HNP polling support for gadget and host
authorLi Jun <jun.li@nxp.com>
Fri, 19 Feb 2016 02:04:46 +0000 (10:04 +0800)
committerFelipe Balbi <balbi@kernel.org>
Fri, 4 Mar 2016 13:14:37 +0000 (15:14 +0200)
Enable HNP polling support for chipidea gadget and allocate memory
for host request flag when otg fsm init.

Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Li Jun <jun.li@nxp.com>
Signed-off-by: Felipe Balbi <balbi@kernel.org>
drivers/usb/chipidea/otg_fsm.c

index cb28e763f0b8dee37a6574ff3a609541bcd73e65..9a963a7494675f932f7ec69145e99dfbbc744084 100644 (file)
@@ -797,6 +797,10 @@ int ci_hdrc_otg_fsm_init(struct ci_hdrc *ci)
        ci->fsm.id = hw_read_otgsc(ci, OTGSC_ID) ? 1 : 0;
        ci->fsm.otg->state = OTG_STATE_UNDEFINED;
        ci->fsm.ops = &ci_otg_ops;
+       ci->gadget.hnp_polling_support = 1;
+       ci->fsm.host_req_flag = devm_kzalloc(ci->dev, 1, GFP_KERNEL);
+       if (!ci->fsm.host_req_flag)
+               return -ENOMEM;
 
        mutex_init(&ci->fsm.lock);