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