1
linux/drivers/usb/fotg210/fotg210.h
Linus Walleij 3e679bde52 usb: fotg210-udc: Implement VBUS session
Implement VBUS session handling for FOTG210. This is
mainly used by the UDC driver which needs to call down to
the FOTG210 core and enable/disable VBUS, as this needs to be
handled outside of the HCD and UDC drivers, by platform
specific glue code.

The Gemini has a special bit in a system register to turn
VBUS on and off so we implement this in the FOTG210 core.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20230103-gemini-fotg210-usb-v2-7-100388af9810@linaro.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-01-19 14:10:44 +01:00

62 lines
1.3 KiB
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __FOTG210_H
#define __FOTG210_H
enum gemini_port {
GEMINI_PORT_NONE = 0,
GEMINI_PORT_0,
GEMINI_PORT_1,
};
struct fotg210 {
struct device *dev;
struct resource *res;
void __iomem *base;
struct clk *pclk;
struct regmap *map;
enum gemini_port port;
};
void fotg210_vbus(struct fotg210 *fotg, bool enable);
#ifdef CONFIG_USB_FOTG210_HCD
int fotg210_hcd_probe(struct platform_device *pdev, struct fotg210 *fotg);
int fotg210_hcd_remove(struct platform_device *pdev);
int fotg210_hcd_init(void);
void fotg210_hcd_cleanup(void);
#else
static inline int fotg210_hcd_probe(struct platform_device *pdev,
struct fotg210 *fotg)
{
return 0;
}
static inline int fotg210_hcd_remove(struct platform_device *pdev)
{
return 0;
}
static inline int fotg210_hcd_init(void)
{
return 0;
}
static inline void fotg210_hcd_cleanup(void)
{
}
#endif
#ifdef CONFIG_USB_FOTG210_UDC
int fotg210_udc_probe(struct platform_device *pdev, struct fotg210 *fotg);
int fotg210_udc_remove(struct platform_device *pdev);
#else
static inline int fotg210_udc_probe(struct platform_device *pdev,
struct fotg210 *fotg)
{
return 0;
}
static inline int fotg210_udc_remove(struct platform_device *pdev)
{
return 0;
}
#endif
#endif /* __FOTG210_H */