static int lvds_pixel_remap(void)
{
	u32 ver = socinfo_get_version();

	if (machine_is_apq8064_cdp() ||
	    machine_is_apq8064_liquid()) {
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return LVDS_PIXEL_MAP_PATTERN_1;
	} else if (machine_is_mpq8064_dtv()) {
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return LVDS_PIXEL_MAP_PATTERN_2;
	}
	return 0;
}
static int msm_fb_detect_panel(const char *name)
{
	u32 version;
	if (machine_is_apq8064_liquid()) {
		version = socinfo_get_platform_version();
		if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
			(SOCINFO_VERSION_MINOR(version) == 1)) {
			if (!strncmp(name, MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_CHIMEI_WXGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		} else {
			if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
				strnlen(LVDS_CHIMEI_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
	} else if (machine_is_apq8064_mtp()) {
		if (!strncmp(name, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
			strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_apq8064_cdp()) {
		if (!strncmp(name, LVDS_CHIMEI_PANEL_NAME,
			strnlen(LVDS_CHIMEI_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
			return 0;
	} else if (machine_is_mpq8064_dtv()) {
		if (!strncmp(name, LVDS_FRC_PANEL_NAME,
			strnlen(LVDS_FRC_PANEL_NAME,
			PANEL_NAME_MAX_LEN))) {
			set_mdp_clocks_for_wuxga();
			return 0;
		}
	}

	if (!strncmp(name, HDMI_PANEL_NAME,
			strnlen(HDMI_PANEL_NAME,
				PANEL_NAME_MAX_LEN))) {
		if (apq8064_hdmi_as_primary_selected())
			set_mdp_clocks_for_wuxga();
		return 0;
	}


	return -ENODEV;
}
void __init apq8064_init_fb(void)
{
	platform_device_register(&msm_fb_device);
	platform_device_register(&lvds_chimei_panel_device);

#ifdef CONFIG_FB_MSM_WRITEBACK_MSM_PANEL
	platform_device_register(&wfd_panel_device);
	platform_device_register(&wfd_device);
#endif

	if (machine_is_apq8064_liquid())
		platform_device_register(&mipi_dsi2lvds_bridge_device);
	if (machine_is_apq8064_mtp())
		platform_device_register(&mipi_dsi_toshiba_panel_device);
	if (machine_is_mpq8064_dtv())
		platform_device_register(&lvds_frc_panel_device);

	msm_fb_register_device("mdp", &mdp_pdata);
	msm_fb_register_device("lvds", &lvds_pdata);
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
	platform_device_register(&hdmi_msm_device);
	msm_fb_register_device("dtv", &dtv_pdata);
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
	if (!(machine_is_mpq8064_hrd()))
		msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
		msm_gpiomux_install(mpq8064_gsbi5_uart_configs,
				ARRAY_SIZE(mpq8064_gsbi5_uart_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		if (machine_is_fsm8064_ep())
			msm_gpiomux_install(fsm8064_ep_gsbi_configs,
					ARRAY_SIZE(fsm8064_ep_gsbi_configs));
		else
			msm_gpiomux_install(apq8064_gsbi_configs,
					ARRAY_SIZE(apq8064_gsbi_configs));

		if (!(machine_is_apq8064_mtp() &&
		(SOCINFO_VERSION_MINOR(platform_version) == 1)))
			msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
				ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
	}
	if (machine_is_apq8064_mtp() &&
	(SOCINFO_VERSION_MINOR(platform_version) == 1)) {
			msm_gpiomux_install(apq8064_mic_i2s_configs,
				ARRAY_SIZE(apq8064_mic_i2s_configs));
			msm_gpiomux_install(apq8064_spkr_i2s_configs,
				ARRAY_SIZE(apq8064_spkr_i2s_configs));
			msm_gpiomux_install(apq8064_mi2s_configs,
				ARRAY_SIZE(apq8064_mi2s_configs));
			msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
	} else {
		if (!machine_is_fsm8064_ep()) {
			msm_gpiomux_install(apq8064_slimbus_config,
				ARRAY_SIZE(apq8064_slimbus_config));
		}
	}

	if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) && !machine_is_apq8064_mtp()) {
		msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
	}

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {

		msm_gpiomux_install(mpq8064_audio_auxpcm_configs,
			ARRAY_SIZE(mpq8064_audio_auxpcm_configs));

		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (!machine_is_mpq8064_hrd() && !machine_is_fsm8064_ep())
		msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	if (!machine_is_fsm8064_ep())
		msm_gpiomux_install(apq8064_hdmi_configs,
				ARRAY_SIZE(apq8064_hdmi_configs));

	if (apq8064_mhl_display_enabled())
		msm_gpiomux_install(apq8064_mhl_configs,
				ARRAY_SIZE(apq8064_mhl_configs));

	if (machine_is_mpq8064_cdp()) {
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

		msm_gpiomux_install(mpq8064_gsbi6_spi_configs,
				ARRAY_SIZE(mpq8064_gsbi6_spi_configs));
	}

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	if (!(machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv())) {
		msm_gpiomux_install(apq8064_sdc3_configs,
				ARRAY_SIZE(apq8064_sdc3_configs));
	}
	 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));

	if (machine_is_fsm8064_ep()) {
		msm_gpiomux_install(fsm8064_ep_boot_configs,
				    ARRAY_SIZE(fsm8064_ep_boot_configs));
		msm_gpiomux_install(fsm8064_ep_backup_configs,
				    ARRAY_SIZE(fsm8064_ep_backup_configs));
		msm_gpiomux_install(fsm8064_ep_uim_configs,
				    ARRAY_SIZE(fsm8064_ep_uim_configs));
		msm_gpiomux_install(fsm8064_ep_sync_configs,
				    ARRAY_SIZE(fsm8064_ep_sync_configs));
		msm_gpiomux_install(fsm8064_ep_led_configs,
				    ARRAY_SIZE(fsm8064_ep_led_configs));
	}
}
Beispiel #5
0
void __init apq8064_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
#if !defined(CONFIG_MACH_LGE)
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif

#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
#if !defined(CONFIG_MACH_LGE)
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif
#endif
		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}
#if defined(CONFIG_LGE_FELICA) || defined(CONFIG_LGE_NFC_SONY_CXD2235AGG)
	msm_gpiomux_install(apq8064_felica_uart_configs,
			ARRAY_SIZE(apq8064_felica_uart_configs));
#endif
	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

#ifdef CONFIG_LGE_IRRC
       msm_gpiomux_install(apq8064_irrc_configs,
                     ARRAY_SIZE(apq8064_irrc_configs));
       pr_debug("[IRRC] gpiomux_install");
#endif
	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

#if !defined(CONFIG_MACH_LGE)
	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));
#endif

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

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(cyts_gpio_configs,
				ARRAY_SIZE(cyts_gpio_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif
/* #ifndef CONFIG_LGE_FELICA_KDDI */
#if !defined(CONFIG_LGE_FELICA_KDDI) && !defined(CONFIG_LGE_FELICA_DCM)
/* [email protected] [START] for NFC */
#if defined(CONFIG_LGE_NFC)
	msm_gpiomux_install(apq8064_nfc_configs,
			ARRAY_SIZE(apq8064_nfc_configs));
#endif
#endif//endif of CONFIG_LGE_FELICA_KDDI, CONFIG_LGE_FELICA_DCM
/* [email protected] [END] for NFC */ 

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev < BOARD_REV09) {
		msm_gpiomux_install(sdc4_interface,
				ARRAY_SIZE(sdc4_interface));
		msm_gpiomux_install(sd_ls_en_60_config,
				ARRAY_SIZE(sd_ls_en_60_config));
	} else {
		msm_gpiomux_install(sdc2_interface,
				ARRAY_SIZE(sdc2_interface));
		msm_gpiomux_install(sd_ls_en_64_config,
				ARRAY_SIZE(sd_ls_en_64_config));
	}
#else
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_nc_configs,
			ARRAY_SIZE(apq8064_nc_configs));

	msm_gpiomux_install(sensorhub_configs,
			ARRAY_SIZE(sensorhub_configs));
	if (system_rev > BOARD_REV11)
		msm_gpiomux_install(nfc_firmware_configs,
			ARRAY_SIZE(nfc_firmware_configs));

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	msm_gpiomux_install(apq8064_auxpcm_configs,
		ARRAY_SIZE(apq8064_auxpcm_configs));		

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
					ARRAY_SIZE(bmdm_configs));
		} else if (socinfo_get_platform_subtype() ==
				PLATFORM_SUBTYPE_SGLTE2) {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
			msm_gpiomux_install(sglte2_qsc_configs,
					ARRAY_SIZE(sglte2_qsc_configs));

			/* GSBI4 UART GPIOs for Primary IPC */
			msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
					ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		} else {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}
	}

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()|| machine_is_JF())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

	if (system_rev < BOARD_REV10)
		msm_gpiomux_install(msm8064_sd_det_config,
				ARRAY_SIZE(msm8064_sd_det_config));

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

#if defined(CONFIG_LEDS_AN30259A)
	msm_gpiomux_install(apq8064_leds_configs,
		ARRAY_SIZE(apq8064_leds_configs));
#endif

#ifdef CONFIG_KEYBOARD_CYPRESS_TOUCH_236
	printk(KERN_INFO"cypress gpio init in %s",__func__);
	if (system_rev > BOARD_REV10)
		msm_gpiomux_install(apq8064_tkey_config,
				ARRAY_SIZE(apq8064_tkey_config));
#endif

#ifdef CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI
	if (system_rev >= BOARD_REV09) {
		printk(KERN_INFO "%s: config touch_irq config.\n",__func__);
		msm_gpiomux_install(apq8064_touch_irq_config,
				ARRAY_SIZE(apq8064_touch_irq_config));
	}
#endif
#ifdef CONFIG_MFD_MAX77693
	msm_gpiomux_install(apq8064_muic_config,
		ARRAY_SIZE(apq8064_muic_config));
#endif
	msm_gpiomux_install(apq8064_sec_jack_configs,
			ARRAY_SIZE(apq8064_sec_jack_configs));
	if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
#ifndef CONFIG_MACH_APQ8064_FIND5
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif

#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif

#ifndef CONFIG_MACH_APQ8064_FIND5
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
#endif
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
#ifdef CONFIG_MACH_APQ8064_FIND5
		if (get_pcb_version() >= PCB_VERSION_DVT) {
			msm_gpiomux_install(apq8064_gsbi7_i2c_config, ARRAY_SIZE(apq8064_gsbi7_i2c_config));
		}
#endif
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

#ifdef CONFIG_MACH_APQ8064_FIND5
	msm_gpiomux_install(apq8064_backlight_enable,
			ARRAY_SIZE(apq8064_backlight_enable));
#endif

	if (machine_is_apq8064_mtp()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
				ARRAY_SIZE(bmdm_configs));
		} else if (socinfo_get_platform_subtype() ==
					PLATFORM_SUBTYPE_SGLTE2) {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
			msm_gpiomux_install(sglte2_qsc_configs,
					ARRAY_SIZE(sglte2_qsc_configs));

			/* GSBI4 UART GPIOs for Primary IPC */
			msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
				ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		} else {
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
		}
	}

	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
	
/* OPPO 2012-11-14 DuYuanHua Add to config GPIO_72 as input pin for sim card detection */
#ifdef OPPO_FEATURE_UIM_CARD_HOTSWAP
	msm_gpiomux_install(apq8064_uim_card_detection_configs,
			ARRAY_SIZE(apq8064_uim_card_detection_configs));
#endif
/* OPPO 2012-11-14 DuYuanHua Add End*/

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
	 if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_uartdm_configs,
				ARRAY_SIZE(mpq8064_uartdm_configs));
}
void __init apq8064_init_gpiomux(void)
{
    int rc;

    rc = msm_gpiomux_init(NR_GPIO_IRQS);
    if (rc) {
        pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
        return;
    }

    msm_gpiomux_install(wcnss_5wire_interface,
                        ARRAY_SIZE(wcnss_5wire_interface));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
                            ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
        msm_gpiomux_install(vcap_configs,
                            ARRAY_SIZE(vcap_configs));
#endif
        msm_gpiomux_install(sx150x_int_configs,
                            ARRAY_SIZE(sx150x_int_configs));
    } else {
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
        msm_gpiomux_install(apq8064_ethernet_configs,
                            ARRAY_SIZE(apq8064_ethernet_configs));
#endif

        msm_gpiomux_install(apq8064_gsbi_configs,
                            ARRAY_SIZE(apq8064_gsbi_configs));
    }

    msm_gpiomux_install(apq8064_slimbus_config,
                        ARRAY_SIZE(apq8064_slimbus_config));

    msm_gpiomux_install(apq8064_audio_codec_configs,
                        ARRAY_SIZE(apq8064_audio_codec_configs));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_spkr_i2s_config,
                            ARRAY_SIZE(mpq8064_spkr_i2s_config));
    }

    pr_debug("%s(): audio-auxpcm: Include GPIO configs"
             " as audio is not the primary user"
             " for these GPIO Pins\n", __func__);

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv())
        msm_gpiomux_install(mpq8064_mi2s_configs,
                            ARRAY_SIZE(mpq8064_mi2s_configs));

    msm_gpiomux_install(apq8064_ext_regulator_configs,
                        ARRAY_SIZE(apq8064_ext_regulator_configs));

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

    if (machine_is_apq8064_mtp())
        msm_gpiomux_install(cyts_gpio_configs,
                            ARRAY_SIZE(cyts_gpio_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
    if (machine_is_apq8064_mtp())
        msm_gpiomux_install(apq8064_hsic_configs,
                            ARRAY_SIZE(apq8064_hsic_configs));
#endif

    if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
        msm_gpiomux_install(apq8064_mxt_configs,
                            ARRAY_SIZE(apq8064_mxt_configs));

    msm_gpiomux_install(apq8064_hdmi_configs,
                        ARRAY_SIZE(apq8064_hdmi_configs));

    if (machine_is_mpq8064_cdp())
        msm_gpiomux_install(mpq8064_ir_configs,
                            ARRAY_SIZE(mpq8064_ir_configs));
}
Beispiel #9
0
void __init apq8064_init_gpiomux(void)
{
    int rc;
    int platform_version = socinfo_get_platform_version();

    rc = msm_gpiomux_init(NR_GPIO_IRQS);
    if (rc) {
        pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
        return;
    }

    msm_gpiomux_install(wcnss_5wire_interface,
                        ARRAY_SIZE(wcnss_5wire_interface));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
                            ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
        msm_gpiomux_install(vcap_configs,
                            ARRAY_SIZE(vcap_configs));
#endif
        msm_gpiomux_install(sx150x_int_configs,
                            ARRAY_SIZE(sx150x_int_configs));
    } else {
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
        /*added by congshan 20121008 start*/
#ifdef CONFIG_ZTEMT_MHL_8064
#else
        msm_gpiomux_install(apq8064_ethernet_configs,
                            ARRAY_SIZE(apq8064_ethernet_configs));
#endif
        /*added by congshan 20121008 end*/
#endif
        msm_gpiomux_install(apq8064_gsbi_configs,
                            ARRAY_SIZE(apq8064_gsbi_configs));
    }

    msm_gpiomux_install(apq8064_slimbus_config,
                        ARRAY_SIZE(apq8064_slimbus_config));

    msm_gpiomux_install(apq8064_audio_codec_configs,
                        ARRAY_SIZE(apq8064_audio_codec_configs));

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv()) {
        msm_gpiomux_install(mpq8064_spkr_i2s_config,
                            ARRAY_SIZE(mpq8064_spkr_i2s_config));
    }

    pr_debug("%s(): audio-auxpcm: Include GPIO configs"
             " as audio is not the primary user"
             " for these GPIO Pins\n", __func__);

    if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
            machine_is_mpq8064_dtv())
        msm_gpiomux_install(mpq8064_mi2s_configs,
                            ARRAY_SIZE(mpq8064_mi2s_configs));

    msm_gpiomux_install(apq8064_ext_regulator_configs,
                        ARRAY_SIZE(apq8064_ext_regulator_configs));

    if (machine_is_apq8064_mtp()) {
        if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
            msm_gpiomux_install(amdm_configs,
                                ARRAY_SIZE(amdm_configs));
            msm_gpiomux_install(bmdm_configs,
                                ARRAY_SIZE(bmdm_configs));
        } else if (socinfo_get_platform_subtype() ==
                   PLATFORM_SUBTYPE_SGLTE2) {
            msm_gpiomux_install(mdm_configs,
                                ARRAY_SIZE(mdm_configs));
            msm_gpiomux_install(sglte2_qsc_configs,
                                ARRAY_SIZE(sglte2_qsc_configs));

            /* GSBI4 UART GPIOs for Primary IPC */
            msm_gpiomux_install(apq8064_uartdm_gsbi4_configs,
                                ARRAY_SIZE(apq8064_uartdm_gsbi4_configs));
        } else if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
            msm_gpiomux_install(mdm_i2s_configs,
                                ARRAY_SIZE(mdm_i2s_configs));
        } else {
            msm_gpiomux_install(mdm_configs,
                                ARRAY_SIZE(mdm_configs));
        }
    }

    if (machine_is_apq8064_mtp()) {
        if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
            msm_gpiomux_install(cyts_gpio_alt_config,
                                ARRAY_SIZE(cyts_gpio_alt_config));
        } else {
            msm_gpiomux_install(cyts_gpio_configs,
                                ARRAY_SIZE(cyts_gpio_configs));
        }
    }

#ifdef CONFIG_USB_EHCI_MSM_HSIC
    if (machine_is_apq8064_mtp())
        msm_gpiomux_install(apq8064_hsic_configs,
                            ARRAY_SIZE(apq8064_hsic_configs));
#endif

    if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
        msm_gpiomux_install(apq8064_mxt_configs,
                            ARRAY_SIZE(apq8064_mxt_configs));

    msm_gpiomux_install(apq8064_hdmi_configs,
                        ARRAY_SIZE(apq8064_hdmi_configs));

    if (machine_is_mpq8064_cdp())
        msm_gpiomux_install(mpq8064_ir_configs,
                            ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
    msm_gpiomux_install(apq8064_sdc2_configs,
                        ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
    msm_gpiomux_install(apq8064_sdc4_configs,
                        ARRAY_SIZE(apq8064_sdc4_configs));
#endif

    msm_gpiomux_install(apq8064_sdc3_configs,
                        ARRAY_SIZE(apq8064_sdc3_configs));
    /*added by congshan 20121008 start*/
#ifdef CONFIG_ZTEMT_MHL_8064
    msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
                        ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif
    /*added by congshan 20121008 end*/
    /* ZTEMT Added by LiuYongfeng, 2012/10/10 */
#ifdef CONFIG_SERIAL_MSM_HSL
    msm_gpiomux_install(mpq8064_gsbi5_uart_configs,
                        ARRAY_SIZE(mpq8064_gsbi5_uart_configs));
#endif
    /* ZTEMT END */
    //# config the sensors' gpio
#ifdef CONFIG_ZTEMT_SENSORS
    msm_gpiomux_install(sensors_gpio_configs, ARRAY_SIZE(sensors_gpio_configs));
#endif
    if (machine_is_mpq8064_hrd() || machine_is_mpq8064_dtv())
        msm_gpiomux_install(mpq8064_uartdm_configs,
                            ARRAY_SIZE(mpq8064_uartdm_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
#ifdef CONFIG_SWITCH_MAX1462X
	msm_gpiomux_install(apq8064_earjack_configs,
			ARRAY_SIZE(apq8064_earjack_configs));
#endif
#ifndef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif
	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

#if defined(CONFIG_ANDROID_IRRC)
	msm_gpiomux_install(apq8064_irrc_tx_configs,
			ARRAY_SIZE(apq8064_irrc_tx_configs));
#endif

#ifdef CONFIG_SND_SOC_TPA2028D_DUAL_SPEAKER
	msm_gpiomux_install(apq8064_gsbi7_i2c_8ma_configs,
					ARRAY_SIZE(apq8064_gsbi7_i2c_8ma_configs));
#endif

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

#if defined(CONFIG_MODEM_SUPPORT)
	if (machine_is_apq8064_mtp()) {
		if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_DSDA2) {
			msm_gpiomux_install(amdm_configs,
					ARRAY_SIZE(amdm_configs));
			msm_gpiomux_install(bmdm_configs,
				ARRAY_SIZE(bmdm_configs));
		} else if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}
#endif

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
#if defined (CONFIG_SLIMPORT_ANX7808)
	msm_gpiomux_install(apq8064_slimport_configs,
			ARRAY_SIZE(apq8064_slimport_configs));
    pr_err("[Slimport] revision = %d gpiomux install complete!\n", lge_get_board_revno());
#endif

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(apq8064_sdc2_configs,
			ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	msm_gpiomux_install(apq8064_sdc4_configs,
			ARRAY_SIZE(apq8064_sdc4_configs));
#endif
	msm_gpiomux_install(apq8064_sdc3_configs_chg,
			ARRAY_SIZE(apq8064_sdc3_configs_chg));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;

//wangtao fusion3-debug begin
if (machine_is_apq8064_cdp())    // yes, it is cdp device defaultly
{
 printk(KERN_ERR "wangtao: this is cdp platform \n");   
}

if (machine_is_apq8064_mtp())   
{
 printk(KERN_ERR "wangtao: this is mtp platform \n");   
}	
//wangtao fusion3-debug end
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

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

#ifdef CONFIG_USB_EHCI_MSM_HSIC
//wangtao fusion3-debug begin
/*
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(cyts_gpio_configs,
				ARRAY_SIZE(cyts_gpio_configs));
*/
//wangtao fusion3-debug end
	

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

//wangtao fusion3-debug begin
//mtp
//	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
//wangtao fusion3-debug end	
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));
#if !defined(CONFIG_PROJECT_P864A20) && !defined(CONFIG_PROJECT_P864G02)		//jiaobaocun deleted for gsbi5
/*[ECID:000000] ZTEBSP shihuiqin, for video_lms501, 20120525*/
	msm_gpiomux_install(apq8064_lcd_z751_gpio_configs,
			ARRAY_SIZE(apq8064_lcd_z751_gpio_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	if (system_rev < BOARD_REV08)
		msm_gpiomux_install(sdc4_interface,
				ARRAY_SIZE(sdc4_interface));
	else
		msm_gpiomux_install(sdc2_interface,
				ARRAY_SIZE(sdc2_interface));
#else
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

/*	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	} */

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_mtp()|| machine_is_JF()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()|| machine_is_JF())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

	msm_gpiomux_install(msm8064_sd_det_config,
			ARRAY_SIZE(msm8064_sd_det_config));

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

#if defined(CONFIG_LEDS_AN30259A)
	msm_gpiomux_install(apq8064_leds_configs,
		ARRAY_SIZE(apq8064_leds_configs));
#endif
#ifdef CONFIG_MFD_MAX77693
	msm_gpiomux_install(apq8064_muic_config,
		ARRAY_SIZE(apq8064_muic_config));
#endif
}
void __init apq8064_init_mmc(void)
{
	if ((machine_is_apq8064_rumi3()) || machine_is_apq8064_sim()) {
		if (apq8064_sdc1_pdata) {
			if (machine_is_apq8064_sim())
				apq8064_sdc1_pdata->disable_bam = true;
			apq8064_sdc1_pdata->disable_runtime_pm = true;
			apq8064_sdc1_pdata->disable_cmd23 = true;
		}
		if (apq8064_sdc3_pdata) {
			if (machine_is_apq8064_sim())
				apq8064_sdc3_pdata->disable_bam = true;
			apq8064_sdc3_pdata->disable_runtime_pm = true;
			apq8064_sdc3_pdata->disable_cmd23 = true;
		}
	}

	if (apq8064_sdc1_pdata)
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);

	if (apq8064_sdc2_pdata)
		apq8064_add_sdcc(2, apq8064_sdc2_pdata);

	if (apq8064_sdc3_pdata) {
		if (!machine_is_apq8064_cdp()) {
			apq8064_sdc3_pdata->wpswitch_gpio = 0;
			apq8064_sdc3_pdata->is_wpswitch_active_low = false;
		}
		if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
			machine_is_mpq8064_dtv()) {
			int rc;
			struct pm_gpio sd_card_det_init_cfg = {
				.direction      = PM_GPIO_DIR_IN,
				.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
				.pull           = PM_GPIO_PULL_UP_30,
				.vin_sel        = PM_GPIO_VIN_S4,
				.out_strength   = PM_GPIO_STRENGTH_NO,
				.function       = PM_GPIO_FUNC_NORMAL,
			};

			apq8064_sdc3_pdata->status_gpio =
				PM8921_GPIO_PM_TO_SYS(31);
			apq8064_sdc3_pdata->status_irq =
				PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 31);
			rc = pm8xxx_gpio_config(apq8064_sdc3_pdata->status_gpio,
					&sd_card_det_init_cfg);
			if (rc) {
				pr_info("%s: SD_CARD_DET GPIO%d config "
					"failed(%d)\n", __func__,
					apq8064_sdc3_pdata->status_gpio, rc);
				apq8064_sdc3_pdata->status_gpio = 0;
				apq8064_sdc3_pdata->status_irq = 0;
			}
		}
		if (machine_is_apq8064_cdp()) {
			int i;

			for (i = 0;
			     i < apq8064_sdc3_pdata->pin_data->pad_data->\
				 drv->size;
			     i++)
				apq8064_sdc3_pdata->pin_data->pad_data->\
					drv->on[i].val = GPIO_CFG_10MA;
		}
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
void __init apq8064_init_mmc(void)
{
	if (apq8064_sdc1_pdata) {
		/* 8064 v2 supports upto 200MHz clock on SDC1 slot */
		if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) {
			apq8064_sdc1_pdata->sup_clk_table =
					sdc1_sup_clk_rates_all;
			apq8064_sdc1_pdata->sup_clk_cnt	=
					ARRAY_SIZE(sdc1_sup_clk_rates_all);
		}
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);
	}
#if defined(CONFIG_MACH_JFVE_EUR)
	apq8064_sdc2_pdata = NULL;
	apq8064_sdc4_pdata = NULL;

	// SDC3 is used for External memory Card
	if (apq8064_sdc3_pdata)
   {  
		apq8064_sdc3_pdata->status_gpio = PM8921_GPIO_PM_TO_SYS(33);
		apq8064_sdc3_pdata->status_irq	= PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 33);

		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
   }
#else
/*
	if (apq8064_sdc2_pdata)
		apq8064_add_sdcc(2, apq8064_sdc2_pdata);
*/
/* system_rev 0x05 or more
 * SDC3 is used for WIFI
    SDC4 is used for External memory Card
 */
	if (apq8064_sdc3_pdata) {

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
		mmc_vdd_reg_data[SDCC3].high_vol_level = 1800000;
		mmc_vdd_reg_data[SDCC3].low_vol_level = 1800000;
		mmc_slot_vreg_data[SDCC3].vdd_io_data = NULL;
		apq8064_sdc3_pdata->status_irq = 0;
		apq8064_sdc3_pdata->status_gpio = 0;
#endif
#if !defined(CONFIG_BCM4335) && !defined(CONFIG_BCM4335_MODULE)
		if (!machine_is_apq8064_cdp()) {
			apq8064_sdc3_pdata->wpswitch_gpio = 0;
			apq8064_sdc3_pdata->is_wpswitch_active_low = false;
		}
		if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
			machine_is_mpq8064_dtv()) {
			int rc;
			struct pm_gpio sd_card_det_init_cfg = {
				.direction      = PM_GPIO_DIR_IN,
				.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
				.pull           = PM_GPIO_PULL_UP_30,
				.vin_sel        = PM_GPIO_VIN_S4,
				.out_strength   = PM_GPIO_STRENGTH_NO,
				.function       = PM_GPIO_FUNC_NORMAL,
			};

			apq8064_sdc3_pdata->status_gpio =
				PM8921_GPIO_PM_TO_SYS(31);
			apq8064_sdc3_pdata->status_irq =
				PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 31);
			rc = pm8xxx_gpio_config(apq8064_sdc3_pdata->status_gpio,
					&sd_card_det_init_cfg);
			if (rc) {
				pr_info("%s: SD_CARD_DET GPIO%d config "
					"failed(%d)\n", __func__,
					apq8064_sdc3_pdata->status_gpio, rc);
				apq8064_sdc3_pdata->status_gpio = 0;
				apq8064_sdc3_pdata->status_irq = 0;
			}
		}
		if (machine_is_apq8064_cdp()) {
			int i;

			for (i = 0;
			     i < apq8064_sdc3_pdata->pin_data->pad_data->\
				 drv->size;
			     i++)
				apq8064_sdc3_pdata->pin_data->pad_data->\
					drv->on[i].val = GPIO_CFG_10MA;
		}
#endif
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_APQ8064_ALTEV
	hw_rev_type lge_bd_rev = HW_REV_EVB1;//                                             
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
#ifdef CONFIG_SWITCH_MAX1462X
       msm_gpiomux_install(apq8064_earjack_configs,
                            ARRAY_SIZE(apq8064_earjack_configs));
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));

#if !defined(CONFIG_MACH_LGE)
		if (!(machine_is_apq8064_mtp() &&
		(SOCINFO_VERSION_MINOR(platform_version) == 1)))
			msm_gpiomux_install(apq8064_non_mi2s_gsbi_configs,
				ARRAY_SIZE(apq8064_non_mi2s_gsbi_configs));
#endif
	}
	if (machine_is_apq8064_mtp() &&
	(SOCINFO_VERSION_MINOR(platform_version) == 1)) {
			msm_gpiomux_install(apq8064_mic_i2s_configs,
				ARRAY_SIZE(apq8064_mic_i2s_configs));
			msm_gpiomux_install(apq8064_spkr_i2s_configs,
				ARRAY_SIZE(apq8064_spkr_i2s_configs));
			msm_gpiomux_install(apq8064_mi2s_configs,
				ARRAY_SIZE(apq8064_mi2s_configs));
			msm_gpiomux_install(apq8064_gsbi1_i2c_2ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_2ma_configs));
	} else {
		msm_gpiomux_install(apq8064_slimbus_config,
				ARRAY_SIZE(apq8064_slimbus_config));
		msm_gpiomux_install(apq8064_gsbi1_i2c_8ma_configs,
				ARRAY_SIZE(apq8064_gsbi1_i2c_8ma_configs));
	}

#if defined(CONFIG_LGE_IRRC)
       msm_gpiomux_install(apq8064_irrc_configs,
                     ARRAY_SIZE(apq8064_irrc_configs));
       pr_debug("[IRRC] gpiomux_install");
#endif

#if defined(CONFIG_ANDROID_SW_IRRC)
		msm_gpiomux_install(apq8064_irrc_tx_configs,
			ARRAY_SIZE(apq8064_irrc_tx_configs));
	pr_debug("[SW IRRC] gpiomux_install");
#endif


#if defined(CONFIG_SND_SOC_TPA2028D_DUAL_SPEAKER)
	msm_gpiomux_install(apq8064_gsbi7_i2c_8ma_configs,
					ARRAY_SIZE(apq8064_gsbi7_i2c_8ma_configs));
	pr_debug("[DUAL AMP] gpiomux_install");
#endif

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));


// kyle00.choi, 20130402, To feature out the modem. [START]
#if defined(CONFIG_MODEM_SUPPORT)
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));

	}
#endif
// kyle00.choi, 20130402, To feature out the modem. [START]

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif
/*                                  */
#if defined(CONFIG_LGE_NFC)
		msm_gpiomux_install(apq8064_nfc_configs,
		ARRAY_SIZE(apq8064_nfc_configs));
#endif
/*                                */ 

//                                                                   
//                                             
//ADD: 0019632: [F200][BT] Bluetooth board bring-up
#ifdef CONFIG_LGE_BLUESLEEP
	msm_gpiomux_install(bt_pcm_configs,
			ARRAY_SIZE(bt_pcm_configs));
	msm_gpiomux_install(mpq8064_uartdm_configs,
			ARRAY_SIZE(mpq8064_uartdm_configs));
/* 	msm_gpiomux_install(gsbi6_uart_configs,
		 	ARRAY_SIZE(gsbi6_uart_configs)); */

	msm_gpiomux_install(msm8960_bt_host_wakeup_configs,
			ARRAY_SIZE(msm8960_bt_host_wakeup_configs));

	msm_gpiomux_install(msm8960_bt_wakeup_configs,
			ARRAY_SIZE(msm8960_bt_wakeup_configs));
#endif
//                                           
//                                                                   
	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
//                                                                          
//                                                          
#if defined (CONFIG_SLIMPORT_ANX7808)
        msm_gpiomux_install(apq8064_slimport_configs,
			ARRAY_SIZE(apq8064_slimport_configs));
    pr_err("[Slimport] revision = %d gpiomux install complete!\n", lge_get_board_revno());
#endif
//                                                        
//                                                                        

#if !defined (CONFIG_MACH_LGE)
	if (apq8064_mhl_display_enabled())
		msm_gpiomux_install(apq8064_mhl_configs,
				ARRAY_SIZE(apq8064_mhl_configs));
#endif

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#else
		msm_gpiomux_install(apq8064_sdc2_not_configs,
				     ARRAY_SIZE(apq8064_sdc2_not_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif
	 	msm_gpiomux_install(apq8064_sdc3_configs_chg,
				ARRAY_SIZE(apq8064_sdc3_configs_chg));
				


#if defined(CONFIG_BATTERY_MAX17043) || defined(CONFIG_BATTERY_MAX17047) || defined(CONFIG_BATTERY_MAX17048)
		msm_gpiomux_install(apq8064_fuel_gauge_configs,
				ARRAY_SIZE(apq8064_fuel_gauge_configs));
#endif

#if defined(CONFIG_BQ24262_CHARGER)
	msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
			ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif

//                                             

}
void __init apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_ASUSTEK
	hw_rev revision = HW_REV_INVALID;
	revision = asustek_get_hw_rev();
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(msm8960_mdp_vsync_configs,
			ARRAY_SIZE(msm8960_mdp_vsync_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
	}

#ifdef CONFIG_MACH_ASUSTEK
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		msm_gpiomux_install(asustek_pcbid_pins_configs,
			ARRAY_SIZE(asustek_pcbid_pins_configs));

		if (revision == HW_REV_B) {
			msm_gpiomux_install(asustek_gpio_keys_configs,
				ARRAY_SIZE(asustek_gpio_keys_configs));
		}

		msm_gpiomux_install(asustek_pwr_keys_configs,
			ARRAY_SIZE(asustek_pwr_keys_configs));
	}
#endif

	msm_gpiomux_install(gpio_bat_low_configs,
			ARRAY_SIZE(gpio_bat_low_configs));


	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));
/*
	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));
*/
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1)
			msm_gpiomux_install(mdm_i2s_configs,
					ARRAY_SIZE(mdm_i2s_configs));
		else
			msm_gpiomux_install(mdm_configs,
					ARRAY_SIZE(mdm_configs));
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if (SOCINFO_VERSION_MINOR(platform_version) == 1) {
			msm_gpiomux_install(cyts_gpio_alt_config,
					ARRAY_SIZE(cyts_gpio_alt_config));
		} else {
			msm_gpiomux_install(cyts_gpio_configs,
					ARRAY_SIZE(cyts_gpio_configs));
		}
	}

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC3_SUPPORT
	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
#endif
	//add touch
	msm_gpiomux_install(msm8064_ts_gpio_config,
			ARRAY_SIZE(msm8064_ts_gpio_config));  

	msm_gpiomux_install(smb345_pin_configs,
			ARRAY_SIZE(smb345_pin_configs));

	switch (revision) {
	case HW_REV_B:
	case HW_REV_C:
	case HW_REV_D:
	case HW_REV_E:
		msm_gpiomux_install(wpc_pok_configs,
			ARRAY_SIZE(wpc_pok_configs));
		break;
	default:
		break;
	}

	if (machine_is_apq8064_flo() || machine_is_apq8064_deb())
		msm_gpiomux_install(apq8064_bcm2079x_nfc_configs,
			ARRAY_SIZE(apq8064_bcm2079x_nfc_configs));
#ifdef CONFIG_SLIMPORT_ANX7808
	msm_gpiomux_install(msm8064_sp_gpio_config,
			ARRAY_SIZE(msm8064_sp_gpio_config));
#endif
	msm_gpiomux_install(apq8064_headphone_configs,
			ARRAY_SIZE(apq8064_headphone_configs));

	msm_gpiomux_install(asustek_gsbi4_configs,
		ARRAY_SIZE(asustek_gsbi4_configs));

#ifdef CONFIG_INPUT_LID
	if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) {
		if ((revision == HW_REV_C) || (revision == HW_REV_D) || (revision == HW_REV_E)) {
			msm_gpiomux_install(asustek_hall_sensor_configs,
			ARRAY_SIZE(asustek_hall_sensor_configs));
		}
	}
#endif

}
void __init apq8064_init_mmc(void)
{
	if (apq8064_sdc1_pdata) {
		/* 8064 v2 supports upto 200MHz clock on SDC1 slot */
		if (SOCINFO_VERSION_MAJOR(socinfo_get_version()) >= 2) {
			apq8064_sdc1_pdata->sup_clk_table =
					sdc1_sup_clk_rates_all;
			apq8064_sdc1_pdata->sup_clk_cnt	=
					ARRAY_SIZE(sdc1_sup_clk_rates_all);
		}
		apq8064_add_sdcc(1, apq8064_sdc1_pdata);
	}

	msm_add_uio();

	if (apq8064_sdc2_pdata)
		apq8064_add_sdcc(2, apq8064_sdc2_pdata);

	if (apq8064_sdc3_pdata) {
		if (!machine_is_apq8064_cdp()) {
			apq8064_sdc3_pdata->wpswitch_gpio = 0;
#if defined(CONFIG_MACH_LGE)
			//apq8064_sdc3_pdata->is_wpswitch_active_low = false;
#endif
		}
		if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
			machine_is_mpq8064_dtv()) {
			int rc;
			struct pm_gpio sd_card_det_init_cfg = {
				.direction      = PM_GPIO_DIR_IN,
				.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
				.pull           = PM_GPIO_PULL_UP_30,
				.vin_sel        = PM_GPIO_VIN_S4,
				.out_strength   = PM_GPIO_STRENGTH_NO,
				.function       = PM_GPIO_FUNC_NORMAL,
			};

			apq8064_sdc3_pdata->status_gpio =
				PM8921_GPIO_PM_TO_SYS(31);
			apq8064_sdc3_pdata->status_irq =
				PM8921_GPIO_IRQ(PM8921_IRQ_BASE, 31);
			rc = pm8xxx_gpio_config(apq8064_sdc3_pdata->status_gpio,
					&sd_card_det_init_cfg);
			if (rc) {
				pr_info("%s: SD_CARD_DET GPIO%d config "
					"failed(%d)\n", __func__,
					apq8064_sdc3_pdata->status_gpio, rc);
				apq8064_sdc3_pdata->status_gpio = 0;
				apq8064_sdc3_pdata->status_irq = 0;
			}
		}
		if (machine_is_apq8064_cdp()) {
			int i;

			for (i = 0;
			     i < apq8064_sdc3_pdata->pin_data->pad_data->\
				 drv->size;
			     i++)
				apq8064_sdc3_pdata->pin_data->pad_data->\
					drv->on[i].val = GPIO_CFG_10MA;
		}
		apq8064_add_sdcc(3, apq8064_sdc3_pdata);
	}
void __init apq8064_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		 machine_is_mpq8064_dtv()) {
/* OPPO 2012-08-29 chenzj Delete begin for del unused code */
#if 0
		msm_gpiomux_install(mpq8064_gsbi5_i2c_configs,
				ARRAY_SIZE(mpq8064_gsbi5_i2c_configs));
#endif
/* OPPO 2012-08-29 chenzj Delete end */
#ifdef CONFIG_MSM_VCAP
		msm_gpiomux_install(vcap_configs,
				ARRAY_SIZE(vcap_configs));
#endif
//OPPO 2012-12-18 huyu del for lcd 5V_enable for dvt
#ifndef CONFIG_VENDOR_EDIT
		msm_gpiomux_install(sx150x_int_configs,
				ARRAY_SIZE(sx150x_int_configs));
#endif
//OPPO 2012-12-18 huyu del for lcd 5V_enable for dvt
	} else {
		#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(apq8064_ethernet_configs,
				ARRAY_SIZE(apq8064_ethernet_configs));
		#endif

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));
/* OPPO 2012-12-14 yxq added begin for s5k6a3yx's I2C */
		if (get_pcb_version() >= 30) {
			msm_gpiomux_install(apq8064_gsbi7_i2c_config, ARRAY_SIZE(apq8064_gsbi7_i2c_config));
		}
/* OPPO 2012-12-14 yxq added end */
	}

	msm_gpiomux_install(apq8064_slimbus_config,
			ARRAY_SIZE(apq8064_slimbus_config));

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv()) {
		msm_gpiomux_install(mpq8064_spkr_i2s_config,
			ARRAY_SIZE(mpq8064_spkr_i2s_config));
	}

	pr_debug("%s(): audio-auxpcm: Include GPIO configs"
		" as audio is not the primary user"
		" for these GPIO Pins\n", __func__);

	if (machine_is_mpq8064_cdp() || machine_is_mpq8064_hrd() ||
		machine_is_mpq8064_dtv())
		msm_gpiomux_install(mpq8064_mi2s_configs,
			ARRAY_SIZE(mpq8064_mi2s_configs));

	msm_gpiomux_install(apq8064_ext_regulator_configs,
			ARRAY_SIZE(apq8064_ext_regulator_configs));

//OPPO 2012-11-2 huyu add for lcd backlight enabl
#ifdef CONFIG_VENDOR_EDIT
	msm_gpiomux_install(apq8064_backlight_enable,
			ARRAY_SIZE(apq8064_backlight_enable));
#endif
//OPPO 2012-11-2 huyu add for lcd backlight enabl
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(cyts_gpio_configs,
				ARRAY_SIZE(cyts_gpio_configs));

	if (machine_is_apq8064_mtp())
		msm_gpiomux_install(apq8064_hsic_configs,
				ARRAY_SIZE(apq8064_hsic_configs));
#endif

	if (machine_is_apq8064_cdp() || machine_is_apq8064_liquid())
		msm_gpiomux_install(apq8064_mxt_configs,
			ARRAY_SIZE(apq8064_mxt_configs));

	msm_gpiomux_install(apq8064_hdmi_configs,
			ARRAY_SIZE(apq8064_hdmi_configs));
	
/* OPPO 2012-11-14 DuYuanHua Add to config GPIO_72 as input pin for sim card detection */
#ifdef OPPO_FEATURE_UIM_CARD_HOTSWAP
	msm_gpiomux_install(apq8064_uim_card_detection_configs,
			ARRAY_SIZE(apq8064_uim_card_detection_configs));
#endif
/* OPPO 2012-11-14 DuYuanHua Add End*/

	 if (machine_is_mpq8064_cdp())
		msm_gpiomux_install(mpq8064_ir_configs,
				ARRAY_SIZE(mpq8064_ir_configs));

#ifdef CONFIG_MMC_MSM_SDC2_SUPPORT
	 msm_gpiomux_install(apq8064_sdc2_configs,
			     ARRAY_SIZE(apq8064_sdc2_configs));
#endif

#ifdef CONFIG_MMC_MSM_SDC4_SUPPORT
	 msm_gpiomux_install(apq8064_sdc4_configs,
			     ARRAY_SIZE(apq8064_sdc4_configs));
#endif

	msm_gpiomux_install(apq8064_sdc3_configs,
			ARRAY_SIZE(apq8064_sdc3_configs));
}