瀏覽代碼

usb: musb-new: omap2430: OMAP4 MUSB USB controller support

This adds support for the OMAP4 MUSB USB controller, with a matching Linux
compat definition, TWL6030 USB device setup and USBOTGHS register setup.

Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
Paul Kocialkowski 9 年之前
父節點
當前提交
27754d18fc
共有 3 個文件被更改,包括 25 次插入0 次删除
  1. 4 0
      drivers/usb/musb-new/linux-compat.h
  2. 13 0
      drivers/usb/musb-new/omap2430.c
  3. 8 0
      drivers/usb/musb-new/omap2430.h

+ 4 - 0
drivers/usb/musb-new/linux-compat.h

@@ -37,4 +37,8 @@
 #define CONFIG_SOC_OMAP3430
 #define CONFIG_SOC_OMAP3430
 #endif
 #endif
 
 
+#ifdef CONFIG_OMAP4430
+#define CONFIG_ARCH_OMAP4
+#endif
+
 #endif /* __LINUX_COMPAT_H__ */
 #endif /* __LINUX_COMPAT_H__ */

+ 13 - 0
drivers/usb/musb-new/omap2430.c

@@ -23,8 +23,10 @@
 #include <linux/usb/musb-omap.h>
 #include <linux/usb/musb-omap.h>
 #else
 #else
 #include <common.h>
 #include <common.h>
+#include <asm/omap_common.h>
 #include <asm/omap_musb.h>
 #include <asm/omap_musb.h>
 #include <twl4030.h>
 #include <twl4030.h>
+#include <twl6030.h>
 #include "linux-compat.h"
 #include "linux-compat.h"
 #endif
 #endif
 
 
@@ -434,6 +436,17 @@ static int omap2430_musb_enable(struct musb *musb)
 				__PRETTY_FUNCTION__);
 				__PRETTY_FUNCTION__);
 	}
 	}
 #endif
 #endif
+
+#ifdef CONFIG_TWL6030_POWER
+	twl6030_usb_device_settings();
+#endif
+
+#ifdef CONFIG_OMAP4430
+	u32 *usbotghs_control = (u32 *)((*ctrl)->control_usbotghs_ctrl);
+	*usbotghs_control = USBOTGHS_CONTROL_AVALID |
+		USBOTGHS_CONTROL_VBUSVALID | USBOTGHS_CONTROL_IDDIG;
+#endif
+
 	return 0;
 	return 0;
 #endif
 #endif
 }
 }

+ 8 - 0
drivers/usb/musb-new/omap2430.h

@@ -50,4 +50,12 @@
 #define OTG_FORCESTDBY		0x414
 #define OTG_FORCESTDBY		0x414
 #	define	ENABLEFORCE		(1 << 0)
 #	define	ENABLEFORCE		(1 << 0)
 
 
+/*
+ * OMAP4-specific definitions
+ */
+
+#define USBOTGHS_CONTROL_AVALID		(1 << 0)
+#define USBOTGHS_CONTROL_VBUSVALID	(1 << 2)
+#define USBOTGHS_CONTROL_IDDIG		(1 << 4)
+
 #endif	/* __MUSB_OMAP243X_H__ */
 #endif	/* __MUSB_OMAP243X_H__ */