blob: bf64bec69218390bb370be69e4de94cd906675b6 [file] [log] [blame]
Duy Truong790f06d2013-02-13 16:38:12 -08001/* Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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>
Anirudh Ghayal934b2712011-12-13 12:49:51 +053026#include <linux/mfd/pm8xxx/misc.h>
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070027
28#define PM8901_IRQ_BLOCK_BIT(block, bit) ((block) * 8 + (bit))
29
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053030#define PM8901_NR_IRQS 72
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070031
Anirudh Ghayal9f77e962011-12-06 12:38:21 +053032/* PM8901 MPP */
33#define PM8901_MPP_BLOCK_START 6
34#define PM8901_MPPS 4
35
36/* PM8901 IRQs */
37#define PM8901_MPP_IRQ(mpp) PM8901_IRQ_BLOCK_BIT(6, (mpp))
38#define PM8901_TEMPSTAT_IRQ PM8901_IRQ_BLOCK_BIT(6, 4)
39#define PM8901_OVERTEMP_IRQ PM8901_IRQ_BLOCK_BIT(6, 5)
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070040
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070041struct pm8901_platform_data {
Anirudh Ghayal934b2712011-12-13 12:49:51 +053042 struct pm8xxx_irq_platform_data *irq_pdata;
43 struct pm8xxx_mpp_platform_data *mpp_pdata;
44 struct pm8xxx_misc_platform_data *misc_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#endif /* __PMIC8901_H__ */