msm_ext_chg.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #ifndef __LINUX_USB_MSM_EXT_CHG_H
  2. #define __LINUX_USB_MSM_EXT_CHG_H
  3. #include <linux/ioctl.h>
  4. #define USB_CHG_BLOCK_ULPI 1
  5. #define USB_CHG_BLOCK_QSCRATCH 2
  6. #define USB_REQUEST_5V 1
  7. #define USB_REQUEST_9V 2
  8. /**
  9. * struct msm_usb_chg_info - MSM USB charger block details.
  10. * @chg_block_type: The type of charger block. QSCRATCH/ULPI.
  11. * @page_offset: USB charger register base may not be aligned to
  12. * PAGE_SIZE. The kernel driver aligns the base
  13. * address and use it for memory mapping. This
  14. * page_offset is used by user space to calaculate
  15. * the corret charger register base address.
  16. * @length: The length of the charger register address space.
  17. */
  18. struct msm_usb_chg_info {
  19. uint32_t chg_block_type;
  20. off_t page_offset;
  21. size_t length;
  22. };
  23. /* Get the MSM USB charger block information */
  24. #define MSM_USB_EXT_CHG_INFO _IOW('M', 0, struct msm_usb_chg_info)
  25. /* Vote against USB hardware low power mode */
  26. #define MSM_USB_EXT_CHG_BLOCK_LPM _IOW('M', 1, int)
  27. /* To tell kernel about voltage being voted */
  28. #define MSM_USB_EXT_CHG_VOLTAGE_INFO _IOW('M', 2, int)
  29. /* To tell kernel about voltage request result */
  30. #define MSM_USB_EXT_CHG_RESULT _IOW('M', 3, int)
  31. /* To tell kernel whether charger connected is external charger or not */
  32. #define MSM_USB_EXT_CHG_TYPE _IOW('M', 4, int)
  33. #endif /* __LINUX_USB_MSM_EXT_CHG_H */