msm: 9615: Add support for PMIC PM8018
Add device structure declarations to the 9615 board file for the
PMIC PM8018 core and its subdevices.
Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-9615.c b/arch/arm/mach-msm/board-9615.c
index d35de58..9238ab2 100644
--- a/arch/arm/mach-msm/board-9615.c
+++ b/arch/arm/mach-msm/board-9615.c
@@ -23,6 +23,7 @@
#include <mach/msm_spi.h>
#include "timer.h"
#include "devices.h"
+#include "board-9615.h"
static struct platform_device *common_devices[] = {
&msm9615_device_uart_gsbi4,
@@ -31,10 +32,48 @@
&msm9615_device_qup_spi_gsbi3,
};
+static struct pm8xxx_irq_platform_data pm8xxx_irq_pdata __devinitdata = {
+ .irq_base = PM8018_IRQ_BASE,
+ .devirq = MSM_GPIO_TO_INT(87),
+ .irq_trigger_flag = IRQF_TRIGGER_LOW,
+};
+
+static struct pm8xxx_gpio_platform_data pm8xxx_gpio_pdata __devinitdata = {
+ .gpio_base = PM8018_GPIO_PM_TO_SYS(1),
+};
+
+static struct pm8xxx_mpp_platform_data pm8xxx_mpp_pdata __devinitdata = {
+ .mpp_base = PM8018_MPP_PM_TO_SYS(1),
+};
+
+static struct pm8xxx_rtc_platform_data pm8xxx_rtc_pdata __devinitdata = {
+ .rtc_write_enable = false,
+};
+
+static struct pm8xxx_pwrkey_platform_data pm8xxx_pwrkey_pdata = {
+ .pull_up = 1,
+ .kpd_trigger_delay_us = 970,
+ .wakeup = 1,
+};
+
+static struct pm8xxx_misc_platform_data pm8xxx_misc_pdata = {
+ .priority = 0,
+};
+
+static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
+ .irq_pdata = &pm8xxx_irq_pdata,
+ .gpio_pdata = &pm8xxx_gpio_pdata,
+ .mpp_pdata = &pm8xxx_mpp_pdata,
+ .rtc_pdata = &pm8xxx_rtc_pdata,
+ .pwrkey_pdata = &pm8xxx_pwrkey_pdata,
+ .misc_pdata = &pm8xxx_misc_pdata,
+};
+
static struct msm_ssbi_platform_data msm9615_ssbi_pm8018_pdata __devinitdata = {
.controller_type = MSM_SBI_CTRL_PMIC_ARBITER,
.slave = {
- .name = "pm8018-core",
+ .name = PM8018_CORE_DEV_NAME,
+ .platform_data = &pm8018_platform_data,
},
};
diff --git a/arch/arm/mach-msm/board-9615.h b/arch/arm/mach-msm/board-9615.h
new file mode 100644
index 0000000..16c5187
--- /dev/null
+++ b/arch/arm/mach-msm/board-9615.h
@@ -0,0 +1,27 @@
+/* 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.
+ */
+
+#ifndef __ARCH_ARM_MACH_MSM_BOARD_9615_H
+#define __ARCH_ARM_MACH_MSM_BOARD_9615_H
+
+#include <mach/irqs.h>
+#include <linux/mfd/pm8xxx/pm8018.h>
+
+/* Macros assume PMIC GPIOs and MPPs start at 1 */
+#define PM8018_GPIO_BASE NR_GPIO_IRQS
+#define PM8018_GPIO_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8018_GPIO_BASE)
+#define PM8018_MPP_BASE (PM8018_GPIO_BASE + PM8018_NR_GPIOS)
+#define PM8018_MPP_PM_TO_SYS(pm_gpio) (pm_gpio - 1 + PM8018_MPP_BASE)
+#define PM8018_IRQ_BASE (NR_MSM_IRQS + NR_GPIO_IRQS)
+#define PM8018_MPP_IRQ_BASE (PM8018_IRQ_BASE + NR_GPIO_IRQS)
+
+#endif
diff --git a/arch/arm/mach-msm/include/mach/irqs-9615.h b/arch/arm/mach-msm/include/mach/irqs-9615.h
index 2dc3c35..8972148 100644
--- a/arch/arm/mach-msm/include/mach/irqs-9615.h
+++ b/arch/arm/mach-msm/include/mach/irqs-9615.h
@@ -182,7 +182,8 @@
#define NR_MSM_IRQS 256
#define NR_GPIO_IRQS 88
-#define NR_BOARD_IRQS 0
+#define NR_PM8018_IRQS 256
+#define NR_BOARD_IRQS NR_PM8018_IRQS
#define NR_TLMM_MSM_DIR_CONN_IRQ 8 /*Need to Verify this Count*/
#define NR_MSM_GPIOS NR_GPIO_IRQS