Exemple #1
0
static int msm_fb_detect_panel(const char *name)
{
	if (machine_is_msm8x60_fluid()) {
		uint32_t soc_platform_version = socinfo_get_platform_version();
		if (SOCINFO_VERSION_MAJOR(soc_platform_version) < 3) {
#ifdef CONFIG_FB_MSM_LCDC_SAMSUNG_OLED_PT
			if (!strncmp(name, LCDC_SAMSUNG_OLED_PANEL_NAME,
					strlen(LCDC_SAMSUNG_OLED_PANEL_NAME)))
				return 0;
#endif
		} else { /*P3 and up use AUO panel */
#ifdef CONFIG_FB_MSM_LCDC_AUO_WVGA
			if (!strncmp(name, LCDC_AUO_PANEL_NAME,
					strlen(LCDC_AUO_PANEL_NAME)))
				return 0;
#endif
		}
		if (!strncmp(name, LCDC_SAMSUNG_WSVGA_PANEL_NAME,
				strlen(LCDC_SAMSUNG_WSVGA_PANEL_NAME)))
			return -ENODEV;
	} else {
		if (!strncmp(name, LCDC_SAMSUNG_WSVGA_PANEL_NAME,
				strlen(LCDC_SAMSUNG_WSVGA_PANEL_NAME)))
			return 0;
		if (!strncmp(name, LCDC_SAMSUNG_OLED_PANEL_NAME,
				strlen(LCDC_SAMSUNG_OLED_PANEL_NAME)))
			return -ENODEV;
	}
	pr_warning("%s: not supported '%s'", __func__, name);
	return -ENODEV;
}
static int msm_fb_detect_panel(const char *name)
{
	/* OPPO 2012-07-24 zhengzk Modify for MIPI start */
#ifndef CONFIG_VENDOR_EDIT
	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;
		}
	}
#else
	if (!strncmp(name, MIPI_VIDEO_ORISE_OPPO_PANEL_NAME,
		strnlen(MIPI_VIDEO_ORISE_OPPO_PANEL_NAME,
			PANEL_NAME_MAX_LEN)))
		return 0;
#endif
/* OPPO 2012-07-24 zhengzk Modify for MIPI end */

	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;
}
static int lvds_pixel_remap(void)
{
	if (machine_is_apq8064_cdp() ||
	    machine_is_apq8064_liquid()) {
		u32 ver = socinfo_get_platform_version(); //+++ ASUS_BSP : miniporting
		if ((SOCINFO_VERSION_MAJOR(ver) == 1) &&
		    (SOCINFO_VERSION_MINOR(ver) == 0))
			return 1;
	}
	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;
}
static void gpio_bt_config(void)
{
	u32 socinfo = socinfo_get_platform_version();
	if (machine_is_msm7627a_qrd1())
		gpio_bt_sys_rest_en = 114;
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
				|| machine_is_msm8625_evt())
		gpio_bt_sys_rest_en = 16;
	if (machine_is_msm8625_qrd7())
		gpio_bt_sys_rest_en = 88;
	if (machine_is_msm7627a_qrd3()) {
		if (socinfo == 0x70002)
			gpio_bt_sys_rest_en = 88;
		 else
			gpio_bt_sys_rest_en = 85;
	}
}
static void gpio_bt_config(void)
{
  #if defined(CONFIG_QCT2243_V21)
  int pin, rc = 0;
	gpio_tlmm_config(fm_rds_int_init[0],
					GPIO_CFG_ENABLE);
  for (pin = 0; pin < ARRAY_SIZE(bt_config_power_off);
			pin++) {
			rc = gpio_tlmm_config(bt_config_power_off[pin],
				GPIO_CFG_ENABLE);
			if (rc < 0) {
				pr_err("%s:"
					" gpio_tlmm_config(%#x)=%d\n",
					__func__,
					bt_config_power_off[pin], rc);
			}
		}
	#else
	u32 socinfo = socinfo_get_platform_version();
	if (machine_is_msm7627a_qrd1())
		gpio_bt_sys_rest_en = 114;
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
				|| machine_is_msm8625_evt())
		gpio_bt_sys_rest_en = 16;
	if (machine_is_msm8625_qrd7())
		gpio_bt_sys_rest_en = 88;
	if (0 || machine_is_msm8625q_evbd()
				|| machine_is_msm8625q_skud())
		gpio_bt_sys_rest_en = 35;
	if (machine_is_msm7627a_qrd3()) {
		if (socinfo == 0x70002)
			gpio_bt_sys_rest_en = 88;
		 else
			gpio_bt_sys_rest_en = 85;
	}
	#endif
}
Exemple #7
0
static int msm_fb_detect_panel(const char *name)
{
	if (machine_is_msm8960_liquid()) {
		u32 ver = socinfo_get_platform_version();
		if (SOCINFO_VERSION_MAJOR(ver) == 3) {
			if (!strncmp(name, MIPI_VIDEO_CHIMEI_WUXGA_PANEL_NAME,
				     strnlen(MIPI_VIDEO_CHIMEI_WUXGA_PANEL_NAME,
						PANEL_NAME_MAX_LEN)))
				return 0;
		} else {
			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, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

#ifndef CONFIG_FB_MSM_MIPI_PANEL_DETECT
		if (!strncmp(name, MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
				strnlen(MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
				strnlen(MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
				strnlen(MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

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

		if (!strncmp(name, MIPI_VIDEO_ORISE_720P_PANEL_NAME,
				strnlen(MIPI_VIDEO_ORISE_720P_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_ORISE_720P_PANEL_NAME,
				strnlen(MIPI_CMD_ORISE_720P_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;
#endif
	}

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

	if (!strncmp(name, TVOUT_PANEL_NAME,
			strnlen(TVOUT_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;

	pr_warning("%s: not supported '%s'", __func__, name);
	return -ENODEV;
}
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();

	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));
	}
}
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;
	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

}
Exemple #13
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;
	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
}
Exemple #15
0
static int msm_fb_detect_panel(const char *name)
{
#ifdef CONFIG_SHLCDC_BOARD
#ifdef CONFIG_SHDISP_PANEL_PHARAOH
	if (!strncmp(name, MIPI_VIDEO_SHARP_PHARAOH_HD_PANEL_NAME,
			strnlen(MIPI_VIDEO_SHARP_PHARAOH_HD_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_SHDISP_PANEL_PHARAOH */

#ifdef CONFIG_SHDISP_PANEL_NICOLE
	if (!strncmp(name, MIPI_VIDEO_SHARP_NICOLE_QHD_PANEL_NAME,
			strnlen(MIPI_VIDEO_SHARP_NICOLE_QHD_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_SHDISP_PANEL_NICOLE */

#ifdef CONFIG_SHDISP_PANEL_KITE
	if (!strncmp(name, MIPI_CMD_SHARP_KITE_HD_PANEL_NAME,
			strnlen(MIPI_CMD_SHARP_KITE_HD_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_SHDISP_PANEL_KITE */

#ifdef CONFIG_SHDISP_PANEL_TAKT
	if (!strncmp(name, MIPI_VIDEO_SHARP_TAKT_QHD_PANEL_NAME,
			strnlen(MIPI_VIDEO_SHARP_TAKT_QHD_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_SHDISP_PANEL_TAKT */

#ifdef CONFIG_SHDISP_PANEL_RYOMA
	if (!strncmp(name, MIPI_CMD_SHARP_RYOMA_WXGA_PANEL_NAME,
			strnlen(MIPI_CMD_SHARP_RYOMA_WXGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_SHDISP_PANEL_RYOMA_WXGA */

#ifdef CONFIG_SHDISP_PANEL_FLUTE
#ifdef CONFIG_FB_MSM_MIPI_SHARP_FLUTE_VIDEO_FWVGA_PT_PANEL
	if (!strncmp(name, MIPI_VIDEO_SHARP_FLUTE_FWVGA_PANEL_NAME,
			strnlen(MIPI_VIDEO_SHARP_FLUTE_FWVGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_FB_MSM_MIPI_SHARP_FLUTE_VIDEO_FWVGA_PT_PANEL */
#ifdef CONFIG_FB_MSM_MIPI_SHARP_FLUTE_CMD_FWVGA_PT_PANEL
	if (!strncmp(name, MIPI_CMD_SHARP_FLUTE_FWVGA_PANEL_NAME,
			strnlen(MIPI_CMD_SHARP_FLUTE_FWVGA_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;
#endif /* CONFIG_FB_MSM_MIPI_SHARP_FLUTE_CMD_FWVGA_PT_PANEL */
#endif /* CONFIG_SHDISP_PANEL_FLUTE */

#else /* CONFIG_SHLCDC_BOARD */

	if (machine_is_msm8960_liquid()) {
		u32 ver = socinfo_get_platform_version();
		if (SOCINFO_VERSION_MAJOR(ver) == 3) {
			if (!strncmp(name, MIPI_VIDEO_CHIMEI_WUXGA_PANEL_NAME,
				     strnlen(MIPI_VIDEO_CHIMEI_WUXGA_PANEL_NAME,
						PANEL_NAME_MAX_LEN))) {
				set_mdp_clocks_for_wuxga();
				return 0;
			}
		} else {
			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, MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_TOSHIBA_WSVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

#if !defined(CONFIG_FB_MSM_LVDS_MIPI_PANEL_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_DETECT)
		if (!strncmp(name, MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
				strnlen(MIPI_VIDEO_NOVATEK_QHD_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
				strnlen(MIPI_CMD_NOVATEK_QHD_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
				strnlen(MIPI_VIDEO_SIMULATOR_VGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
				strnlen(MIPI_CMD_RENESAS_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

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

		if (!strncmp(name, MIPI_VIDEO_ORISE_720P_PANEL_NAME,
				strnlen(MIPI_VIDEO_ORISE_720P_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;

		if (!strncmp(name, MIPI_CMD_ORISE_720P_PANEL_NAME,
				strnlen(MIPI_CMD_ORISE_720P_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
			return 0;
#endif
	}
#endif /* CONFIG_SHLCDC_BOARD */

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

	if (!strncmp(name, TVOUT_PANEL_NAME,
			strnlen(TVOUT_PANEL_NAME,
				PANEL_NAME_MAX_LEN)))
		return 0;

	pr_warning("%s: not supported '%s'", __func__, name);
	return -ENODEV;
}