msm: mpq8064: Add platform specific changes to enable cs8427.
Add platform specific changes for cs8427, secondary RX i2s.
Change-Id: Idf1ca080f1975373ae95fd809b81d4fc72054c72
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-gpiomux.c b/arch/arm/mach-msm/board-8064-gpiomux.c
index 3b4b0b3..4b9931a 100644
--- a/arch/arm/mach-msm/board-8064-gpiomux.c
+++ b/arch/arm/mach-msm/board-8064-gpiomux.c
@@ -442,6 +442,39 @@
},
};
+static struct gpiomux_setting spkr_i2c = {
+ .func = GPIOMUX_FUNC_1,
+ .drv = GPIOMUX_DRV_8MA,
+ .pull = GPIOMUX_PULL_KEEPER,
+};
+
+static struct msm_gpiomux_config mpq8064_spkr_i2s_config[] __initdata = {
+ {
+ .gpio = 47, /* spkr i2c sck */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &spkr_i2c,
+ },
+ },
+ {
+ .gpio = 48, /* spkr_i2s_ws */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &spkr_i2c,
+ },
+ },
+ {
+ .gpio = 49, /* spkr_i2s_dout */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &spkr_i2c,
+ },
+ },
+ {
+ .gpio = 50, /* spkr_i2s_mclk */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &spkr_i2c,
+ },
+ },
+};
+
static struct msm_gpiomux_config apq8064_audio_codec_configs[] __initdata = {
{
.gpio = 39,
@@ -628,6 +661,12 @@
msm_gpiomux_install(apq8064_audio_codec_configs,
ARRAY_SIZE(apq8064_audio_codec_configs));
+ if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
+ machine_is_mpq8064_dtv()) {
+ msm_gpiomux_install(mpq8064_spkr_i2s_config,
+ ARRAY_SIZE(mpq8064_spkr_i2s_config));
+ }
+
pr_debug("%s(): audio-auxpcm: Include GPIO configs"
" as audio is not the primary user"
" for these GPIO Pins\n", __func__);
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index bd0aaee..d02b4be 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -65,6 +65,7 @@
#include <linux/msm_tsens.h>
#include <mach/msm_xo.h>
#include <mach/msm_rtb.h>
+#include <sound/cs8427.h>
#include "msm_watchdog.h"
#include "board-8064.h"
@@ -891,6 +892,18 @@
},
};
+static struct cs8427_platform_data cs8427_i2c_platform_data = {
+ .irq = SX150X_GPIO(1, 4),
+ .reset_gpio = SX150X_GPIO(1, 6),
+};
+
+static struct i2c_board_info cs8427_device_info[] __initdata = {
+ {
+ I2C_BOARD_INFO("cs8427", CS8427_ADDR4),
+ .platform_data = &cs8427_i2c_platform_data,
+ },
+};
+
#define HAP_SHIFT_LVL_OE_GPIO PM8921_MPP_PM_TO_SYS(8)
#define ISA1200_HAP_EN_GPIO PM8921_GPIO_PM_TO_SYS(33)
#define ISA1200_HAP_LEN_GPIO PM8921_GPIO_PM_TO_SYS(20)
@@ -1901,6 +1914,7 @@
&apq_pcm_routing,
&apq_cpudai0,
&apq_cpudai1,
+ &mpq_cpudai_sec_i2s_rx,
&apq_cpudai_hdmi_rx,
&apq_cpudai_bt_rx,
&apq_cpudai_bt_tx,
@@ -2320,6 +2334,12 @@
isa1200_board_info,
ARRAY_SIZE(isa1200_board_info),
},
+ {
+ I2C_MPQ_CDP,
+ APQ_8064_GSBI5_QUP_I2C_BUS_ID,
+ cs8427_device_info,
+ ARRAY_SIZE(cs8427_device_info),
+ },
};
struct sx150x_platform_data mpq8064_sx150x_pdata[] = {
diff --git a/arch/arm/mach-msm/board-8064.h b/arch/arm/mach-msm/board-8064.h
index 7dcad10..f62a9fb 100644
--- a/arch/arm/mach-msm/board-8064.h
+++ b/arch/arm/mach-msm/board-8064.h
@@ -80,6 +80,7 @@
#define APQ_8064_GSBI1_QUP_I2C_BUS_ID 0
#define APQ_8064_GSBI3_QUP_I2C_BUS_ID 3
#define APQ_8064_GSBI4_QUP_I2C_BUS_ID 4
+#define APQ_8064_GSBI5_QUP_I2C_BUS_ID 5
unsigned char apq8064_hdmi_as_primary_selected(void);
void apq8064_init_fb(void);
diff --git a/arch/arm/mach-msm/devices-8064.c b/arch/arm/mach-msm/devices-8064.c
index 35588d6..aef5cfd 100644
--- a/arch/arm/mach-msm/devices-8064.c
+++ b/arch/arm/mach-msm/devices-8064.c
@@ -411,7 +411,10 @@
.name = "msm-dai-q6",
.id = 0x4001,
};
-
+struct platform_device mpq_cpudai_sec_i2s_rx = {
+ .name = "msm-dai-q6",
+ .id = 4,
+};
struct platform_device apq_cpudai_hdmi_rx = {
.name = "msm-dai-q6-hdmi",
.id = 8,
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 2e6a6bd..f110a33 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -194,6 +194,7 @@
extern struct platform_device msm_pcm_routing;
extern struct platform_device msm_cpudai0;
extern struct platform_device msm_cpudai1;
+extern struct platform_device mpq_cpudai_sec_i2s_rx;
extern struct platform_device msm_cpudai_hdmi_rx;
extern struct platform_device msm_cpudai_bt_rx;
extern struct platform_device msm_cpudai_bt_tx;