msm: Add msm-ssbi devices for PM8058 on supported targets

Supported targets are msm8660, msm7x30 and fsm9xxx

Change-Id: I1d21b73ba67c6769441658e648c32204c72754d3
Acked-by: Kaushik Sikdar <ksikdar@qualcomm.com>
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-fsm9xxx.c b/arch/arm/mach-msm/board-fsm9xxx.c
index f7e50fd..13f4847 100644
--- a/arch/arm/mach-msm/board-fsm9xxx.c
+++ b/arch/arm/mach-msm/board-fsm9xxx.c
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/delay.h>
 #include <linux/io.h>
+#include <linux/msm_ssbi.h>
 #include <linux/mfd/pmic8058.h>
 #include <linux/regulator/pmic8058-regulator.h>
 #include <linux/i2c.h>
@@ -464,6 +465,7 @@
 
 static struct pm8058_platform_data pm8058_fsm9xxx_data = {
 	.irq_base = PMIC8058_IRQ_BASE,
+	.irq = MSM_GPIO_TO_INT(47),
 
 	.num_subdevs = ARRAY_SIZE(pm8058_subdevs),
 	.sub_devices = pm8058_subdevs,
@@ -477,6 +479,16 @@
 	},
 };
 
+#ifdef CONFIG_MSM_SSBI
+static struct msm_ssbi_platform_data fsm9xxx_ssbi_pm8058_pdata = {
+	.controller_type = FSM_SBI_CTRL_SSBI,
+	.slave  = {
+		.name                   = "pm8058-core",
+		.platform_data          = &pm8058_fsm9xxx_data,
+	},
+};
+#endif
+
 static int __init buses_init(void)
 {
 	if (gpio_tlmm_config(GPIO_CFG(PMIC_GPIO_INT, 5, GPIO_CFG_INPUT,
@@ -614,7 +626,9 @@
 static struct msm_i2c_ssbi_platform_data msm_i2c_ssbi3_pdata = {
 	.controller_type = FSM_SBI_CTRL_SSBI,
 };
+#endif
 
+#if defined(CONFIG_I2C_SSBI) || defined(CONFIG_MSM_SSBI)
 /* Intialize GPIO configuration for SSBI */
 static struct msm_gpio ssbi_gpio_config_data[] = {
 	{ GPIO_CFG(140, 1, GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN, GPIO_CFG_4MA),
@@ -812,6 +826,9 @@
 	&msm_device_smd,
 	&msm_device_dmov,
 	&msm_device_nand,
+#ifdef CONFIG_MSM_SSBI
+	&msm_device_ssbi_pmic1,
+#endif
 #ifdef CONFIG_I2C_SSBI
 	&msm_device_ssbi1,
 	&msm_device_ssbi2,
@@ -874,6 +891,14 @@
 
 	regulator_has_full_constraints();
 
+#if defined(CONFIG_I2C_SSBI) || defined(CONFIG_MSM_SSBI)
+	fsm9xxx_init_ssbi_gpio();
+#endif
+#ifdef CONFIG_MSM_SSBI
+	msm_device_ssbi_pmic1.dev.platform_data =
+			&fsm9xxx_ssbi_pm8058_pdata;
+#endif
+
 	platform_add_devices(devices, ARRAY_SIZE(devices));
 
 #ifdef CONFIG_MSM_SPM
@@ -888,7 +913,6 @@
 	fsm9xxx_init_uart1();
 #endif
 #ifdef CONFIG_I2C_SSBI
-	fsm9xxx_init_ssbi_gpio();
 	msm_device_ssbi1.dev.platform_data = &msm_i2c_ssbi1_pdata;
 	msm_device_ssbi2.dev.platform_data = &msm_i2c_ssbi2_pdata;
 	msm_device_ssbi3.dev.platform_data = &msm_i2c_ssbi3_pdata;