void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#ifdef CONFIG_MFD_MAX77888
#if 0 // MCU Pin
	msm_gpiomux_install(msm8974_muic_configs, ARRAY_SIZE(msm8974_muic_configs));
#endif
#endif

#ifdef CONFIG_W1_SLAVE_DS28EL15
	msm_gpiomux_install(msm8974_cover_id_config, ARRAY_SIZE(msm8974_cover_id_config));
#endif

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if 0//defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));

#if 0//!defined(CONFIG_SENSORS_SSP)
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(es325_config, ARRAY_SIZE(es325_config));
	msm_gpiomux_install(msm8974_audio_configs, ARRAY_SIZE(msm8974_audio_configs));	
	msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));
#if 0 // MCU pin
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

#if defined(CONFIG_SENSORS)
	msm_gpiomux_install(msm_sensors_configs,
		ARRAY_SIZE(msm_sensors_configs));
#endif
	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
	if (system_rev > 5)
		msm_gpiomux_install(msm_hdmi_ddc_configs,
				ARRAY_SIZE(msm_hdmi_ddc_configs));
#ifdef CONFIG_VIDEO_MHL_V2
	if(system_rev > 1)
		msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif
#if 0
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
#if defined(CONFIG_SEC_NFC_I2C) || defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif
	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 10)
		msm_gpiomux_install(vienna_r10_muic_configs,
				ARRAY_SIZE(vienna_r10_muic_configs));
	else
		msm_gpiomux_install(vienna_muic_configs,
				ARRAY_SIZE(vienna_muic_configs));
#endif

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

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

#ifdef CONFIG_INPUT_WACOM_HL
	msm_gpiomux_install(msm8974_wacom_configs,
		ARRAY_SIZE(msm8974_wacom_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#ifdef CONFIG_MFD_MAX77888
	msm_gpiomux_install(msm8974_muic_configs, ARRAY_SIZE(msm8974_muic_configs));
#endif
	msm_gpiomux_install(msm_battery_configs, ARRAY_SIZE(msm_battery_configs));
#if !defined(CONFIG_MACH_LT03_LTE)	
	msm_gpiomux_install(msm_batteryotg_configs, ARRAY_SIZE(msm_batteryotg_configs));
#endif	

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
	msm_gpiomux_btwake_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));
#if defined(CONFIG_MACH_LT03_VZW) || defined(CONFIG_MACH_LT03_EUR) || defined(CONFIG_MACH_LT03_TMO) \
|| defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(spk_ext_config, ARRAY_SIZE(spk_ext_config));
#endif

	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#ifdef CONFIG_VIDEO_MHL_V2
	msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif

#if 0
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 7)
		msm_gpiomux_install(lt03_r04_muic_configs,
				ARRAY_SIZE(lt03_r04_muic_configs));
	else
		msm_gpiomux_install(lt03_muic_configs,
				ARRAY_SIZE(lt03_muic_configs));
#endif

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_FB_MSM_EDP_SAMSUNG
	msm_gpiomux_install(msm8974_lcd_config,
				ARRAY_SIZE(msm8974_lcd_config));
#endif
#ifdef CONFIG_INPUT_WACOM
	msm_gpiomux_install(msm8974_wacom_configs,
			ARRAY_SIZE(msm8974_wacom_configs));
#endif
	msm_gpiomux_install(msm_grip_configs, ARRAY_SIZE(msm_grip_configs));
	msm_gpiomux_install(msm_sensors_configs, ARRAY_SIZE(msm_sensors_configs));

#if defined(CONFIG_MACH_LT03_VZW) || defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) || defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(ext_buck_configs, ARRAY_SIZE(ext_buck_configs));
#endif

#if defined(CONFIG_MACH_LT03_LTE)
	msm_gpiomux_install(gpio_nc_configs,ARRAY_SIZE(gpio_nc_configs));
#endif

}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#if defined (CONFIG_MACH_MILLETLTE_VZW)
	msm_gpiomux_install(milletltevzw_gpio_10, ARRAY_SIZE(milletltevzw_gpio_10));
#endif
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_keypad_configs,
			ARRAY_SIZE(msm_keypad_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));
	else
#if defined (CONFIG_MACH_BERLUTI3G_EUR)
		msm_gpiomux_install(msm_cypress_configs,
				ARRAY_SIZE(msm_cypress_configs));

		msm_gpiomux_install(msm_keyboad_cypress_configs,
				ARRAY_SIZE(msm_keyboad_cypress_configs));
#elif defined(CONFIG_SEC_MILLET_PROJECT)
msm_gpiomux_install(msm_melfas_configs,
				ARRAY_SIZE(msm_melfas_configs));
#else
		msm_gpiomux_install(msm_synaptics_configs,
				ARRAY_SIZE(msm_synaptics_configs));
#endif
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

#if !defined (CONFIG_SEC_MILLET_PROJECT)
	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));
#endif

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#if defined (CONFIG_SEC_MILLET_PROJECT)
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
	if ( system_rev >= 0 && system_rev < 3) {
		msm_gpiomux_install(light_prox_config, ARRAY_SIZE(light_prox_config));
		msm_gpiomux_install(irled_i2c_scl_config,
						ARRAY_SIZE(irled_i2c_scl_config));
	} else {
		msm_gpiomux_install(nc_light_prox_config, ARRAY_SIZE(nc_light_prox_config));
#if defined (CONFIG_MACH_MILLETLTE_VZW) || defined(CONFIG_SEC_MILLETWIFI_COMMON)
		msm_gpiomux_install(irled_i2c_scl_config,
						ARRAY_SIZE(irled_i2c_scl_config));
#endif
	}
#endif
	msm_gpiomux_sdc3_install();


	msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));
	msm_gpiomux_install(msm_ta_int_n_configs, ARRAY_SIZE(msm_ta_int_n_configs));
  #if defined (CONFIG_SEC_MILLETLTE_COMMON)
  if ( system_rev >= 3)
  {
    msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
  }
  #else
    msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
  #endif
#if defined (CONFIG_SEC_MILLETWIFI_COMMON)
	msm_gpiomux_install(milletwifi_nc_gpio_cfgs, ARRAY_SIZE(milletwifi_nc_gpio_cfgs));
#endif
#if defined (CONFIG_MACH_MILLETLTE_OPEN)
msm_gpiomux_install(millet_nc_gpio_cfgs, ARRAY_SIZE(millet_nc_gpio_cfgs));
if ( system_rev >= 3){
	msm_gpiomux_install(millet_nc3_gpio_cfgs, ARRAY_SIZE(millet_nc3_gpio_cfgs));
}
#endif
#if defined (CONFIG_MACH_MILLET3G_EUR)
if ( system_rev >= 2)
	msm_gpiomux_install(millet3g_nc_gpio_cfgs, ARRAY_SIZE(millet3g_nc_gpio_cfgs));
#endif
#if defined (CONFIG_MACH_MILLETLTE_VZW)
if ( system_rev >= 1)
	msm_gpiomux_install(milletltevzw_nc_gpio_cfgs, ARRAY_SIZE(milletltevzw_nc_gpio_cfgs));
#endif
#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
	if(!poweroff_charging)
	msm_gpiomux_install(wcdcodec_reset_cfg, ARRAY_SIZE(wcdcodec_reset_cfg));
#ifdef CONFIG_SND_SOC_MAX98504
#if defined(CONFIG_MACH_MILLETLTE_OPEN)
				if ( system_rev >= 0 && system_rev < 3)
#elif defined (CONFIG_MACH_MILLET3G_EUR)
				if ( system_rev >= 2 && system_rev < 4)
#elif defined(CONFIG_MACH_MILLETWIFI_OPEN)
				if ( system_rev >= 0 && system_rev < 5)
#endif

		{
			msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
			msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
			msm_gpiomux_install(msm8226_amp_int_configs,ARRAY_SIZE(msm8226_amp_int_configs));
		}
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

/* Battery charging and BMS GPIO */
	msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));

	msm_gpiomux_install(msm_hrm_configs,
		ARRAY_SIZE(msm_hrm_configs));

	msm_gpiomux_install(msm_sensorhub_configs,
		ARRAY_SIZE(msm_sensorhub_configs));

	msm_gpiomux_install(msm_nfc_configs,
		ARRAY_SIZE(msm_nfc_configs));

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

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));

		msm_gpiomux_install(msm_synaptics_configs,
				ARRAY_SIZE(msm_synaptics_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));

	/*
	 * gpio mux settings for the NC GPIOs
	 */
	msm_gpiomux_install(nc_gpio_cfgs,
			ARRAY_SIZE(nc_gpio_cfgs));

	msm_gpiomux_install(hw_chkbits_cfg, ARRAY_SIZE(hw_chkbits_cfg));
	msm_gpiomux_sdc3_install();

	/*
	 * HSIC STROBE gpio is also used by the ethernet. Install HSIC
	 * gpio mux config only when HSIC is enabled. HSIC config will
	 * be disabled when ethernet config is enabled.
	 */
#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_msm8926()) {
		msm_hsic_configs[0].gpio = 119; /* STROBE */
		msm_hsic_configs[1].gpio = 120; /* DATA */
	}
	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
#endif
#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
#ifdef CONFIG_SND_SOC_MAX98504
		msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
#endif
}
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up*/
#if defined(CONFIG_BU52061NVX)
static struct msm_gpiomux_config msm_hall_ic_configs[] __initdata = {
	{
		.gpio = 4,
		.settings = {
			[GPIOMUX_ACTIVE] = &hall_ic_sus_cfg,
		},
    },
#ifdef CONFIG_BU52033NVX_CARKIT
	{
		.gpio = 5,
		.settings = {
			[GPIOMUX_ACTIVE] = &hall_ic_sus_cfg,
		},
    },
#endif
};
#endif /* CONFIG_BU52061NVX */
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif /* CONFIG_MACH_LGE */
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

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

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
#ifdef CONFIG_MACH_LGE
	if(hw_rev < HW_REV_A2) {
		msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
		printk(KERN_ERR "[Touch] HW_REV_A configs \n");
	} else if(hw_rev == HW_REV_A2) {
#if defined(CONFIG_TOUCHSCREEN_LGE_TS_MISC)
		msm_gpiomux_install(msm_touch_configs_rev_a2, ARRAY_SIZE(msm_touch_configs_rev_a2));
		printk(KERN_ERR "[Touch] HW_REV_A2 configs \n");
#endif /* CONFIG_TOUCHSCREEN_LGE_TS_MISC */
	} else if(hw_rev >= HW_REV_B) {
#if defined (CONFIG_LGE_TOUCHSCREEN_SYNAPTIC) || defined(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)
		msm_gpiomux_install(msm_touch_configs_rev_b, ARRAY_SIZE(msm_touch_configs_rev_b));
		if(hw_rev == HW_REV_B) {
			printk(KERN_ERR "[Touch] HW_REV_B configs \n");
		} else if (hw_rev >= HW_REV_B2) {
			printk(KERN_ERR "[Touch] over HW_REV_B2 configs \n");
		} else {}
#endif /* CONFIG_LGE_TOUCHSCREEN_SYNAPTIC || CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4 */
	} else {}
#endif /* CONFIG_MACH_LGE */
#if defined(CONFIG_BU52061NVX)
	msm_gpiomux_install(msm_hall_ic_configs, ARRAY_SIZE(msm_hall_ic_configs));
#endif /* CONFIG_BU52061NVX */
	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
#ifndef CONFIG_MACH_LGE
	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif

/*  LGE_CHANGE_S, [NFC][[email protected]], NFC Bring up */
#ifdef CONFIG_LGE_NFC_PN547_C2
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up */
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	/* Keypad */
	msm_gpiomux_install(msm_keypad_configs,
		ARRAY_SIZE(msm_keypad_configs));

	/* HallSensors */
	msm_gpiomux_install(msm_hall_configs,
		ARRAY_SIZE(msm_hall_configs));

	/* BLSP */
	msm_gpiomux_install(msm_blsp_configs,
		ARRAY_SIZE(msm_blsp_configs));

	/* WCNSS */
	msm_gpiomux_install(wcnss_5wire_interface,
		ARRAY_SIZE(wcnss_5wire_interface));

	/* TX_GTR */
	msm_gpiomux_install(msm8226_tx_gtr_configs,
		ARRAY_SIZE(msm8226_tx_gtr_configs));

	/* LCD */
	msm_gpiomux_install_nowrite(msm_lcd_configs,
		ARRAY_SIZE(msm_lcd_configs));

	/* Camera */
	msm_gpiomux_install(msm_csensor_configs,
		ARRAY_SIZE(msm_csensor_configs));

	/* Touch */
	msm_gpiomux_install(msm_cypress_configs,
		ARRAY_SIZE(msm_cypress_configs));

	/* Touch Key */
	msm_gpiomux_install(msm_keyboad_cypress_configs,
		ARRAY_SIZE(msm_keyboad_cypress_configs));

	/* NFC */
	msm_gpiomux_install(msm_nfc_configs,
		ARRAY_SIZE(msm_nfc_configs));

	/* Sensors */
	msm_gpiomux_install(msm_sensors_configs,
		ARRAY_SIZE(msm_sensors_configs));

	/* Cover ID */
	msm_gpiomux_install(msm_cover_id_configs,
		ARRAY_SIZE(msm_cover_id_configs));

	/* SDCC3 */
	msm_gpiomux_sdc3_install();

	/* Earjack */
	msm_gpiomux_install(msm_earjack_gpio_configs,
		ARRAY_SIZE(msm_earjack_gpio_configs));

	/* MUIC */
	msm_gpiomux_install(muic_configs,
 		ARRAY_SIZE(muic_configs));

	/* HW_REV Pin */
	msm_gpiomux_install(hwrev_configs,
		ARRAY_SIZE(hwrev_configs));

	/* TOUCH_3P3_EN */
	msm_gpiomux_install(msm8226_touch_3p3_en_configs,
		ARRAY_SIZE(msm8226_touch_3p3_en_configs));

	/* NC */
	msm_gpiomux_install(berluti_nc_gpio_cfgs, ARRAY_SIZE(berluti_nc_gpio_cfgs));
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	int gpio_index = 0;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#ifdef CONFIG_MACH_LGE

	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via X5
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.WLC>>
	// GPIO related function <<17.SIM>>
	// GPIO related function <<18.SLIMBUS>>
	// GPIO related function <<19.RF>>
	// GPIO related function <<20.KEY PAD>>
	// GPIO related function <<21.LOGIC>>

	// GPIO related function <<0.Resreved Pin>>
	switch ( hw_rev ){
		case HW_REV_0 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_A :
            for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_B :
            for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_C :
		case HW_REV_D :
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
	}
	
	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(gpio_func_sensor_configs, ARRAY_SIZE(gpio_func_sensor_configs));
	msm_gpiomux_install(msm_hall_ic_configs, ARRAY_SIZE(msm_hall_ic_configs));
	
	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(gpio_func_i2c_configs, ARRAY_SIZE(gpio_func_i2c_configs));
	
	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs, ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	if(hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_synaptics_configs, ARRAY_SIZE(msm_synaptics_configs));
		printk(KERN_ERR "[Touch] synaptics msm_gpiomux_install HW_REV_A configs rev : %d\n", hw_rev);
	} else {
		msm_gpiomux_install(msm_atmel_s540_configs, ARRAY_SIZE(msm_atmel_s540_configs));
		printk(KERN_ERR "[Touch] atmel msm_gpiomux_install HW_REV_A configs rev : %d\n", hw_rev);
	}

	// GPIO related function <<5.NFC>>
/*                                                       */
#ifdef CONFIG_LGE_NFC_PN547
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
/*                                                       */

	// GPIO related function <<6.LCD>>
	msm_gpiomux_install(gpio_func_lcd_configs,
			ARRAY_SIZE(gpio_func_lcd_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs, ARRAY_SIZE(msm_lcd_configs));
	
	// GPIO related function <<7.CAMERA>>	
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
	
	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_flash_led_configs, ARRAY_SIZE(gpio_func_flash_led_configs));

	// GPIO related function <<10.AUDIO>>

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_install(&sd_card_det, 1);

	// GPIO related function <<12.BATTERY>>
	msm_gpiomux_install(gpio_func_battery_configs, ARRAY_SIZE(gpio_func_battery_configs));	
	
	// GPIO related function <<13.BT>>
	msm_gpiomux_install(gpio_func_bt_configs, ARRAY_SIZE(gpio_func_bt_configs));
	
	// GPIO related function <<14.WIFI>>
#if defined ( CONFIG_BCMDHD ) || defined ( CONFIG_BCMDHD_MODULE )
#else
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
	
	// GPIO related function <<15.FM>>
	msm_gpiomux_install(gpio_func_fm_configs, ARRAY_SIZE(gpio_func_fm_configs));
	
	// GPIO related function <<16.WLC>>
	msm_gpiomux_install(gpio_func_wlc_configs, ARRAY_SIZE(gpio_func_wlc_configs));
	
	// GPIO related function <<17.SIM>>
	msm_gpiomux_install(gpio_func_sim_configs, ARRAY_SIZE(gpio_func_sim_configs));
	
	// GPIO related function <<18.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs, ARRAY_SIZE(gpio_func_slimbus_configs));
	
	// GPIO related function <<19.RF>>
	msm_gpiomux_install(gpio_func_rf_configs, ARRAY_SIZE(gpio_func_rf_configs));
	
	// GPIO related function <<20.KEY PAD>>
	msm_gpiomux_install(msm_keypad_configs, ARRAY_SIZE(msm_keypad_configs));
	
	// GPIO related function <<21.LOGIC>>
	msm_gpiomux_install(gpio_func_logic_configs, ARRAY_SIZE(gpio_func_logic_configs));

	// GPIO related function <<22.FUEL GAUGE>>
#ifdef CONFIG_MAX17048_FUELGAUGE
	msm_gpiomux_install(msm_fuel_configs, ARRAY_SIZE(msm_fuel_configs));
#endif

   // GPIO related function <<23.External Charger>>
#ifdef CONFIG_LGE_WIRELESS_CHARGER_RT9536
	msm_gpiomux_install(msm_rt9536_configs, ARRAY_SIZE(msm_rt9536_configs));
#endif

#endif

#ifndef CONFIG_MACH_LGE	
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));


	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif
/*                                                  */
#ifdef CONFIG_LGE_BLUETOOTH
    bluetooth_msm_gpiomux_install();
#endif /*                      */
/*                                                  */

msm_gpiomux_install(msm_auxpcm_configs,
		ARRAY_SIZE(msm_auxpcm_configs));

#if 0// defined(CONFIG_TSPDRV)
	msm_gpiomux_install(vibrator_configs, ARRAY_SIZE(vibrator_configs));
#endif

    msm_gpiomux_sdc3_install();
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
	int gpio_index = 0;

	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();

	/*  Device Tree Initailize */
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	/*--------------------------------------------
	   MSM8X26 GPIO Confiuration via JAGUAR
	  --------------------------------------------
	   GPIO related function <<0.Resreved Pin>>
	   GPIO related function <<1.SENSOR>>
	   GPIO related function <<2.I2C>>
	   GPIO related function <<3.UART>>
	   GPIO related function <<4.TOUCH>>
	   GPIO related function <<5.NFC>>
	   GPIO related function <<6.LCD>>
	   GPIO related function <<7.CAMERA>>
	   GPIO related function <<8.FLASH LED>>
	   GPIO related function <<9.IRRC>>
	   GPIO related function <<10.AUDIO>>
	   GPIO related function <<11.SD CARD>>
	   GPIO related function <<12.BATTERY>>
	   GPIO related function <<13.BT>>
	   GPIO related function <<14.WIFI>>
	   GPIO related function <<15.FM>>
	   GPIO related function <<16.WLC>>
	   GPIO related function <<17.SIM>>
	   GPIO related function <<18.SLIMBUS>>
	   GPIO related function <<19.RF>>
	   GPIO related function <<20.KEY PAD>>
	   GPIO related function <<21.LOGIC>>

	   GPIO related function <<0.Resreved Pin>> */
	switch (hw_rev) {
	case HW_REV_0:
        for (gpio_index = 0; gpio_reserved_pin_rev_zero[gpio_index] < MSM8x26_GPIO_END; gpio_index++){
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_zero[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
	case HW_REV_A:
        for (gpio_index = 0; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END; gpio_index++){
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
	case HW_REV_B:
        for (gpio_index = 0; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END; gpio_index++){
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
	case HW_REV_C:
	case HW_REV_D:
	case HW_REV_E:
	case HW_REV_1_0:
	case HW_REV_1_1:
	default:
        for (gpio_index = 0; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END; gpio_index++){
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
	}

	/* GPIO related function <<1.SENSOR>> */
	msm_gpiomux_install(msm_sensor_ic_configs, ARRAY_SIZE(msm_sensor_ic_configs));

	/* GPIO related function <<2.I2C>> */
	msm_gpiomux_install(msm_i2c_configs, ARRAY_SIZE(msm_i2c_configs));

	/* GPIO related function <<3.UART>> */
	msm_gpiomux_install(gpio_func_uart_configs, ARRAY_SIZE(gpio_func_uart_configs));

	/* GPIO related function <<4.TOUCH>> */
	if (hw_rev <= HW_REV_A) {
		msm_gpiomux_install(msm_atmel_configs, ARRAY_SIZE(msm_atmel_configs));
		printk(KERN_ERR "[Touch] HW_REV_0, A configs \n");
	} else {
		msm_gpiomux_install(msm_synaptics_configs_rev_b, ARRAY_SIZE(msm_synaptics_configs_rev_b));
		printk(KERN_ERR "[Touch] HW_REV_B, C, D, E configs \n");
	}

	/* GPIO related function <<5.NFC>> */
/*                                                       */
#ifdef CONFIG_LGE_NFC_PN547_C2
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
/*                                                       */

	/* GPIO related function <<6.LCD>> */
	if (hw_rev <= HW_REV_A)
		msm_gpiomux_install_nowrite(msm_lcd_configs_A,
				ARRAY_SIZE(msm_lcd_configs_A));
	else
		msm_gpiomux_install_nowrite(msm_lcd_configs_B,
				ARRAY_SIZE(msm_lcd_configs_B));

	/* GPIO related function <<7.CAMERA>> */
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	/* GPIO related function <<8.FLASH LED>> */
	msm_gpiomux_install(gpio_func_flash_led_configs, ARRAY_SIZE(gpio_func_flash_led_configs));

	/* GPIO related function <<10.AUDIO>> */

	/* GPIO related function <<11.SD CARD>> */
	msm_gpiomux_sdc3_install();

	/* GPIO related function <<12.BATTERY>> */
	msm_gpiomux_install(power_configs, ARRAY_SIZE(power_configs));

	/* GPIO related function <<13.BT>> */
#ifdef CONFIG_LGE_BLUETOOTH
    bluetooth_msm_gpiomux_install();
#endif /*                      */

	/* GPIO related function <<14.WIFI>> */
#if defined (CONFIG_BCMDHD) || defined (CONFIG_BCMDHD_MODULE)
	if (hw_rev == HW_REV_0)
		msm_gpiomux_install(wcnss_5wire_interface_zero,
					ARRAY_SIZE(wcnss_5wire_interface_zero));
	else
		msm_gpiomux_install(wcnss_5wire_interface_A,
					ARRAY_SIZE(wcnss_5wire_interface_A));
#endif

	/* GPIO related function <<15.FM>> */
	msm_gpiomux_install(msm_auxpcm_configs,	ARRAY_SIZE(msm_auxpcm_configs));

	/* GPIO related function <<16.WLC>> */
	msm_gpiomux_install(&gpio_func_wlc_config, 1);

	/* GPIO related function <<17.SIM>> */
	msm_gpiomux_install(gpio_func_sim_configs, ARRAY_SIZE(gpio_func_sim_configs));

	/* GPIO related function <<18.SLIMBUS>> */
	msm_gpiomux_install(gpio_func_slimbus_configs, ARRAY_SIZE(gpio_func_slimbus_configs));

	/* GPIO related function <<19.RF>> */
	msm_gpiomux_install(gpio_func_rf_configs, ARRAY_SIZE(gpio_func_rf_configs));

	/* GPIO related function <<20.KEY PAD>> */
	msm_gpiomux_install(msm_keypad_configs, ARRAY_SIZE(msm_keypad_configs));

	/* GPIO related function <<21.LOGIC>> */
	logic_msm_gpiomux_install();

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

#ifndef CONFIG_MACH_LGE
	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

	if (machine_is_apq8074() && (of_board_is_liquid() || \
	    of_board_is_dragonboard()))
		msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));

	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
	if (of_board_is_fluid())
		msm_gpiomux_install(msm_mhl_configs,
				    ARRAY_SIZE(msm_mhl_configs));

	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

	if (of_board_is_cdp())
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
	else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));

	msm_gpiomux_install(msm_cir_configs, ARRAY_SIZE(msm_cir_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));
}
void __init apq8084_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	if (of_board_is_sbc()) {
		msm_gpiomux_install(msm_sbc_blsp_configs,
				ARRAY_SIZE(msm_sbc_blsp_configs));
	} else {
		msm_gpiomux_install(msm_blsp_configs,
				ARRAY_SIZE(msm_blsp_configs));
	}
	msm_gpiomux_install(msm_blsp1_uart6_configs,
					ARRAY_SIZE(msm_blsp1_uart6_configs));
	msm_gpiomux_install(msm_synaptics_configs,
					ARRAY_SIZE(msm_synaptics_configs));

	if (of_board_is_liquid() || of_board_is_sbc()) {
		msm_gpiomux_install(msm_blsp2_uart5_configs,
				ARRAY_SIZE(msm_blsp2_uart5_configs));
		msm_gpiomux_install(msm_qca1530_liquid_configs,
				ARRAY_SIZE(msm_qca1530_liquid_configs));
	} else {
		msm_gpiomux_install(mdm_configs, ARRAY_SIZE(mdm_configs));
		if (of_board_is_cdp())
			msm_gpiomux_install(msm_qca1530_cdp_configs,
					ARRAY_SIZE(msm_qca1530_cdp_configs));
	}
	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install(msm_lcd_te_configs,
			ARRAY_SIZE(msm_lcd_te_configs));
	msm_gpiomux_install(apq8084_pri_ter_auxpcm_configs,
			ARRAY_SIZE(apq8084_pri_ter_auxpcm_configs));

	if (of_board_is_sbc()) {
		msm_gpiomux_install(msm_hdmi_nomux_configs,
			ARRAY_SIZE(msm_hdmi_nomux_configs));
		msm_gpiomux_install(apq8084_general_led_configs,
			ARRAY_SIZE(apq8084_general_led_configs));
	} else {
		msm_gpiomux_install(apq8084_hsic_configs,
			ARRAY_SIZE(apq8084_hsic_configs));
		msm_gpiomux_install(msm_hdmi_configs,
			ARRAY_SIZE(msm_hdmi_configs));
		msm_gpiomux_install(hap_lvl_shft_config,
			ARRAY_SIZE(hap_lvl_shft_config));
	}

	msm_gpiomux_install(msm_wlan_configs, ARRAY_SIZE(msm_wlan_configs));
	msm_gpiomux_install(sd_card_det, ARRAY_SIZE(sd_card_det));
	if (of_board_is_cdp() || of_board_is_sbc())
		msm_gpiomux_install(eth_pwr, ARRAY_SIZE(eth_pwr));
	if (of_board_is_sbc())
		msm_gpiomux_install(msm_sbc_sensor_configs,
				ARRAY_SIZE(msm_sbc_sensor_configs));
	else
		msm_gpiomux_install(msm_sensor_configs,
				ARRAY_SIZE(msm_sensor_configs));
	msm_gpiomux_install(msm_pcie_configs, ARRAY_SIZE(msm_pcie_configs));
	msm_gpiomux_install(msm_epm_configs, ARRAY_SIZE(msm_epm_configs));

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (of_board_is_cdp())
		msm_gpiomux_install(msm_eth_configs,
			ARRAY_SIZE(msm_eth_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_keypad_configs,
			ARRAY_SIZE(msm_keypad_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));
	else
		msm_gpiomux_install(msm_synaptics_configs,
				ARRAY_SIZE(msm_synaptics_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

#if defined(CONFIG_MACH_VICTOR_CHN_CMCC)
		msm_gpiomux_install(msm_lcd_det_configs, ARRAY_SIZE(msm_lcd_det_configs));
		msm_gpiomux_install_nowrite(msm_lcd_configs,ARRAY_SIZE(msm_lcd_configs));
#endif

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

	msm_gpiomux_sdc3_install();
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));

	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));

#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
	if(!poweroff_charging)
	msm_gpiomux_install(wcdcodec_reset_cfg, ARRAY_SIZE(wcdcodec_reset_cfg));
#ifdef CONFIG_SND_SOC_MAX98504
	msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
	msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
	msm_gpiomux_install(msm8226_amp_int_configs,ARRAY_SIZE(msm8226_amp_int_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

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

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));
	else
		msm_gpiomux_install(msm_melfas_configs,
				ARRAY_SIZE(msm_melfas_configs));
#if !defined(CONFIG_MACH_DEGASLTE_SBM)
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));
#endif
	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));

#if defined (CONFIG_SEC_DEGASLTE_COMMON)
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
#if !defined(CONFIG_MACH_DEGASLTE_SBM)
	msm_gpiomux_install(irled_i2c_scl_config, ARRAY_SIZE(irled_i2c_scl_config));
#endif
	msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
#endif
	msm_gpiomux_sdc3_install();


	msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));
	msm_gpiomux_install(msm_ta_int_n_configs, ARRAY_SIZE(msm_ta_int_n_configs));
#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
	if(!poweroff_charging)
		msm_gpiomux_install(wcdcodec_reset_cfg, ARRAY_SIZE(wcdcodec_reset_cfg));
#ifdef CONFIG_SND_SOC_MAX98504
	msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
	msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
	msm_gpiomux_install(msm8226_amp_int_configs,ARRAY_SIZE(msm8226_amp_int_configs));
#endif
#if defined (CONFIG_MACH_DEGASLTE_SPR) || defined(CONFIG_MACH_DEGASLTE_VZW) || defined(CONFIG_MACH_DEGASLTE_SBM)
	msm_gpiomux_install(degaslte_spr_nc_gpios, ARRAY_SIZE(degaslte_spr_nc_gpios));
	msm_gpiomux_install(degasltespr_gpio_10, ARRAY_SIZE(degasltespr_gpio_10));
#endif

#if defined(CONFIG_MACH_DEGASLTE_SBM)
	msm_gpiomux_install(degaslte_sbm_gpios, ARRAY_SIZE(degaslte_sbm_gpios));
#endif
}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	if (of_board_is_liquid())
		msm_gpiomux_install_nowrite(ath_gpio_configs,
					ARRAY_SIZE(ath_gpio_configs));
	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));
#ifdef CONFIG_SENSORS_GP2A_IIO_PROX
	msm_gpiomux_install(msm_proximity_configs, ARRAY_SIZE(msm_proximity_configs));
#endif
	msm_gpiomux_install(msm_mag_sensor_configs, ARRAY_SIZE(msm_mag_sensor_configs));

		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(msm_sensor_configs_dragonboard, \
				ARRAY_SIZE(msm_sensor_configs_dragonboard));
	else
		msm_gpiomux_install(msm_sensor_configs, \
				ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

	msm_gpiomux_install(msm_disp_configs, ARRAY_SIZE(msm_disp_configs));

	if (machine_is_apq8074() && (of_board_is_liquid() || \
	    of_board_is_dragonboard()))
		msm_gpiomux_sdc3_install();

	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(tx_gtr_thres_enable_config, ARRAY_SIZE(tx_gtr_thres_enable_config));
	msm_gpiomux_install(speaker_enable_config, ARRAY_SIZE(speaker_enable_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (of_board_is_liquid() ||
	    (of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm8974_pri_ter_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_ter_auxpcm_configs));
	else
		msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

	if (of_board_is_cdp()) {
#if 0 /* Not used at Mondrian */
		msm_gpiomux_install(msm8974_sec_auxpcm_configs,
				 ARRAY_SIZE(msm8974_sec_auxpcm_configs));
#endif
	} else if (of_board_is_liquid() || of_board_is_fluid() ||
						of_board_is_mtp())
		msm_gpiomux_install(msm_epm_configs,
				ARRAY_SIZE(msm_epm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));
			
	msm_gpiomux_install(gpio_nc_configs, ARRAY_SIZE(gpio_nc_configs));

}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
		socinfo_get_version());
	if (socinfo_get_version() >= 0x20000)
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0xf);

#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	if (!(of_board_is_dragonboard() && machine_is_apq8074()))
		msm_gpiomux_install(msm_eth_configs, \
			ARRAY_SIZE(msm_eth_configs));
#endif
	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif
#if 0 //defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
#endif

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
#if !defined(CONFIG_SENSORS_SSP)
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));
#endif

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));


	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();

	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(fuel_i2c_config, ARRAY_SIZE(fuel_i2c_config));
#if !defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));
#endif
#if defined(CONFIG_SENSORS_SSP)
	msm_gpiomux_install(ssp_configs,
				ARRAY_SIZE(ssp_configs));
#endif

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#if defined(CONFIG_BCM2079X_NFC_I2C) || defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif
	msm_gpiomux_install(msm8974_pri_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_pri_auxpcm_configs));

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#if defined(CONFIG_LEDS_AN30259A)
	if (system_rev < 7) {
		msm_gpiomux_install(an30259a_led_config,
				ARRAY_SIZE(an30259a_led_config));
	}
	else
	{
		msm_gpiomux_install(an30259a_led_config_rev7,
				ARRAY_SIZE(an30259a_led_config_rev7));
	}
#endif

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

	if (of_board_is_dragonboard() && machine_is_apq8074())
		msm_gpiomux_install(apq8074_dragonboard_ts_config,
			ARRAY_SIZE(apq8074_dragonboard_ts_config));

#ifdef CONFIG_SENSORS_HALL
	msm_gpiomux_install(msm8974_hall_configs, ARRAY_SIZE(msm8974_hall_configs));
#endif

#if defined(CONFIG_KEYBOARD_CYPRESS_TOUCHKEY_KS01)
	msm_gpiomux_install(cypress_touch_configs, ARRAY_SIZE(cypress_touch_configs));
#endif

	msm_gpiomux_install(fpga_tflash, ARRAY_SIZE(fpga_tflash));

#if defined(CONFIG_TDMB) || defined(CONFIG_TDMB_MODULE)
	msm_gpiomux_install(tdmb_int_config, ARRAY_SIZE(tdmb_int_config));
#endif

#if defined(CONFIG_MACH_KS01EUR)
	msm_gpiomux_install(batt_rem_alarm_configs,
			ARRAY_SIZE(batt_rem_alarm_configs));
#endif

	msm_gpiomux_install(nc_configs,
			ARRAY_SIZE(nc_configs));
#if defined(CONFIG_MACH_KS01EUR)
	msm_gpiomux_install(wireless_charge_configs, ARRAY_SIZE(wireless_charge_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

#if defined(CONFIG_MACH_MATISSELTE_VZW)
	msm_gpiomux_install(msm_sda_configs, ARRAY_SIZE(msm_sda_configs));
#endif

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

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));
	else
#if defined (CONFIG_MACH_BERLUTI3G_EUR)
		msm_gpiomux_install(msm_cypress_configs,
				ARRAY_SIZE(msm_cypress_configs));

		msm_gpiomux_install(msm_keyboad_cypress_configs,
				ARRAY_SIZE(msm_keyboad_cypress_configs));
#else
		msm_gpiomux_install(msm_synaptics_configs,
				ARRAY_SIZE(msm_synaptics_configs));
#endif
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

  msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));
  msm_gpiomux_install(msm_ta_int_n_configs, ARRAY_SIZE(msm_ta_int_n_configs));
  if(system_rev > 1)
     msm_gpiomux_install(ovp_enable_configs, ARRAY_SIZE(ovp_enable_configs));
  msm_gpiomux_install(msm_hall_configs,
      ARRAY_SIZE(msm_hall_configs));
  if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#if defined(CONFIG_SEC_MATISSE_PROJECT)
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
#endif
	msm_gpiomux_sdc3_install();
#if defined(CONFIG_SEC_MATISSEWIFI_COMMON)
	msm_gpiomux_install(msm_nfc_configs,	ARRAY_SIZE(msm_nfc_configs));
#endif
	/*
	 * HSIC STROBE gpio is also used by the ethernet. Install HSIC
	 * gpio mux config only when HSIC is enabled. HSIC config will
	 * be disabled when ethernet config is enabled.
	 */
#ifdef CONFIG_USB_EHCI_MSM_HSIC
#if !defined(CONFIG_MACH_MATISSE3G_OPEN)
	if (machine_is_msm8926()) {
		msm_hsic_configs[0].gpio = 119; /* STROBE */
		msm_hsic_configs[1].gpio = 120; /* DATA */
	}
	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
#endif
#endif
#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
	msm_gpiomux_install(msm_lineout_en_gpio_configs, ARRAY_SIZE(msm_lineout_en_gpio_configs));
	msm_gpiomux_install(msm_spk_en_gpio_configs, ARRAY_SIZE(msm_spk_en_gpio_configs));
#ifdef CONFIG_SND_SOC_MAX98504
#if defined(CONFIG_MACH_MILLETLTE_OPEN)
				if ( system_rev >= 0 && system_rev < 3)
#elif defined (CONFIG_MACH_MILLET3G_EUR)
				if ( system_rev >= 2 && system_rev < 4)
#elif defined(CONFIG_MACH_MILLETWIFI_OPEN)
				if ( system_rev >= 0 && system_rev < 5)
#endif

		{
			msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
			msm_gpiomux_install(msm8226_blsp_codec_configs,ARRAY_SIZE(msm8226_blsp_codec_configs));
		}
#endif
/* Install NC Configurations */
#if defined(CONFIG_MACH_MATISSEWIFI_OPEN)
	msm_gpiomux_install(matissewifi_open_nc_gpio_cfgs, ARRAY_SIZE(matissewifi_open_nc_gpio_cfgs));
#endif

#if defined(CONFIG_MACH_MATISSELTE_OPEN)
	msm_gpiomux_install(matisselte_open_nc_gpio_cfgs, ARRAY_SIZE(matisselte_open_nc_gpio_cfgs));
#endif

#if defined (CONFIG_MACH_MATISSELTE_VZW)
	msm_gpiomux_install(matisseltevzw_nc_gpio_cfgs, ARRAY_SIZE(matisseltevzw_nc_gpio_cfgs));
#endif

#if defined (CONFIG_MACH_MATISSE3G_OPEN)
	msm_gpiomux_install(matisse3g_nc_gpio_cfgs, ARRAY_SIZE(matisse3g_nc_gpio_cfgs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	int gpio_index = 0;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#ifdef CONFIG_MACH_LGE

	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via W7 Rev 0
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.SIM>>
	// GPIO related function <<17.SLIMBUS>>
	// GPIO related function <<18.RF>>
	// GPIO related function <<19.KEY PAD>>
	// GPIO related function <<20.LOGIC>>

	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(gpio_func_sensor_configs,
			ARRAY_SIZE(gpio_func_sensor_configs));

	msm_gpiomux_install(msm_hall_ic_configs,
			ARRAY_SIZE(msm_hall_ic_configs));

	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(gpio_func_i2c_configs,
			ARRAY_SIZE(gpio_func_i2c_configs));

	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs,
			ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	msm_gpiomux_install(msm_atmel_configs, ARRAY_SIZE(msm_atmel_configs));

	// GPIO related function <<5.NFC>>
	/*                                                      */
#ifdef CONFIG_LGE_NFC_PN547_C2
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
	/*                                                      */


	// GPIO related function <<6.LCD>>
	msm_gpiomux_install_nowrite(msm_lcd_configs, ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install_nowrite(msm_bl_configs, ARRAY_SIZE(msm_bl_configs));

	// GPIO related function <<7.CAMERA>
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

#if 0
/*                                                                                  */
	if(hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
		printk(KERN_ERR " [Camera] below HW_REV_0 is using power source from PM\n");
	}
	else if(hw_rev == HW_REV_A) {
		msm_gpiomux_install(msm_sensor_configs_rev_a, ARRAY_SIZE(msm_sensor_configs_rev_a));
		printk(KERN_ERR " [Camera] greater than HW_REV_A is using power source from Ex-LDO used GPIO\n");
	}
	else if(hw_rev == HW_REV_B) {
		msm_gpiomux_install(msm_sensor_configs_rev_b, ARRAY_SIZE(msm_sensor_configs_rev_b));
		printk(KERN_ERR " [Camera] In greater than HW_REV_B, MAIN_CAM0_RESET_N has been changed from GPIO_98 to GPIO_114\n");
	}
	else {
		msm_gpiomux_install(msm_sensor_configs_rev_c, ARRAY_SIZE(msm_sensor_configs_rev_c));
		printk(KERN_ERR " [Camera] In greater than HW_REV_C, GPIO_110 is used for HI707\n");
	}
/*                                                                                  */
#endif

	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_irrc_configs,
			ARRAY_SIZE(gpio_func_irrc_configs));

	// GPIO related function <<10.AUDIO>>
	msm_gpiomux_install(gpio_func_audio_configs,
			ARRAY_SIZE(gpio_func_audio_configs));

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_install(&sd_card_det, 1);

	// GPIO related function <<12.BATTERY>>


	// GPIO related function <<13.BT>>
	msm_gpiomux_install(gpio_func_bt_configs,
			ARRAY_SIZE(gpio_func_bt_configs));

	// GPIO related function <<14.WIFI>>
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

	// GPIO related function <<15.FM>>


	// GPIO related function <<16.SIM>>


	// GPIO related function <<17.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs,
			ARRAY_SIZE(gpio_func_slimbus_configs));

	// GPIO related function <<18.RF>>
	msm_gpiomux_install(gpio_func_rf_configs,
			ARRAY_SIZE(gpio_func_rf_configs));

	// GPIO related function <<19.KEY PAD>>
	msm_gpiomux_install(msm_keypad_configs,
			ARRAY_SIZE(msm_keypad_configs));

	// GPIO related function <<20.LOGIC>>
	msm_gpiomux_install(gpio_func_logic_configs,
			ARRAY_SIZE(gpio_func_logic_configs));


	/* Moved from the top of this function */
	// GPIO related function <<0.Resreved Pin>>
	switch ( hw_rev ){
		case HW_REV_0 :
		case HW_REV_A :
		case HW_REV_B :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
			}
			break;
		case HW_REV_C :
		case HW_REV_D :
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_10[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_10[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
	}
#endif
}
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up*/
void __init msm8610_init_gpiomux(void)
{
	int rc;
	hw_rev_type revision = lge_get_board_revno();

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

	printk(KERN_INFO"[%s][TOUCH] HW_Revision = %d ", __func__, revision );
	/* Touch gpio Mux */
	if(revision == HW_REV_A)/*For Incell Touch*/
	{
		msm_gpiomux_install(aps_ts_configs, ARRAY_SIZE(aps_ts_configs));
		msm_gpiomux_install(ags04_ts_configs, ARRAY_SIZE(ags04_ts_configs));
	} 
	else if(revision == HW_REV_B)
		msm_gpiomux_install(mms100s_ts_configs, ARRAY_SIZE(mms100s_ts_configs));
	else if(revision == HW_REV_C)
		msm_gpiomux_install(mms100s_ts_configs_rev_c, ARRAY_SIZE(mms100s_ts_configs_rev_c));
	else
		msm_gpiomux_install(synaptics_configs, ARRAY_SIZE(synaptics_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
	msm_gpiomux_install_nowrite(msm_lcd_configs,
				ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install(msm_keypad_configs,
				ARRAY_SIZE(msm_keypad_configs));
	if(revision == HW_REV_B) {
		msm_gpiomux_install(sd_card_det_rev_b, ARRAY_SIZE(sd_card_det));
	} else {
		msm_gpiomux_install(sd_card_det, ARRAY_SIZE(sd_card_det));
	}
	/* LGE_CHANGE_S, Add gpiomux for ex-ldo used gpio, 2013-09-04, [email protected] */
	if(revision == HW_REV_0) {
		msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
		printk(KERN_ERR " [Camera] below HW_REV_0 is using power source from PM\n");
	}
	else if(revision == HW_REV_A) {
		msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
		printk(KERN_ERR " [Camera] greater than HW_REV_A is using power source from Ex-LDO used GPIO\n");
	}
	else {
		msm_gpiomux_install(msm_sensor_configs_rev_b, ARRAY_SIZE(msm_sensor_configs_rev_b));
		printk(KERN_ERR " [Camera] In greater than HW_REV_B, MAIN_CAM0_RESET_N has been changed from GPIO_98 to GPIO_114\n");
	}
/* LGE_CHANGE_E, Add gpiomux for ex-ldo used gpio, 2013-09-04, [email protected] */

	msm_gpiomux_install(msm_gpio_int_configs,
			ARRAY_SIZE(msm_gpio_int_configs));

	/*  LGE_CHANGE_S, [NFC][[email protected]], NFC Bring up */
#ifdef CONFIG_LGE_NFC_PN547
	if (revision <= HW_REV_B){
		msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
	}
	else{
		msm_gpiomux_install(msm_nfc_configs_rev_c, ARRAY_SIZE(msm_nfc_configs_rev_c));
	}
#endif
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up */
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	int gpio_index = 0;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#ifdef CONFIG_MACH_LGE

	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via W7 Rev 0
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.SIM>>
	// GPIO related function <<17.SLIMBUS>>
	// GPIO related function <<18.RF>>
	// GPIO related function <<19.KEY PAD>>
	// GPIO related function <<20.LOGIC>>

	// GPIO related function <<0.Resreved Pin>>
	switch ( hw_rev ){
		case HW_REV_0 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_A :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_B :
		case HW_REV_C :
		case HW_REV_D :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_E[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_E[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
	}

	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(gpio_func_sensor_configs,
			ARRAY_SIZE(gpio_func_sensor_configs));

	msm_gpiomux_install(msm_hall_ic_configs,
			ARRAY_SIZE(msm_hall_ic_configs));

	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(gpio_func_i2c_configs,
			ARRAY_SIZE(gpio_func_i2c_configs));

	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs,
			ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	if(hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_synaptics_configs, ARRAY_SIZE(msm_synaptics_configs));
		printk(KERN_ERR " [Touch] HW_REV_0 uses Synaptics \n");
	}
	else if(hw_rev == HW_REV_A) {
		msm_gpiomux_install(msm_melfas_configs_rev_a, ARRAY_SIZE(msm_melfas_configs_rev_a));
		printk(KERN_ERR "[Touch] HW_REV_A configs \n");
	}
	else if(hw_rev == HW_REV_B){
		msm_gpiomux_install(msm_melfas_configs_rev_b, ARRAY_SIZE(msm_melfas_configs_rev_b));
		printk(KERN_ERR "[Touch] HW_REV_B configs \n");
	}
	else if(hw_rev < HW_REV_E){
		msm_gpiomux_install(msm_melfas_configs_rev_c, ARRAY_SIZE(msm_melfas_configs_rev_c));
		printk(KERN_ERR "[Touch] HW_REV_C configs \n");
	}
	else {
		msm_gpiomux_install(msm_atmel_configs_rev_e, ARRAY_SIZE(msm_atmel_configs_rev_e));
		printk(KERN_ERR " [Touch] HW_REV_E or above use Atmel \n");
	}

	// GPIO related function <<5.NFC>>
	/*	LGE_CHANGE_S, [NFC][[email protected]], NFC Bring up */
#ifdef CONFIG_LGE_NFC_PN547
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
	/*	LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up */


	// GPIO related function <<6.LCD>>
	msm_gpiomux_install(gpio_func_lcd_configs,
			ARRAY_SIZE(gpio_func_lcd_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	// GPIO related function <<7.CAMERA>>
/* LGE_CHANGE_S, Add gpiomux for ex-ldo used gpio, 2013-09-04, [email protected] */
	if(hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
		printk(KERN_ERR " [Camera] below HW_REV_0 is using power source from PM\n");
	}
	else if(hw_rev == HW_REV_A) {
		msm_gpiomux_install(msm_sensor_configs_rev_a, ARRAY_SIZE(msm_sensor_configs_rev_a));
		printk(KERN_ERR " [Camera] greater than HW_REV_A is using power source from Ex-LDO used GPIO\n");
	}
	else if(hw_rev == HW_REV_B) {
		msm_gpiomux_install(msm_sensor_configs_rev_b, ARRAY_SIZE(msm_sensor_configs_rev_b));
		printk(KERN_ERR " [Camera] In greater than HW_REV_B, MAIN_CAM0_RESET_N has been changed from GPIO_98 to GPIO_114\n");
	}
	else {
		msm_gpiomux_install(msm_sensor_configs_rev_c, ARRAY_SIZE(msm_sensor_configs_rev_c));
		printk(KERN_ERR " [Camera] In greater than HW_REV_C, GPIO_110 is used for HI707\n");
	}
/* LGE_CHANGE_E, Add gpiomux for ex-ldo used gpio, 2013-09-04, [email protected] */

	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_flash_led_configs,
			ARRAY_SIZE(gpio_func_flash_led_configs));

	// GPIO related function <<10.AUDIO>>
	msm_gpiomux_install(gpio_func_audio_configs,
			ARRAY_SIZE(gpio_func_audio_configs));

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_install(&sd_card_det, 1);

	// GPIO related function <<12.BATTERY>>
	msm_gpiomux_install(gpio_func_battery_configs,
			ARRAY_SIZE(gpio_func_battery_configs));

	// GPIO related function <<13.BT>>
	msm_gpiomux_install(gpio_func_bt_configs,
			ARRAY_SIZE(gpio_func_bt_configs));

	// GPIO related function <<14.WIFI>>
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	// GPIO related function <<15.FM>>
	msm_gpiomux_install(gpio_func_fm_configs,
			ARRAY_SIZE(gpio_func_fm_configs));

	// GPIO related function <<16.SIM>>
	msm_gpiomux_install(gpio_func_sim_configs,
			ARRAY_SIZE(gpio_func_sim_configs));

	// GPIO related function <<17.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs,
			ARRAY_SIZE(gpio_func_slimbus_configs));

	// GPIO related function <<18.RF>>
	msm_gpiomux_install(gpio_func_rf_configs,
			ARRAY_SIZE(gpio_func_rf_configs));

	// GPIO related function <<19.KEY PAD>>
	if ( hw_rev >= HW_REV_A )
		msm_gpiomux_install(msm_keypad_configs_rev_a,
				ARRAY_SIZE(msm_keypad_configs_rev_a));
	else
		msm_gpiomux_install(msm_keypad_configs,
				ARRAY_SIZE(msm_keypad_configs));

	// GPIO related function <<20.LOGIC>>
	msm_gpiomux_install(gpio_func_logic_configs,
			ARRAY_SIZE(gpio_func_logic_configs));

#endif

#ifndef CONFIG_MACH_LGE
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
		msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif

/* Applied Rev_E board changes */
	if( hw_rev >= HW_REV_E )
	{
		msm_gpiomux_install(pcb_indicator_configs, ARRAY_SIZE(pcb_indicator_configs));
		msm_gpiomux_install(radiation_pwr_ant_configs, ARRAY_SIZE(radiation_pwr_ant_configs));
		msm_gpiomux_install(vt_maker_id_configs, ARRAY_SIZE(vt_maker_id_configs));
	}
}
示例#19
0
void __init msm8226_init_gpiomux(void)
{
    int rc;
#ifdef CONFIG_MACH_LGE
    int gpio_index = 0;
    hw_rev_type hw_rev;
    hw_rev = lge_get_board_revno();
#endif

    // Device Tree Initailize
    rc = msm_gpiomux_init_dt();
    if (rc) {
        pr_err("%s failed %d\n", __func__, rc);
        return;
    }
#ifdef CONFIG_MACH_LGE

    //--------------------------------------------
    // MSM8X26 GPIO Confiuration via W7 Rev 0
    //--------------------------------------------
    // GPIO related function <<0.Resreved Pin>>
    // GPIO related function <<1.SENSOR>>
    // GPIO related function <<2.I2C>>
    // GPIO related function <<3.UART>>
    // GPIO related function <<4.TOUCH>>
    // GPIO related function <<5.NFC>>
    // GPIO related function <<6.LCD>>
    // GPIO related function <<7.CAMERA>>
    // GPIO related function <<8.FLASH LED>>
    // GPIO related function <<9.IRRC>>
    // GPIO related function <<10.AUDIO>>
    // GPIO related function <<11.SD CARD>>
    // GPIO related function <<12.BATTERY>>
    // GPIO related function <<13.BT>>
    // GPIO related function <<14.WIFI>>
    // GPIO related function <<15.FM>>
    // GPIO related function <<16.SIM>>
    // GPIO related function <<17.SLIMBUS>>
    // GPIO related function <<18.RF>>
    // GPIO related function <<19.KEY PAD>>
    // GPIO related function <<20.LOGIC>>

    /* Moved to the last of this function */
#if 0
    // GPIO related function <<0.Resreved Pin>>
    switch ( hw_rev ) {
    case HW_REV_0 :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_A :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_B :
    case HW_REV_C :
    case HW_REV_D :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_E :
    case HW_REV_1_0 :
    case HW_REV_1_1 :
    default :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_E[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_E[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    }
#endif // 0

    // GPIO related function <<1.SENSOR>>
    msm_gpiomux_install(gpio_func_sensor_configs,
                        ARRAY_SIZE(gpio_func_sensor_configs));

    msm_gpiomux_install(msm_hall_ic_configs,
                        ARRAY_SIZE(msm_hall_ic_configs));

    // GPIO related function <<2.I2C>>
    msm_gpiomux_install(gpio_func_i2c_configs,
                        ARRAY_SIZE(gpio_func_i2c_configs));

    // GPIO related function <<3.UART>>
    msm_gpiomux_install(gpio_func_uart_configs,
                        ARRAY_SIZE(gpio_func_uart_configs));

    // GPIO related function <<4.TOUCH>>
    msm_gpiomux_install(msm_atmel_configs, ARRAY_SIZE(msm_atmel_configs));
    printk(KERN_ERR " [Touch] HW_REV for Atmel Touch IC \n");

    // GPIO related function <<5.NFC>>
    /*                                                      */
#ifdef CONFIG_LGE_NFC_PN547
    msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
    /*                                                      */


    // GPIO related function <<6.LCD>>
    //msm_gpiomux_install(msm_lcd_configs_rev_0, ARRAY_SIZE(msm_lcd_configs_rev_0));

    //msm_gpiomux_install(msm_bl_configs_rev_0, ARRAY_SIZE(msm_bl_configs_rev_0));

    // GPIO related function <<7.CAMERA>>
    msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

    // GPIO related function <<8.FLASH LED>>
    msm_gpiomux_install(gpio_func_flash_led_configs,
                        ARRAY_SIZE(gpio_func_flash_led_configs));

    // GPIO related function <<10.AUDIO>>
    msm_gpiomux_install(gpio_func_audio_configs,
                        ARRAY_SIZE(gpio_func_audio_configs));

    // GPIO related function <<11.SD CARD>>
    msm_gpiomux_install(&sd_card_det, 1);

    // GPIO related function <<12.BATTERY>>
    msm_gpiomux_install(gpio_func_battery_configs,
                        ARRAY_SIZE(gpio_func_battery_configs));

    // GPIO related function <<13.BT>>
    msm_gpiomux_install(gpio_func_bt_configs,
                        ARRAY_SIZE(gpio_func_bt_configs));

    // GPIO related function <<14.WIFI>>
    msm_gpiomux_install(wcnss_5wire_interface,
                        ARRAY_SIZE(wcnss_5wire_interface));

    // GPIO related function <<15.FM>>
    msm_gpiomux_install(gpio_func_fm_configs,
                        ARRAY_SIZE(gpio_func_fm_configs));

    // GPIO related function <<16.SIM>>
    msm_gpiomux_install(gpio_func_sim_configs,
                        ARRAY_SIZE(gpio_func_sim_configs));

    // GPIO related function <<17.SLIMBUS>>
    msm_gpiomux_install(gpio_func_slimbus_configs,
                        ARRAY_SIZE(gpio_func_slimbus_configs));

    // GPIO related function <<18.RF>>
    msm_gpiomux_install(gpio_func_rf_configs,
                        ARRAY_SIZE(gpio_func_rf_configs));

    // GPIO related function <<19.KEY PAD>>
    if ( hw_rev >= HW_REV_A )
        msm_gpiomux_install(msm_keypad_configs_rev_a,
                            ARRAY_SIZE(msm_keypad_configs_rev_a));
    else
        msm_gpiomux_install(msm_keypad_configs,
                            ARRAY_SIZE(msm_keypad_configs));

    // GPIO related function <<20.LOGIC>>
    msm_gpiomux_install(gpio_func_logic_configs,
                        ARRAY_SIZE(gpio_func_logic_configs));

#endif

#ifndef CONFIG_MACH_LGE
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
    msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif

    msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

    msm_gpiomux_install(msm_auxpcm_configs,
                        ARRAY_SIZE(msm_auxpcm_configs));

    if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
        msm_gpiomux_install(usb_otg_sw_configs,
                            ARRAY_SIZE(usb_otg_sw_configs));
#endif

    /* Applied Rev_E board changes */
    if( hw_rev >= HW_REV_E )
    {
        msm_gpiomux_install(pcb_indicator_configs, ARRAY_SIZE(pcb_indicator_configs));
        msm_gpiomux_install(radiation_pwr_ant_configs, ARRAY_SIZE(radiation_pwr_ant_configs));
        msm_gpiomux_install(vt_maker_id_configs, ARRAY_SIZE(vt_maker_id_configs));
    }

    /* Moved from the top of this function */
    // GPIO related function <<0.Resreved Pin>>
    switch ( hw_rev ) {
    case HW_REV_0 :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_A :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_B :
    case HW_REV_C :
    case HW_REV_D :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_E :
    case HW_REV_1_0 :
    case HW_REV_1_1 :
    default :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_E[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_E[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    }
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

/* Battery charging and BMS GPIO */
	msm_gpiomux_install(msm_ta_nchg_configs, ARRAY_SIZE(msm_ta_nchg_configs));


#if defined(CONFIG_SEC_ATLANTIC_PROJECT)
	msm_gpiomux_install(msm_hrm_configs,
		ARRAY_SIZE(msm_hrm_configs));
#endif
	msm_gpiomux_install(msm_nfc_configs,
		ARRAY_SIZE(msm_nfc_configs));

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

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));
	else
#if defined (CONFIG_MACH_BERLUTI3G_EUR)
		msm_gpiomux_install(msm_cypress_configs,
				ARRAY_SIZE(msm_cypress_configs));

		msm_gpiomux_install(msm_keyboad_cypress_configs,
				ARRAY_SIZE(msm_keyboad_cypress_configs));
#else
		msm_gpiomux_install(msm_synaptics_configs,
				ARRAY_SIZE(msm_synaptics_configs));
#endif
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#if defined(CONFIG_SEC_ATLANTIC_PROJECT)
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));
#endif

	/*
	 * gpio mux settings for the NC GPIOs	
	 */
	msm_gpiomux_install(afyon_nc_gpio_cfgs,
			ARRAY_SIZE(afyon_nc_gpio_cfgs));

	msm_gpiomux_sdc3_install();

	/*
	 * HSIC STROBE gpio is also used by the ethernet. Install HSIC
	 * gpio mux config only when HSIC is enabled. HSIC config will
	 * be disabled when ethernet config is enabled.
	 */
#ifdef CONFIG_USB_EHCI_MSM_HSIC
	if (machine_is_msm8926()) {
		msm_hsic_configs[0].gpio = 119; /* STROBE */
		msm_hsic_configs[1].gpio = 120; /* DATA */
	}
	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
#endif
#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
#ifdef CONFIG_SND_SOC_MAX98504
#if defined(CONFIG_MACH_MILLETLTE_OPEN)
				if ( system_rev >= 0 && system_rev < 3)
#elif defined (CONFIG_MACH_MILLET3G_EUR)
				if ( system_rev >= 2 && system_rev < 4)
#elif defined(CONFIG_MACH_MILLETWIFI_OPEN)
				if ( system_rev >= 0 && system_rev < 5)
#endif

		{
			msm_gpiomux_install(msm8226_tertiary_mi2s_configs,ARRAY_SIZE(msm8226_tertiary_mi2s_configs));
		}
#endif
}
/*                                                                                               */

static struct msm_gpiomux_config msm_keypad_configs[] __initdata = {
	{
		.gpio = 72,
		.settings = {
			[GPIOMUX_ACTIVE]    = &gpio_keys_active,
			[GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
		},
	},
	{
		.gpio = 73,
		.settings = {
			[GPIOMUX_ACTIVE]    = &gpio_keys_active,
			[GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
		},
	},
	{
		.gpio = 74,
		.settings = {
			[GPIOMUX_ACTIVE]    = &gpio_keys_active,
			[GPIOMUX_SUSPENDED] = &gpio_keys_suspend,
		},
	},
};

static struct gpiomux_setting sd_card_det_active_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_NONE,
	.dir = GPIOMUX_IN,
};

#ifdef CONFIG_MACH_LGE
static struct gpiomux_setting sd_card_det_suspend_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_NONE,
	.dir = GPIOMUX_IN,
};
#else
static struct gpiomux_setting sd_card_det_suspend_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_UP,
	.dir = GPIOMUX_IN,
};
#endif

static struct msm_gpiomux_config sd_card_det[] __initdata = {
	{
		.gpio = 42,
		.settings = {
			[GPIOMUX_ACTIVE]    = &sd_card_det_active_config,
			[GPIOMUX_SUSPENDED] = &sd_card_det_suspend_config,
		},
	},
};

#if defined(CONFIG_MACH_LGE) && defined(CONFIG_SWITCH_SPK_RCV)
//                                                                           
static struct gpiomux_setting spk_rcv_active_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_8MA,
	.pull = GPIOMUX_PULL_DOWN,
	.dir = GPIOMUX_OUT_HIGH
};


static struct msm_gpiomux_config msm_spk_rcv_det[] __initdata = {
	{
		.gpio = 19,
		.settings = {
			[GPIOMUX_ACTIVE] = &spk_rcv_active_config,
		},
	}
};
#endif/*                                      */

#ifdef CONFIG_FMR_INTENNA
//                                                              
static struct gpiomux_setting fmr_intenna_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_8MA,
	.pull = GPIOMUX_PULL_DOWN,
	.dir = GPIOMUX_OUT_HIGH
};

static struct msm_gpiomux_config fmr_intenna_det[] __initdata = {
	{
		.gpio = 58,
		.settings = {
			[GPIOMUX_ACTIVE] = &fmr_intenna_config,
		},
	}
};
#endif

/// Rev_E
#ifdef CONFIG_MACH_LGE
static struct gpiomux_setting pcb_indicator_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_NONE,
	.dir = GPIOMUX_IN
};

static struct msm_gpiomux_config pcb_indicator[] __initdata = {
	{
		.gpio = 59,	/* Low Band */
		.settings = {
			[GPIOMUX_ACTIVE] = &pcb_indicator_config,
			[GPIOMUX_SUSPENDED] = &pcb_indicator_config,
		},
	},
	{
		.gpio = 83,	/* High Band */
		.settings = {
			[GPIOMUX_ACTIVE] = &pcb_indicator_config,
			[GPIOMUX_SUSPENDED] = &pcb_indicator_config,
		},
	},
	{
		.gpio = 84,	/* FMR */
		.settings = {
			[GPIOMUX_ACTIVE] = &pcb_indicator_config,
			[GPIOMUX_SUSPENDED] = &pcb_indicator_config,
		},
	}
};
#endif /*                 */

#ifdef CONFIG_MACH_LGE
static struct gpiomux_setting main_cam_id_gpio_act_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_UP,
	.dir = GPIOMUX_IN
};
static struct gpiomux_setting main_cam_id_gpio_sus_config = {
	.func = GPIOMUX_FUNC_GPIO,
	.drv = GPIOMUX_DRV_2MA,
	.pull = GPIOMUX_PULL_NONE,
	.dir = GPIOMUX_IN
};

static struct msm_gpiomux_config main_cam_id_gpio[] __initdata = {
	{
		.gpio = 71,
		.settings = {
			[GPIOMUX_ACTIVE] = &main_cam_id_gpio_act_config,
			[GPIOMUX_SUSPENDED] = &main_cam_id_gpio_sus_config,
		}
	}
};
#endif /*                 */
void __init msm8610_init_gpiomux(void)
{
	int rc;

#ifdef CONFIG_MACH_LGE
	int gpio_index = 0;
	//2013-07-29, seungkyu.joo, add gpio85 config for revA[End]
      hw_rev_type lge_bd_rev = lge_get_board_revno();
	//2013-07-29, seungkyu.joo, add gpio85 config for revA[End]
#endif

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#ifdef CONFIG_MACH_LGE
	//--------------------------------------------
	// MSM8X10 GPIO Confiuration via W3
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.SIM>>
	// GPIO related function <<17.SLIMBUS>>
	// GPIO related function <<18.RF>>
	// GPIO related function <<19.KEY PAD>>
	// GPIO related function <<20.LOGIC>>

	switch ( lge_bd_rev ){
		case HW_REV_0 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x10_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			msm_gpiomux_install(msm_sensor_configs_revA, ARRAY_SIZE(msm_sensor_configs_revA)); //                                                                          
			break;
		case HW_REV_A :
            for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x10_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			msm_gpiomux_install(msm_sensor_configs_revA, ARRAY_SIZE(msm_sensor_configs_revA)); //                                                                          
			break;
		case HW_REV_B :
		case HW_REV_C :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_C[gpio_index] < MSM8x10_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_C[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
            msm_gpiomux_install(msm_sensor_configs_revB, ARRAY_SIZE(msm_sensor_configs_revB)); //                                                                          
            break;
		case HW_REV_D :
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_E[gpio_index] < MSM8x10_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_E[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			msm_gpiomux_install(msm_sensor_configs_revB, ARRAY_SIZE(msm_sensor_configs_revB)); //                                                                          
			msm_gpiomux_install(pcb_indicator, ARRAY_SIZE(pcb_indicator));
			msm_gpiomux_install(main_cam_id_gpio, ARRAY_SIZE(main_cam_id_gpio));	/* MAIN_CAM_ID */
			break;
	}
#endif

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
	if (of_board_is_qrd()) {
		msm_gpiomux_install(msm_focaltech_configs,
			ARRAY_SIZE(msm_focaltech_configs));
	} else {
		if(lge_bd_rev < HW_REV_E) {
			printk(KERN_ERR "[TOUCH] Set GPIO for MELFAS \n");
			msm_gpiomux_install(msm_melfas_configs, ARRAY_SIZE(msm_melfas_configs));
		}else{
			printk(KERN_ERR "[TOUCH] Set GPIO for greater than Rev.E \n");
			msm_gpiomux_install(msm_syunap_configs, ARRAY_SIZE(msm_syunap_configs));
		}
	}
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
	msm_gpiomux_install_nowrite(msm_lcd_configs,
				ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install(msm_keypad_configs,
				ARRAY_SIZE(msm_keypad_configs));
	msm_gpiomux_install(sd_card_det, ARRAY_SIZE(sd_card_det));
	msm_gpiomux_install(msm_gpio_int_configs,
			ARRAY_SIZE(msm_gpio_int_configs));

#if defined (CONFIG_LGE_BROADCAST_ONESEG)
	if(lge_get_board_revno()>= HW_REV_B)
	msm_gpiomux_install(lge_1seg_blsp_configs, ARRAY_SIZE(lge_1seg_blsp_configs));	
	else if(lge_get_board_revno()== HW_REV_A)
	msm_gpiomux_install(lge_1seg_blsp_configs_revA, ARRAY_SIZE(lge_1seg_blsp_configs_revA));	
	else
	msm_gpiomux_install(lge_1seg_blsp_configs_rev0, ARRAY_SIZE(lge_1seg_blsp_configs_rev0));	
#endif  /*                             */
#if defined(CONFIG_MACH_LGE) && defined(CONFIG_SWITCH_SPK_RCV)
//                                                                           
	msm_gpiomux_install(msm_spk_rcv_det,
			ARRAY_SIZE(msm_spk_rcv_det));
#endif/*                                       */

#ifdef CONFIG_FMR_INTENNA
//                                                              
	msm_gpiomux_install(fmr_intenna_det,
		ARRAY_SIZE(fmr_intenna_det));
#endif

}
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

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

#ifndef CONFIG_MACH_LGE
	msm_gpiomux_install(msm_blsp2_uart7_configs,
			 ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

	msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
		msm_gpiomux_install(hap_lvl_shft_config,
				ARRAY_SIZE(hap_lvl_shft_config));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);

	if (machine_is_apq8074() && (of_board_is_liquid() || \
	    of_board_is_dragonboard()))
		msm_gpiomux_sdc3_install();

	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));

	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
	if (of_board_is_fluid())
		msm_gpiomux_install(msm_mhl_configs,
				    ARRAY_SIZE(msm_mhl_configs));

#ifndef CONFIG_MACH_LGE
	msm_gpiomux_install(msm8974_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_auxpcm_configs));
#endif
	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));

	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#if defined(CONFIG_MACH_LGE)
	if (HW_REV_B == lge_get_board_revno()) {
		msm_gpiomux_install(slimport_configs_rev_b,
					ARRAY_SIZE(slimport_configs_rev_b));
		printk(KERN_INFO "slimport gpio configs for rev.B upper\n");
	} else if (HW_REV_1_0 == lge_get_board_revno()) {
		msm_gpiomux_install(slimport_configs,
					ARRAY_SIZE(slimport_configs));
		printk(KERN_INFO "slimport gpio configs for evb\n");
	} else {
		msm_gpiomux_install(slimport_configs_rev_a,
					ARRAY_SIZE(slimport_configs_rev_a));
		printk(KERN_INFO "slimport gpio configs for rev.A\n");
	}
/* msm_gpiomux_install(msm_display_configs, ARRAY_SIZE(msm_display_configs)); */
#endif
#if 0 /* disable sensor GPIO setting (enable ADSP)*/
	msm_gpiomux_install(sensor_configs, ARRAY_SIZE(sensor_configs));
#endif
#if defined(CONFIG_LGE_SM100) || defined(CONFIG_TSPDRV)
	msm_gpiomux_install(vibrator_configs, ARRAY_SIZE(vibrator_configs));
#endif
#ifdef CONFIG_EARJACK_DEBUGGER
	msm_gpiomux_install(msm_earjack_debugger_configs,
			ARRAY_SIZE(msm_earjack_debugger_configs));
#endif
}
示例#23
0
void __init msm_8974_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	pr_err("%s:%d socinfo_get_version %x\n", __func__, __LINE__,
	socinfo_get_version());
	msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);

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

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	msm_gpiomux_install(msm_blsp2_uart7_configs, ARRAY_SIZE(msm_blsp2_uart7_configs));
#endif

#if defined(CONFIG_BT_BCM4335) || defined(CONFIG_BT_BCM4339)
	msm_gpiomux_btuart_install();
	if(system_rev < 5)
	{
		msm_gpiomux_install(msm8974_btwifi_ldo_en_configs, ARRAY_SIZE(msm8974_btwifi_ldo_en_configs));
	}
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(msm8974_slimbus_config,
			ARRAY_SIZE(msm8974_slimbus_config));

#if defined(CONFIG_MACH_LT03SKT) || defined(CONFIG_MACH_LT03KTT) ||defined(CONFIG_MACH_LT03LGT)
	msm_gpiomux_install(ext_buck_configs, ARRAY_SIZE(ext_buck_configs));
#endif
	msm_gpiomux_install(msm_grip_configs, ARRAY_SIZE(msm_grip_configs));
	msm_gpiomux_install(hw_rev_configs, ARRAY_SIZE(hw_rev_configs));
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	msm_gpiomux_install(&sd_card_det, 1);
	msm_gpiomux_sdc3_install();
	msm_gpiomux_sdc4_install();

	msm_gpiomux_install(msm_taiko_config, ARRAY_SIZE(msm_taiko_config));
	msm_gpiomux_install(ear_send_end_config, ARRAY_SIZE(ear_send_end_config));

	msm_gpiomux_install(msm_hsic_configs, ARRAY_SIZE(msm_hsic_configs));
	msm_gpiomux_install(msm_hsic_hub_configs,
				ARRAY_SIZE(msm_hsic_hub_configs));

	msm_gpiomux_install(msm_hdmi_configs, ARRAY_SIZE(msm_hdmi_configs));
#if defined(CONFIG_PN547_NFC)
	msm_gpiomux_install(msm_nfc_configs,
	ARRAY_SIZE(msm_nfc_configs));
#endif

#if defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE)
	msm_gpiomux_wlan_host_wakeup_install();
#endif /* defined(CONFIG_BCM4335) || defined(CONFIG_BCM4335_MODULE) || defined(CONFIG_BCM4339) || defined(CONFIG_BCM4339_MODULE) */

#ifdef CONFIG_VIDEO_MHL_V2
	msm_gpiomux_install(mhl_configs, ARRAY_SIZE(mhl_configs));
#endif

	msm_gpiomux_install(msm8974_pri_auxpcm_configs,
				 ARRAY_SIZE(msm8974_pri_auxpcm_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));
#if !defined(CONFIG_BT_BCM4335) && !defined(CONFIG_BT_BCM4339)
	if (of_board_is_rumi())
		msm_gpiomux_install(msm_rumi_blsp_configs,
				    ARRAY_SIZE(msm_rumi_blsp_configs));
#endif

	msm_gpiomux_install(msm8974_audio_configs, ARRAY_SIZE(msm8974_audio_configs));
#ifdef CONFIG_INPUT_WACOM
		msm_gpiomux_install(msm8974_wacom_configs,
			ARRAY_SIZE(msm8974_wacom_configs));
#endif

	msm_gpiomux_install(msm_sensors_configs,
			ARRAY_SIZE(msm_sensors_configs));
	if (socinfo_get_platform_subtype() == PLATFORM_SUBTYPE_MDM)
		msm_gpiomux_install(mdm_configs,
			ARRAY_SIZE(mdm_configs));

#ifdef CONFIG_USB_SWITCH_FSA9485
	if (system_rev >= 7)
		msm_gpiomux_install(lt03_r04_muic_configs,
				ARRAY_SIZE(lt03_r04_muic_configs));
	else
		msm_gpiomux_install(lt03_muic_configs,
				ARRAY_SIZE(lt03_muic_configs));
#endif
	msm_gpiomux_install(gpio_nc_configs,ARRAY_SIZE(gpio_nc_configs));
#ifdef CONFIG_FB_MSM_EDP_SAMSUNG
	msm_gpiomux_install(msm8974_lcd_config,
			ARRAY_SIZE(msm8974_lcd_config));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	msm_gpiomux_install(msm_keypad_configs,
			ARRAY_SIZE(msm_keypad_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_blsp_configs,
			ARRAY_SIZE(msm_skuf_blsp_configs));
	else
		msm_gpiomux_install(msm_blsp_configs,
			ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);
	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_goodix_configs,
				ARRAY_SIZE(msm_skuf_goodix_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_skuf_nfc_configs,
				ARRAY_SIZE(msm_skuf_nfc_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	if (of_board_is_skuf())
		msm_gpiomux_install(msm_sensor_configs_skuf_plus,
			ARRAY_SIZE(msm_sensor_configs_skuf_plus));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
	msm_gpiomux_install(msm_nativesensors_configs,ARRAY_SIZE(msm_nativesensors_configs));

	msm_gpiomux_install(muic_gpio_config, ARRAY_SIZE(muic_gpio_config));

	msm_gpiomux_install(tkey_led_gpio_configs, ARRAY_SIZE(tkey_led_gpio_configs));

	/* Cover ID */
	msm_gpiomux_install(msm_cover_id_configs,
		ARRAY_SIZE(msm_cover_id_configs));

	msm_gpiomux_install(hw_chk_bit_configs, ARRAY_SIZE(hw_chk_bit_configs));

	msm_gpiomux_install(tsp_id_configs, ARRAY_SIZE(tsp_id_configs));

#if defined(CONFIG_NFC_PN547)
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif

	/*
	 * gpio mux settings for the NC GPIOs
	 */
	msm_gpiomux_install(gpio_nc_configs,
			ARRAY_SIZE(gpio_nc_configs));

#if defined(CONFIG_SAMSUNG_JACK)
	msm_gpiomux_install(msm_earjack_gpio_configs, ARRAY_SIZE(msm_earjack_gpio_configs));
#endif
#ifdef CONFIG_SND_SOC_MAX98505
	msm_gpiomux_install(msm8226_max98504_i2c_configs,ARRAY_SIZE(msm8226_max98504_i2c_configs));
#endif
#ifdef CONFIG_LEDS_KTD2026
	msm_gpiomux_install(msm_ktd2026_i2c_configs,ARRAY_SIZE(msm_ktd2026_i2c_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
	int gpio_index = 0;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via JAGUAR
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.WLC>>
	// GPIO related function <<17.SIM>>
	// GPIO related function <<18.SLIMBUS>>
	// GPIO related function <<19.RF>>
	// GPIO related function <<20.KEY PAD>>
	// GPIO related function <<21.LOGIC>>

	// GPIO related function <<0.Resreved Pin>>
	switch ( hw_rev ){
		case HW_REV_0 :
#if 0
            for ( gpio_index = 0 ; gpio_reserved_pin_rev_zero[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_zero[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
#endif
			break;
		case HW_REV_A :
            for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_B :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
		case HW_REV_C :
		case HW_REV_D :
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
				}
			break;
	}

	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(msm_sensor_ic_configs, ARRAY_SIZE(msm_sensor_ic_configs));

	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(msm_i2c_configs, ARRAY_SIZE(msm_i2c_configs));

	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs, ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	if (hw_rev >= HW_REV_A) {
		msm_gpiomux_install(msm_touch_configs, ARRAY_SIZE(msm_touch_configs));
		printk(KERN_ERR "[Touch] HW_REV_A configs \n");
	}

	// GPIO related function <<5.NFC>>
/*  LGE_CHANGE_S, [NFC][[email protected]], NFC Bring up */
#ifdef CONFIG_LGE_NFC_PN544_C3
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up */

	// GPIO related function <<6.LCD>>
	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	// GPIO related function <<7.CAMERA>>
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_flash_led_configs, ARRAY_SIZE(gpio_func_flash_led_configs));

	// GPIO related function <<10.AUDIO>>

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_sdc3_install();

	// GPIO related function <<12.BATTERY>>
	msm_gpiomux_install(power_configs, ARRAY_SIZE(power_configs));

	// GPIO related function <<13.BT>>
#ifdef CONFIG_LGE_BLUETOOTH
    bluetooth_msm_gpiomux_install();
#endif /* CONFIG_LGE_BLUETOOTH */

	// GPIO related function <<14.WIFI>>
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	// GPIO related function <<15.FM>>
	msm_gpiomux_install(msm_auxpcm_configs,	ARRAY_SIZE(msm_auxpcm_configs));

	// GPIO related function <<16.WLC>>
	msm_gpiomux_install(&gpio_func_wlc_config, 1);

	// GPIO related function <<17.SIM>>
	msm_gpiomux_install(gpio_func_sim_configs, ARRAY_SIZE(gpio_func_sim_configs));

	// GPIO related function <<18.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs, ARRAY_SIZE(gpio_func_slimbus_configs));

	// GPIO related function <<19.RF>>
	msm_gpiomux_install(gpio_func_rf_configs, ARRAY_SIZE(gpio_func_rf_configs));

	// GPIO related function <<20.KEY PAD>>
	msm_gpiomux_install(msm_keypad_configs, ARRAY_SIZE(msm_keypad_configs));

	// GPIO related function <<21.LOGIC>>
	msm_gpiomux_install(ext_ldo_en_configs, ARRAY_SIZE(ext_ldo_en_configs));

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

#ifndef CONFIG_MACH_LGE
	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif

#ifdef CONFIG_SND_BRCM_FM_RADIO
	msm_gpiomux_install(msm_pri_mi2s_configs, ARRAY_SIZE(msm_pri_mi2s_configs));
#endif
}
void __init ursa_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	/* shared with all board revisions P0 - EVT */
	msm_gpiomux_install(ursa_audio_configs_common, ARRAY_SIZE(ursa_audio_configs_common));
	msm_gpiomux_install(ursa_camera_configs_common, ARRAY_SIZE(ursa_camera_configs_common));
	msm_gpiomux_install(ursa_sensor_configs_common, ARRAY_SIZE(ursa_sensor_configs_common));
	msm_gpiomux_install_nowrite(ursa_display_configs, ARRAY_SIZE(ursa_display_configs));
	msm_gpiomux_install(ursa_nfc_configs, ARRAY_SIZE(ursa_nfc_configs));
	msm_gpiomux_install(ursa_system_configs_common, ARRAY_SIZE(ursa_system_configs_common));
	msm_gpiomux_install(ursa_touch_configs_common, ARRAY_SIZE(ursa_touch_configs_common));

	if (ursa_board_revision() == URSA_REVISION_P1)
	{
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if (ursa_board_revision() == URSA_REVISION_P0_5)
	{
		/* shared with P1 family*/
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* different for P0.5 */
		msm_gpiomux_install(ursa_configs_p0_5, ARRAY_SIZE(ursa_configs_p0_5));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_P2) ||
		 (ursa_board_revision() == URSA_REVISION_PRE_EVT))
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_sensor_configs_p1_pre_evt, ARRAY_SIZE(ursa_sensor_configs_p1_pre_evt));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* different for P2 */
		msm_gpiomux_install(ursa_camera_configs_p2, ARRAY_SIZE(ursa_camera_configs_p2));
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_EVT)  ||
		 (ursa_board_revision() == URSA_REVISION_P0_E))
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_camera_configs_p2, ARRAY_SIZE(ursa_camera_configs_p2));
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* before pre DVT */
		msm_gpiomux_install(ursa_camera_configs_p1p2evt_common, ARRAY_SIZE(ursa_camera_configs_p1p2evt_common));
	}
	else if ((ursa_board_revision() == URSA_REVISION_PRE_DVT) )
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* pre DVT */
		msm_gpiomux_install(ursa_camera_configs_pre_dvt, ARRAY_SIZE(ursa_camera_configs_pre_dvt));
	}
	else if ((ursa_board_revision() == URSA_REVISION_DVT) ||
		 (ursa_board_revision() == URSA_REVISION_DVT3GS) ||
		 (ursa_board_revision() == URSA_REVISION_PRE_DVT2) )
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_camera_configs_p1p2common, ARRAY_SIZE(ursa_camera_configs_p1p2common));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* DVT */
		msm_gpiomux_install(ursa_camera_configs_dvt, ARRAY_SIZE(ursa_camera_configs_dvt));
	}
	else if (ursa_board_revision() == URSA_REVISION_DVTHD)
	{
		/* shared with P1 family */
		msm_gpiomux_install(ursa_audio_configs_p1, ARRAY_SIZE(ursa_audio_configs_p1));
		msm_gpiomux_install(ursa_bt_wifi_configs_p1, ARRAY_SIZE(ursa_bt_wifi_configs_p1));
		msm_gpiomux_install(ursa_system_configs_p1, ARRAY_SIZE(ursa_system_configs_p1));
		msm_gpiomux_install(ursa_touch_configs_p1, ARRAY_SIZE(ursa_touch_configs_p1));
		/* shared with P2 */
		msm_gpiomux_install(ursa_nfc_configs_p2, ARRAY_SIZE(ursa_nfc_configs_p2));
		msm_gpiomux_install(ursa_system_configs_p2, ARRAY_SIZE(ursa_system_configs_p2));
		/* DVT */
		msm_gpiomux_install(ursa_camera_configs_dvt, ARRAY_SIZE(ursa_camera_configs_dvt));
		/* DVTHD */
		msm_gpiomux_install(ursa_camera_configs_dvthd, ARRAY_SIZE(ursa_camera_configs_dvthd));
		msm_gpiomux_install(ursa_hdmi_configs, ARRAY_SIZE(ursa_hdmi_configs));
	}
	else
	{
		pr_crit("%s - Invalid board revision\n", __func__);
		panic("ursa-gpiomux: Invalid board revision");
	}

	// Switch camera MCLK source to alternate clocks
	if (socinfo_get_version() >= 0x20000) {
		msm_tlmm_misc_reg_write(TLMM_SPARE_REG, 0x5);
	}
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	int gpio_index;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

#ifdef CONFIG_MACH_LGE
	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via W7 Rev 0
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.SIM>>
	// GPIO related function <<17.SLIMBUS>>
	// GPIO related function <<18.RF>>
	// GPIO related function <<19.KEY PAD>>
	// GPIO related function <<20.LOGIC>>

	// GPIO related function <<0.Resreved Pin>>
	switch (hw_rev) {
	case HW_REV_A:
		for (gpio_index = 0; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END; gpio_index++) {
			gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
			msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
		}
		break;
	case HW_REV_B:
	default:
		for (gpio_index = 0; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END; gpio_index++) {
			gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
			msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
		}
		break;
	}

	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(gpio_func_sensor_configs,
			ARRAY_SIZE(gpio_func_sensor_configs));

	msm_gpiomux_install(msm_hall_ic_configs,
			ARRAY_SIZE(msm_hall_ic_configs));

	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(gpio_func_i2c_configs,
			ARRAY_SIZE(gpio_func_i2c_configs));

	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs,
			ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	msm_gpiomux_install(msm_synaptics_configs,
			ARRAY_SIZE(msm_synaptics_configs));

	// GPIO related function <<5.NFC>>
	/*                                                      */
#ifdef CONFIG_LGE_NFC_PN547_C2
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
	/*                                                      */


	// GPIO related function <<6.LCD>>
	msm_gpiomux_install(gpio_func_lcd_configs,
			ARRAY_SIZE(gpio_func_lcd_configs));

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_configs));

	// GPIO related function <<7.CAMERA>>
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_flash_led_configs,
			ARRAY_SIZE(gpio_func_flash_led_configs));

	// GPIO related function <<10.AUDIO>>
	msm_gpiomux_install(gpio_func_audio_configs,
			ARRAY_SIZE(gpio_func_audio_configs));

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_install(&sd_card_det, 1);

	// GPIO related function <<12.BATTERY>>
	msm_gpiomux_install(gpio_func_battery_configs,
			ARRAY_SIZE(gpio_func_battery_configs));

	// GPIO related function <<13.BT>>
	/*msm_gpiomux_install(gpio_func_bt_configs,
			ARRAY_SIZE(gpio_func_bt_configs)); */
#ifdef CONFIG_LGE_BLUETOOTH
    bluetooth_msm_gpiomux_install();
#endif  /*                      */

	// GPIO related function <<14.WIFI>>
#if defined ( CONFIG_BCMDHD ) || defined ( CONFIG_BCMDHD_MODULE )
#else
	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));
#endif
	
	// GPIO related function <<15.FM>>
	msm_gpiomux_install(gpio_func_fm_configs,
			ARRAY_SIZE(gpio_func_fm_configs));

	// GPIO related function <<16.SIM>>
	msm_gpiomux_install(gpio_func_sim_configs,
			ARRAY_SIZE(gpio_func_sim_configs));

	// GPIO related function <<17.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs,
			ARRAY_SIZE(gpio_func_slimbus_configs));

	// GPIO related function <<18.RF>>
	msm_gpiomux_install(gpio_func_rf_configs,
			ARRAY_SIZE(gpio_func_rf_configs));

	// GPIO related function <<19.KEY PAD>>
	msm_gpiomux_install(msm_keypad_configs,
				ARRAY_SIZE(msm_keypad_configs));

	// GPIO related function <<20.LOGIC>>
	msm_gpiomux_install(gpio_func_logic_configs,
			ARRAY_SIZE(gpio_func_logic_configs));
#endif

#ifndef CONFIG_MACH_LGE
#if defined(CONFIG_KS8851) || defined(CONFIG_KS8851_MODULE)
	msm_gpiomux_install(msm_eth_configs, ARRAY_SIZE(msm_eth_configs));
#endif

	msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));

	msm_gpiomux_install(msm_auxpcm_configs,
			ARRAY_SIZE(msm_auxpcm_configs));

	if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
		msm_gpiomux_install(usb_otg_sw_configs,
					ARRAY_SIZE(usb_otg_sw_configs));
#endif

#if defined(CONFIG_TSPDRV)
	msm_gpiomux_install(vibrator_configs, ARRAY_SIZE(vibrator_configs));
#endif

    msm_gpiomux_sdc3_install();
#ifdef CONFIG_SND_BRCM_FM_RADIO
    msm_gpiomux_install(msm_pri_mi2s_configs, ARRAY_SIZE(msm_pri_mi2s_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
	int rc;

	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}

	/* Keypad */
	msm_gpiomux_install(msm_keypad_configs,
		ARRAY_SIZE(msm_keypad_configs));

	/* HallSensors */
	msm_gpiomux_install(msm_hall_configs,
		ARRAY_SIZE(msm_hall_configs));

	/* BLSP */
	msm_gpiomux_install(msm_blsp_configs,
		ARRAY_SIZE(msm_blsp_configs));
	/*HW */
	msm_gpiomux_install(hw_rev_configs,
	ARRAY_SIZE(hw_rev_configs));


	/* WCNSS */
	msm_gpiomux_install(wcnss_5wire_interface,
		ARRAY_SIZE(wcnss_5wire_interface));

	/*T_FLASH_DETECT */
	msm_gpiomux_install(&sd_card_det, 1);

	/* TX_GTR */
	msm_gpiomux_install(msm8226_tx_gtr_configs,
		ARRAY_SIZE(msm8226_tx_gtr_configs));

	/* LCD */
	msm_gpiomux_install_nowrite(msm_lcd_configs,
		ARRAY_SIZE(msm_lcd_configs));

	/* Camera */
	msm_gpiomux_install(msm_csensor_configs,
		ARRAY_SIZE(msm_csensor_configs));

	/* Touch */
	msm_gpiomux_install(msm_melfas_configs,
		ARRAY_SIZE(msm_melfas_configs));

	/* Touch Key */
	msm_gpiomux_install(msm_keyboad_cypress_configs,
		ARRAY_SIZE(msm_keyboad_cypress_configs));

#ifdef CONFIG_SEC_NFC_I2C
	/* NFC */
	msm_gpiomux_install(msm_nfc_configs,
		ARRAY_SIZE(msm_nfc_configs));
#endif

	/* Sensors */
	msm_gpiomux_install(msm_sensors_configs,
		ARRAY_SIZE(msm_sensors_configs));

	/* SDCC3 */
	msm_gpiomux_sdc3_install();

	/* Codec */
	msm_gpiomux_install(msm_cdc_reset_config,
		ARRAY_SIZE(msm_cdc_reset_config));

	/* Earjack */
	msm_gpiomux_install(msm_earjack_gpio_configs,
		ARRAY_SIZE(msm_earjack_gpio_configs));

	/* MUIC */
	msm_gpiomux_install(muic_configs,
			ARRAY_SIZE(muic_configs));

	/* NC */
	msm_gpiomux_install(berluti3g_nc_gpio_cfgs, ARRAY_SIZE(berluti3g_nc_gpio_cfgs));
}
void __init msm8226_init_gpiomux(void)
{
	int rc;
#ifdef CONFIG_MACH_LGE
	int gpio_index = 0;
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif

	// Device Tree Initailize
	rc = msm_gpiomux_init_dt();
	if (rc) {
		pr_err("%s failed %d\n", __func__, rc);
		return;
	}
#ifdef CONFIG_MACH_LGE

	//--------------------------------------------
	// MSM8X26 GPIO Confiuration via X5
	//--------------------------------------------
	// GPIO related function <<0.Resreved Pin>>
	// GPIO related function <<1.SENSOR>>
	// GPIO related function <<2.I2C>>
	// GPIO related function <<3.UART>>
	// GPIO related function <<4.TOUCH>>
	// GPIO related function <<5.NFC>>
	// GPIO related function <<6.LCD>>
	// GPIO related function <<7.CAMERA>>
	// GPIO related function <<8.FLASH LED>>
	// GPIO related function <<9.IRRC>>
	// GPIO related function <<10.AUDIO>>
	// GPIO related function <<11.SD CARD>>
	// GPIO related function <<12.BATTERY>>
	// GPIO related function <<13.BT>>
	// GPIO related function <<14.WIFI>>
	// GPIO related function <<15.FM>>
	// GPIO related function <<16.WLC>>
	// GPIO related function <<17.SIM>>
	// GPIO related function <<18.SLIMBUS>>
	// GPIO related function <<19.RF>>
	// GPIO related function <<20.KEY PAD>>
	// GPIO related function <<21.LOGIC>>

	// GPIO related function <<0.Resreved Pin>>
	switch ( hw_rev ){
		case HW_REV_0 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_0[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_0[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
			}
			break;
		case HW_REV_A :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_A[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_A[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
			}
			break;
		case HW_REV_B :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
			}
			break;
		case HW_REV_C :
		case HW_REV_D :
		case HW_REV_E :
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ){
				gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
				msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
			}
			break;
	}

	// GPIO related function <<1.SENSOR>>
	msm_gpiomux_install(gpio_func_sensor_configs, ARRAY_SIZE(gpio_func_sensor_configs));
	msm_gpiomux_install(msm_hall_ic_configs, ARRAY_SIZE(msm_hall_ic_configs));
	msm_gpiomux_install(msm_cap_sensor_configs, ARRAY_SIZE(msm_cap_sensor_configs));

	// GPIO related function <<2.I2C>>
	msm_gpiomux_install(gpio_func_i2c_configs, ARRAY_SIZE(gpio_func_i2c_configs));

	// GPIO related function <<3.UART>>
	msm_gpiomux_install(gpio_func_uart_configs, ARRAY_SIZE(gpio_func_uart_configs));

	// GPIO related function <<4.TOUCH>>
	if(hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_atmel_configs, ARRAY_SIZE(msm_atmel_configs));
		printk(KERN_ERR " [Touch] HW_REV_0 for Atmel Touch IC \n");
	} 	else if(hw_rev == HW_REV_A){
		msm_gpiomux_install(msm_atmel_configs_rev_A, ARRAY_SIZE(msm_atmel_configs_rev_A));
		printk(KERN_ERR " [Touch] HW_REV A for Atmel Touch IC \n");
	}
	else {
		msm_gpiomux_install(msm_atmel_configs_rev_B, ARRAY_SIZE(msm_atmel_configs_rev_B));
		printk(KERN_ERR " [Touch] HW_REV B for Atmel Touch IC \n");

	}

	// GPIO related function <<5.NFC>>
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));

	// GPIO related function <<6.LCD>>
	msm_gpiomux_install_nowrite(msm_lcd_configs, ARRAY_SIZE(msm_lcd_configs));
	msm_gpiomux_install_nowrite(msm_bl_configs, ARRAY_SIZE(msm_bl_configs));

	// GPIO related function <<7.CAMERA>>
	msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));

	// GPIO related function <<8.FLASH LED>>
	msm_gpiomux_install(gpio_func_flash_led_configs, ARRAY_SIZE(gpio_func_flash_led_configs));

	// GPIO related function <<9.IRRC>>
	 msm_gpiomux_install(gpio_func_irrc_configs,
                        ARRAY_SIZE(gpio_func_irrc_configs));

	// GPIO related function <<10.AUDIO>>

	// GPIO related function <<11.SD CARD>>
	msm_gpiomux_install(&sd_card_det, 1);

	// GPIO related function <<12.BATTERY>>
	msm_gpiomux_install(gpio_func_battery_configs, ARRAY_SIZE(gpio_func_battery_configs));

	// GPIO related function <<13.BT>>
	msm_gpiomux_install(gpio_func_bt_configs, ARRAY_SIZE(gpio_func_bt_configs));

	// GPIO related function <<14.WIFI>>
#if defined ( CONFIG_BCMDHD ) || defined ( CONFIG_BCMDHD_MODULE )
#else
	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));
#endif

	// GPIO related function <<15.FM>>
	msm_gpiomux_install(gpio_func_fm_configs, ARRAY_SIZE(gpio_func_fm_configs));

	// GPIO related function <<16.WLC>>
	msm_gpiomux_install(gpio_func_wlc_configs, ARRAY_SIZE(gpio_func_wlc_configs));

	// GPIO related function <<17.SIM>>
	msm_gpiomux_install(gpio_func_sim_configs, ARRAY_SIZE(gpio_func_sim_configs));

	// GPIO related function <<18.SLIMBUS>>
	msm_gpiomux_install(gpio_func_slimbus_configs, ARRAY_SIZE(gpio_func_slimbus_configs));

	// GPIO related function <<19.RF>>
	msm_gpiomux_install(gpio_func_rf_configs, ARRAY_SIZE(gpio_func_rf_configs));

	// GPIO related function <<20.KEY PAD>>
	msm_gpiomux_install(msm_keypad_configs, ARRAY_SIZE(msm_keypad_configs));

	// GPIO related function <<21.LOGIC>>
	msm_gpiomux_install(gpio_func_logic_configs, ARRAY_SIZE(gpio_func_logic_configs));
#endif
}
void __init msm8226_init_gpiomux(void)
{
    int rc;
#ifdef CONFIG_MACH_LGE
    int gpio_index = 0;
    hw_rev_type hw_rev;
    hw_rev = lge_get_board_revno();
#endif
    rc = msm_gpiomux_init_dt();
    if (rc) {
        pr_err("%s failed %d\n", __func__, rc);
        return;
    }
#ifdef CONFIG_MACH_LGE

    //--------------------------------------------
    // MSM8X26 GPIO Confiuration via X5
    //--------------------------------------------
    // GPIO related function <<0.Resreved Pin>>
    // GPIO related function <<1.SENSOR>>
    // GPIO related function <<2.I2C>>
    // GPIO related function <<3.UART>>
    // GPIO related function <<4.TOUCH>>
    // GPIO related function <<5.NFC>>
    // GPIO related function <<6.LCD>>
    // GPIO related function <<7.CAMERA>>
    // GPIO related function <<8.FLASH LED>>
    // GPIO related function <<9.IRRC>>
    // GPIO related function <<10.AUDIO>>
    // GPIO related function <<11.SD CARD>>
    // GPIO related function <<12.BATTERY>>
    // GPIO related function <<13.BT>>
    // GPIO related function <<14.WIFI>>
    // GPIO related function <<15.FM>>
    // GPIO related function <<16.WLC>>
    // GPIO related function <<17.SIM>>
    // GPIO related function <<18.SLIMBUS>>
    // GPIO related function <<19.RF>>
    // GPIO related function <<20.KEY PAD>>
    // GPIO related function <<21.LOGIC>>

    // GPIO related function <<0.Resreved Pin>>
    switch ( hw_rev ) {
    case HW_REV_0 :
    case HW_REV_A :
    case HW_REV_B :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    case HW_REV_C :
    case HW_REV_D :
    case HW_REV_E :
    case HW_REV_1_0 :
    case HW_REV_1_1 :
    default :
        for ( gpio_index = 0 ; gpio_reserved_pin_rev_B[gpio_index] < MSM8x26_GPIO_END ; gpio_index++ ) {
            gpio_func_reserved_pin_config.gpio = gpio_reserved_pin_rev_B[gpio_index];
            msm_gpiomux_install(&gpio_func_reserved_pin_config, 1);
        }
        break;
    }
#endif

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

    msm_gpiomux_install(msm_blsp_configs, ARRAY_SIZE(msm_blsp_configs));
    msm_gpiomux_install(wcnss_5wire_interface,
                        ARRAY_SIZE(wcnss_5wire_interface));

    msm_gpiomux_install(&sd_card_det, 1);

    if (hw_rev <= HW_REV_B) {
        msm_gpiomux_install(msm_melfas_configs, ARRAY_SIZE(msm_melfas_configs));
        printk(KERN_ERR "[Touch] HW_REV_0, A, B configs \n");
    } else if (hw_rev == HW_REV_C) {
        msm_gpiomux_install(msm_melfas_configs_rev_c, ARRAY_SIZE(msm_melfas_configs_rev_c));
        printk(KERN_ERR "[Touch] HW_REV_C configs \n");
    } else {
        msm_gpiomux_install(msm_atmel_configs_rev_d, ARRAY_SIZE(msm_atmel_configs_rev_d));
        printk(KERN_ERR "[Touch] HW_REV_D or above use Atmel \n");
    }

    msm_gpiomux_install_nowrite(msm_lcd_configs,
                                ARRAY_SIZE(msm_lcd_configs));
    msm_gpiomux_install(msm_sensor_configs, ARRAY_SIZE(msm_sensor_configs));
    msm_gpiomux_install(msm_hall_ic_configs, ARRAY_SIZE(msm_hall_ic_configs));
#ifndef CONFIG_MACH_LGE
    msm_gpiomux_install(msm_auxpcm_configs,
                        ARRAY_SIZE(msm_auxpcm_configs));

    if (of_board_is_cdp() || of_board_is_mtp() || of_board_is_xpm())
        msm_gpiomux_install(usb_otg_sw_configs,
                            ARRAY_SIZE(usb_otg_sw_configs));
#endif


    /*                                                         */
#ifdef CONFIG_LGE_NFC_PN544_C3
    msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
    /*                                                         */


}