mfd: 8821: Add support for pm8821 core driver

Add support for the Qualcomm PM8821 PMIC chip. The core driver
will communicate with the PMIC chip via the MSM SSBI bus.

Initial support is provided for: IRQ, MPP, and Debug

Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
diff --git a/include/linux/mfd/pm8xxx/core.h b/include/linux/mfd/pm8xxx/core.h
index 74c35bf..e279a10 100644
--- a/include/linux/mfd/pm8xxx/core.h
+++ b/include/linux/mfd/pm8xxx/core.h
@@ -24,6 +24,7 @@
 	PM8XXX_VERSION_8058,
 	PM8XXX_VERSION_8901,
 	PM8XXX_VERSION_8921,
+	PM8XXX_VERSION_8821,
 };
 
 /* PMIC version specific silicon revisions */
@@ -43,6 +44,11 @@
 #define PM8XXX_REVISION_8921_1p1	2
 #define PM8XXX_REVISION_8921_2p0	3
 
+#define PM8XXX_REVISION_8821_TEST	0
+#define PM8XXX_REVISION_8821_1p0	1
+#define PM8XXX_REVISION_8821_2p0	2
+#define PM8XXX_REVISION_8821_2p1	3
+
 struct pm8xxx_drvdata {
 	int			(*pmic_readb) (const struct device *dev,
 						u16 addr, u8 *val);
diff --git a/include/linux/mfd/pm8xxx/mpp.h b/include/linux/mfd/pm8xxx/mpp.h
index 1bec5a2..a97c3f7 100644
--- a/include/linux/mfd/pm8xxx/mpp.h
+++ b/include/linux/mfd/pm8xxx/mpp.h
@@ -167,6 +167,10 @@
 #define	PM8921_MPP_DIG_LEVEL_L17	4
 #define	PM8921_MPP_DIG_LEVEL_VPH	7
 
+/* Digital Input/Output: level [PM8821] */
+#define	PM8821_MPP_DIG_LEVEL_1P8	1
+#define	PM8821_MPP_DIG_LEVEL_VPH	7
+
 /* Digital Input: control */
 #define	PM8XXX_MPP_DIN_TO_INT		0
 #define	PM8XXX_MPP_DIN_TO_DBUS1		1
diff --git a/include/linux/mfd/pm8xxx/pm8821.h b/include/linux/mfd/pm8xxx/pm8821.h
new file mode 100644
index 0000000..850e8c1
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/pm8821.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (c) 2011, Code Aurora Forum. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ */
+/*
+ * Qualcomm PMIC 8821 driver header file
+ *
+ */
+
+#ifndef __MFD_PM8821_H
+#define __MFD_PM8821_H
+
+#include <linux/device.h>
+#include <linux/mfd/pm8xxx/irq.h>
+#include <linux/mfd/pm8xxx/mpp.h>
+
+#define PM8821_NR_IRQS		(64)
+#define PM8821_NR_MPPS		(4)
+
+#define PM8821_MPP_BLOCK_START	(16)
+#define PM8821_IRQ_BLOCK_BIT(block, bit) ((block) * 8 + (bit))
+
+/* MPPs [1,N] */
+#define PM8821_MPP_IRQ(base, mpp)	((base) + \
+		PM8821_IRQ_BLOCK_BIT(PM8821_MPP_BLOCK_START, (mpp)-1))
+
+/* PMIC Interrupts */
+
+struct pm8821_platform_data {
+	int					irq_base;
+	struct pm8xxx_irq_platform_data		*irq_pdata;
+	struct pm8xxx_mpp_platform_data		*mpp_pdata;
+};
+
+#endif