GNU Linux-libre 6.7.9-gnu
[releases.git] / drivers / usb / fotg210 / fotg210.h
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __FOTG210_H
3 #define __FOTG210_H
4
5 enum gemini_port {
6         GEMINI_PORT_NONE = 0,
7         GEMINI_PORT_0,
8         GEMINI_PORT_1,
9 };
10
11 struct fotg210 {
12         struct device *dev;
13         struct resource *res;
14         void __iomem *base;
15         struct clk *pclk;
16         struct regmap *map;
17         enum gemini_port port;
18 };
19
20 void fotg210_vbus(struct fotg210 *fotg, bool enable);
21
22 #ifdef CONFIG_USB_FOTG210_HCD
23 int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg);
24 int fotg210_hcd_remove(struct platform_device *pdev);
25 int fotg210_hcd_init(void);
26 void fotg210_hcd_cleanup(void);
27 #else
28 static inline int fotg210_hcd_probe(struct platform_device *pdev,
29                                     struct fotg210 *fotg)
30 {
31         return 0;
32 }
33 static inline int fotg210_hcd_remove(struct platform_device *pdev)
34 {
35         return 0;
36 }
37 static inline int fotg210_hcd_init(void)
38 {
39         return 0;
40 }
41 static inline void fotg210_hcd_cleanup(void)
42 {
43 }
44 #endif
45
46 #ifdef CONFIG_USB_FOTG210_UDC
47 int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg);
48 int fotg210_udc_remove(struct platform_device *pdev);
49 #else
50 static inline int fotg210_udc_probe(struct platform_device *pdev,
51                                     struct fotg210 *fotg)
52 {
53         return 0;
54 }
55 static inline int fotg210_udc_remove(struct platform_device *pdev)
56 {
57         return 0;
58 }
59 #endif
60
61 #endif /* __FOTG210_H */