pm8821.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /*
  2. * Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 and
  6. * only version 2 as published by the Free Software Foundation.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. */
  13. /*
  14. * Qualcomm PMIC 8821 driver header file
  15. *
  16. */
  17. #ifndef __MFD_PM8821_H
  18. #define __MFD_PM8821_H
  19. #include <linux/device.h>
  20. #include <linux/mfd/pm8xxx/pm8821-irq.h>
  21. #include <linux/mfd/pm8xxx/mpp.h>
  22. #include <linux/mfd/pm8xxx/tm.h>
  23. #define PM8821_NR_IRQS (112)
  24. #define PM8821_NR_MPPS (4)
  25. #define PM8821_MPP_BLOCK_START (4)
  26. /*
  27. * Block 0 does not exist in PM8821 IRQ SSBI address space,
  28. * IRQ0 is assigned to bit0 of block1
  29. */
  30. #define PM8821_IRQ_BLOCK_BIT(block, bit) ((block-1) * 8 + (bit))
  31. /* MPPs [1,N] */
  32. #define PM8821_MPP_IRQ(base, mpp) ((base) + \
  33. PM8821_IRQ_BLOCK_BIT(PM8821_MPP_BLOCK_START, (mpp)-1))
  34. /* PMIC Interrupts */
  35. #define PM8821_OVERTEMP_IRQ PM8821_IRQ_BLOCK_BIT(5, 2)
  36. #define PM8821_TEMPSTAT_IRQ PM8821_IRQ_BLOCK_BIT(5, 7)
  37. struct pm8821_platform_data {
  38. int irq_base;
  39. struct pm8xxx_irq_platform_data *irq_pdata;
  40. struct pm8xxx_mpp_platform_data *mpp_pdata;
  41. };
  42. #endif