xhci-mtk.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef _XHCI_MTK_H
  2. #define _XHCI_MTK_H
  3. #include <linux/usb.h>
  4. #include <mu3phy/mtk-phy.h>
  5. #include "ssusb_io.h"
  6. #include "musb_core.h"
  7. #define IDDIG_EINT_PIN 16
  8. #ifdef CONFIG_SSUSB_MTK_XHCI
  9. void mtk_xhci_ip_init(struct ssusb_mtk *ssusb);
  10. void mtk_xhci_ip_exit(struct ssusb_mtk *ssusb);
  11. void ssusb_mode_switch_manual(struct ssusb_mtk *ssusb, int to_host);
  12. #endif
  13. bool mtk_is_host_mode(void);
  14. int mtk_otg_switch_init(struct ssusb_mtk *ssusb);
  15. void mtk_otg_switch_exit(struct ssusb_mtk *ssusb);
  16. int ssusb_host_init(struct ssusb_mtk *ssusb);
  17. void ssusb_host_exit(struct ssusb_mtk *ssusb);
  18. /* from charge driver */
  19. extern void tbl_charger_otg_vbus(int mode);
  20. /*
  21. mediatek probe out
  22. */
  23. /************************************************************************************/
  24. #if 0
  25. #define SW_PRB_OUT_ADDR (SIFSLV_IPPC+0xc0) /* 0xf00447c0 */
  26. #define PRB_MODULE_SEL_ADDR (SIFSLV_IPPC+0xbc) /* 0xf00447bc */
  27. static inline void mtk_probe_init(const u32 byte)
  28. {
  29. __u32 __iomem *ptr = (__u32 __iomem *) PRB_MODULE_SEL_ADDR;
  30. writel(byte, ptr);
  31. }
  32. static inline void mtk_probe_out(const u32 value)
  33. {
  34. __u32 __iomem *ptr = (__u32 __iomem *) SW_PRB_OUT_ADDR;
  35. writel(value, ptr);
  36. }
  37. static inline u32 mtk_probe_value(void)
  38. {
  39. __u32 __iomem *ptr = (__u32 __iomem *) SW_PRB_OUT_ADDR;
  40. return readl(ptr);
  41. }
  42. #endif
  43. #endif