@@ -116,6 +116,12 @@ void usbhs_sys_function_ctrl(struct usbhs_priv *priv, int enable)
u16 mask = DCFM | DRPD | DPRPU | HSE | USBE;
u16 val = HSE | USBE;
+ /* CNEN bit is required for function operation */
+ if (usbhsc_flags_has(priv, USBHSF_HAS_CNEN)) {
+ mask |= CNEN;
+ val |= CNEN;
+ }
+
/*
* if enable
*
@@ -104,6 +104,7 @@ struct usbhs_priv;
/* SYSCFG */
#define SCKE (1 << 10) /* USB Module Clock Enable */
+#define CNEN (1 << 8) /* Single-ended receiver operation Enable */
#define HSE (1 << 7) /* High-Speed Operation Enable */
#define DCFM (1 << 6) /* Controller Function Select */
#define DRPD (1 << 5) /* D+ Line/D- Line Resistance Control */
@@ -343,6 +344,7 @@ struct usbhs_priv *usbhs_pdev_to_priv(struct platform_device *pdev);
* flags
*/
#define USBHSF_RUNTIME_PWCTRL (1 << 0)
+#define USBHSF_HAS_CNEN (1 << 1) /* Single-ended receiver */
#define usbhsc_flags_init(p) ((p)->flags = 0)
#define usbhsc_flags_set(p, b) ((p)->flags |= (b))
For some SoC, CNEN must be set for USB Device mode operation. Signed-off-by: Chris Brandt <chris.brandt@renesas.com> --- drivers/usb/renesas_usbhs/common.c | 6 ++++++ drivers/usb/renesas_usbhs/common.h | 2 ++ 2 files changed, 8 insertions(+)