mt_pmic_wrap.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef __MT_PMIC_WRAP_H__
  2. #define __MT_PMIC_WRAP_H__
  3. #include <linux/types.h>
  4. #include <linux/device.h>
  5. #define PWRAP_READ 0
  6. #define PWRAP_WRITE 1
  7. struct mt_pmic_wrap_driver {
  8. struct device_driver driver;
  9. s32 (*wacs2_hal)(u32 write, u32 adr, u32 wdata, u32 *rdata);
  10. s32 (*show_hal)(char *buf);
  11. s32 (*store_hal)(const char *buf, size_t count);
  12. s32 (*suspend)(void);
  13. void (*resume)(void);
  14. };
  15. /* ------external API for pmic_wrap user-------------------------------------------------- */
  16. s32 pwrap_read(u32 adr, u32 *rdata);
  17. s32 pwrap_write(u32 adr, u32 wdata);
  18. s32 pwrap_wacs2(u32 write, u32 adr, u32 wdata, u32 *rdata);
  19. /*_____________ROME only_____________________________________________*/
  20. /********************************************************************/
  21. /* return value : EINT_STA: [0]: CPU IRQ status in MT6331 */
  22. /* [1]: MD32 IRQ status in MT6331 */
  23. /* [2]: CPU IRQ status in MT6332 */
  24. /* [3]: RESERVED */
  25. /********************************************************************/
  26. u32 pmic_wrap_eint_status(void);
  27. /********************************************************************/
  28. /* set value(W1C) : EINT_CLR: [0]: CPU IRQ status in MT6331 */
  29. /* [1]: MD32 IRQ status in MT6331 */
  30. /* [2]: CPU IRQ status in MT6332 */
  31. /* [3]: RESERVED */
  32. /* para: offset is shift of clear bit which needs to clear */
  33. /********************************************************************/
  34. void pmic_wrap_eint_clr(int offset);
  35. /*--------------------------------------------------------------------*/
  36. u32 mt_pmic_wrap_eint_status(void);
  37. void mt_pmic_wrap_eint_clr(int offset);
  38. s32 pwrap_init(void);
  39. struct mt_pmic_wrap_driver *get_mt_pmic_wrap_drv(void);
  40. #endif /* __MT_PMIC_WRAP_H__ */