PageRenderTime 26ms CodeModel.GetById 15ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/include/linux/mfd/pm8xxx/pm8018.h

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