host_notify.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Host notify class driver
  3. *
  4. * Copyright (C) 2011-2013 Samsung, Inc.
  5. * Author: Dongrak Shin <dongrak.shin@samsung.com>
  6. *
  7. */
  8. #ifndef __LINUX_HOST_NOTIFY_H__
  9. #define __LINUX_HOST_NOTIFY_H__
  10. enum host_uevent_state {
  11. NOTIFY_HOST_NONE,
  12. NOTIFY_HOST_ADD,
  13. NOTIFY_HOST_REMOVE,
  14. NOTIFY_HOST_OVERCURRENT,
  15. NOTIFY_HOST_LOWBATT,
  16. NOTIFY_HOST_BLOCK,
  17. NOTIFY_HOST_UNKNOWN,
  18. };
  19. enum otg_hostnotify_mode {
  20. NOTIFY_NONE_MODE,
  21. NOTIFY_HOST_MODE,
  22. NOTIFY_PERIPHERAL_MODE,
  23. NOTIFY_TEST_MODE,
  24. };
  25. enum booster_power {
  26. NOTIFY_POWER_OFF,
  27. NOTIFY_POWER_ON,
  28. };
  29. enum set_command {
  30. NOTIFY_SET_OFF,
  31. NOTIFY_SET_ON,
  32. };
  33. struct host_notify_dev {
  34. const char *name;
  35. struct device *dev;
  36. int index;
  37. int state;
  38. int mode;
  39. int booster;
  40. int (*set_mode)(int);
  41. int (*set_booster)(int, struct host_notify_dev *);
  42. };
  43. struct booster_data {
  44. const char * name;
  45. int (*boost)(int enable);
  46. };
  47. extern int host_state_notify(struct host_notify_dev *ndev, int state);
  48. extern int host_notify_dev_register(struct host_notify_dev *ndev);
  49. extern void host_notify_dev_unregister(struct host_notify_dev *ndev);
  50. /* see usb_phy_events in <linux/usb/otg.h> */
  51. enum host_notify_event {
  52. HNOTIFY_NONE,
  53. HNOTIFY_VBUS,
  54. HNOTIFY_ID, //#2
  55. HNOTIFY_CHARGER,
  56. HNOTIFY_ENUMERATED,
  57. HNOTIFY_ID_PULL, //#5
  58. HNOTIFY_OVERCURRENT,
  59. HNOTIFY_OTG_POWER_ON,
  60. HNOTIFY_OTG_POWER_OFF,
  61. HNOTIFY_SMARTDOCK_ON,
  62. HNOTIFY_SMARTDOCK_OFF,
  63. HNOTIFY_AUDIODOCK_ON,
  64. HNOTIFY_AUDIODOCK_OFF,
  65. HNOTIFY_LANHUB_ON,
  66. HNOTIFY_LANHUB_OFF,
  67. HNOTIFY_LANHUBTA_ON, //#15
  68. HNOTIFY_LANHUBTA_OFF, //#16
  69. };
  70. enum host_notify_data {
  71. HNOTIFY_EVENT,
  72. HNOTIFY_MODE,
  73. HNOTIFY_BOOSTER,
  74. };
  75. extern int check_usb_block_type(void);
  76. extern int sec_otg_notify(int event);
  77. extern int sec_otg_register_booster(struct booster_data *);
  78. extern int sec_get_notification(int ndata);
  79. #endif /* __LINUX_HOST_NOTIFY_H__ */