static unsigned int msm_AR600X_setup_power(bool on)
{
	int rc = 0;
	static bool init_done;

	if (unlikely(!init_done)) {
		gpio_wlan_config();
		rc = qrf6285_init_regs();
		if (rc) {
			pr_err("%s: qrf6285 init failed = %d\n", __func__, rc);
			return rc;
		} else {
			init_done = true;
		}
	}

	rc = wlan_switch_regulators(on);
	if (rc) {
		pr_err("%s: wlan_switch_regulators error = %d\n", __func__, rc);
		goto out;
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto reg_disable;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 1);
	}

	/*
	 * gpio_wlan_sys_rest_en is not from the GPIO expander for QRD7627a,
	 * EVB1.0 and QRD8625,so the below step is required for those devices.
	 */
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()  
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto qrd_gpio_fail;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 1);
	} else {
		rc = gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		if (rc) {
			pr_err("%s: WLAN sys_rest_en GPIO %d request failed %d\n",
				__func__,
				gpio_wlan_sys_rest_en, rc);
			goto qrd_gpio_fail;
		}
		rc = setup_wlan_gpio(on);
		if (rc) {
			pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
			goto gpio_fail;
		}
		gpio_free(gpio_wlan_sys_rest_en);
	}

	/* Enable the A0 clock */
	rc = setup_wlan_clock(on);
	if (rc) {
		pr_err("%s: setup_wlan_clock = %d\n", __func__, rc);
		goto set_gpio_fail;
	}

	/* Configure A0 clock to be slave to WLAN_CLK_PWR_REQ */
	rc = pmapp_clock_vote(id, PMAPP_CLOCK_ID_A0,
				 PMAPP_CLOCK_VOTE_PIN_CTRL);
	if (rc) {
		pr_err("%s: Configuring A0 to Pin controllable failed %d\n",
				__func__, rc);
		goto set_clock_fail;
	}

	pr_info("WLAN power-up success\n");
	return 0;
set_clock_fail:
	setup_wlan_clock(0);
set_gpio_fail:
	setup_wlan_gpio(0);
gpio_fail:
	gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1())
		gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
	wlan_switch_regulators(0);
out:
	pr_info("WLAN power-up failed\n");
	return rc;
}
void __init msm7627a_camera_init(void)
{

#ifndef CONFIG_MSM_CAMERA_V4L2
	int rc;
#endif

	pr_debug("msm7627a_camera_init Entered\n");

	/* LCD and camera power (VREG & LDO) init */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
#ifndef CONFIG_MSM_CAMERA_V4L2
		lcd_camera_power_init();
#endif
		evb_camera_gpio_cfg();
	}

#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		qrd1_camera_gpio_cfg();
		platform_add_devices(camera_devices_qrd,
				ARRAY_SIZE(camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		platform_add_devices(camera_devices_evb,
				ARRAY_SIZE(camera_devices_evb));
	} else if (machine_is_msm7627a_qrd3())
		return;
	else
		platform_add_devices(camera_devices_msm,
				ARRAY_SIZE(camera_devices_msm));
#endif
#ifndef CONFIG_MSM_CAMERA_V4L2
	rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not get regulators: %d\n", __func__, rc);
		return;
	}

	rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not set voltages: %d\n", __func__, rc);
		return;
	}
#endif

#if defined(CONFIG_MSM_CAMERA_V4L2)
	msm7x27a_init_cam();
#endif
#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_qrd,
				ARRAY_SIZE(i2c_camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		pr_debug("machine_is_msm7627a_evb i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_evb,
				ARRAY_SIZE(i2c_camera_devices_evb));
	} else
#endif
		pr_debug("i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices,
				ARRAY_SIZE(i2c_camera_devices));
}
void __init msm7627a_sensor_init(void)
{
#ifdef CONFIG_AVAGO_APDS990X
	if ( machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		pr_info("i2c_register_board_info APDS990X\n");
		apds990x_setup();
	}
#endif

#ifdef CONFIG_MPU_SENSORS_MPU3050
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		pr_info("i2c_register_board_info MPU3050\n");
		mpu3050_gpio_setup();
	}
#endif

#ifdef CONFIG_BOSCH_BMA250
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3() || machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info BMA250 ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					bma250_i2c_info,
					ARRAY_SIZE(bma250_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_ISL29028
	if (machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info ISL29028 ALP sensor!\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
					isl29028_i2c_info,
					ARRAY_SIZE(isl29028_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_LIS3DH
	if (machine_is_msm8625q_skue()) {
		lis3dh_acc_gpio_setup();
		pr_info("i2c_register_board_info LIS3DH ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					lis3dh_acc_i2c_info,
					ARRAY_SIZE(lis3dh_acc_i2c_info));
	}
#endif

#ifdef CONFIG_SENSORS_BMA250
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				bma250_i2c_info,
				ARRAY_SIZE(bma250_i2c_info));
#endif
#ifdef CONFIG_SENSORS_BMM050
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				bmm050_i2c_info,
				ARRAY_SIZE(bmm050_i2c_info));
#endif

#ifdef CONFIG_INPUT_LTR502
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3()) {
		pr_info("i2c_register_board_info LTR502\n");
		ltr502_light_gpio_setup();
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				ltr502_light_i2c_info,
				ARRAY_SIZE(ltr502_light_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_LTR558_D9
	printk("i2c_register_board_info LTR558 weiqingdan\n");
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				ltr558_light_i2c_info,
				ARRAY_SIZE(ltr558_light_i2c_info));
#endif

#ifdef CONFIG_SENSORS_AK8975
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3() || machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info AKM8975\n");
		akm_gpio_setup();
		akm_platform_data_8975.gpio_DRDY = 18;
		akm8975_i2c_info[0].irq = gpio_to_irq(akm_platform_data_8975.gpio_DRDY);
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				akm8975_i2c_info,
				ARRAY_SIZE(akm8975_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_KXTJ9
	if(machine_is_msm8625_skua()) {
	pr_info("i2c_register_board_info KXTJ9\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
			accel_kxtj9_i2c_info,
			ARRAY_SIZE(accel_kxtj9_i2c_info));
	}
#endif


}
void __init msm7627a_sensor_init(void)
{
#ifdef CONFIG_AVAGO_APDS990X
	if (machine_is_msm8625_skua() || machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ) {
		apds990x_setup();
	}
#endif

#ifdef CONFIG_MPU_SENSORS_MPU3050
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		mpu3050_gpio_setup();
	}
#endif

#ifdef CONFIG_BOSCH_BMA250
	if (machine_is_msm8625_qrd7()) {
		pr_info("i2c_register_board_info BMA250 ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					bma250_i2c_info,
					ARRAY_SIZE(bma250_i2c_info));
	}
#endif

#ifdef CONFIG_CELLON_PRJ_C8681
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					tps61310_i2c_info,
					ARRAY_SIZE(tps61310_i2c_info));
#endif

#ifdef CONFIG_GSENSOR_BMA2X2
		pr_info("i2c_register_board_info BMA2X2 ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					bma2x2_i2c_info,
					ARRAY_SIZE(bma2x2_i2c_info));
#endif 
#ifdef CONFIG_GSENSOR_MC32X0
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mc32x0_i2c_info,
					ARRAY_SIZE(mc32x0_i2c_info));
#endif
#ifdef CONFIG_SENSORS_MMA845X
	pr_info("i2c_register_board_info mma8452 ACC\n");
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mma8452_i2c_info,
					ARRAY_SIZE(mma8452_i2c_info));
#endif
#ifdef CONFIG_GSENSOR_LIS3DH
		pr_info("i2c_register_board_info lis3dh_acc ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					lis3dh_acc_i2c_info,
					ARRAY_SIZE(lis3dh_acc_i2c_info));
#endif 

#ifdef CONFIG_INPUT_LTR502
	if (machine_is_msm8625_qrd7()) {
		pr_info("i2c_register_board_info LTR502\n");
		ltr502_light_gpio_setup();
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				ltr502_light_i2c_info,
				ARRAY_SIZE(ltr502_light_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_LTR558
	pr_info("i2c_register_board_info LTR558\n");
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
			ltr558_light_i2c_info,
			ARRAY_SIZE(ltr558_light_i2c_info));
#endif

#if defined(CONFIG_INPUT_PS31XX)
	printk("i2c_register_board_info PS31XX\n");
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
			ps31xx_light_i2c_info,
			ARRAY_SIZE(ps31xx_light_i2c_info));
#endif

#ifdef CONFIG_INPUT_TMD27713
	taos_init_irq();
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID, 
			tmd27713_gpio_i2c_board_info,
			ARRAY_SIZE(tmd27713_gpio_i2c_board_info));
#endif

#ifdef CONFIG_SENSORS_AK8975
	if (machine_is_msm8625_qrd7()) {
		pr_info("i2c_register_board_info AKM8975\n");
		akm_gpio_setup();
		akm_platform_data_8975.gpio_DRDY = 18;
		akm8975_i2c_info[0].irq = gpio_to_irq(akm_platform_data_8975.gpio_DRDY);
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				akm8975_i2c_info,
				ARRAY_SIZE(akm8975_i2c_info));
	}
#endif

#ifdef CONFIG_SENSORS_AK8963
		pr_info("i2c_register_board_info AKM8963\n");
		akm_gpio_setup();
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				akm8963_i2c_info,
				ARRAY_SIZE(akm8963_i2c_info));
#endif

#ifdef CONFIG_INPUT_KXTJ9
	if(machine_is_msm8625_skua()) {
	pr_info("i2c_register_board_info KXTJ9\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
			accel_kxtj9_i2c_info,
			ARRAY_SIZE(accel_kxtj9_i2c_info));
	}
#endif
}
void __init msm_fb_add_devices(void)
{
	int rc = 0;
	msm7x27a_set_display_params(prim_panel_name);
	if (machine_is_msm7627a_qrd1())
		platform_add_devices(qrd_fb_devices,
				ARRAY_SIZE(qrd_fb_devices));
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
						|| machine_is_msm8625_evt()) {
		mipi_NT35510_pdata.bl_lock = 1;
		mipi_NT35516_pdata.bl_lock = 1;
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;


		platform_add_devices(evb_fb_devices,
				ARRAY_SIZE(evb_fb_devices));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		sku3_lcdc_lcd_camera_power_init();
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(qrd3_fb_devices,
						ARRAY_SIZE(qrd3_fb_devices));
	} else if (machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
						|| machine_is_msm8625q_skud()) {
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(skud_fb_devices,
				ARRAY_SIZE(skud_fb_devices));
	} else {
		/* mipi video mode need setting for support continuous splash */
		if (get_hw_lcd_interface_type() == LCD_IS_MIPI_VIDEO)
		{
			mdp_pdata.cont_splash_enabled = 0x1;
		}
		else
		{
			mdp_pdata.cont_splash_enabled = 0x0;
		}
		platform_add_devices(msm_fb_devices,
				ARRAY_SIZE(msm_fb_devices));
	}

	msm_fb_register_device("mdp", &mdp_pdata);
	if (machine_is_msm7625a_surf() || machine_is_msm7x27a_surf() ||
			machine_is_msm8625_surf() || machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7())
		msm_fb_register_device("lcdc", &lcdc_pdata);
#ifdef CONFIG_FB_MSM_MIPI_DSI
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
#endif
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
		|| machine_is_msm8625_evt() || machine_is_msm8625q_evbd()) {

		gpio_reg_2p85v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vdd");
		if (IS_ERR(gpio_reg_2p85v))
			pr_err("%s:ext_2p85v regulator get failed", __func__);

		gpio_reg_1p8v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vddi");
		if (IS_ERR(gpio_reg_1p8v))
			pr_err("%s:ext_1p8v regulator get failed", __func__);

		if (mdp_pdata.cont_splash_enabled) {
			/*Enable EXT_2.85 and 1.8 regulators*/
			rc = regulator_enable(gpio_reg_2p85v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
			rc = regulator_enable(gpio_reg_1p8v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
		}
	}
}
static void msm7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length = ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_touchpad_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
					GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				mxt_device_info,
				ARRAY_SIZE(mxt_device_info));

	}else if (machine_is_msm7627a_qrd3() || 
			machine_is_msm8625_skua() ||
			machine_is_msm8625_qrd7()){
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* change the keymap for qrd sku5 */
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;

	/* keypad */
	if (machine_is_msm7627a_evb() ||
		 machine_is_msm8625_evb()||
		 machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ||
		 machine_is_msm8625_qrd7() ||
		 machine_is_msm8625_skua())
		platform_device_register(&kp_pdev_8625);

	/* leds */
/* disable the AP leds
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5()) {
		rc = gpio_tlmm_config(GPIO_CFG(LED_RED_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_RED_GPIO_8625);
		}

		rc = gpio_tlmm_config(GPIO_CFG(LED_GREEN_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_GREEN_GPIO_8625);
		}

		platform_device_register(&gpio_leds_8625);
	}
*/
#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	tricolor_leds_gpio_setup();
#endif
}
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Flash Porting */
void __init msm7627a_camera_init(void)
{

#ifndef CONFIG_MSM_CAMERA_V4L2
	int rc;
#endif

	pr_debug("msm7627a_camera_init Entered\n");

	if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
#ifdef CONFIG_OV7692
		ov7692_cam_req_gpio[0].gpio =
			GPIO_SKU7_CAM_VGA_SHDN;
		ov7692_cam_gpio_set_tbl[0].gpio = GPIO_SKU7_CAM_VGA_SHDN;
		ov7692_cam_gpio_set_tbl[1].gpio = GPIO_SKU7_CAM_VGA_SHDN;

		msm_camera_sensor_ov5647_data.sensor_pwd =
			GPIO_SKU7_CAM_5MP_SHDN_N;
		msm_camera_sensor_ov5647_data.sensor_reset =
			GPIO_SKU7_CAM_5MP_CAMIF_RESET;
#endif
	}

	/* LCD and camera power (VREG & LDO) init */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
#ifndef CONFIG_MSM_CAMERA_V4L2
		lcd_camera_power_init();
#endif
#ifdef CONFIG_OV5647
		evb_camera_gpio_cfg();
#endif
	}

#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		qrd1_camera_gpio_cfg();
		platform_add_devices(camera_devices_qrd,
				ARRAY_SIZE(camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		platform_add_devices(camera_devices_evb,
				ARRAY_SIZE(camera_devices_evb));
	} else if (machine_is_msm7627a_qrd3())
		return;
	else
		platform_add_devices(camera_devices_msm,
				ARRAY_SIZE(camera_devices_msm));
#endif
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MACH_LGE
	if (!machine_is_msm7627a_qrd1() || !machine_is_msm7627a_evb()
					|| !machine_is_msm8625_evb()
					|| !machine_is_msm8625_evt()
					|| !machine_is_msm7627a_qrd3()
					|| !machine_is_msm8625_qrd7())
		register_i2c_devices();
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MSM_CAMERA_V4L2
	rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not get regulators: %d\n", __func__, rc);
		return;
	}

	rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not set voltages: %d\n", __func__, rc);
		return;
	}
#endif

#if defined(CONFIG_MSM_CAMERA_V4L2)
	msm7x27a_init_cam();
#endif
#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_qrd,
				ARRAY_SIZE(i2c_camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		pr_debug("machine_is_msm7627a_evb i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_evb,
				ARRAY_SIZE(i2c_camera_devices_evb));
	} else
#endif
		pr_debug("i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices,
				ARRAY_SIZE(i2c_camera_devices));
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifdef CONFIG_LEDS_AS364X
	lge_add_gpio_i2c_device(lge_init_i2c_camera);
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
}
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
		/*MTD-MM-SL-ImproveFrontCamera-00*{ */
		/*MTD-MM-SL-CameraPorting-00*{ */
		#ifndef CONFIG_FIH_CAMERA
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
		#else
		#ifdef CONFIG_ISX006
		sensor_board_info_isx006.cam_vreg = NULL;
		sensor_board_info_isx006.num_vreg = 0;
		#endif
		#endif
		/*MTD-MM-SL-CameraPorting-00*} */
		/*MTD-MM-SL-ImproveFrontCamera-00*} */

	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()) {
		#ifndef CONFIG_FIH_CAMERA
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
		#endif
	}
	platform_device_register(&msm_camera_server);
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
static int mipi_dsi_panel_power(int on)
{
	int rc = 0;
#if 1 // #suwg.
    if(!odmm_dsi_gpio_initialized){
		rc = gpio_request(ODMM_LCD_BACKLIGHT,
			"odmm_gpio_bkl_en");
		if (rc < 0)
			return rc;

		rc = gpio_tlmm_config(GPIO_CFG(ODMM_LCD_BACKLIGHT, 0,
			GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
			GPIO_CFG_ENABLE);
		if (rc < 0) {
			pr_err("failed odmm GPIO_BACKLIGHT_EN tlmm config\n");
			return rc;
		}
		rc = gpio_direction_output(ODMM_LCD_BACKLIGHT, 1);
		if (rc < 0) {
			pr_err("failed to enable backlight\n");
			gpio_free(ODMM_LCD_BACKLIGHT);
			return rc;
		}
		rc = regulator_bulk_get(NULL, ARRAY_SIZE(odmm_regs_dsi), odmm_regs_dsi);
		if (rc) {
			pr_err("%s: could not get regulators: %d\n",
					__func__, rc);
			goto fail_gpio2;
		}

		rc = regulator_bulk_set_voltage(ARRAY_SIZE(odmm_regs_dsi),
						odmm_regs_dsi);
		if (rc) {
			pr_err("%s: could not set voltages: %d\n",
					__func__, rc);
			goto fail_vreg;
		}

        rc =  regulator_bulk_enable(ARRAY_SIZE(odmm_regs_dsi), odmm_regs_dsi);
             // regulator_bulk_disable(ARRAY_SIZE(odmm_regs_dsi), odmm_regs_dsi);
        
        if (rc)
            pr_err("%s: could not %sable regulators: %d\n",
                    __func__, on ? "en" : "dis", rc);

		odmm_dsi_gpio_initialized = 1;
        
    }
    

    return rc;
fail_vreg:
    regulator_bulk_free(ARRAY_SIZE(odmm_regs_dsi), odmm_regs_dsi);
fail_gpio2:
    gpio_free(ODMM_LCD_BACKLIGHT);
    return rc;
#endif
	if (machine_is_msm7627a_qrd1())
		rc = mipi_dsi_panel_qrd1_power(on);
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
                        || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		rc = mipi_dsi_panel_qrd3_power(on);
        else if (machine_is_msm8625q_skud())
                rc = mipi_dsi_panel_skud_power(on);
        else if (machine_is_msm8625q_evbd())
                rc = mipi_dsi_panel_evbd_power(on);
        else if (machine_is_msm8625q_skue())
                rc = mipi_dsi_panel_skue_power(on);
	else
		rc = mipi_dsi_panel_msm_power(on);
	return rc;
}
void __init msm7627a_camera_init(void)
{
#ifndef CONFIG_MSM_CAMERA_V4L2
	int rc;
#endif

	pr_debug("msm7627a_camera_init Entered\n");

#ifndef CONFIG_MACH_LGE
	if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		ov7692_cam_req_gpio[0].gpio =
			GPIO_SKU7_CAM_VGA_SHDN;
		ov7692_cam_gpio_set_tbl[0].gpio = GPIO_SKU7_CAM_VGA_SHDN;
		ov7692_cam_gpio_set_tbl[1].gpio = GPIO_SKU7_CAM_VGA_SHDN;

		msm_camera_sensor_ov5647_data.sensor_pwd =
			GPIO_SKU7_CAM_5MP_SHDN_N;
		msm_camera_sensor_ov5647_data.sensor_reset =
			GPIO_SKU7_CAM_5MP_CAMIF_RESET;
	}
#endif
	/* LCD and camera power (VREG & LDO) init */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
#ifndef CONFIG_MSM_CAMERA_V4L2
		lcd_camera_power_init();
#endif
		evb_camera_gpio_cfg();
	}

#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		qrd1_camera_gpio_cfg();
		platform_add_devices(camera_devices_qrd,
				ARRAY_SIZE(camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		platform_add_devices(camera_devices_evb,
				ARRAY_SIZE(camera_devices_evb));
	} else if (machine_is_msm7627a_qrd3())
		return;
	else
		platform_add_devices(camera_devices_msm,
				ARRAY_SIZE(camera_devices_msm));
#endif
#ifndef CONFIG_MACH_LGE
	if (!machine_is_msm7627a_qrd1() || !machine_is_msm7627a_evb()
					|| !machine_is_msm8625_evb()
					|| !machine_is_msm8625_evt()
					|| !machine_is_msm7627a_qrd3()
					|| !machine_is_msm8625_qrd7())
		register_i2c_devices();
#endif
#ifndef CONFIG_MSM_CAMERA_V4L2
	rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not get regulators: %d\n", __func__, rc);
		return;
	}

	rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_camera), regs_camera);

	if (rc) {
		pr_err("%s: could not set voltages: %d\n", __func__, rc);
		return;
	}
#endif
/*                                                                                     */
#ifdef CONFIG_MINIABB_REGULATOR
	{
		int rc;

		/* CAM_IOVDD */
		regulator_cam_iovdd = regulator_get( NULL, "cam_iovdd" );
		if( regulator_cam_iovdd == NULL ) {
			pr_err("### %s: could not get regulators: cam_iovdd ###\n", __func__);
		}
		else {
			rc = regulator_set_voltage( regulator_cam_iovdd, 1800000, 1800000 );
			if( rc ) {
				pr_err("### %s: could not set cam_iovdd voltages: %d ###\n", __func__, rc);
			}
		}
		/* CAM_AVDD */
		regulator_cam_avdd = regulator_get( NULL, "cam_avdd" );
		if( regulator_cam_avdd == NULL ) {
			pr_err("### %s: could not get regulators: cam_avdd ###\n", __func__);
		}
		else {
			rc = regulator_set_voltage( regulator_cam_avdd, 2800000, 2800000 );
			if( rc ) {
				pr_err("### %s: could not set cam_avdd voltages: %d ###\n", __func__, rc);
			}
		}
		/* CAM_DVDD */
		regulator_cam_dvdd = regulator_get( NULL, "cam_dvdd" );
		if( regulator_cam_dvdd == NULL ) {
			pr_err("### %s: could not get regulators: cam_dvdd ###\n", __func__);
		}
		else
		{
			rc = regulator_set_voltage( regulator_cam_dvdd, 1800000, 1800000 );
			if( rc ) {
				pr_err("### %s: could not set cam_dvdd voltages: %d ###\n", __func__, rc);
			}
		}
	}
#endif /* CONFIG_MINIABB_REGULATOR */
/*                                                                                     */

#if defined(CONFIG_MSM_CAMERA_V4L2)
	msm7x27a_init_cam();
#endif
#ifndef CONFIG_MSM_CAMERA_V4L2
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_qrd,
				ARRAY_SIZE(i2c_camera_devices_qrd));
	} else if (machine_is_msm7627a_evb()
			|| machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7()) {
		pr_debug("machine_is_msm7627a_evb i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices_evb,
				ARRAY_SIZE(i2c_camera_devices_evb));
	} else
#endif
		pr_debug("i2c_register_board_info\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
				i2c_camera_devices,
				ARRAY_SIZE(i2c_camera_devices));
}
static void __init msm7x27a_init_cam(void)
{
#ifdef CONFIG_HI351
	struct msm_camera_sensor_info *s_info;
#endif

#ifdef CONFIG_T4K28
	struct msm_camera_sensor_info *s_info;
#endif

	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
#ifdef CONFIG_MACH_LGE
#ifdef CONFIG_HI351
		sensor_board_info_hi351.cam_vreg = NULL;
		sensor_board_info_hi351.num_vreg = 0;
		s_info = &msm_camera_sensor_hi351_data;
		s_info->sensor_platform_info->ext_power_ctrl =
			msm_camera_7x27a_ext_power_ctrl;
#endif
#ifdef CONFIG_T4K28
		sensor_board_info_t4k28.cam_vreg = NULL;
		sensor_board_info_t4k28.num_vreg = 0;
		s_info = &msm_camera_sensor_t4k28_data;
		s_info->sensor_platform_info->ext_power_ctrl =
			msm_camera_7x27a_ext_power_ctrl;
#endif


#else
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
#endif
	}
#ifndef CONFIG_MACH_LGE
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()) {
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
	}
#endif
/*                                                               */
	platform_device_register(&msm_camera_server);
#if 0
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
#else
	platform_device_register(&msm7x27a_device_csic0);
	platform_device_register(&msm7x27a_device_csic1);
#endif
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
        if (cont_splash_enabled == 1) {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif
                ret = 0;
        } else if (cont_splash_enabled == 2) {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif
                ret = 0;
        } else {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif

                ret = 0;
        }
	} else if (machine_is_msm8625_skua()) {
		if (!strncmp(name, "mipi_video_himax_wvga", 21) && skua_panel_is_himax())
			ret = 0;
		else if (!strncmp(name, "mipi_cmd_nt35510_alaska_wvga", 28) && !skua_panel_is_himax())
			ret = 0;
	} else if (machine_is_msm8625_evt()) {
		if (!strncmp(name, "mipi_video_nt35510_wvga", 23))
			ret = 0;
	}

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif

	return ret;
}
void __init qrd7627a_add_io_devices(void)
{
        int rc;	
       	int i; //hanjue
	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
	#if 1   //linxc 2012-12-21 +++
		if (machine_is_msm8625_qrd5()) {
			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID, 
			himax_ts_i2c_info, 
			ARRAY_SIZE(himax_ts_i2c_info));
		}
	#else
		/* Use configuration data for sku5 */
		if (machine_is_msm8625_qrd5()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		if (machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5a;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5a);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	#endif  //linxc 2012-12-21 ---	
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7() || machine_is_msm8625q_skud() || machine_is_msm8625q_skue()) {
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif
//add by hanjue
    /* change the keymap for qrd sku5 */
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;
		kp_matrix_info_8625.output_gpios = kp_row_gpios_8625_qrd5;
		kp_matrix_info_8625.noutputs = ARRAY_SIZE(kp_row_gpios_8625_qrd5);

		
		for (i = 0; i < kp_matrix_info_8625.noutputs; i++) {
			rc = gpio_tlmm_config(GPIO_CFG(kp_matrix_info_8625.output_gpios[i], 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_2MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, kp_matrix_info_8625.output_gpios[i]);
			}
		}
		for (i = 0; i < kp_matrix_info_8625.ninputs; i++) {
			rc = gpio_tlmm_config(GPIO_CFG(kp_matrix_info_8625.input_gpios[i], 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_2MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, kp_matrix_info_8625.input_gpios[i]);
			}
		}
		

	}
	/* keypad */
	if (machine_is_msm7627a_evb() ||
		 machine_is_msm8625_evb()||
		 machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ||
		 machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_skud);
    #if 0
	/* keypad */
	if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_skud);
     #endif
/*start by lf 2012.12.26 */	 
#if 0
	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {

		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	} else if (machine_is_msm8625q_skud()) {
		platform_device_register(&pmic_mpp_leds_pdev_skud);
		/* enable the skud flash and torch by gpio leds driver */
		platform_device_register(&gpio_flash_skud);
	}
#endif
/*end by lf 2012.12.26 */
#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		platform_device_register(&msm_device_tricolor_leds);
		tricolor_leds_gpio_setup();
	}
#endif
}
static unsigned int msm_AR600X_shutdown_power(bool on)
{
	int rc = 0;

	if (!wlan_powered_up) {
		pr_info("WLAN is not powered up, returning success\n");
		return 0;
	}

	/* Disable the A0 clock */
	rc = setup_wlan_clock(on);
	if (rc) {
		pr_err("%s: setup_wlan_clock = %d\n", __func__, rc);
		goto set_clock_fail;
	}

	/*
	 * gpio_wlan_sys_rest_en is not from the GPIO expander for QRD7627a,
	 * EVB1.0 and QRD8625,so the below step is required for those devices.
	 */
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()
					|| machine_is_msm8625q_evbd()
					|| machine_is_qrd_skud_prime()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto gpio_fail;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 0);
	} else {
#ifdef CONFIG_HUAWEI_KERNEL
		/* rollback to 1030 baseline */
		gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		rc = setup_wlan_gpio(on);
		if (rc) {
			pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
			goto set_gpio_fail;
		}
		gpio_free(gpio_wlan_sys_rest_en);
#else
		rc = setup_wlan_gpio(on);
		if (rc) {
			pr_err("%s: setup_wlan_gpio = %d\n", __func__, rc);
			goto set_gpio_fail;
		}
		gpio_free(gpio_wlan_sys_rest_en);
#endif
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto qrd_gpio_fail;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 0);
	}

	rc = wlan_switch_regulators(on);
	if (rc) {
		pr_err("%s: wlan_switch_regulators error = %d\n",
			__func__, rc);
		goto reg_disable;
	}
	wlan_powered_up = false;
	pr_info("WLAN power-down success\n");
	return 0;
set_clock_fail:
	setup_wlan_clock(0);
set_gpio_fail:
	setup_wlan_gpio(0);
gpio_fail:
	if (!(machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb() ||
	    machine_is_msm8625_evb() || machine_is_msm8625_evt() ||
	    machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()))
			gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1())
		gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
	wlan_switch_regulators(0);

#ifndef CONFIG_HUAWEI_KERNEL
out:
	pr_info("WLAN power-down failed\n");
#endif
	return rc;
}
static unsigned int msm_AR600X_shutdown_power(bool on)
{
	int rc = 0;

	/* Disable the A0 clock */
	rc = setup_wlan_clock(on);
	if (rc) {
		pr_err("%s: setup_wlan_clock = %d\n", __func__, rc);
		goto set_clock_fail;
	}

	/*
	 * gpio_wlan_sys_rest_en is not from the GPIO expander for QRD7627a,
	 * EVB1.0 and QRD8625,so the below step is required for those devices.
	 */
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto gpio_fail;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 0);
	} else {
		rc = gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		if (!rc) {
			rc = setup_wlan_gpio(on);
			if (rc) {
				pr_err("%s: setup_wlan_gpio = %d\n",
					__func__, rc);
				goto set_gpio_fail;
			}
			gpio_free(gpio_wlan_sys_rest_en);
		}
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto qrd_gpio_fail;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 0);
	}

	rc = wlan_switch_regulators(on);
	if (rc) {
		pr_err("%s: wlan_switch_regulators error = %d\n",
			__func__, rc);
		goto reg_disable;
	}

	pr_info("WLAN power-down success\n");
	return 0;
set_clock_fail:
	setup_wlan_clock(0);
set_gpio_fail:
	setup_wlan_gpio(0);
gpio_fail:
	gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1())
		gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
	wlan_switch_regulators(0);
	pr_info("WLAN power-down failed\n");
	return rc;
}
void __init msm_fb_add_devices(void)
{
	int rc = 0;
	#if 1 // #suwg.
	printk("xxx %s \n",__func__);
	printk("machine_is_msm7627a_qrd1 %d\n",machine_is_msm7627a_qrd1());
	printk("machine_is_msm8625q_skud %d\n",machine_is_msm8625q_skud());
	printk("machine_is_msm7x27a_qrd5a %d\n",machine_is_msm7x27a_qrd5a());
	printk("machine_is_msm8625_qrd5 %d\n",machine_is_msm8625_qrd5());
	printk("disable_splash %d\n",disable_splash);

	msm7x27a_set_display_params(prim_panel_name);
	if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;

	platform_add_devices(odmm_fb_devices, ARRAY_SIZE(odmm_fb_devices));
	msm_fb_register_device("mdp", &mdp_pdata);
//#ifdef CONFIG_FB_MSM_MIPI_DSI
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
//#endif
	
	return;
	#endif

        msm7x27a_set_display_params(prim_panel_name);

	if (machine_is_msm7627a_qrd1())
		platform_add_devices(qrd_fb_devices,
				ARRAY_SIZE(qrd_fb_devices));
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
                        || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		mipi_NT35510_pdata.bl_lock = 1;
		mipi_NT35516_pdata.bl_lock = 1;
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;

		platform_add_devices(evb_fb_devices,
				ARRAY_SIZE(evb_fb_devices));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		sku3_lcdc_lcd_camera_power_init();
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(qrd3_fb_devices,
						ARRAY_SIZE(qrd3_fb_devices));
	} else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd()) {
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;

                /* SKUD and SKUD' use different lane connection */
                if (cpu_is_msm8625q()){
					if(!strncmp((char *)prim_panel_name, "mipi_video_hx8392a_720p", 23))
						mipi_dsi_pdata.dlane_swap = 3;
					else
						mipi_dsi_pdata.dlane_swap = 0;

					pr_info("[DISP] The prim panel name is %s, Swap lane is %d\n", prim_panel_name,mipi_dsi_pdata.dlane_swap);
				}
                platform_add_devices(skud_fb_devices,
				ARRAY_SIZE(skud_fb_devices));
        } else if (machine_is_msm8625q_skue()) {
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;

                /* SKUE and SKUE' use different lane connection */
                if (cpu_is_msm8625q())
                        mipi_dsi_pdata.dlane_swap = 0;

		platform_add_devices(skue_fb_devices,
				ARRAY_SIZE(skue_fb_devices));
        } else {
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(msm_fb_devices,
				ARRAY_SIZE(msm_fb_devices));
	}

	msm_fb_register_device("mdp", &mdp_pdata);
	if (machine_is_msm7625a_surf() || machine_is_msm7x27a_surf() ||
			machine_is_msm8625_surf() || machine_is_msm7627a_qrd3()
			|| machine_is_msm8625_qrd7())
		msm_fb_register_device("lcdc", &lcdc_pdata);
#ifdef CONFIG_FB_MSM_MIPI_DSI
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
#endif
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
                        || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()
                        || machine_is_msm8625q_evbd()) {
		gpio_reg_2p85v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vdd");
		if (IS_ERR(gpio_reg_2p85v))
			pr_err("%s:ext_2p85v regulator get failed", __func__);

		gpio_reg_1p8v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vddi");
		if (IS_ERR(gpio_reg_1p8v))
			pr_err("%s:ext_1p8v regulator get failed", __func__);

		if (mdp_pdata.cont_splash_enabled) {
			/*Enable EXT_2.85 and 1.8 regulators*/
			rc = regulator_enable(gpio_reg_2p85v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
			rc = regulator_enable(gpio_reg_1p8v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
		}
	}
}
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		/* Use configuration data for EVT */
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */
	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_sku3);

	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
						machine_is_msm8625_evt()) {
		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	}
}
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		/* Use configuration data for EVT */
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_qrd_skud_prime()
				|| machine_is_msm8625q_skud()
				|| machine_is_msm8625q_evbd()) {
		ft5x06_touchpad_setup();
		/* evbd+ can support synaptic as well */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			/* for QPR EVBD+ with synaptic touch panel */
			/* TODO: Add  gpio request to the driver
				to support proper dynamic touch detection */
			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_ATTEN_GPIO_EVBD_PLUS, 0,
				GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_set_value(CLEARPAD3000_RESET_GPIO, 0);
			usleep(10000);
			gpio_set_value(CLEARPAD3000_RESET_GPIO, 1);
			usleep(50000);

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				rmi4_i2c_devices,
				ARRAY_SIZE(rmi4_i2c_devices));
		}
		else {
			if (machine_is_msm8625q_evbd()) {
				mxt_config_array[0].config = mxt_config_data;
				mxt_config_array[0].config_length =
				ARRAY_SIZE(mxt_config_data);
				mxt_platform_data.panel_maxy = 875;
				mxt_platform_data.need_calibration = true;
				mxt_platform_data.irq_gpio = MXT_TS_EVBD_IRQ_GPIO;
				mxt_vkey_setup();

			rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_EVBD_IRQ_GPIO, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
						__func__, MXT_TS_EVBD_IRQ_GPIO);
			}

			rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			if (rc) {
				pr_err("%s: gpio_tlmm_config for %d failed\n",
						__func__, MXT_TS_RESET_GPIO);
			}

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				mxt_device_info,
				ARRAY_SIZE(mxt_device_info));
			}
		}
	}

	/* handset and power key*/
	/* ignore end key as this target doesn't need it */
	hs_platform_data.ignore_end_key = true;
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */

	if (machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud()) {
		kp_matrix_info_sku3.keymap = keymap_skud;
		kp_matrix_info_sku3.output_gpios = kp_row_gpios_skud;
		kp_matrix_info_sku3.input_gpios = kp_col_gpios_skud;
		kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_skud);
		kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_skud);
		/* keypad info for EVBD+ */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			gpio_tlmm_config(GPIO_CFG(37, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(42, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(31, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			kp_matrix_info_sku3.output_gpios = kp_row_gpios_evbdp;
			kp_matrix_info_sku3.input_gpios = kp_col_gpios_evbdp;
			kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_evbdp);
			kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_evbdp);
		}
	}

	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
		|| machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud())
		platform_device_register(&kp_pdev_sku3);

	/* leds */

	if (machine_is_qrd_skud_prime() || machine_is_msm8625q_evbd()
		|| machine_is_msm8625q_skud()) {
		ctp_backlight_info.flags =
			PM_MPP__I_SINK__LEVEL_40mA << 16 | PM_MPP_8;
	}

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
		machine_is_msm8625_evt() || machine_is_qrd_skud_prime()
		|| machine_is_msm8625q_evbd() || machine_is_msm8625q_skud())
		platform_device_register(&pmic_mpp_leds_pdev);

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
		machine_is_msm8625_evt() || machine_is_msm8625q_evbd())
		platform_device_register(&tricolor_leds_pdev);
}
void __init msm_fb_add_devices(void)
{
	int rc = 0;
	msm7x27a_set_display_params(prim_panel_name);

	if (disable_splash)
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(msm_fb_devices,
				ARRAY_SIZE(msm_fb_devices));

#if 0 // Qualcomm Target setting
	if (machine_is_msm7627a_qrd1())
		platform_add_devices(qrd_fb_devices,
				ARRAY_SIZE(qrd_fb_devices));
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
						|| machine_is_msm8625_evt()) {
		mipi_NT35510_pdata.bl_lock = 1;
		mipi_NT35516_pdata.bl_lock = 1;
		if (disable_splash)
			mdp_pdata.cont_splash_enabled = 0x0;


		platform_add_devices(evb_fb_devices,
				ARRAY_SIZE(evb_fb_devices));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		sku3_lcdc_lcd_camera_power_init();
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(qrd3_fb_devices,
						ARRAY_SIZE(qrd3_fb_devices));
	} else {
		mdp_pdata.cont_splash_enabled = 0x0;
		platform_add_devices(msm_fb_devices,
				ARRAY_SIZE(msm_fb_devices));
	}
#endif

	msm_fb_register_device("mdp", &mdp_pdata);

#ifdef CONFIG_FB_MSM_LCDC
//	if (machine_is_msm7625a_surf() || machine_is_msm7x27a_surf() ||
//			machine_is_msm8625_surf() || machine_is_msm7627a_qrd3()
//			|| machine_is_msm8625_qrd7())
		msm_fb_register_device("lcdc", &lcdc_pdata);
#endif

#ifdef CONFIG_FB_MSM_MIPI_DSI
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
#endif
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
					|| machine_is_msm8625_evt()) {
		gpio_reg_2p85v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vdd");
		if (IS_ERR(gpio_reg_2p85v))
			pr_err("%s:ext_2p85v regulator get failed", __func__);

		gpio_reg_1p8v = regulator_get(&mipi_dsi_device.dev,
								"lcd_vddi");
		if (IS_ERR(gpio_reg_1p8v))
			pr_err("%s:ext_1p8v regulator get failed", __func__);

		if (mdp_pdata.cont_splash_enabled) {
			/*Enable EXT_2.85 and 1.8 regulators*/
			rc = regulator_enable(gpio_reg_2p85v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
			rc = regulator_enable(gpio_reg_1p8v);
			if (rc < 0)
				pr_err("%s: reg enable failed\n", __func__);
		}
	}
}
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		
		if (machine_is_msm8625_evt()) {
			mxt_config_array[0].config = mxt_config_data_evt;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_evt);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_qrd_skud_prime()) {
		ft5x06_touchpad_setup();
	}

	
	
	hs_platform_data.ignore_end_key = true;
	platform_device_register(&hs_pdev);

	
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	

	if (machine_is_qrd_skud_prime()) {
		kp_matrix_info_sku3.keymap = keymap_skud;
		kp_matrix_info_sku3.output_gpios = kp_row_gpios_skud;
		kp_matrix_info_sku3.input_gpios = kp_col_gpios_skud;
		kp_matrix_info_sku3.noutputs = ARRAY_SIZE(kp_row_gpios_skud);
		kp_matrix_info_sku3.ninputs = ARRAY_SIZE(kp_col_gpios_skud);
	}

	if (machine_is_msm8625_evt())
		kp_matrix_info_8625.keymap = keymap_8625_evt;

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
		|| machine_is_qrd_skud_prime())
		platform_device_register(&kp_pdev_sku3);

	
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
						machine_is_msm8625_evt()) {
		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	}
}
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifdef CONFIG_MACH_LGE
#ifdef CONFIG_HI542
				sensor_board_info_hi542.cam_vreg = NULL;
				sensor_board_info_hi542.num_vreg = 0;
#endif
#ifdef CONFIG_MT9E013_LGIT
				mt9e013_lgit_sensor_info.cam_vreg = NULL;
				mt9e013_lgit_sensor_info.num_vreg = 0;
#endif
#ifdef CONFIG_MT9V113
		sensor_board_info_mt9v113.cam_vreg = NULL;
		sensor_board_info_mt9v113.num_vreg = 0;
#endif
#else
#ifdef CONFIG_S5K4E1
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
#endif
#ifdef CONFIG_MT9E013
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
#endif
#ifdef CONFIG_WEBCAM_OV9726
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
#endif
#ifdef CONFIG_OV7692
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
#endif
#ifdef CONFIG_OV5647
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
#endif
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()) {
#ifdef CONFIG_OV7692
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
#endif
#ifdef CONFIG_OV5647
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
#endif
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MACH_LGE
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	}
	platform_device_register(&msm_camera_server);
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MACH_LGE
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()
			|| machine_is_msm7x27a_u0()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
#endif
	platform_device_register(&msm7x27a_device_csic0);
	platform_device_register(&msm7x27a_device_csic1);
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
void __init qrd7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		/* Use configuration data for sku5 */
		if (machine_is_msm8625_qrd5()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_platform_data.panel_maxy = 875;
			mxt_platform_data.need_calibration = true;
			mxt_vkey_setup();
		}

		if (machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5a;
			mxt_config_array[0].config_length =
					ARRAY_SIZE(mxt_config_data_qrd5a);
			mxt_platform_data.panel_maxy = 875;
			mxt_vkey_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
				GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					mxt_device_info,
					ARRAY_SIZE(mxt_device_info));
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()
				|| machine_is_msm8625q_skud()
				|| machine_is_msm8625q_evbd()
				|| machine_is_msm8625q_skue()) {
		ft5x06_touchpad_setup();
		/* evbd+ can support synaptic as well */
		if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 0x13)) {
			/* for QPR EVBD+ with synaptic touch panel */
			/* TODO: Add  gpio request to the driver
				to support proper dynamic touch detection */
			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_ATTEN_GPIO_EVBD_PLUS, 0,
				GPIO_CFG_INPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_tlmm_config(
				GPIO_CFG(CLEARPAD3000_RESET_GPIO, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE);

			gpio_set_value(CLEARPAD3000_RESET_GPIO, 0);
			usleep(10000);
			gpio_set_value(CLEARPAD3000_RESET_GPIO, 1);
			usleep(50000);

			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				rmi4_i2c_devices,
				ARRAY_SIZE(rmi4_i2c_devices));
		}
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* keypad */
	if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;
	/* keypad info for EVBD+ */
	if (machine_is_msm8625q_evbd() &&
			(socinfo_get_platform_type() == 13)) {
			gpio_tlmm_config(GPIO_CFG(37, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(42, 0,
						GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			gpio_tlmm_config(GPIO_CFG(31, 0,
						GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
						GPIO_CFG_8MA), GPIO_CFG_ENABLE);
			kp_matrix_info_skud.output_gpios = kp_row_gpios_evbdp;
			kp_matrix_info_skud.input_gpios = kp_col_gpios_evbdp;
			kp_matrix_info_skud.noutputs = ARRAY_SIZE(kp_row_gpios_evbdp);
			kp_matrix_info_skud.ninputs = ARRAY_SIZE(kp_col_gpios_evbdp);
	}

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		platform_device_register(&kp_pdev_8625);
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7())
		platform_device_register(&kp_pdev_qrd3);
	else if (machine_is_msm8625q_skud()||machine_is_msm8625q_evbd())
		platform_device_register(&kp_pdev_skud);
	else if (machine_is_msm8625q_skue())
		platform_device_register(&kp_pdev_skue);

	/* leds */
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {

		platform_device_register(&pmic_mpp_leds_pdev);
		platform_device_register(&tricolor_leds_pdev);
	} else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd()) {
		platform_device_register(&pmic_mpp_leds_pdev_skud);
		/* enable the skud flash and torch by gpio leds driver */
		platform_device_register(&gpio_flash_skud);
	} else if (machine_is_msm8625q_skue()) {
		 /* enable the skue flashlight by gpio leds driver */
                platform_device_register(&gpio_flash_skue);
	}

#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
            || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		platform_device_register(&msm_device_tricolor_leds);
		tricolor_leds_gpio_setup();
	}
#endif
}