blob: 932f8da4bff8901f04ea5dc7e228c39ae30bc91d [file] [log] [blame]
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07001/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 */
13#ifndef __PMIC8901_H__
14#define __PMIC8901_H__
15/*
16 * Qualcomm PMIC8901 driver header file
17 *
18 */
19
20#include <linux/irq.h>
21#include <linux/mfd/core.h>
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053022#include <linux/mfd/pm8xxx/irq.h>
23#include <linux/mfd/pm8xxx/mpp.h>
24#include <linux/mfd/pm8xxx/tm.h>
25#include <linux/regulator/pmic8901-regulator.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070026
27#define PM8901_IRQ_BLOCK_BIT(block, bit) ((block) * 8 + (bit))
28
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053029#define PM8901_NR_IRQS 72
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070030
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053031/* PM8901 MPP */
32#define PM8901_MPP_BLOCK_START 6
33#define PM8901_MPPS 4
34
35/* PM8901 IRQs */
36#define PM8901_MPP_IRQ(mpp) PM8901_IRQ_BLOCK_BIT(6, (mpp))
37#define PM8901_TEMPSTAT_IRQ PM8901_IRQ_BLOCK_BIT(6, 4)
38#define PM8901_OVERTEMP_IRQ PM8901_IRQ_BLOCK_BIT(6, 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070039
40struct pm8901_chip;
41
42struct pm8901_platform_data {
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053043 struct pm8xxx_irq_platform_data *irq_pdata;
44 struct pm8xxx_mpp_platform_data *mpp_pdata;
45 struct pm8901_vreg_pdata *regulator_pdatas;
46 int num_regulators;
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070047};
48
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070049#ifdef CONFIG_PMIC8901
50int pm8901_reset_pwr_off(int reset);
51#else
52static inline int pm8901_reset_pwr_off(int reset) { return 0; }
53#endif
54
55#endif /* __PMIC8901_H__ */