static void set_wake_locked(int wake)
{
	if (wake)
		wake_lock(&bt_lpm.bt_wake_lock);

	gpio_set_value(gpio_rev(GPIO_BT_WAKE), wake);
}
/* test: Qualcomm */
void print_ldos(void)
{
	int temp = 0;
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
	temp = gpio_get_value(gpio_rev(CAM_CORE_EN));
#else
	temp = gpio_get_value(CAM_CORE_EN);
#endif
	printk(KERN_DEBUG "[s5c73m3] check CAM_CORE_EN : %d\n", temp);

	temp = gpio_get_value(GPIO_CAM_A_EN);
	printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_A_EN : %d\n", temp);

	temp = gpio_get_value(GPIO_CAM_SENSOR_EN);
	printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_SENSOR_EN : %d\n", temp);

	temp = gpio_get_value(CAM_MIPI_EN);
	printk(KERN_DEBUG "[s5c73m3] check CAM_MIPI_EN : %d\n", temp);

	temp = gpio_get_value(PM8921_GPIO_PM_TO_SYS(24));/*SPI_TEMP*/
	printk(KERN_DEBUG "[s5c73m3] check ISP_STANDBY : %d\n", temp);

	temp = gpio_get_value(ISP_RESET);
	printk(KERN_DEBUG "[s5c73m3] check ISP_RESET : %d\n", temp);

}
Example #3
0
static int bcm4334_bluetooth_remove(struct platform_device *pdev)
{
	rfkill_unregister(bt_rfkill);
	rfkill_destroy(bt_rfkill);

	gpio_free(gpio_rev(BT_EN));

	return 0;
}
static int bcm4334_bluetooth_remove(struct platform_device *pdev)
{
	rfkill_unregister(bt_rfkill);
	rfkill_destroy(bt_rfkill);

	gpio_free(GPIO_BT_EN);
	gpio_free(gpio_rev(GPIO_BT_WAKE));
	gpio_free(GPIO_BT_HOST_WAKE);

	wake_lock_destroy(&bt_lpm.host_wake_lock);
	wake_lock_destroy(&bt_lpm.bt_wake_lock);

	return 0;
}
Example #5
0
static void gpio_rev_init(void)
{
	bluesleep_resources[0].start = gpio_rev(BT_HOST_WAKE);
	bluesleep_resources[0].end = gpio_rev(BT_HOST_WAKE);
	bluesleep_resources[1].start = gpio_rev(BT_WAKE);
	bluesleep_resources[1].end = gpio_rev(BT_WAKE);
	bluesleep_resources[2].start = MSM_GPIO_TO_INT(gpio_rev(BT_HOST_WAKE));
	bluesleep_resources[2].end = MSM_GPIO_TO_INT(gpio_rev(BT_HOST_WAKE));
}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

#ifdef CONFIG_VP_A2220
		msm_gpiomux_install(audience_suspend_configs,
			ARRAY_SIZE(audience_suspend_configs));
#endif

	msm8960_gpio_key_configs[0].gpio = gpio_rev(VOLUME_UP);
	msm8960_gpio_key_configs[1].gpio = gpio_rev(VOLUME_DOWN);
	if (system_rev < BOARD_REV13)
		msm_gpiomux_install(msm8960_gpio_key_configs, 2);
	else
		msm_gpiomux_install(msm8960_gpio_key_configs,
			ARRAY_SIZE(msm8960_gpio_key_configs));

	msm_gpiomux_install(msm8960_sec_ts_configs,
			ARRAY_SIZE(msm8960_sec_ts_configs));

	msm_gpiomux_install(msm8960_sec_sensor_configs,
			ARRAY_SIZE(msm8960_sec_sensor_configs));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev >= BOARD_REV09)
		msm_gpiomux_install(sdc4_interface, ARRAY_SIZE(sdc4_interface));
	else
#endif
		msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	msm_gpiomux_install(msm8960_fsa9485_configs,
			ARRAY_SIZE(msm8960_fsa9485_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
		machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
		(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
			ARRAY_SIZE(msm8960_hsic_configs));
#endif

#ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));
#endif

#if defined(CONFIG_VIDEO_MHL_V1) || defined(CONFIG_VIDEO_MHL_V2)
	msm_gpiomux_install(msm8960_mhl_configs,
			ARRAY_SIZE(msm8960_mhl_configs));
#endif

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	return 0;
}
static int bcm4334_bluetooth_probe(struct platform_device *pdev)
{
	int rc = 0;
	int ret;

	rc = gpio_request(GPIO_BT_EN, "bcm4334_bten_gpio");
	if (unlikely(rc)) {
		pr_err("[BT] GPIO_BT_EN request failed.\n");
		return rc;
	}
	rc = gpio_request(gpio_rev(GPIO_BT_WAKE), "bcm4334_btwake_gpio");
	if (unlikely(rc)) {
		pr_err("[BT] GPIO_BT_WAKE request failed.\n");
		gpio_free(GPIO_BT_EN);
		return rc;
	}
	rc = gpio_request(GPIO_BT_HOST_WAKE, "bcm4334_bthostwake_gpio");
	if (unlikely(rc)) {
		pr_err("[BT] GPIO_BT_HOST_WAKE request failed.\n");
		gpio_free(gpio_rev(GPIO_BT_WAKE));
		gpio_free(GPIO_BT_EN);
		return rc;
	}
	gpio_direction_input(GPIO_BT_HOST_WAKE);
	gpio_direction_output(gpio_rev(GPIO_BT_WAKE), 0);
	gpio_direction_output(GPIO_BT_EN, 0);

	bt_rfkill = rfkill_alloc("bcm4334 Bluetooth", &pdev->dev,
				RFKILL_TYPE_BLUETOOTH, &bcm4334_bt_rfkill_ops,
				NULL);

	if (unlikely(!bt_rfkill)) {
		pr_err("[BT] bt_rfkill alloc failed.\n");
		gpio_free(GPIO_BT_HOST_WAKE);
		gpio_free(gpio_rev(GPIO_BT_WAKE));
		gpio_free(GPIO_BT_EN);
		return -ENOMEM;
	}

	rfkill_init_sw_state(bt_rfkill, 0);

	rc = rfkill_register(bt_rfkill);

	if (unlikely(rc)) {
		pr_err("[BT] bt_rfkill register failed.\n");
		rfkill_destroy(bt_rfkill);
		gpio_free(GPIO_BT_HOST_WAKE);
		gpio_free(gpio_rev(GPIO_BT_WAKE));
		gpio_free(GPIO_BT_EN);
		return -1;
	}

	rfkill_set_sw_state(bt_rfkill, true);

#ifdef BT_LPM_ENABLE
	ret = bcm_bt_lpm_init(pdev);
	if (ret) {
		rfkill_unregister(bt_rfkill);
		rfkill_destroy(bt_rfkill);

		gpio_free(GPIO_BT_HOST_WAKE);
		gpio_free(gpio_rev(GPIO_BT_WAKE));
		gpio_free(GPIO_BT_EN);
	}
#endif
	return rc;
}
static void cam_ldo_power_off(int mode)
{
	int ret = 0;
	int temp = 0;

	printk(KERN_DEBUG "[%s : %d] %s CAMERA POWER OFF!!\n",
	       __func__, __LINE__, mode ? "FRONT" : "REAR");

	if (mode) {		/* front camera */
		/* VT_RESET */
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
		gpio_set_value_cansleep(gpio_rev(CAM2_RST_N), 0);
		usleep(1*1000);
#else
		gpio_set_value_cansleep(CAM2_RST_N, 0);
		usleep(1*1000);
#endif
		/* ISP 8M MIPI 1.2V */
	  /* delete for unnecessary power */


		/* ISP 8M HOST 1.8V */
		if (l29) {
			ret = regulator_disable(l29);
			if (ret)
				cam_err("error disabling regulator\n");
		}
		usleep(1*1000);

		/* MCLK 24MHz*/

		/* 8M AVDD 2.8V */
		gpio_set_value_cansleep(GPIO_CAM_A_EN, 0);
		usleep(1*1000);
		/* ISP CORE 1.2V */
	  /* delete for unnecessary power */
	} else {		/* rear camera */
		/* ISP_STANDBY */
		gpio_set_value_cansleep(PM8921_GPIO_PM_TO_SYS(24), 0);
		usleep(1*1000);

		/* ISP_RESET */
		gpio_set_value_cansleep(ISP_RESET, 0);
		usleep(1*1000);

		/* AF 2.8V */
		gpio_set_value_cansleep(gpio_rev(CAM_AF_EN), 0);
		usleep(1*1000);

		/* ISP 8M MIPI 1.2V */
		gpio_set_value_cansleep(CAM_MIPI_EN, 0);
		usleep(1*1000);

		/* ISP 8M HOST 1.8V */
		if (l29) {
			ret = regulator_disable(l29);
			if (ret)
				cam_err("error disabling regulator\n");
		}
		usleep(1*1000);

		/* 8M DVDD 1.2V */
		gpio_set_value_cansleep(GPIO_CAM_SENSOR_EN, 0);
		usleep(1*1000);

		/* 8M AVDD 2.8V */
		gpio_set_value_cansleep(GPIO_CAM_A_EN, 0);
		usleep(1*1000);

		/* ISP CORE 1.2V */
#if defined(CONFIG_MACH_M2)
		if (system_rev >= BOARD_REV08)
			ret = regulator_disable(isp_core);
		if (ret)
			cam_err("error disabling regulator");
		regulator_put(isp_core);
#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
		gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 0);
#else
		gpio_set_value_cansleep(CAM_CORE_EN, 0);
#endif
		usleep(1*1000);

		/* flash power 1.8V */
		if (l28) {
			ret = regulator_disable(l28);
			if (ret)
				cam_err("error disabling regulator\n");
		}
		usleep(1*1000);

		/* GPIO_CAM_FLASH_SW : tourch */
		temp = gpio_get_value(GPIO_MSM_FLASH_NOW);

		if (isFlashCntlEn == 0 && temp == 0) {
			/* GPIO_CAM_FLASH_SW : tourch */
			gpio_set_value_cansleep(gpio_cam_flash_sw, 0);
			temp = gpio_get_value(gpio_cam_flash_sw);
			printk(KERN_DEBUG "[s5c73m3] check"
				" GPIO_CAM_FLASH_SW : %d\n", temp);
			/* FLASH_LED_LOCK*/
			gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
				(PMIC_MPP_FLASH_LED_UNLOCK), 0);
			usleep(1*1000);
		}
	}
}
static void cam_ldo_power_on(int mode, int num)
{
	int ret = 0;
	int temp = 0;

	printk(KERN_DEBUG "[%s : %d] %s CAMERA POWER ON!!\n",
	       __func__, __LINE__, mode ? "FRONT" : "REAR");

	if (mode) {		/* front camera */
		if (num == 0) {
			/* ISP CORE 1.2V */
			/* delete for unnecessary power */
			/* 8M AVDD 2.8V */
			gpio_set_value_cansleep(GPIO_CAM_A_EN, 1);
			temp = gpio_get_value(GPIO_CAM_A_EN);
			printk(KERN_DEBUG "[s5k6a3yx] check GPIO_CAM_A_EN : %d\n",
				temp);
			usleep(1*1000);
		}	else	{
			/* VT_RESET */
		#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
			gpio_set_value_cansleep(gpio_rev(CAM2_RST_N), 1);
			temp = gpio_get_value(gpio_rev(CAM2_RST_N));
		#else
			gpio_set_value_cansleep(CAM2_RST_N, 1);
			temp = gpio_get_value(CAM2_RST_N);
		#endif
			printk(KERN_DEBUG "[s5k6a3yx] check CAM2_RST_N : %d\n",
				temp);
			usleep(1*1000);

			/* ISP 8M HOST 1.8V */
			l29 = regulator_get(NULL, "8921_lvs5");
			ret = regulator_enable(l29);
			if (ret)
				cam_err("error enabling regulator\n");
			usleep(1*1000);

			/* ISP 8M MIPI 1.2V */
			/* delete for unnecessary power */
		}
	} else {		/* rear camera */
		if (num == 0) {
			printk(KERN_DEBUG "[s5c73m3] rear camera on 1\n");

			temp = gpio_get_value(GPIO_MSM_FLASH_NOW);

			if (isFlashCntlEn == 0 && temp == 0) {
				/* FLASH_LED_UNLOCK*/
				gpio_set_value_cansleep(PM8921_MPP_PM_TO_SYS
					(PMIC_MPP_FLASH_LED_UNLOCK), 1);
				/* GPIO_CAM_FLASH_SW : tourch */
				gpio_set_value_cansleep(gpio_cam_flash_sw, 1);
				temp = gpio_get_value(gpio_cam_flash_sw);
				printk(KERN_DEBUG "[s5c73m3] check"
					" GPIO_CAM_FLASH_SW : %d\n", temp);
				usleep(1*1000);
			}

			/* flash power 1.8V */
			l28 = regulator_get(NULL, "8921_lvs4");
			ret = regulator_enable(l28);
			if (ret)
				cam_err("error enabling regulator\n");
			usleep(1*1000);

			/* ISP CORE 1.2V */
#if defined(CONFIG_MACH_M2)
			if (system_rev >= BOARD_REV08) {
				printk(KERN_DEBUG "[s5c73m3] m2 check vddCore : %d\n",
					vddCore);

				isp_core = regulator_get(NULL, "cam_isp_core");
				ret = regulator_set_voltage(isp_core,
					vddCore, vddCore);
				if (ret)
					cam_err("error setting voltage\n");

				ret = regulator_enable(isp_core);
				if (ret)
					cam_err("error enabling regulator.");
			} else
				gpio_set_value_cansleep(CAM_CORE_EN, 1);
#elif defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
			gpio_set_value_cansleep(gpio_rev(CAM_CORE_EN), 1);
#else
			gpio_set_value_cansleep(CAM_CORE_EN, 1);
#endif
			usleep(1200);

			/* 8M AVDD 2.8V */
			gpio_set_value_cansleep(GPIO_CAM_A_EN, 1);
			temp = gpio_get_value(GPIO_CAM_A_EN);
			printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_A_EN : %d\n",
				temp);
			usleep(1*1000);

			/* 8M DVDD 1.2V */
			gpio_set_value_cansleep(GPIO_CAM_SENSOR_EN, 1);
			temp = gpio_get_value(GPIO_CAM_SENSOR_EN);
			printk(KERN_DEBUG "[s5c73m3] check GPIO_CAM_SENSOR_EN : %d\n",
			       temp);
			usleep(1*1000);
		} else {
			printk(KERN_DEBUG "[s5c73m3] rear camera on 2\n");
			/* AF 2.8V */
			gpio_set_value_cansleep(gpio_rev(CAM_AF_EN), 1);
			temp = gpio_get_value(gpio_rev(CAM_AF_EN));
			printk(KERN_DEBUG "[s5c73m3] check CAM_AF_EN : %d\n",
			       temp);
			usleep(3*1000);

			/* ISP 8M HOST 1.8V */
			l29 = regulator_get(NULL, "8921_lvs5");
			ret = regulator_enable(l29);
			if (ret)
				cam_err("error enabling regulator\n");

			/* ISP 8M MIPI 1.2V */
			gpio_set_value_cansleep(CAM_MIPI_EN, 1);
			temp = gpio_get_value(CAM_MIPI_EN);
			printk(KERN_DEBUG "[s5c73m3] check CAM_MIPI_EN : %d\n",
				temp);
			usleep(1*1000);

			/* ISP_STANDBY */
			gpio_set_value_cansleep(PM8921_GPIO_PM_TO_SYS(24), 1);
			usleep(1*1000);

			/* ISP_RESET */
			gpio_set_value_cansleep(ISP_RESET, 1);
			temp = gpio_get_value(ISP_RESET);
			printk(KERN_DEBUG "[s5c73m3] check ISP_RESET : %d\n",
				temp);
			usleep(1*1000);
		}
	}

}
void __init msm8960_init_cam(void)
{
	int rev = 0;
	struct msm_camera_sensor_info *s_info;

	rev = get_mclk_rev();

#if !defined(CONFIG_MACH_STRETTO)
#if defined(CONFIG_S5C73M3) || defined(CONFIG_S5K6A3YX)\
	|| defined(CONFIG_MACH_APEXQ) || defined(CONFIG_MACH_COMANCHE) \
	|| defined(CONFIG_MACH_EXPRESS) || defined(CONFIG_MACH_GOGH) \
	|| defined(CONFIG_MACH_INFINITE)
	/*|| ((defined(CONFIG_ISX012) || defined(CONFIG_DB8131M))\temp */

	if (rev) {
		int rc;

		struct pm_gpio param_flash = {
			.direction      = PM_GPIO_DIR_OUT,
			.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
			.output_value   = 0,
			.pull	   = PM_GPIO_PULL_NO,
			.vin_sel	= PM_GPIO_VIN_S4,
			.out_strength   = PM_GPIO_STRENGTH_MED,
			.function       = PM_GPIO_FUNC_NORMAL,
		};

		rc = pm8xxx_gpio_config(PM8921_GPIO_PM_TO_SYS
			(PMIC_MSM_FLASH_CNTL_EN), &param_flash);

		if (rc) {
			pr_err("%s pmic gpio config failed\n", __func__);
			return;
		}
		pmic_gpio_msm_flash_cntl_en =
			PM8921_GPIO_PM_TO_SYS(PMIC_MSM_FLASH_CNTL_EN);
	} else {
		pmic_gpio_msm_flash_cntl_en = 0;
	}
	isFlashCntlEn = false;
#endif
#endif

	msm8960_cam_create_node();

	msm_gpiomux_install(msm8960_cam_common_configs,
			ARRAY_SIZE(msm8960_cam_common_configs));

#if defined(CONFIG_S5C73M3) && defined(CONFIG_S5K6A3YX)
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
	gpio_tlmm_config(GPIO_CFG(gpio_rev(CAM_CORE_EN), 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#else
	gpio_tlmm_config(GPIO_CFG(CAM_CORE_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#endif
	gpio_tlmm_config(GPIO_CFG(CAM_MIPI_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_CAM_A_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_CAM_SENSOR_EN, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	gpio_tlmm_config(GPIO_CFG(ISP_RESET, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
	gpio_tlmm_config(GPIO_CFG(gpio_rev(CAM2_RST_N), 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#else
	gpio_tlmm_config(GPIO_CFG(CAM2_RST_N, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#endif

	gpio_cam_flash_sw = gpio_rev(CAM_FLASH_SW);
	gpio_tlmm_config(GPIO_CFG(gpio_cam_flash_sw, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	gpio_tlmm_config(GPIO_CFG(gpio_rev(CAM_AF_EN), 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);

	if (!pmic_gpio_msm_flash_cntl_en) {
		gpio_tlmm_config(GPIO_CFG(GPIO_MSM_FLASH_CNTL_EN, 0,
			GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	}
	gpio_tlmm_config(GPIO_CFG(GPIO_MSM_FLASH_NOW, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_PULL_DOWN, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
	gpio_tlmm_config(GPIO_CFG(GPIO_VT_CAM_SEN_DET, 0, GPIO_CFG_OUTPUT,
		GPIO_CFG_NO_PULL, GPIO_CFG_16MA), GPIO_CFG_ENABLE);
#endif

#if defined(CONFIG_S5C73M3)
	s_info = &msm_camera_sensor_s5c73m3_data;
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
	s_info->sensor_platform_info->sensor_pwd =
		gpio_rev(CAM_CORE_EN);
#endif
	msm_get_cam_resources(s_info);
	platform_device_register(cam_dev[0]);
#endif
#if defined(CONFIG_S5K6A3YX)
	s_info = &msm_camera_sensor_s5k6a3yx_data;
#if defined(CONFIG_MACH_M2_DCM) || defined(CONFIG_MACH_K2_KDI)
	s_info->sensor_platform_info->sensor_pwd =
		gpio_rev(CAM_CORE_EN);
#endif
	 if (rev) {
		s_info->sensor_platform_info->mclk =
			GPIO_CAM_MCLK2;
		s_info->gpio_conf->cam_gpiomux_conf_tbl =
			msm8960_cam_2d_configs_v2;
		s_info->gpio_conf->cam_gpio_tbl =
			msm_cam_gpio_2d_tbl_v2;
	}

	msm_get_cam_resources(s_info);
	platform_device_register(cam_dev[1]);
#endif
	if (spi_register_board_info(
				    s5c73m3_spi_info,
				    ARRAY_SIZE(s5c73m3_spi_info)) != 0)
		pr_err("%s: spi_register_board_info returned error\n",
			__func__);

	pr_err("[%s:%d]setting done!!\n", __func__, __LINE__);

	platform_device_register(&msm8960_device_csiphy0);
	platform_device_register(&msm8960_device_csiphy1);
	platform_device_register(&msm8960_device_csid0);
	platform_device_register(&msm8960_device_csid1);
	platform_device_register(&msm8960_device_ispif);
	platform_device_register(&msm8960_device_vfe);
	platform_device_register(&msm8960_device_vpe);
#ifdef CONFIG_LEDS_AAT1290A
	platform_device_register(&s3c_device_aat1290a_led);
#endif
}
int __init msm8960_init_gpiomux(void)
{
	int rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return rc;
	}

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm8960_ethernet_configs,
			ARRAY_SIZE(msm8960_ethernet_configs));
#endif

	msm_gpiomux_install(msm8960_gsbi_configs,
			ARRAY_SIZE(msm8960_gsbi_configs));

	msm8960_gpio_key_configs[0].gpio = gpio_rev(VOLUME_UP);
	msm8960_gpio_key_configs[1].gpio = gpio_rev(VOLUME_DOWN);
	msm_gpiomux_install(msm8960_gpio_key_configs,
		ARRAY_SIZE(msm8960_gpio_key_configs));

	msm_gpiomux_install(msm8960_sec_ts_configs,
			ARRAY_SIZE(msm8960_sec_ts_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

#ifndef CONFIG_SLIMBUS_MSM_CTRL
	msm_gpiomux_install(msm8960_audio_i2s_rx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));

	msm_gpiomux_install(msm8960_audio_i2s_tx_codec_configs,
			ARRAY_SIZE(msm8960_audio_i2s_tx_codec_configs));
#else
	msm_gpiomux_install(msm8960_slimbus_config,
			ARRAY_SIZE(msm8960_slimbus_config));

	msm_gpiomux_install(msm8960_audio_codec_configs,
			ARRAY_SIZE(msm8960_audio_codec_configs));

#endif

	msm_gpiomux_install(nc_configs,
	ARRAY_SIZE(nc_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	msm_gpiomux_install(msm8960_fsa9485_configs,
			ARRAY_SIZE(msm8960_fsa9485_configs));
#endif

	if (machine_is_msm8960_mtp() || machine_is_msm8960_fluid() ||
			machine_is_msm8960_liquid() || machine_is_msm8960_cdp())
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (PLATFORM_IS_CHARM25())
		msm_gpiomux_install(mdm_configs,
				ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if ((SOCINFO_VERSION_MAJOR(socinfo_get_version()) != 1) &&
			(PLATFORM_IS_CHARM25() || machine_is_msm8960_liquid()))
		msm_gpiomux_install(msm8960_hsic_configs,
				ARRAY_SIZE(msm8960_hsic_configs));
#endif

	msm_gpiomux_install(msm8960_hdmi_configs,
			ARRAY_SIZE(msm8960_hdmi_configs));

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	return 0;
}