Loading Documentation/devicetree/bindings/usb/dwc3.txt +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ Optional properties: - usb-core-id: Differentiates between different controllers present on a device. - snps,bus-suspend-enable: If present then controller supports low power mode during bus suspend. - snps,usb3-u1u2-disable: If present, disable U1U2 low power modes in Superspeed mode - in addition all properties from usb-xhci.txt from the current directory are supported as well Loading drivers/usb/dwc3/core.c +2 −0 Original line number Diff line number Diff line Loading @@ -1047,6 +1047,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) &dwc->fladj); dwc->enable_bus_suspend = device_property_read_bool(dev, "snps,bus-suspend-enable"); dwc->usb3_u1u2_disable = device_property_read_bool(dev, "snps,usb3-u1u2-disable"); dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis; Loading drivers/usb/dwc3/core.h +2 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,7 @@ struct dwc3_scratchpad_array { * 2 - No de-emphasis * 3 - Reserved * @err_evt_seen: previous event in queue was erratic error * @usb3_u1u2_disable: if true, disable U1U2 low power modes in Superspeed mode * @in_lpm: indicates if controller is in low power mode (no clocks) * @irq: irq number * @irq_cnt: total irq count Loading Loading @@ -1123,6 +1124,7 @@ struct dwc3 { unsigned tx_de_emphasis:2; unsigned err_evt_seen:1; unsigned enable_bus_suspend:1; unsigned usb3_u1u2_disable:1; atomic_t in_lpm; bool b_suspend; Loading drivers/usb/dwc3/ep0.c +21 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ * GNU General Public License for more details. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/spinlock.h> Loading @@ -35,6 +36,10 @@ #include "gadget.h" #include "io.h" static bool enable_dwc3_u1u2; module_param(enable_dwc3_u1u2, bool, 0644); MODULE_PARM_DESC(enable_dwc3_u1u2, "Enable support for U1U2 low power modes"); static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep); static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, struct dwc3_ep *dep, struct dwc3_request *req); Loading Loading @@ -409,6 +414,9 @@ static int dwc3_ep0_handle_u1(struct dwc3 *dwc, enum usb_device_state state, (dwc->speed != DWC3_DSTS_SUPERSPEED_PLUS)) return -EINVAL; if (dwc->usb3_u1u2_disable && !enable_dwc3_u1u2) return -EINVAL; reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (set) reg |= DWC3_DCTL_INITU1ENA; Loading @@ -431,6 +439,9 @@ static int dwc3_ep0_handle_u2(struct dwc3 *dwc, enum usb_device_state state, (dwc->speed != DWC3_DSTS_SUPERSPEED_PLUS)) return -EINVAL; if (dwc->usb3_u1u2_disable && !enable_dwc3_u1u2) return -EINVAL; reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (set) reg |= DWC3_DCTL_INITU2ENA; Loading Loading @@ -701,14 +712,17 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) usb_gadget_set_state(&dwc->gadget, USB_STATE_CONFIGURED); if (!dwc->usb3_u1u2_disable || enable_dwc3_u1u2) { /* * Enable transition to U1/U2 state when * nothing is pending from application. */ reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA); reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA); dwc3_writel(dwc->regs, DWC3_DCTL, reg); } } break; case USB_STATE_CONFIGURED: Loading Loading
Documentation/devicetree/bindings/usb/dwc3.txt +1 −0 Original line number Diff line number Diff line Loading @@ -61,6 +61,7 @@ Optional properties: - usb-core-id: Differentiates between different controllers present on a device. - snps,bus-suspend-enable: If present then controller supports low power mode during bus suspend. - snps,usb3-u1u2-disable: If present, disable U1U2 low power modes in Superspeed mode - in addition all properties from usb-xhci.txt from the current directory are supported as well Loading
drivers/usb/dwc3/core.c +2 −0 Original line number Diff line number Diff line Loading @@ -1047,6 +1047,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) &dwc->fladj); dwc->enable_bus_suspend = device_property_read_bool(dev, "snps,bus-suspend-enable"); dwc->usb3_u1u2_disable = device_property_read_bool(dev, "snps,usb3-u1u2-disable"); dwc->lpm_nyet_threshold = lpm_nyet_threshold; dwc->tx_de_emphasis = tx_de_emphasis; Loading
drivers/usb/dwc3/core.h +2 −0 Original line number Diff line number Diff line Loading @@ -946,6 +946,7 @@ struct dwc3_scratchpad_array { * 2 - No de-emphasis * 3 - Reserved * @err_evt_seen: previous event in queue was erratic error * @usb3_u1u2_disable: if true, disable U1U2 low power modes in Superspeed mode * @in_lpm: indicates if controller is in low power mode (no clocks) * @irq: irq number * @irq_cnt: total irq count Loading Loading @@ -1123,6 +1124,7 @@ struct dwc3 { unsigned tx_de_emphasis:2; unsigned err_evt_seen:1; unsigned enable_bus_suspend:1; unsigned usb3_u1u2_disable:1; atomic_t in_lpm; bool b_suspend; Loading
drivers/usb/dwc3/ep0.c +21 −7 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ * GNU General Public License for more details. */ #include <linux/module.h> #include <linux/kernel.h> #include <linux/slab.h> #include <linux/spinlock.h> Loading @@ -35,6 +36,10 @@ #include "gadget.h" #include "io.h" static bool enable_dwc3_u1u2; module_param(enable_dwc3_u1u2, bool, 0644); MODULE_PARM_DESC(enable_dwc3_u1u2, "Enable support for U1U2 low power modes"); static void __dwc3_ep0_do_control_status(struct dwc3 *dwc, struct dwc3_ep *dep); static void __dwc3_ep0_do_control_data(struct dwc3 *dwc, struct dwc3_ep *dep, struct dwc3_request *req); Loading Loading @@ -409,6 +414,9 @@ static int dwc3_ep0_handle_u1(struct dwc3 *dwc, enum usb_device_state state, (dwc->speed != DWC3_DSTS_SUPERSPEED_PLUS)) return -EINVAL; if (dwc->usb3_u1u2_disable && !enable_dwc3_u1u2) return -EINVAL; reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (set) reg |= DWC3_DCTL_INITU1ENA; Loading @@ -431,6 +439,9 @@ static int dwc3_ep0_handle_u2(struct dwc3 *dwc, enum usb_device_state state, (dwc->speed != DWC3_DSTS_SUPERSPEED_PLUS)) return -EINVAL; if (dwc->usb3_u1u2_disable && !enable_dwc3_u1u2) return -EINVAL; reg = dwc3_readl(dwc->regs, DWC3_DCTL); if (set) reg |= DWC3_DCTL_INITU2ENA; Loading Loading @@ -701,14 +712,17 @@ static int dwc3_ep0_set_config(struct dwc3 *dwc, struct usb_ctrlrequest *ctrl) usb_gadget_set_state(&dwc->gadget, USB_STATE_CONFIGURED); if (!dwc->usb3_u1u2_disable || enable_dwc3_u1u2) { /* * Enable transition to U1/U2 state when * nothing is pending from application. */ reg = dwc3_readl(dwc->regs, DWC3_DCTL); reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA); reg |= (DWC3_DCTL_ACCEPTU1ENA | DWC3_DCTL_ACCEPTU2ENA); dwc3_writel(dwc->regs, DWC3_DCTL, reg); } } break; case USB_STATE_CONFIGURED: Loading