rk: restore file mode
[firefly-linux-kernel-4.4.55.git] / drivers / usb / dwc_otg_310 / usbdev_rk.h
index 06584dd516ca443b3e981a9a18a02af220870b0d..c4b0dd72f550c8eb5d59c5e6f20e8b42a1c4aef1 100755 (executable)
@@ -19,6 +19,8 @@
 #include <linux/interrupt.h>
 #include <linux/irq.h>
 #include <linux/reset.h>
+#include <linux/mfd/syscon.h>
+#include <linux/regmap.h>
 #include <linux/rockchip/cru.h>
 #include <linux/rockchip/grf.h>
 #include <linux/rockchip/cpu.h>
@@ -34,6 +36,9 @@
 #define PHY_USB_MODE    (0)
 #define PHY_UART_MODE   (1)
 
+#define PHY_POWER_DOWN (0)
+#define PHY_POWER_UP   (1)
+
 #define USB_STATUS_BVABLID    (1)
 #define USB_STATUS_DPDM       (2)
 #define USB_STATUS_ID         (3)
@@ -52,16 +57,15 @@ enum rkusb_rst_flag {
        RST_OTHER,
 };
 
-extern int rk_usb_charger_status;
 extern void rk_send_wakeup_key(void);
 /* rk3188 platform data */
 extern struct dwc_otg_platform_data usb20otg_pdata_rk3188;
 extern struct dwc_otg_platform_data usb20host_pdata_rk3188;
-extern struct rkehci_platform_data rkhsic_pdata_rk3188;
+extern struct rkehci_platform_data rkehci_pdata_rk3188;
 /* rk3288 platform data */
 extern struct dwc_otg_platform_data usb20otg_pdata_rk3288;
 extern struct dwc_otg_platform_data usb20host_pdata_rk3288;
-extern struct rkehci_platform_data rkhsic_pdata_rk3288;
+extern struct rkehci_platform_data rkehci1_pdata_rk3288;
 extern struct rkehci_platform_data rkehci_pdata_rk3288;
 extern struct rkehci_platform_data rkohci_pdata_rk3288;
 /* rk3036 platform data */
@@ -70,7 +74,12 @@ extern struct dwc_otg_platform_data usb20host_pdata_rk3036;
 /* rk3126 platform data */
 extern struct dwc_otg_platform_data usb20otg_pdata_rk3126;
 extern struct dwc_otg_platform_data usb20host_pdata_rk3126;
-
+extern struct dwc_otg_platform_data usb20ohci_pdata_rk3126;
+extern struct rkehci_platform_data usb20ehci_pdata_rk3126;
+/* rk3368 platform data */
+extern struct rkehci_platform_data usb20ehci_pdata_rk3368;
+extern struct dwc_otg_platform_data usb20ohci_pdata_rk3368;
+extern struct dwc_otg_platform_data usb20otg_pdata_rk3368;
 
 struct dwc_otg_platform_data {
        void *privdata;
@@ -89,13 +98,14 @@ struct dwc_otg_platform_data {
        void (*dwc_otg_uart_mode) (void *pdata, int enter_usb_uart_mode);
        void (*bc_detect_cb) (int bc_type);
        int (*get_status) (int id);
+       void (*phy_power_down)(int power_down);
 };
 
 struct rkehci_platform_data {
        struct device *dev;
-       struct clk *hclk_hsic;
-       struct clk *hsic_phy_480m;
-       struct clk *hsic_phy_12m;
+       struct clk *hclk_ehci;
+       struct clk *ehci_phy_480m;
+       struct clk *ehci_phy_12m;
        struct clk *phyclk;
        struct clk *ahbclk;
        void (*hw_init) (void);
@@ -120,6 +130,7 @@ struct dwc_otg_control_usb {
        pGRF_SOC_STATUS19_RK3288 grf_soc_status19_rk3288;
        pGRF_SOC_STATUS21_RK3288 grf_soc_status21_rk3288;
 
+       struct regmap *grf;
        struct gpio *host_gpios;
        struct gpio *otg_gpios;
        struct clk *hclk_usb_peri;
@@ -128,6 +139,7 @@ struct dwc_otg_control_usb {
        struct wake_lock usb_wakelock;
        int remote_wakeup;
        int usb_irq_wakeup;
+       int linestate_wakeup;
        int chip_id;
 };
 
@@ -138,16 +150,6 @@ enum {
        RK3126_USB_CTLR,
 };
 
-struct usb20otg_pdata_id {
-       char name[32];
-       struct dwc_otg_platform_data *pdata;
-};
-
-struct usb20host_pdata_id {
-       char name[32];
-       struct dwc_otg_platform_data *pdata;
-};
-
 struct rkehci_pdata_id {
        char name[32];
        struct rkehci_platform_data *pdata;