msm: board-8064: Add platform device support for GPIO IR receiver
GPIO IR receier is a simple GPIO based IR Narrow Band receiver used
to get demodulated signal from IR receiver and sends the event to rc
framework for processing.
Change-Id: I452be5b0cd7296ba6f49ef2aae5db0f11aee54bc
Signed-off-by: Ravi Kumar V <kumarrav@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-gpiomux.c b/arch/arm/mach-msm/board-8064-gpiomux.c
index de6e0d2..d9999e7 100644
--- a/arch/arm/mach-msm/board-8064-gpiomux.c
+++ b/arch/arm/mach-msm/board-8064-gpiomux.c
@@ -900,6 +900,28 @@
},
};
+static struct gpiomux_setting ir_suspended_cfg = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_2MA,
+ .pull = GPIOMUX_PULL_UP,
+};
+
+static struct gpiomux_setting ir_active_cfg = {
+ .func = GPIOMUX_FUNC_GPIO,
+ .drv = GPIOMUX_DRV_8MA,
+ .pull = GPIOMUX_PULL_UP,
+};
+
+static struct msm_gpiomux_config mpq8064_ir_configs[] __initdata = {
+ {
+ .gpio = 88, /* GPIO IR */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &ir_suspended_cfg,
+ [GPIOMUX_ACTIVE] = &ir_active_cfg,
+ },
+ },
+};
+
void __init apq8064_init_gpiomux(void)
{
int rc;
@@ -970,4 +992,8 @@
msm_gpiomux_install(apq8064_hdmi_configs,
ARRAY_SIZE(apq8064_hdmi_configs));
+
+ if (machine_is_mpq8064_cdp())
+ msm_gpiomux_install(mpq8064_ir_configs,
+ ARRAY_SIZE(mpq8064_ir_configs));
}
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index dbc47eb..9bf16c9 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -66,6 +66,7 @@
#include <mach/msm_xo.h>
#include <mach/msm_rtb.h>
#include <sound/cs8427.h>
+#include <media/gpio-ir-recv.h>
#include "msm_watchdog.h"
#include "board-8064.h"
@@ -1860,6 +1861,18 @@
},
};
+static struct gpio_ir_recv_platform_data gpio_ir_recv_pdata = {
+ .gpio_nr = 88,
+ .active_low = 1,
+};
+
+static struct platform_device gpio_ir_recv_pdev = {
+ .name = "gpio-rc-recv",
+ .dev = {
+ .platform_data = &gpio_ir_recv_pdata,
+ },
+};
+
static struct platform_device *common_devices[] __initdata = {
&apq8064_device_dmov,
#ifndef CONFIG_MSM_VCAP
@@ -2061,6 +2074,7 @@
#ifdef CONFIG_MSM_ROTATOR
&msm_rotator_device,
#endif
+ &gpio_ir_recv_pdev,
&mpq8064_device_ext_5v_frc_vreg,
&mpq8064_device_ext_1p2_buck_vreg,
&mpq8064_device_ext_1p8_buck_vreg,