usb: dwc_otg_310: fix usb vbus power controlled by pmic
[firefly-linux-kernel-4.4.55.git] / drivers / usb / dwc_otg_310 / dwc_otg_os_dep.h
1 #ifndef _DWC_OS_DEP_H_
2 #define _DWC_OS_DEP_H_
3
4 /**
5  * @file
6  *
7  * This file contains OS dependent structures.
8  *
9  */
10
11 #include <linux/kernel.h>
12 #include <linux/module.h>
13 #include <linux/moduleparam.h>
14 #include <linux/init.h>
15 #include <linux/device.h>
16 #include <linux/errno.h>
17 #include <linux/types.h>
18 #include <linux/slab.h>
19 #include <linux/list.h>
20 #include <linux/interrupt.h>
21 #include <linux/ctype.h>
22 #include <linux/string.h>
23 #include <linux/dma-mapping.h>
24 #include <linux/jiffies.h>
25 #include <linux/delay.h>
26 #include <linux/timer.h>
27 #include <linux/workqueue.h>
28 #include <linux/stat.h>
29 #include <linux/pci.h>
30 #include <linux/wakelock.h>
31
32 #include <linux/version.h>
33
34 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 20)
35 # include <linux/irq.h>
36 #endif
37
38 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 21)
39 # include <linux/usb/ch9.h>
40 #else
41 # include <linux/usb_ch9.h>
42 #endif
43
44 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 24)
45 # include <linux/usb/gadget.h>
46 #else
47 # include <linux/usb_gadget.h>
48 #endif
49
50 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 20)
51 # include <asm/irq.h>
52 #endif
53
54 # include <asm/unaligned.h>
55 # include <asm/sizes.h>
56 # include <asm/param.h>
57 # include <asm/io.h>
58 # include <linux/platform_device.h>
59 # include <linux/of.h>
60 # include <linux/of_platform.h>
61
62 /* # include <asm/arch/lm.h> */
63 /* # include <asm/arch/irqs.h> */
64 /* # include <asm/arch/regs-irq.h> */
65
66 /** The OS page size */
67 #define DWC_OS_PAGE_SIZE        PAGE_SIZE
68
69 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
70 typedef int gfp_t;
71 #endif
72
73 #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
74 # define IRQF_SHARED SA_SHIRQ
75 #endif
76
77 typedef struct os_dependent {
78         /** Base address returned from ioremap() */
79         void *base;
80
81         /** Register offset for Diagnostic API */
82         uint32_t reg_offset;
83
84
85         struct platform_device *pdev;
86 } os_dependent_t;
87
88 #ifdef __cplusplus
89 }
90 #endif
91
92 #endif /* _DWC_OS_DEP_H_ */