static int broadcast_tdmb_get_ch_info(void __user *arg)
{
	int rc = ERROR;
	char fic_kernel_buffer[400];
	unsigned int fic_len = 0;

	struct broadcast_tdmb_ch_info __user* puserdata = (struct broadcast_tdmb_ch_info __user*)arg;

	if((puserdata == NULL)||( puserdata->ch_buf == NULL))
	{
		printk("broadcast_tdmb_get_ch_info argument error\n");
		return rc;
	}

	memset(fic_kernel_buffer, 0x00, sizeof(fic_kernel_buffer));

//                                                          
#if defined (CONFIG_MACH_MSM8974_Z_KR)
	if(lge_get_board_revno() == HW_REV_A){
		rc = broadcast_drv_if_get_ch_info_fci(fic_kernel_buffer, &fic_len);
	}
	else
#endif
//                                                        
	rc = broadcast_drv_if_get_ch_info(fic_kernel_buffer, &fic_len);

	if(rc == OK)
	{
		if(copy_to_user((void __user*)puserdata->ch_buf, (void*)fic_kernel_buffer, fic_len))
		{
			fic_len = 0;
			rc = ERROR;
		}
	}
	else
	{
		fic_len = 0;
		rc = ERROR;
	}

	puserdata->buf_len = fic_len;

	return rc;
}
static int __init imx219_init_module(void)
{
	int32_t rc = 0;
	hw_rev_type rev_type = 0;
	pr_info("%s:%d\n", __func__, __LINE__);
      rev_type = lge_get_board_revno();
#if 1//                         
	switch(rev_type) {
		case HW_REV_0:
			printk("%s: Sensor power is set as Rev.0\n", __func__);
			imx219_s_ctrl.power_setting_array.power_setting = imx219_power_setting_rev_0;
			imx219_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx219_power_setting_rev_0);
			break;
		case HW_REV_A:
#if defined(CONFIG_MACH_MSM8X10_W5N_GLOBAL_COM) || defined(CONFIG_MACH_MSM8X10_W5_GLOBAL_COM)
			printk("%s: Sensor power is set as Rev. %d\n", __func__,rev_type);
			imx219_s_ctrl.power_setting_array.power_setting = imx219_power_setting_rev_a;
			imx219_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx219_power_setting_rev_a);
#elif defined(CONFIG_MACH_MSM8X10_W6)
			printk("%s: HW rev is %d. But sensor power is set as Rev.B \n", __func__,rev_type);
			imx219_s_ctrl.power_setting_array.power_setting = imx219_power_setting_rev_b;
			imx219_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx219_power_setting_rev_b);
#endif
		case HW_REV_B:
		default:
			printk("%s: Sensor power is set as Rev.%d(Line:%d)\n", __func__,rev_type, __LINE__);
#if defined(CONFIG_MACH_MSM8X10_W5N_GLOBAL_COM) || defined(CONFIG_MACH_MSM8X10_W5_GLOBAL_COM) || defined(CONFIG_MACH_MSM8X10_W6)
			imx219_s_ctrl.power_setting_array.power_setting = imx219_power_setting_rev_b;
			imx219_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx219_power_setting_rev_b);
#else
			imx219_s_ctrl.power_setting_array.power_setting = imx219_power_setting_rev_a;
			imx219_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx219_power_setting_rev_a);
#endif
			break;
	}
#endif

	rc = platform_driver_probe(&imx219_platform_driver,
		imx219_platform_probe);
	if (!rc)
		return rc;
	pr_err("%s:%d rc %d\n", __func__, __LINE__, rc);
	return i2c_add_driver(&imx219_i2c_driver);
}
Exemplo n.º 3
0
static int broadcast_tdmb_power_on(void)
{
	int rc = ERROR;

//20130516_wonhee.jeong Code for revision separation [START]
#if defined (CONFIG_MACH_MSM8974_Z_KR)
	if(lge_get_board_revno() == HW_REV_A){
		rc = broadcast_drv_if_power_on_fci();
		broadcast_drv_if_user_stop_fci( 0 );
		return rc;
	}
#endif
//20130516_wonhee.jeong Code for revision separation [END]
	rc = broadcast_drv_if_power_on();
	broadcast_drv_if_user_stop( 0 );


	return rc;
}
static int broadcast_tdmb_power_on(void)
{
	int rc = ERROR;

//                                                          
#if defined (CONFIG_MACH_MSM8974_Z_KR)
	if(lge_get_board_revno() == HW_REV_A){
		rc = broadcast_drv_if_power_on_fci();
		broadcast_drv_if_user_stop_fci( 0 );
		return rc;
	}
#endif
//                                                        
	rc = broadcast_drv_if_power_on();
	broadcast_drv_if_user_stop( 0 );


	return rc;
}
static int broadcast_tdmb_detect_sync(void __user *arg)
{
	int rc = ERROR;
	int udata;
	int __user* puser = (int __user*)arg;
	udata = *puser;

//                                                          
#if defined (CONFIG_MACH_MSM8974_Z_KR)
	if(lge_get_board_revno() == HW_REV_A){
		rc = broadcast_drv_if_detect_sync_fci(udata);
		return rc;
	}
#endif
//                                                        
	rc = broadcast_drv_if_detect_sync(udata);

	return rc;
}
Exemplo n.º 6
0
static int broadcast_tdmb_detect_sync(void __user *arg)
{
	int rc = ERROR;
	int udata;
	int __user* puser = (int __user*)arg;
	udata = *puser;

//20130516_wonhee.jeong Code for revision separation [START]
#if defined (CONFIG_MACH_MSM8974_Z_KR)
	if(lge_get_board_revno() == HW_REV_A){
		rc = broadcast_drv_if_detect_sync_fci(udata);
		return rc;
	}
#endif
//20130516_wonhee.jeong Code for revision separation [END]
	rc = broadcast_drv_if_detect_sync(udata);

	return rc;
}
static void max14688_irq_jack_inserted (struct max14688 *me)
{
	unsigned long det_work_delay = msecs_to_jiffies(1000);

	/* Check INT bit and STATUS_INT bit for avoiding JIG mode */
	if (unlikely(max14688_get_status(me, STATUS_INT) && max14688_get_status(me, STATUS_MICIN))) {
		log_info("JIG power detected\n");

		max14688_disable_irq(me, IRQ_SWD);
#ifdef CONFIG_EARJACK_DEBUGGER
		if (lge_get_board_revno() < HW_REV_1_0)
			msm_serial_set_uart_console(1);
#endif
		me->matched_jack   = -1;
		me->matched_button = -1;
		goto out;
	}

	if (unlikely(__present_valid_jack(me))) {
		log_warn("new jack detected during insertion of jack %s\n",
				__current_jack_name(me));
#ifdef MAX14688_OVERWRITE_JACK_INSERTION
		max14688_irq_jack_removed(me);
#else
		goto out;
#endif
	}

	if (unlikely(delayed_work_pending(&me->det_work))) {
		log_warn("detection in progress\n");
		goto out;
	}

	log_dbg("%s\n", __func__);
	max14688_write_mode0(me, MAX14688_MODE_HIGH);
	max14688_write_mode1(me, MAX14688_MODE_LOW);

	schedule_delayed_work(&me->det_work, det_work_delay);

out:
	return;
}
/*
* Description :
* Input :
* Output :
*/
int felica_get_int_gpio_num(void)
{
/* If it has different GPIO number each HW version, please use this route. */	
#ifdef CONFIG_LGE_FELICA_NFC_DCM
  int gpionum = GPIO_FELICA_INT;

  if (lge_get_board_revno() < HW_REV_D)
  {
    gpionum = GPIO_FELICA_INT;
  }
  else
  {
    gpionum = GPIO_FELICA_INT_REV_D;  
  }
	FELICA_DEBUG_MSG_LOW("[FELICA_GPIO] felica_get_rws_gpio_num(%d) \n",gpionum);

	return gpionum;
#else	
	return GPIO_FELICA_INT;
#endif
}
Exemplo n.º 9
0
static int8 broadcast_tdmb_user_stop(void __user *arg)
{
	int udata;
	int __user* puser = (int __user*)arg;

	udata = *puser;

	//printk("broadcast_tdmb_user_stop data =(%d)\n", udata);

//20130516_wonhee.jeong Code for revision separation [START]
#if defined (CONFIG_MACH_MSM8974_Z_KR) 
	if(lge_get_board_revno() == HW_REV_A){
		broadcast_drv_if_user_stop_fci( udata );
		return OK;
	}
#endif
//20130516_wonhee.jeong Code for revision separation [END]
	broadcast_drv_if_user_stop( udata );

	return OK;
}
static int8 broadcast_tdmb_user_stop(void __user *arg)
{
	int udata;
	int __user* puser = (int __user*)arg;

	udata = *puser;

	//                                                       

//                                                          
#if defined (CONFIG_MACH_MSM8974_Z_KR) 
	if(lge_get_board_revno() == HW_REV_A){
		broadcast_drv_if_user_stop_fci( udata );
		return OK;
	}
#endif
//                                                        
	broadcast_drv_if_user_stop( udata );

	return OK;
}
static void __init touch_panel(int bus_num)
{
#if defined(CONFIG_TOUCHSCREEN_ATMEL_MAXT224E) ||\
	defined(CONFIG_TOUCHSCREEN_MMS136) ||\
	defined(CONFIG_TOUCHSCREEN_MMS128)
#if defined (CONFIG_MACH_MSM8960_L1A) || defined (CONFIG_MACH_MSM8960_L1T)
	i2c_register_board_info(MSM_8960_GSBI3_QUP_I2C_BUS_ID,
		(&melfas_touch_panel_i2c_bdinfo[2]), 1);
#else
	if (lge_get_board_revno() >= HW_REV_B) {
		i2c_register_board_info(MSM_8960_GSBI3_QUP_I2C_BUS_ID,
			(&melfas_touch_panel_i2c_bdinfo[0]), 1);
	} else {
		i2c_register_board_info(MSM_8960_GSBI3_QUP_I2C_BUS_ID,
			(&melfas_touch_panel_i2c_bdinfo[1]), 1);
	}
#endif
#elif defined(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4)
	i2c_register_board_info(MSM_8960_GSBI3_QUP_I2C_BUS_ID,
		&synaptics_panel_i2c_bdinfo[0], 1);
#endif
}
Exemplo n.º 12
0
int felica_get_int_gpio_num(void)
{
/*                                                                         */	
#ifdef CONFIG_LGE_FELICA_NFC_DCM
  int gpionum = GPIO_FELICA_INT;

  if (lge_get_board_revno() < HW_REV_D)
  {
    gpionum = GPIO_FELICA_INT;
  }
  else
  {
    gpionum = GPIO_FELICA_INT_REV_D;  
  }
	#ifdef FEATURE_DEBUG_LOW
	FELICA_DEBUG_MSG("[FELICA_GPIO] felica_get_rws_gpio_num(%d) \n",gpionum);
	#endif
	return gpionum;
#else	
	return GPIO_FELICA_INT;
#endif
}
Exemplo n.º 13
0
static int __init leds_init(void)
{
#ifdef CONFIG_MACH_LGE
#ifdef CONFIG_MACH_MSM8926_B2L_ATT
	hw_rev_type hw_rev;
	hw_rev = lge_get_board_revno();
#endif
#endif
	leds_class = class_create(THIS_MODULE, "leds");
	if (IS_ERR(leds_class))
		return PTR_ERR(leds_class);
	leds_class->suspend = led_suspend;
	leds_class->resume = led_resume;
	leds_class->dev_attrs = led_class_attrs;
#ifdef CONFIG_LEDS_PM8226_EMOTIONAL
#ifdef CONFIG_MACH_MSM8926_B2L_ATT
	if(HW_REV_A < hw_rev)
#endif
	led_pattern_sysfs_register();
#endif
	return 0;
}
Exemplo n.º 14
0
static int __init imx214_init_module(void)
{
	int32_t rc = 0;
	CDBG("%s E\n", __func__);

#if defined(CONFIG_MACH_LGE)
	switch(lge_get_board_revno()) {
		case HW_REV_A:
		default:
			CDBG("%s: Sensor power is set \n", __func__);
			imx214_s_ctrl.power_setting_array.power_setting = imx214_power_setting;
			imx214_s_ctrl.power_setting_array.size = ARRAY_SIZE(imx214_power_setting);
			break;
	}
#endif
	rc = platform_driver_probe(&imx214_platform_driver,
		imx214_platform_probe);
	if (!rc) {
		CDBG("%s: X, rc = %d\n", __func__, rc);
		return rc;
	}
	return i2c_add_driver(&imx214_i2c_driver);
}
static __init void mako_fixup_cam(void)
{
	int ret;
	int gpio_vcm_en;

	if (lge_get_board_revno() > HW_REV_1_0)
		gpio_vcm_en = GPIO_CAM_VCM_EN_11;
	else
		gpio_vcm_en = GPIO_CAM_VCM_EN;

	ret = gpio_request_one(gpio_vcm_en, GPIOF_INIT_HIGH, "vcm_en");
	if (ret < 0) {
		pr_err("%s: failed gpio request vcm_en\n", __func__);
		return;
	}

	gpio_free(gpio_vcm_en);

	ret = gpio_request_array(apq8064_common_cam_gpio,
			ARRAY_SIZE(apq8064_common_cam_gpio));
	if (ret < 0)
		pr_err("%s: failed gpio request common_cam_gpio\n", __func__);
}
Exemplo n.º 16
0
int __devinit broadcast_tdmb_drv_init(void)
{
	int rc = 0;
	printk("%s is called\n", "broadcast_tdmb_drv_init");

//20130516_wonhee.jeong Code for revision separation [START]
#if defined (CONFIG_MACH_MSM8974_Z_KR) 
	if(lge_get_board_revno() == HW_REV_A){
		printk("TDMB T3A00 Not support in MSM8974_Z_KR Rev.A board\n");
		return rc;
	}
#endif
//20130516_wonhee.jeong Code for revision separation [END]
	rc = broadcast_tdmb_drv_start();
	if (rc) {
		printk("broadcast_tdmb_drv_start %s failed to load\n", __func__);
		return rc;
	}
	rc = spi_register_driver(&broadcast_tdmb_driver);
	printk("broadcast_spi_add_driver rc = (%d)\n", rc);

	return rc;
}
Exemplo n.º 17
0
static int __init hi544_init_module(void)
{
	int32_t rc = 0;
	pr_info("%s:%d\n", __func__, __LINE__);

#if defined(CONFIG_MACH_MSM8926_E2_SPR_US)
	switch(lge_get_board_revno()) {
		case HW_REV_A:
			printk("%s: Sensor power is set as Rev.A, line:%d\n", __func__, __LINE__);
			hi544_s_ctrl.power_setting_array.power_setting = hi544_power_setting_rev_a;
			hi544_s_ctrl.power_setting_array.size = ARRAY_SIZE(hi544_power_setting_rev_a);
			break;
		case HW_REV_B:
			printk("%s: Sensor power is set as Rev.B, line:%d\n", __func__, __LINE__);
			hi544_s_ctrl.power_setting_array.power_setting = hi544_power_setting_rev_b;
			hi544_s_ctrl.power_setting_array.size = ARRAY_SIZE(hi544_power_setting_rev_b);
			break;
		default:
			printk("%s: Sensor power is set as Rev.10, line:%d\n", __func__, __LINE__);
			hi544_s_ctrl.power_setting_array.power_setting = hi544_power_setting_rev_b;
			hi544_s_ctrl.power_setting_array.size = ARRAY_SIZE(hi544_power_setting_rev_b);
			break;
	}
#else
	printk("%s: Sensor power is set, line:%d\n", __func__, __LINE__);
	hi544_s_ctrl.power_setting_array.power_setting = hi544_power_setting_rev_a;
	hi544_s_ctrl.power_setting_array.size = ARRAY_SIZE(hi544_power_setting_rev_a);
#endif

	rc = platform_driver_probe(&hi544_platform_driver,
		hi544_platform_probe);
	if (!rc)
		return rc;
	pr_info("%s:%d rc %d\n", __func__, __LINE__, rc);
	return i2c_add_driver(&hi544_i2c_driver);
}
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>>
/*  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 */

	// 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));
#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
/* LGE_CHANGE_S, [BT][[email protected]], 2013-05-13 */
#ifdef CONFIG_LGE_BLUETOOTH
    bluetooth_msm_gpiomux_install();
#endif /* CONFIG_LGE_BLUETOOTH */
/* LGE_CHANGE_E, [BT][[email protected]], 2013-05-13 */
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 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 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_D[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_E :
		case HW_REV_1_0 :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_1_0[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_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_1_0[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)); //                                                                          
			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 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));

    /* Touch IC Setting */

    printk(KERN_INFO"[%s][TOUCH] HW_Revision = %d ", __func__, revision );

    if(revision == HW_REV_A) //melfas
        msm_gpiomux_install(mms100s_ts_configs, ARRAY_SIZE(mms100s_ts_configs));
    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));

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

#if defined (CONFIG_LGE_BROADCAST_ONESEG)
    if(lge_get_board_revno()>= HW_REV_A) {
        msm_gpiomux_install(lge_1seg_blsp_configs, ARRAY_SIZE(lge_1seg_blsp_configs));
        printk(KERN_ERR " [Oneseg] In greater than HW_REV_A\n");
    }
#endif  /* CONFIG_LGE_BROADCAST_ONESEG */

#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 */
}
/*  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
	msm_gpiomux_install(msm_nfc_configs, ARRAY_SIZE(msm_nfc_configs));
#endif
/*  LGE_CHANGE_E, [NFC][[email protected]], NFC Bring up */
}
Exemplo n.º 22
0
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_0) {
		msm_gpiomux_install(msm_atmel_configs, ARRAY_SIZE(msm_atmel_configs));
		printk(KERN_ERR "[Touch] HW_REV_0 configs \n");

	} else {
		msm_gpiomux_install(msm_synaptics_configs_rev_b, ARRAY_SIZE(msm_synaptics_configs_rev_b));
		printk(KERN_ERR "[Touch] HW_REV_A.. 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)
#else
	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>>
	
	// 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_LGE_BROADCAST_TDMB)
	msm_gpiomux_install(msm8926_tdmb_configs, ARRAY_SIZE(msm8926_tdmb_configs));
#endif
/*                                                           */

#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 apq8064_init_gpiomux(void)
{
	int rc;
	int platform_version = socinfo_get_platform_version();
#ifdef CONFIG_MACH_APQ8064_ALTEV
	hw_rev_type lge_bd_rev = HW_REV_EVB1;//                                             
#endif
	rc = msm_gpiomux_init(NR_GPIO_IRQS);
	if (rc) {
		pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc);
		return;
	}
#ifdef CONFIG_SWITCH_MAX1462X
       msm_gpiomux_install(apq8064_earjack_configs,
                            ARRAY_SIZE(apq8064_earjack_configs));
#endif

	msm_gpiomux_install(wcnss_5wire_interface,
			ARRAY_SIZE(wcnss_5wire_interface));

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

		msm_gpiomux_install(apq8064_gsbi_configs,
				ARRAY_SIZE(apq8064_gsbi_configs));

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

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

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


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

	msm_gpiomux_install(apq8064_audio_codec_configs,
			ARRAY_SIZE(apq8064_audio_codec_configs));

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

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

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


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

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

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

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

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

	msm_gpiomux_install(msm8960_bt_host_wakeup_configs,
			ARRAY_SIZE(msm8960_bt_host_wakeup_configs));

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

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

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

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

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

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


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

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

//                                             

}
Exemplo n.º 24
0
static int power_set_pm8941_regulator(int onoff)
{
	int rc = -1;
	
#if defined(CONFIG_MACH_MSM8974_VU3_KR)
	if((lge_get_board_revno() == HW_REV_A)){
		pm8941_power_reg = NULL;
		printk("[T3A00]VU3 RevA does not support PMIC 1.8V\n");
		return rc;
	}
#endif

#if defined(CONFIG_MACH_MSM8974_Z_KR)
	if((lge_get_board_revno() != HW_REV_C))
	{
		pm8941_power_reg = NULL;
		printk("[T3A00]Z-KOR does not support PMIC 1.8V except Rev.C\n");
		return rc;
	}
#endif


	if(!t3a00_ctrl_info.spi_ptr){
		printk("[T3A00]T3A00 Contrl Block invalid\n");
		return rc;
	}

	if(!pm8941_power_reg ) {
		pm8941_power_reg = regulator_get(&t3a00_ctrl_info.spi_ptr->dev, "tdmb-vdd-io");
		if(IS_ERR(pm8941_power_reg)) {
			printk("%s: regulator get of pm8941 power failed in T3A00 (%ld)\n",
				__func__, PTR_ERR(pm8941_power_reg));
				rc = PTR_ERR(pm8941_power_reg);
				pm8941_power_reg = NULL;
				return rc;
		}
	}

	if(onoff){
		rc = regulator_set_voltage(pm8941_power_reg , 1800000, 1800000);
		if(rc < 0 ) {
			printk("[T3A00] %s: cannot control regulator pm8941 1.8V :%d\n", __func__, rc);
			goto vreg_set_fail;
		}
		rc = regulator_enable(pm8941_power_reg);
		if(rc < 0 ) {
			printk("[T3A00] %s: cannot regulator enable %d\n", __func__, rc);
			goto vreg_set_fail;

		}
	}else {
		rc = regulator_disable(pm8941_power_reg);
		if(rc < 0 ) {
			printk("[T3A00] %s: cannot regulator enable %d\n", __func__, rc);
			goto vreg_set_fail;
		}
	}
	printk("[T3A00]pm8941 voltage contorl success mode =(%d)\n", onoff);
	return rc;

vreg_set_fail:
	regulator_put(pm8941_power_reg);
	pm8941_power_reg = NULL;
	return rc;
}
Exemplo n.º 25
0
static int __devinit gdsc_probe(struct platform_device *pdev)
{
	static atomic_t gdsc_count = ATOMIC_INIT(-1);
	struct regulator_init_data *init_data;
	struct resource *res;
	struct gdsc *sc;
	uint32_t regval;
	bool retain_mem, retain_periph;
	int i, ret;
#ifdef CONFIG_MACH_LGE
	int use_lge_workaround = 0; /* default: all not applied */
#endif

	sc = devm_kzalloc(&pdev->dev, sizeof(struct gdsc), GFP_KERNEL);
	if (sc == NULL)
		return -ENOMEM;

	init_data = of_get_regulator_init_data(&pdev->dev, pdev->dev.of_node);
	if (init_data == NULL)
		return -ENOMEM;

	if (of_get_property(pdev->dev.of_node, "parent-supply", NULL))
		init_data->supply_regulator = "parent";

	ret = of_property_read_string(pdev->dev.of_node, "regulator-name",
				      &sc->rdesc.name);
	if (ret)
		return ret;

	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
	if (res == NULL)
		return -EINVAL;
	sc->gdscr = devm_ioremap(&pdev->dev, res->start, resource_size(res));
	if (sc->gdscr == NULL)
		return -ENOMEM;

	sc->clock_count = of_property_count_strings(pdev->dev.of_node,
					    "qcom,clock-names");
	if (sc->clock_count == -EINVAL) {
		sc->clock_count = 0;
	} else if (IS_ERR_VALUE(sc->clock_count)) {
		dev_err(&pdev->dev, "Failed to get clock names\n");
		return -EINVAL;
	}

	sc->clocks = devm_kzalloc(&pdev->dev,
			sizeof(struct clk *) * sc->clock_count, GFP_KERNEL);
	if (!sc->clocks)
		return -ENOMEM;
	for (i = 0; i < sc->clock_count; i++) {
		const char *clock_name;
		of_property_read_string_index(pdev->dev.of_node,
					      "qcom,clock-names", i,
					      &clock_name);
		sc->clocks[i] = devm_clk_get(&pdev->dev, clock_name);
		if (IS_ERR(sc->clocks[i])) {
			int rc = PTR_ERR(sc->clocks[i]);
			if (rc != -EPROBE_DEFER)
				dev_err(&pdev->dev, "Failed to get %s\n",
					clock_name);
			return rc;
		}
	}
#ifdef CONFIG_MACH_LGE
	of_property_read_u32(pdev->dev.of_node, "lge,use_workaround",
			&use_lge_workaround);
	sc->use_lge_workaround = !(!use_lge_workaround);
#endif
	sc->rdesc.id = atomic_inc_return(&gdsc_count);
	sc->rdesc.ops = &gdsc_ops;
	sc->rdesc.type = REGULATOR_VOLTAGE;
	sc->rdesc.owner = THIS_MODULE;
	platform_set_drvdata(pdev, sc);

	/*
	 * Disable HW trigger: collapse/restore occur based on registers writes.
	 * Disable SW override: Use hardware state-machine for sequencing.
	 */
	regval = readl_relaxed(sc->gdscr);
	regval &= ~(HW_CONTROL_MASK | SW_OVERRIDE_MASK);

	/* Configure wait time between states. */
	regval &= ~(EN_REST_WAIT_MASK | EN_FEW_WAIT_MASK | CLK_DIS_WAIT_MASK);
	regval |= EN_REST_WAIT_VAL | EN_FEW_WAIT_VAL | CLK_DIS_WAIT_VAL;
	writel_relaxed(regval, sc->gdscr);

	retain_mem = of_property_read_bool(pdev->dev.of_node,
					    "qcom,retain-mem");
	retain_periph = of_property_read_bool(pdev->dev.of_node,
					    "qcom,retain-periph");
	for (i = 0; i < sc->clock_count; i++) {
		if (retain_mem || (regval & PWR_ON_MASK))
			clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_MEM);
		else
			clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_MEM);

		if (retain_periph || (regval & PWR_ON_MASK))
			clk_set_flags(sc->clocks[i], CLKFLAG_RETAIN_PERIPH);
		else
			clk_set_flags(sc->clocks[i], CLKFLAG_NORETAIN_PERIPH);
	}
	sc->toggle_mem = !retain_mem;
	sc->toggle_periph = !retain_periph;
	sc->toggle_logic = !of_property_read_bool(pdev->dev.of_node,
						"qcom,skip-logic-collapse");
	if (!sc->toggle_logic) {
#ifdef CONFIG_MACH_LGE
		/* LGE workaround is not used if a device is good pdn revision */
		if (lge_get_board_revno() >= use_lge_workaround) {
			regval &= ~SW_COLLAPSE_MASK;
			writel_relaxed(regval, sc->gdscr);

			ret = readl_tight_poll_timeout(sc->gdscr, regval,
					regval & PWR_ON_MASK, TIMEOUT_US);
			if (ret) {
				dev_err(&pdev->dev, "%s enable timed out\n",
						sc->rdesc.name);
				return ret;
			}
		} else {
			pr_info("%s: %s is enabled only at first by lge workaround\n",
					__func__, sc->rdesc.name);
			ret = lge_gdsc_enable(sc);
			if (ret) {
				dev_err(&pdev->dev, "%s enable timed out\n",
						sc->rdesc.name);
				return ret;
			}
		}
#else /* qmc */
		regval &= ~SW_COLLAPSE_MASK;
		writel_relaxed(regval, sc->gdscr);

		ret = readl_tight_poll_timeout(sc->gdscr, regval,
					regval & PWR_ON_MASK, TIMEOUT_US);
		if (ret) {
			dev_err(&pdev->dev, "%s enable timed out\n",
				sc->rdesc.name);
			return ret;
		}
#endif
	}

	sc->rdev = regulator_register(&sc->rdesc, &pdev->dev, init_data, sc,
				      pdev->dev.of_node);
	if (IS_ERR(sc->rdev)) {
		dev_err(&pdev->dev, "regulator_register(\"%s\") failed.\n",
			sc->rdesc.name);
		return PTR_ERR(sc->rdev);
	}

	return 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 /* 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
	switch ( hw_rev ){
		case HW_REV_0 :
		case HW_REV_A :
		case HW_REV_A2 :
		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);
				msm_gpiomux_install(main_cam_id_gpio, ARRAY_SIZE(main_cam_id_gpio));	/* MAIN_CAM_ID */
				}
			break;
		case HW_REV_B2 :
		case HW_REV_C :
		    for ( gpio_index = 0 ; gpio_reserved_pin_rev_C[gpio_index] < MSM8x26_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(main_cam_id_gpio, ARRAY_SIZE(main_cam_id_gpio));	/* MAIN_CAM_ID */
				}
			break;
		case HW_REV_1_0 :
		case HW_REV_1_1 :
		default :
			for ( gpio_index = 0 ; gpio_reserved_pin_rev_C[gpio_index] < MSM8x26_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(main_cam_id_gpio, ARRAY_SIZE(main_cam_id_gpio));	/* MAIN_CAM_ID */
				}
			break;
	}
	
	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 */
}
static int mipi_dsi_panel_power(int on)
{
	static struct regulator *reg_l8, *reg_l2, *reg_lvs6, *ext_dsv_load;
	static int gpio42;
	int rc;

	struct pm_gpio gpio42_param = {
		.direction = PM_GPIO_DIR_OUT,
		.output_buffer = PM_GPIO_OUT_BUF_CMOS,
		.output_value = 0,
		.pull = PM_GPIO_PULL_NO,
		.vin_sel = 2,
		.out_strength = PM_GPIO_STRENGTH_HIGH,
		.function = PM_GPIO_FUNC_PAIRED,
		.inv_int_pol = 0,
		.disable_pin = 0,
	};
	printk(KERN_INFO"%s: mipi lcd function started status = %d \n", __func__, on);

	pr_debug("%s: state : %d\n", __func__, on);

	if (!dsi_power_on) {

		gpio42 = PM8921_GPIO_PM_TO_SYS(42);

		rc = gpio_request(gpio42, "disp_rst_n");
		if (rc) {
			pr_err("request gpio 42 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		if (lge_get_board_revno() > HW_REV_C) {
			ext_dsv_load = regulator_get(NULL, "ext_dsv_load");
			if (IS_ERR(ext_dsv_load)) {
				pr_err("could not get ext_dsv_load, rc = %ld\n",
					PTR_ERR(ext_dsv_load));
				return -ENODEV;
			}
		}

		reg_l8 = regulator_get(&msm_mipi_dsi1_device.dev, "dsi_vci");
		if (IS_ERR(reg_l8)) {
			pr_err("could not get 8921_l8, rc = %ld\n",
				PTR_ERR(reg_l8));
			return -ENODEV;
		}

		reg_lvs6 = regulator_get(&msm_mipi_dsi1_device.dev, "dsi_iovcc");
		if (IS_ERR(reg_lvs6)) {
			pr_err("could not get 8921_lvs6, rc = %ld\n",
				 PTR_ERR(reg_lvs6));
			return -ENODEV;
		}

		reg_l2 = regulator_get(&msm_mipi_dsi1_device.dev, "dsi_vdda");
		if (IS_ERR(reg_l2)) {
			pr_err("could not get 8921_l2, rc = %ld\n",
				PTR_ERR(reg_l2));
			return -ENODEV;
		}

		rc = regulator_set_voltage(reg_l8, 3000000, 3000000);
		if (rc) {
			pr_err("set_voltage l8 failed, rc=%d\n", rc);
			return -EINVAL;
		}

		rc = regulator_set_voltage(reg_l2, 1200000, 1200000);
		if (rc) {
			pr_err("set_voltage l2 failed, rc=%d\n", rc);
			return -EINVAL;
		}

		dsi_power_on = true;
	}
	if (on) {

		if (lge_get_board_revno() > HW_REV_C) {
			rc = regulator_enable(ext_dsv_load);
			if (rc) {
				pr_err("enable ext_dsv_load failed, rc=%d\n", rc);
				return -ENODEV;
			}
		}

		rc = regulator_set_optimum_mode(reg_l8, 100000);
		if (rc < 0) {
			pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
			return -EINVAL;
		}

		rc = regulator_set_optimum_mode(reg_l2, 100000);
		if (rc < 0) {
			pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
			return -EINVAL;
		}

#if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WXGA_PT)
		rc = regulator_enable(reg_l8);  // dsi_vci
		if (rc) {
			pr_err("enable l8 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		udelay(100);

		rc = regulator_enable(reg_lvs6); // IOVCC
		if (rc) {
			pr_err("enable lvs6 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		udelay(100);
#endif

		rc = regulator_enable(reg_l2);  // DSI
		if (rc) {
			pr_err("enable l2 failed, rc=%d\n", rc);
			return -ENODEV;
		}

		printk(KERN_INFO " %s : reset start.", __func__);
		/* LCD RESET HIGH */
		mdelay(2);
		gpio42_param.output_value = 1;
		rc = pm8xxx_gpio_config(gpio42,&gpio42_param);
		if (rc) {
			pr_err("gpio_config 42 failed (3), rc=%d\n", rc);
			return -EINVAL;
		}
		mdelay(5);

	} else {
		/* LCD RESET LOW */
		gpio42_param.output_value = 0;
		rc = pm8xxx_gpio_config(gpio42,&gpio42_param);
		if (rc) {
			pr_err("gpio_config 42 failed, rc=%d\n", rc);
			return -ENODEV;
		}
		udelay(100);

#if defined(CONFIG_FB_MSM_MIPI_LGIT_VIDEO_WXGA_PT)
		rc = regulator_disable(reg_lvs6); // IOVCC
		if (rc) {
			pr_err("disable lvs6 failed, rc=%d\n", rc);
			return -ENODEV;
		}
		udelay(100);

		rc = regulator_disable(reg_l8);	//VCI
		if (rc) {
			pr_err("disable reg_l8  failed, rc=%d\n", rc);
			return -ENODEV;
		}
		udelay(100);
#endif
		rc = regulator_disable(reg_l2);	//DSI
		if (rc) {
			pr_err("disable reg_l2  failed, rc=%d\n", rc);
			return -ENODEV;
		}

		rc = regulator_set_optimum_mode(reg_l8, 100);
		if (rc < 0) {
			pr_err("set_optimum_mode l8 failed, rc=%d\n", rc);
			return -EINVAL;
		}

		rc = regulator_set_optimum_mode(reg_l2, 100);
		if (rc < 0) {
			pr_err("set_optimum_mode l2 failed, rc=%d\n", rc);
			return -EINVAL;
		}

		if (lge_get_board_revno() > HW_REV_C) {
			rc = regulator_disable(ext_dsv_load);
			if (rc) {
				pr_err("disable ext_dsv_load  failed, rc=%d\n", rc);
				return -ENODEV;
			}
		}
	}

	return 0;
}

static char mipi_dsi_splash_is_enabled(void)
{
	return mdp_pdata.cont_splash_enabled;
}

static struct mipi_dsi_platform_data mipi_dsi_pdata = {
	.dsi_power_save = mipi_dsi_panel_power,
	.splash_is_enabled = mipi_dsi_splash_is_enabled,
};

static struct msm_bus_vectors dtv_bus_init_vectors[] = {
	{
		.src = MSM_BUS_MASTER_MDP_PORT0,
		.dst = MSM_BUS_SLAVE_EBI_CH0,
		.ab = 0,
		.ib = 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

	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));
	// GPIO related function <<7.CAMERA>>
/* LGE_CHANGE_S, Add gpiomux for ex-ldo used gpio, 2013-09-04, [email protected] */
	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] */


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

	msm_gpiomux_install(wcnss_5wire_interface,
				ARRAY_SIZE(wcnss_5wire_interface));

	msm_gpiomux_install(&sd_card_det, 1);

	if (hw_rev == HW_REV_0) {
		msm_gpiomux_install(msm_melfas_configs, ARRAY_SIZE(msm_melfas_configs));
		printk(KERN_ERR "[Touch] HW_REV_0 \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 \n");
	} else {
		msm_gpiomux_install(msm_atmel_configs_rev_b, ARRAY_SIZE(msm_atmel_configs_rev_b));
		printk(KERN_ERR "[Touch] HW_REV_B or above \n");
	}

	msm_gpiomux_install_nowrite(msm_lcd_configs,
			ARRAY_SIZE(msm_lcd_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


/*  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 */

#if defined(CONFIG_TSPDRV)
	msm_gpiomux_install(vibrator_configs, ARRAY_SIZE(vibrator_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

	// 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 :
		case HW_REV_A :
		case HW_REV_B :
		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;
	}

	// 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 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));
	}
	/*                                                                                  */
	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");
	}
/*                                                                                  */

	msm_gpiomux_install(msm_gpio_int_configs,
			ARRAY_SIZE(msm_gpio_int_configs));

	/*                                                        */
#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
/*                                                        */
}