mt_auxadc_hw.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _MTK_ADC_HW_H
  2. #define _MTK_ADC_HW_H
  3. #ifdef CONFIG_OF
  4. extern void __iomem *auxadc_base;
  5. extern void __iomem *auxadc_apmix_base;
  6. extern void __iomem *auxadc_efuse_base;
  7. #undef AUXADC_BASE
  8. #undef APMIXED_BASE
  9. #undef EFUSEC_BASE
  10. #define AUXADC_BASE auxadc_base
  11. #define APMIXED_BASE auxadc_apmix_base
  12. #define EFUSEC_BASE auxadc_efuse_base
  13. #else
  14. #include <mach/mt_reg_base.h>
  15. #endif
  16. #define ADC_CHANNEL_MAX 16
  17. #define MT_PDN_PERI_AUXADC MT_CG_PERI_AUXADC
  18. #define ADC_CALI_EN_A_REG (EFUSEC_BASE + 0x548)
  19. #define EFUSE_CALI /*Auxadc sw flow support efuse function, so this micro always defined */
  20. #define ADC_GE_A_MASK 0x3ff0000
  21. #define ADC_GE_A_SHIFT 16
  22. #define ADC_OE_A_MASK 0x3ff
  23. #define ADC_OE_A_SHIFT 0
  24. #define ADC_CALI_EN_A_MASK 0x400
  25. #define ADC_CALI_EN_A_SHIFT 10
  26. #define AUXADC_NODE "mediatek,mt6735-auxadc"
  27. #define AUXADC_CON0 (AUXADC_BASE + 0x000)
  28. #define AUXADC_CON1 (AUXADC_BASE + 0x004)
  29. #define AUXADC_CON2 (AUXADC_BASE + 0x010)
  30. #define AUXADC_DAT0 (AUXADC_BASE + 0x014)
  31. #define AUXADC_TP_CMD (AUXADC_BASE + 0x005c)
  32. #define AUXADC_TP_ADDR (AUXADC_BASE + 0x0060)
  33. #define AUXADC_TP_CON0 (AUXADC_BASE + 0x0064)
  34. #define AUXADC_TP_DATA0 (AUXADC_BASE + 0x0074)
  35. #define AUXADC_DET_VOLT (AUXADC_BASE + 0x084)
  36. #define AUXADC_DET_SEL (AUXADC_BASE + 0x088)
  37. #define AUXADC_DET_PERIOD (AUXADC_BASE + 0x08C)
  38. #define AUXADC_DET_DEBT (AUXADC_BASE + 0x090)
  39. #define PAD_AUX_XP 13
  40. #define PAD_AUX_YM 15
  41. #define TP_CMD_ADDR_X 0x0005
  42. #define AUXADC_CON_RTP (APMIXED_BASE + 0x0404)
  43. #endif /*_MTK_ADC_HW_H*/