MLK-17312-3 usb: cdns3: gadget: configure all endpoints before set configuration
authorPeter Chen <peter.chen@nxp.com>
Wed, 27 Dec 2017 09:00:22 +0000 (17:00 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:52:29 +0000 (14:52 -0500)
commite54bdbea09483ff9d7337486c8121a67b27af174
tree633387285bb9c8be2a9d506202feb228b667762d
parenta84bafab1999c01a8ce34569998144409df1878c
MLK-17312-3 usb: cdns3: gadget: configure all endpoints before set configuration

Cadence IP has one limitation that all endpoints must be configured
(Type & MaxPacketSize) before setting configuration through hardware
register, it means we can't change endpoints configuration after
set_configuration.

In this patch, we add non-control endpoint through usb_ss->ep_match_list,
which is added when the gadget driver uses usb_ep_autoconfig to configure
specific endpoint; When the udc driver receives set_configurion request,
it goes through usb_ss->ep_match_list, and configure all endpoints
accordingly.

At usb_ep_ops.enable/disable, we only enable and disable endpoint through
ep_cfg register which can be changed after set_configuration, and do
some software operation accordingly.

Acked-by: Jun Li <jun.li@nxp.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
drivers/usb/cdns3/gadget.c
drivers/usb/cdns3/gadget.h