msm: board-8064: Add keypad device for CDP, LIQUID, and MTP
Create a platform device for 8064's CDP, LIQUID, and MTP
platforms and pass corresponding keymaps
Change-Id: I8210a46a8a654f69a485c6455fa4174a76dbda9a
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-pmic.c b/arch/arm/mach-msm/board-8064-pmic.c
index 4c386e9..27952f4 100644
--- a/arch/arm/mach-msm/board-8064-pmic.c
+++ b/arch/arm/mach-msm/board-8064-pmic.c
@@ -120,6 +120,17 @@
PM8921_GPIO_OUTPUT_FUNC(44, 0, PM_GPIO_FUNC_2),
PM8921_GPIO_OUTPUT(33, 0, HIGH),
PM8921_GPIO_OUTPUT(20, 0, HIGH),
+ PM8921_GPIO_INPUT(35, PM_GPIO_PULL_UP_1P5),
+ PM8921_GPIO_INPUT(38, PM_GPIO_PULL_UP_1P5),
+};
+
+static struct pm8xxx_gpio_init pm8921_mtp_kp_gpios[] __initdata = {
+ PM8921_GPIO_INPUT(3, PM_GPIO_PULL_UP_1P5),
+ PM8921_GPIO_INPUT(4, PM_GPIO_PULL_UP_1P5),
+};
+
+static struct pm8xxx_gpio_init pm8921_cdp_kp_gpios[] __initdata = {
+ PM8921_GPIO_INPUT(37, PM_GPIO_PULL_UP_1P5),
};
/* Initial PM8XXX MPP configurations */
@@ -143,6 +154,28 @@
}
}
+ if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
+ for (i = 0; i < ARRAY_SIZE(pm8921_cdp_kp_gpios); i++) {
+ rc = pm8xxx_gpio_config(pm8921_cdp_kp_gpios[i].gpio,
+ &pm8921_cdp_kp_gpios[i].config);
+ if (rc) {
+ pr_err("%s: pm8xxx_gpio_config: rc=%d\n",
+ __func__, rc);
+ break;
+ }
+ }
+
+ if (machine_is_apq8064_mtp())
+ for (i = 0; i < ARRAY_SIZE(pm8921_mtp_kp_gpios); i++) {
+ rc = pm8xxx_gpio_config(pm8921_mtp_kp_gpios[i].gpio,
+ &pm8921_mtp_kp_gpios[i].config);
+ if (rc) {
+ pr_err("%s: pm8xxx_gpio_config: rc=%d\n",
+ __func__, rc);
+ break;
+ }
+ }
+
for (i = 0; i < ARRAY_SIZE(pm8xxx_mpps); i++) {
rc = pm8xxx_mpp_config(pm8xxx_mpps[i].mpp,
&pm8xxx_mpps[i].config);