USB: add otg irq detect function and chip id detect function
[firefly-linux-kernel-4.4.55.git] / drivers / usb / dwc_otg_310 / usbdev_rk.h
1 #ifndef __USBDEV_RK_H
2 #define __USBDEV_RK_H
3
4 #define USB_PHY_ENABLED (0)
5 #define USB_PHY_SUSPEND (1)
6
7 #define PHY_USB_MODE    (0)
8 #define PHY_UART_MODE   (1)
9
10 #define USB_STATUS_BVABLID    (1)
11 #define USB_STATUS_DPDM           (2)
12 #define USB_STATUS_ID         (3)
13 #define USB_STATUS_UARTMODE   (4)
14
15 struct dwc_otg_platform_data {
16     void *privdata;
17     struct device *dev;
18     struct clk* phyclk;
19     struct clk* ahbclk;
20     struct clk* busclk;
21     int phy_status;
22     void (*hw_init)(void);
23     void (*phy_suspend)(void* pdata, int suspend);
24     void (*soft_reset)(void);
25     void (*clock_init)(void* pdata);
26     void (*clock_enable)(void* pdata, int enable);
27     void (*power_enable)(int enable);
28     void (*dwc_otg_uart_mode)(void* pdata, int enter_usb_uart_mode);
29     int (*get_status)(int id);
30     int (*get_chip_id)(void);
31 };
32
33 struct rkehci_platform_data{
34         struct device *dev;
35         struct clk* hclk_hsic;
36         struct clk* hsic_phy_480m;
37         struct clk* hsic_phy_12m;
38         void (*hw_init)(void);
39         void (*clock_init)(void* pdata);
40         void (*clock_enable)(void *pdata, int enable);
41         void (*soft_reset)(void);
42         int (*get_chip_id)(void);
43         int clk_status;
44 };
45
46 struct dwc_otg_control_usb {
47         void *grf_soc_status0;
48         void *grf_uoc0_base;
49         void *grf_uoc1_base;
50         void *grf_uoc2_base;
51         void *grf_uoc3_base;
52         struct gpio *host_gpios;
53         struct gpio *otg_gpios;
54         struct clk* hclk_usb_peri;
55         struct delayed_work usb_det_wakeup_work;
56         struct wake_lock usb_wakelock;
57         int chip_id;
58 };
59
60 enum {
61         RK3188_USB_CTLR = 0,    /* rk3188 chip usb */
62         RK3288_USB_CTLR,        /* rk3288 chip usb */
63 };
64
65 #endif