msm: mpq_8064: add support for GSBI5 I2C configuration
GSBI5 support is added on MPQ 8064 as an I2C device
to provide access to the AVC board. Also, GSBI1 and
GSGI7 are not available because VCAP is enabled so
support for them is removed.
Change-Id: I7436574be80f0be035189aba4ed4ea31a7eb33e1
Signed-off-by: Joel King <joelking@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-8064-gpiomux.c b/arch/arm/mach-msm/board-8064-gpiomux.c
index 2f94069..3b4b0b3 100644
--- a/arch/arm/mach-msm/board-8064-gpiomux.c
+++ b/arch/arm/mach-msm/board-8064-gpiomux.c
@@ -163,6 +163,18 @@
.pull = GPIOMUX_PULL_DOWN,
};
+static struct gpiomux_setting gsbi5_suspended_cfg = {
+ .func = GPIOMUX_FUNC_2,
+ .drv = GPIOMUX_DRV_12MA,
+ .pull = GPIOMUX_PULL_NONE,
+};
+
+static struct gpiomux_setting gsbi5_active_cfg = {
+ .func = GPIOMUX_FUNC_2,
+ .drv = GPIOMUX_DRV_12MA,
+ .pull = GPIOMUX_PULL_NONE,
+};
+
#ifdef CONFIG_USB_EHCI_MSM_HSIC
static struct gpiomux_setting hsic_act_cfg = {
.func = GPIOMUX_FUNC_1,
@@ -566,6 +578,23 @@
},
};
+static struct msm_gpiomux_config mpq8064_gsbi5_i2c_configs[] __initdata = {
+ {
+ .gpio = 53, /* GSBI5 I2C QUP SDA */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
+ [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
+ },
+ },
+ {
+ .gpio = 54, /* GSBI5 I2C QUP SCL */
+ .settings = {
+ [GPIOMUX_SUSPENDED] = &gsbi5_suspended_cfg,
+ [GPIOMUX_ACTIVE] = &gsbi5_active_cfg,
+ },
+ },
+};
+
void __init apq8064_init_gpiomux(void)
{
int rc;
@@ -576,16 +605,22 @@
return;
}
-#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
- msm_gpiomux_install(apq8064_ethernet_configs,
- ARRAY_SIZE(apq8064_ethernet_configs));
-#endif
-
msm_gpiomux_install(wcnss_5wire_interface,
ARRAY_SIZE(wcnss_5wire_interface));
- msm_gpiomux_install(apq8064_gsbi_configs,
- ARRAY_SIZE(apq8064_gsbi_configs));
+ if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
+ machine_is_mpq8064_dtv()) {
+ msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
+ ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
+ } else {
+ #if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
+ msm_gpiomux_install(apq8064_ethernet_configs,
+ ARRAY_SIZE(apq8064_ethernet_configs));
+ #endif
+
+ msm_gpiomux_install(apq8064_gsbi_configs,
+ ARRAY_SIZE(apq8064_gsbi_configs));
+ }
msm_gpiomux_install(apq8064_slimbus_config,
ARRAY_SIZE(apq8064_slimbus_config));
diff --git a/arch/arm/mach-msm/board-8064.c b/arch/arm/mach-msm/board-8064.c
index 414e234..7b8e7c1 100644
--- a/arch/arm/mach-msm/board-8064.c
+++ b/arch/arm/mach-msm/board-8064.c
@@ -1837,6 +1837,14 @@
},
};
+static struct platform_device *mpq_devices[] __initdata = {
+ &mpq8064_device_qup_i2c_gsbi5,
+ &msm_device_sps_apq8064,
+#ifdef CONFIG_MSM_ROTATOR
+ &msm_rotator_device,
+#endif
+};
+
static struct platform_device *common_devices[] __initdata = {
&apq8064_device_dmov,
&apq8064_device_qup_i2c_gsbi1,
@@ -2012,6 +2020,11 @@
.src_clk_rate = 24000000,
};
+static struct msm_i2c_platform_data mpq8064_i2c_qup_gsbi5_pdata = {
+ .clk_freq = 100000,
+ .src_clk_rate = 24000000,
+};
+
#define GSBI_DUAL_MODE_CODE 0x60
#define MSM_GSBI1_PHYS 0x12440000
static void __init apq8064_i2c_init(void)
@@ -2032,6 +2045,8 @@
&apq8064_i2c_qup_gsbi1_pdata;
apq8064_device_qup_i2c_gsbi4.dev.platform_data =
&apq8064_i2c_qup_gsbi4_pdata;
+ mpq8064_device_qup_i2c_gsbi5.dev.platform_data =
+ &mpq8064_i2c_qup_gsbi5_pdata;
}
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
@@ -2283,6 +2298,7 @@
static void __init apq8064_common_init(void)
{
+ msm_tsens_early_init(&apq_tsens_pdata);
if (socinfo_init() < 0)
pr_err("socinfo_init() failed!\n");
BUG_ON(msm_rpm_init(&apq8064_rpm_data));
@@ -2347,31 +2363,30 @@
&msm8064_device_watchdog.dev.platform_data;
wdog_pdata->bark_time = 15000;
- msm_tsens_early_init(&apq_tsens_pdata);
apq8064_common_init();
platform_add_devices(sim_devices, ARRAY_SIZE(sim_devices));
}
static void __init apq8064_rumi3_init(void)
{
- msm_tsens_early_init(&apq_tsens_pdata);
apq8064_common_init();
ethernet_init();
platform_add_devices(rumi3_devices, ARRAY_SIZE(rumi3_devices));
spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
- apq8064_init_fb();
- apq8064_init_gpu();
}
static void __init apq8064_cdp_init(void)
{
- msm_tsens_early_init(&apq_tsens_pdata);
apq8064_common_init();
- ethernet_init();
- platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
- if (!machine_is_apq8064_mtp())
- msm_rotator_update_bus_vectors(1376, 768);
- spi_register_board_info(spi_board_info, ARRAY_SIZE(spi_board_info));
+ if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
+ machine_is_mpq8064_dtv()) {
+ platform_add_devices(mpq_devices, ARRAY_SIZE(mpq_devices));
+ } else {
+ ethernet_init();
+ platform_add_devices(cdp_devices, ARRAY_SIZE(cdp_devices));
+ spi_register_board_info(spi_board_info,
+ ARRAY_SIZE(spi_board_info));
+ }
apq8064_init_fb();
apq8064_init_gpu();
platform_add_devices(apq8064_fs_devices, apq8064_num_fs_devices);
diff --git a/arch/arm/mach-msm/clock-8960.c b/arch/arm/mach-msm/clock-8960.c
index f370c1d..0eeaedb 100644
--- a/arch/arm/mach-msm/clock-8960.c
+++ b/arch/arm/mach-msm/clock-8960.c
@@ -4952,6 +4952,7 @@
CLK_LOOKUP("core_clk", gsbi3_qup_clk.c, "qup_i2c.3"),
CLK_LOOKUP("core_clk", gsbi4_qup_clk.c, "qup_i2c.4"),
CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "spi_qsd.0"),
+ CLK_LOOKUP("core_clk", gsbi5_qup_clk.c, "qup_i2c.5"),
CLK_LOOKUP("core_clk", gsbi6_qup_clk.c, ""),
CLK_LOOKUP("core_clk", gsbi7_qup_clk.c, ""),
CLK_LOOKUP("core_clk", pdm_clk.c, ""),
@@ -4986,6 +4987,7 @@
CLK_LOOKUP("iface_clk", gsbi3_p_clk.c, "qup_i2c.3"),
CLK_LOOKUP("iface_clk", gsbi4_p_clk.c, "qup_i2c.4"),
CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "spi_qsd.0"),
+ CLK_LOOKUP("iface_clk", gsbi5_p_clk.c, "qup_i2c.5"),
CLK_LOOKUP("iface_clk", gsbi6_p_clk.c, ""),
CLK_LOOKUP("iface_clk", gsbi7_p_clk.c, "msm_serial_hsl.0"),
CLK_LOOKUP("iface_clk", tsif_p_clk.c, ""),
diff --git a/arch/arm/mach-msm/devices-8064.c b/arch/arm/mach-msm/devices-8064.c
index e67f8d0..35588d6 100644
--- a/arch/arm/mach-msm/devices-8064.c
+++ b/arch/arm/mach-msm/devices-8064.c
@@ -325,6 +325,46 @@
.resource = resources_qup_spi_gsbi5,
};
+static struct resource resources_qup_i2c_gsbi5[] = {
+ {
+ .name = "gsbi_qup_i2c_addr",
+ .start = MSM_GSBI5_PHYS,
+ .end = MSM_GSBI5_PHYS + 4 - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "qup_phys_addr",
+ .start = MSM_GSBI5_QUP_PHYS,
+ .end = MSM_GSBI5_QUP_PHYS + MSM_QUP_SIZE - 1,
+ .flags = IORESOURCE_MEM,
+ },
+ {
+ .name = "qup_err_intr",
+ .start = GSBI5_QUP_IRQ,
+ .end = GSBI5_QUP_IRQ,
+ .flags = IORESOURCE_IRQ,
+ },
+ {
+ .name = "i2c_clk",
+ .start = 54,
+ .end = 54,
+ .flags = IORESOURCE_IO,
+ },
+ {
+ .name = "i2c_sda",
+ .start = 53,
+ .end = 53,
+ .flags = IORESOURCE_IO,
+ },
+};
+
+struct platform_device mpq8064_device_qup_i2c_gsbi5 = {
+ .name = "qup_i2c",
+ .id = 5,
+ .num_resources = ARRAY_SIZE(resources_qup_i2c_gsbi5),
+ .resource = resources_qup_i2c_gsbi5,
+};
+
static struct resource resources_uart_gsbi7[] = {
{
.start = GSBI7_UARTDM_IRQ,
diff --git a/arch/arm/mach-msm/devices.h b/arch/arm/mach-msm/devices.h
index 8e53774..2e6a6bd 100644
--- a/arch/arm/mach-msm/devices.h
+++ b/arch/arm/mach-msm/devices.h
@@ -364,3 +364,4 @@
extern struct platform_device msm_device_vfe;
extern struct platform_device msm_device_vpe;
+extern struct platform_device mpq8064_device_qup_i2c_gsbi5;