pm8018.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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 8018 driver header file
  15. *
  16. */
  17. #ifndef __MFD_PM8018_H
  18. #define __MFD_PM8018_H
  19. #include <linux/device.h>
  20. #include <linux/mfd/pm8xxx/irq.h>
  21. #include <linux/mfd/pm8xxx/gpio.h>
  22. #include <linux/mfd/pm8xxx/mpp.h>
  23. #include <linux/mfd/pm8xxx/rtc.h>
  24. #include <linux/mfd/pm8xxx/tm.h>
  25. #include <linux/input/pmic8xxx-pwrkey.h>
  26. #include <linux/mfd/pm8xxx/misc.h>
  27. #include <linux/regulator/pm8xxx-regulator.h>
  28. #include <linux/mfd/pm8xxx/pm8xxx-adc.h>
  29. #include <linux/mfd/pm8xxx/pwm.h>
  30. #include <linux/leds-pm8xxx.h>
  31. #define PM8018_CORE_DEV_NAME "pm8018-core"
  32. #define PM8018_NR_IRQS 256
  33. #define PM8018_NR_GPIOS 6
  34. #define PM8018_NR_MPPS 6
  35. #define PM8018_GPIO_BLOCK_START 24
  36. #define PM8018_MPP_BLOCK_START 16
  37. #define PM8018_IRQ_BLOCK_BIT(block, bit) ((block) * 8 + (bit))
  38. /* GPIOs and MPPs [1,N] */
  39. #define PM8018_GPIO_IRQ(base, gpio) ((base) + \
  40. PM8018_IRQ_BLOCK_BIT(PM8018_GPIO_BLOCK_START, (gpio)-1))
  41. #define PM8018_MPP_IRQ(base, mpp) ((base) + \
  42. PM8018_IRQ_BLOCK_BIT(PM8018_MPP_BLOCK_START, (mpp)-1))
  43. /* PMIC Interrupts */
  44. #define PM8018_RTC_ALARM_IRQ PM8018_IRQ_BLOCK_BIT(4, 7)
  45. #define PM8018_PWRKEY_REL_IRQ PM8018_IRQ_BLOCK_BIT(6, 2)
  46. #define PM8018_PWRKEY_PRESS_IRQ PM8018_IRQ_BLOCK_BIT(6, 3)
  47. #define PM8018_ADC_EOC_USR_IRQ PM8018_IRQ_BLOCK_BIT(9, 6)
  48. #define PM8018_ADC_BATT_TEMP_WARM_IRQ PM8018_IRQ_BLOCK_BIT(9, 1)
  49. #define PM8018_ADC_BATT_TEMP_COLD_IRQ PM8018_IRQ_BLOCK_BIT(9, 0)
  50. #define PM8018_OVERTEMP_IRQ PM8018_IRQ_BLOCK_BIT(4, 2)
  51. #define PM8018_TEMPSTAT_IRQ PM8018_IRQ_BLOCK_BIT(6, 7)
  52. #define PM8018_LVS1_OCP_IRQ PM8921_IRQ_BLOCK_BIT(13, 0)
  53. struct pm8018_platform_data {
  54. struct pm8xxx_irq_platform_data *irq_pdata;
  55. struct pm8xxx_gpio_platform_data *gpio_pdata;
  56. struct pm8xxx_mpp_platform_data *mpp_pdata;
  57. struct pm8xxx_rtc_platform_data *rtc_pdata;
  58. struct pm8xxx_pwrkey_platform_data *pwrkey_pdata;
  59. struct pm8xxx_misc_platform_data *misc_pdata;
  60. struct pm8xxx_regulator_platform_data *regulator_pdatas;
  61. struct pm8xxx_adc_platform_data *adc_pdata;
  62. int num_regulators;
  63. struct pm8xxx_led_platform_data *leds_pdata;
  64. };
  65. #endif