hi655x-pmic.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Device driver for regulators in hi655x IC
  4. *
  5. * Copyright (c) 2016 Hisilicon.
  6. *
  7. * Authors:
  8. * Chen Feng <puck.chen@hisilicon.com>
  9. * Fei Wang <w.f@huawei.com>
  10. */
  11. #ifndef __HI655X_PMIC_H
  12. #define __HI655X_PMIC_H
  13. /* Hi655x registers are mapped to memory bus in 4 bytes stride */
  14. #define HI655X_STRIDE 4
  15. #define HI655X_BUS_ADDR(x) ((x) << 2)
  16. #define HI655X_BITS 8
  17. #define HI655X_NR_IRQ 32
  18. #define HI655X_IRQ_STAT_BASE (0x003 << 2)
  19. #define HI655X_IRQ_MASK_BASE (0x007 << 2)
  20. #define HI655X_ANA_IRQM_BASE (0x1b5 << 2)
  21. #define HI655X_IRQ_ARRAY 4
  22. #define HI655X_IRQ_MASK 0xFF
  23. #define HI655X_IRQ_CLR 0xFF
  24. #define HI655X_VER_REG 0x00
  25. #define PMU_VER_START 0x10
  26. #define PMU_VER_END 0x38
  27. #define RESERVE_INT 7
  28. #define PWRON_D20R_INT 6
  29. #define PWRON_D20F_INT 5
  30. #define PWRON_D4SR_INT 4
  31. #define VSYS_6P0_D200UR_INT 3
  32. #define VSYS_UV_D3R_INT 2
  33. #define VSYS_2P5_R_INT 1
  34. #define OTMP_D1R_INT 0
  35. #define RESERVE_INT_MASK BIT(RESERVE_INT)
  36. #define PWRON_D20R_INT_MASK BIT(PWRON_D20R_INT)
  37. #define PWRON_D20F_INT_MASK BIT(PWRON_D20F_INT)
  38. #define PWRON_D4SR_INT_MASK BIT(PWRON_D4SR_INT)
  39. #define VSYS_6P0_D200UR_INT_MASK BIT(VSYS_6P0_D200UR_INT)
  40. #define VSYS_UV_D3R_INT_MASK BIT(VSYS_UV_D3R_INT)
  41. #define VSYS_2P5_R_INT_MASK BIT(VSYS_2P5_R_INT)
  42. #define OTMP_D1R_INT_MASK BIT(OTMP_D1R_INT)
  43. struct hi655x_pmic {
  44. struct resource *res;
  45. struct device *dev;
  46. struct regmap *regmap;
  47. int gpio;
  48. unsigned int ver;
  49. struct regmap_irq_chip_data *irq_data;
  50. };
  51. #endif