}
return 0;
}
-
+/* usb */
+static int otg_drv = DEF_OTG_DRV;
+module_param(otg_drv, int, 0644);
+static int host_drv = DEF_HOST_DRV;
+module_param(host_drv, int, 0644);
+static inline int check_usb_param(void)
+{
+ return 0;
+}
+int inline otg_drv_init(int on)
+{
+ return port_output_init(otg_drv, on, "otg_drv");
+}
+void inline otg_drv_on(void)
+{
+ port_output_on(otg_drv);
+}
+void inline otg_drv_off(void)
+{
+ port_output_off(otg_drv);
+}
+int inline host_drv_init(int on)
+{
+ return port_output_init(host_drv, on, "host_drv");
+}
+void inline host_drv_on(void)
+{
+ port_output_on(host_drv);
+}
+void inline host_drv_off(void)
+{
+ port_output_off(host_drv);
+}
/* lcd */
static int lcd_cabc = DEF_LCD_CABC;
module_param(lcd_cabc, int, 0644);
enum{
DEF_KEY_ADC = 1,
DEF_PLAY_KEY = 0x000101a4,
- DEF_VOLDN_KEY = 0x000102b4,
+ DEF_VOLDN_KEY = 0x000102b6,
DEF_VOLUP_KEY = 1 | (1<<31),
- DEF_MENU_KEY = 135 | (1<<31),
- DEF_ESC_KEY = 334 | (1<<31),
- DEF_HOME_KEY = 550 | (1<<31),
- DEF_CAM_KEY = 700 | (1<<31),
+ DEF_MENU_KEY = 100 | (1<<31),
+ DEF_ESC_KEY = 255 | (1<<31),
+ DEF_HOME_KEY = 425 | (1<<31),
+ DEF_CAM_KEY = 576 | (1<<31),
};
/* backlight */
enum{
DEF_BL_MIN = 60,
DEF_BL_EN = 0x000002c1,
};
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = 0x000002b4,
+};
/* lcd */
enum {
DEF_LCD_CABC = 0x000002c3,
DEF_BL_MIN = 60,
DEF_BL_EN = 0x000003c4,
};
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = 0x000001b2,
+};
/* lcd */
enum {
DEF_LCD_CABC = 0x000002d1,
DEF_BL_MIN = 80,
DEF_BL_EN = -1,
};
+
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = -1,
+};
/* lcd */
enum {
DEF_LCD_CABC = -1,
DEF_BL_MIN = 80,
DEF_BL_EN = 0x000003c5,
};
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = -1,
+};
/* lcd */
enum {
DEF_LCD_CABC = -1,
DEF_BL_MIN = 80,
DEF_BL_EN = 0x000001b0,
};
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = -1,
+};
/* lcd */
enum {
DEF_LCD_CABC = -1,
DEF_BL_MIN = 0,
DEF_BL_EN = -1,
};
+/* usb */
+enum {
+ DEF_OTG_DRV = -1,
+ DEF_HOST_DRV = -1,
+};
/* lcd */
enum {
DEF_LCD_CABC = -1,
enum {
DEF_PWR_ON = -1,
};
-
#endif
+int inline otg_drv_init(int on);
+void inline otg_drv_on(void);
+void inline otg_drv_off(void);
+
+int inline host_drv_init(int on);
+void inline host_drv_on(void);
+void inline host_drv_off(void);
+
#endif
#include <mach/gpio.h>\r
#include <mach/iomux.h>\r
#include <mach/cru.h>\r
+#include <mach/config.h>\r
\r
#include "usbdev_rk.h"\r
#include "dwc_otg_regs.h"\r
*(unsigned int *)(USBGRF_UOC0_CON0) = 0x07e70350;\r
\r
// other hardware init\r
+#ifdef CONFIG_RK_CONFIG\r
+ otg_drv_init(0);\r
+#else\r
rk30_mux_api_set(GPIO3C1_OTG_DRVVBUS_NAME, GPIO3C_OTG_DRVVBUS); \r
+#endif\r
}\r
void usb20otg_phy_suspend(void* pdata, int suspend)\r
{\r
\r
void usb20otg_power_enable(int enable)\r
{\r
+#ifdef CONFIG_RK_CONFIG\r
+ if(enable)\r
+ otg_drv_on();\r
+ else\r
+ otg_drv_off();\r
+#endif\r
}\r
struct dwc_otg_platform_data usb20otg_pdata = {\r
.phyclk = NULL,\r
// usb phy config init\r
*(unsigned int *)(USBGRF_UOC1_CON0) = 0x07e70350;\r
// other haredware init\r
- \r
+#ifdef CONFIG_RK_CONFIG\r
+ host_drv_init(1);\r
+#endif\r
}\r
void usb20host_phy_suspend(void* pdata, int suspend)\r
{\r
}\r
void usb20host_power_enable(int enable)\r
{\r
+#ifdef CONFIG_RK_CONFIG\r
+ if(enable)\r
+ host_drv_on();\r
+ else\r
+ host_drv_off();\r
+#endif\r
}\r
struct dwc_otg_platform_data usb20host_pdata = {\r
.phyclk = NULL,\r
#endif\r
static int __init usbdev_init_devices(void)\r
{\r
+ int ret = 0;\r
#ifdef CONFIG_USB20_OTG\r
- platform_device_register(&device_usb20_otg);\r
+ ret = platform_device_register(&device_usb20_otg);\r
+ if(ret < 0){\r
+ printk("%s: platform_device_register(usb20_otg) failed\n", __func__);\r
+ return ret;\r
+ }\r
#endif\r
#ifdef CONFIG_USB20_HOST\r
- platform_device_register(&device_usb20_host);\r
+ ret = platform_device_register(&device_usb20_host);\r
#endif\r
+ return ret;\r
}\r
arch_initcall(usbdev_init_devices);\r
#endif\r