fotg210.h 1.3 KB

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