board: msm7x27a: Add machine types for 7625A SURF and FFA

7625A SURF and FFA has some differences like display
resolution (single lane DSI), different tuning parameters
for touchscreen, camera resolution. Some of these
tuning parameters results in lesser PMEM size requirements.

PMEM size allocation is done very early during the linux boot
process and at that time we can't provide a hack to detect
the 7625a using the socinfo, because these are really a
machine differences sometime induced by soc limitation and
new tuning parameters required due to it.

7625AA is also classified under 7625a_surf and 7625a_ffa
macros only.

Signed-off-by: Trilok Soni <tsoni@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm7x27a.c b/arch/arm/mach-msm/board-msm7x27a.c
index 44c5ccb..aa10e88 100644
--- a/arch/arm/mach-msm/board-msm7x27a.c
+++ b/arch/arm/mach-msm/board-msm7x27a.c
@@ -216,7 +216,7 @@
 	int pin, rc = 0;
 
 	if (mode == FM_I2S_ON) {
-		if (machine_is_msm7x27a_surf())
+		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
 			config_pcm_i2s_mode(0);
 		pr_err("%s mode = FM_I2S_ON", __func__);
 		for (pin = 0; pin < ARRAY_SIZE(fm_i2s_config_power_on);
@@ -247,7 +247,7 @@
 	int pin, rc = 0;
 
 	if (mode == BT_PCM_ON) {
-		if (machine_is_msm7x27a_surf())
+		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
 			config_pcm_i2s_mode(1);
 		pr_err("%s mode =BT_PCM_ON", __func__);
 		for (pin = 0; pin < ARRAY_SIZE(bt_config_pcm_on);
@@ -997,7 +997,7 @@
 				cam_exp_i2c_info,
 				ARRAY_SIZE(cam_exp_i2c_info));
 
-	if (machine_is_msm7x27a_surf())
+	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
 		sx150x_data[SX150X_CORE].io_open_drain_ena = 0xe0f0;
 
 	core_exp_i2c_info[0].platform_data =
@@ -1773,7 +1773,7 @@
 {
 	int ret = -EPERM;
 
-	if (machine_is_msm7x27a_surf()) {
+	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
 		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21))
 			ret = 0;
 	} else {
@@ -2212,7 +2212,7 @@
 {
 	int rc = 0;
 
-	if (machine_is_msm7x27a_ffa())
+	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
 		msm_camera_vreg_config(1);
 
 	rc = config_gpio_table(camera_on_gpio_table,
@@ -2228,7 +2228,7 @@
 
 static void config_camera_off_gpios_rear(void)
 {
-	if (machine_is_msm7x27a_ffa())
+	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
 		msm_camera_vreg_config(0);
 
 	config_gpio_table(camera_off_gpio_table,
@@ -2239,7 +2239,7 @@
 {
 	int rc = 0;
 
-	if (machine_is_msm7x27a_ffa())
+	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
 		msm_camera_vreg_config(1);
 
 	rc = config_gpio_table(camera_on_gpio_table,
@@ -2255,7 +2255,7 @@
 
 static void config_camera_off_gpios_front(void)
 {
-	if (machine_is_msm7x27a_ffa())
+	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
 		msm_camera_vreg_config(0);
 
 	config_gpio_table(camera_off_gpio_table,
@@ -2642,7 +2642,7 @@
 {
 	int rc = DSI_TWO_LANES;
 
-	if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
+	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
 		rc = DSI_SINGLE_LANE;
 		pr_info("DSI Single Lane\n");
 	} else {
@@ -2684,7 +2684,7 @@
 	gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
 
 	if (!rc) {
-		if (machine_is_msm7x27a_surf()) {
+		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
 			lcdc_reset_ptr = ioremap_nocache(LCDC_RESET_PHYS,
 				sizeof(uint32_t));
 
@@ -2728,7 +2728,7 @@
 			return rc;
 		}
 
-		if (machine_is_msm7x27a_surf()) {
+		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
 			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, 1);
 			if (rc < 0) {
 				pr_err("failed to enable display pwr\n");
@@ -2765,10 +2765,11 @@
 		dsi_gpio_initialized = 1;
 	}
 
-	if (machine_is_msm7x27a_surf()) {
+	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
 		gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
 		gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
-	} else if (machine_is_msm7x27a_ffa()) {
+	} else if (machine_is_msm7x27a_ffa() ||
+			 machine_is_msm7625a_ffa()) {
 		if (on) {
 			/* This line drives an active low pin on FFA */
 			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, !on);
@@ -2787,7 +2788,8 @@
 	if (on) {
 		gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);
 
-		if (machine_is_msm7x27a_surf()) {
+		if (machine_is_msm7x27a_surf() ||
+				 machine_is_msm7625a_surf()) {
 			lcdc_reset_cfg = readl_relaxed(lcdc_reset_ptr);
 			rmb();
 			lcdc_reset_cfg &= ~1;
@@ -2862,7 +2864,8 @@
 		return;
 
 	ebi2_cfg = readl(ebi2_cfg_ptr);
-	if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf())
+	if (machine_is_msm7x27a_rumi3() || machine_is_msm7x27a_surf() ||
+			machine_is_msm7625a_surf())
 		ebi2_cfg |= (1 << 4); /* CS2 */
 
 	writel(ebi2_cfg, ebi2_cfg_ptr);
@@ -2875,7 +2878,7 @@
 		return;
 
 	ebi2_cfg = readl(ebi2_cfg_ptr);
-	if (machine_is_msm7x27a_surf())
+	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf())
 		ebi2_cfg |= (1 << 31);
 
 	writel(ebi2_cfg, ebi2_cfg_ptr);
@@ -3173,7 +3176,7 @@
 #if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
 	bt_power_init();
 #endif
-	if (cpu_is_msm7x25a() || cpu_is_msm7x25aa()) {
+	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
 		atmel_ts_pdata.min_x = 0;
 		atmel_ts_pdata.max_x = 480;
 		atmel_ts_pdata.min_y = 0;
@@ -3203,7 +3206,7 @@
 		platform_device_register(&led_pdev);
 
 #ifdef CONFIG_MSM_RPC_VIBRATOR
-	if (machine_is_msm7x27a_ffa())
+	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
 		msm_init_pmic_vibrator();
 #endif
 	/*7x25a kgsl initializations*/
@@ -3242,3 +3245,21 @@
 	.timer		= &msm_timer,
 	.init_early     = msm7x2x_init_early,
 MACHINE_END
+MACHINE_START(MSM7625A_SURF, "QCT MSM7625a SURF")
+	.boot_params    = PHYS_OFFSET + 0x100,
+	.map_io         = msm_common_io_init,
+	.reserve        = msm7x27a_reserve,
+	.init_irq       = msm_init_irq,
+	.init_machine   = msm7x2x_init,
+	.timer          = &msm_timer,
+	.init_early     = msm7x2x_init_early,
+MACHINE_END
+MACHINE_START(MSM7625A_FFA, "QCT MSM7625a FFA")
+	.boot_params    = PHYS_OFFSET + 0x100,
+	.map_io         = msm_common_io_init,
+	.reserve        = msm7x27a_reserve,
+	.init_irq       = msm_init_irq,
+	.init_machine   = msm7x2x_init,
+	.timer          = &msm_timer,
+	.init_early     = msm7x2x_init_early,
+MACHINE_END