Example #1
0
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1())) {
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
	}
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
/*===========================================================================


FUNCTION     get_compass_gs_position

DESCRIPTION
  This function probe which G-sensor & Campass status type should be used

DEPENDENCIES
  
RETURN VALUE
  None

SIDE EFFECTS
  None
===========================================================================*/
compass_gs_position_type  get_compass_gs_position(void)
{
	compass_gs_position_type compass_gs_position=COMPASS_TOP_GS_TOP;
	/* modify compass and gs position by board id */
    //move C8820\25D define from TOP to BOTTOM
	if (machine_is_msm7x27a_surf() 
	 || machine_is_msm7x27a_ffa() 
	 || machine_is_msm7x27a_umts() 
	 || machine_is_msm7x27a_cdma()
	 || machine_is_msm7x27a_U8815()) 
	{
		compass_gs_position=COMPASS_TOP_GS_TOP;
	}
	/*< DTS2012022006500 yangbo 20120220 begin */
	/*version A and version B has compass, since version C don't have compass*/
	else if(machine_is_msm7x27a_C8820() && (HW_VER_SUB_VC <= get_hw_sub_board_id()))
	{
		compass_gs_position=COMPASS_NONE_GS_BOTTOM;
	}
	/* DTS2012022006500 yangbo 20120220 end > */
	/* add U8655_EMMC, use the u8655 configuration */
	else if (machine_is_msm7x27a_U8655() 
		  || machine_is_msm7x27a_U8655_EMMC()  
		  || machine_is_msm7x27a_C8655_NAND()  
		  || machine_is_msm7x27a_M660()  
		  || machine_is_msm7x27a_U8661()    
		  || machine_is_msm7x27a_C8820()   
		  || machine_is_msm7x27a_C8825D()
		  || machine_is_msm7x30_u8800()
		  || machine_is_msm7x30_u8820() 
		  || machine_is_msm7x30_u8800_51()
		  || machine_is_msm8255_u8800_pro()
		  || machine_is_msm8255_u8860() 
		  || machine_is_msm8255_c8860() 
		  || machine_is_msm8255_u8860lp()
          /* < DTS2012022905490 ganfan 20120301 begin */
          || machine_is_msm8255_u8860_r()
          /* DTS2012022905490 ganfan 20120301 end > */
		  || machine_is_msm8255_u8860_92()            
		  || machine_is_msm8255_u8860_51())
	{
		compass_gs_position=COMPASS_BOTTOM_GS_BOTTOM;
	}
	else if (machine_is_msm7x27a_U8185())	
	{
		compass_gs_position=COMPASS_NONE_GS_TOP;
	}
	else if(machine_is_msm8255_u8680() 
	     || machine_is_msm8255_u8730())
	{
	    compass_gs_position=COMPASS_TOP_GS_TOP;
	}
	/*< DTS2012022300887 fengwei 20120224 begin */
    else if (machine_is_msm7x27a_C8668D() )	
	{
		compass_gs_position = COMPASS_BOTTOM_GS_TOP;
	}
	/* DTS2012022300887 fengwei 20120224 end >*/
	return compass_gs_position;
}
Example #3
0
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	}

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif
	return ret;
}
void __init msm_msm7627a_allocate_memory_regions(void)
{
	void *addr;
	unsigned long fb_size;

	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa())
		fb_size = MSM7x25A_MSM_FB_SIZE;
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
						|| machine_is_msm8625_evt())
		fb_size = MSM8x25_MSM_FB_SIZE;
	else if (machine_is_msm7x27a_ffa())
	{
		fb_size = MSM7627A_QRD3_FB_SIZE;
		pr_info("7627a_qrd3 allocating %lu bytes for fb\n", fb_size);
	}
	else
		fb_size = MSM_FB_SIZE;

	addr = alloc_bootmem_align(fb_size, 0x1000);
	msm_fb_resources[0].start = __pa(addr);
	msm_fb_resources[0].end = msm_fb_resources[0].start + fb_size - 1;
	pr_info("allocating %lu bytes at %p (%lx physical) for fb\n", fb_size,
						addr, __pa(addr));

#ifdef CONFIG_MSM_V4L2_VIDEO_OVERLAY_DEVICE
	fb_size = MSM_V4L2_VIDEO_OVERLAY_BUF_SIZE;
	addr = alloc_bootmem_align(fb_size, 0x1000);
	msm_v4l2_video_overlay_resources[0].start = __pa(addr);
	msm_v4l2_video_overlay_resources[0].end =
		msm_v4l2_video_overlay_resources[0].start + fb_size - 1;
	pr_debug("allocating %lu bytes at %p (%lx physical) for v4l2\n",
		fb_size, addr, __pa(addr));
#endif

}
Example #5
0
void __init msm7627a_add_io_devices(void)
{
	/* touchscreen */
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
	/* keypad */
	platform_device_register(&kp_pdev);

	/* headset */
	platform_device_register(&hs_pdev);

	/* LED: configure it as a pdm function */
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

	/* Vibrator */
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa())
		msm_init_pmic_vibrator();
}
/*===========================================================================


FUNCTION     get_compass_gs_position

DESCRIPTION
  This function probe which G-sensor & Campass status type should be used

DEPENDENCIES
  
RETURN VALUE
  None

SIDE EFFECTS
  None
===========================================================================*/
compass_gs_position_type  get_compass_gs_position(void)
{
	compass_gs_position_type compass_gs_position=COMPASS_TOP_GS_TOP;
	/* modify compass and gs position by board id */
    //move C8820\25D define from TOP to BOTTOM
    if (machine_is_msm7x27a_surf() 
        || machine_is_msm7x27a_ffa() 
        || machine_is_msm7x27a_U8815()
        || machine_is_msm8x25_C8950D()
        || (machine_is_msm8x25_U8950() && (HW_VER_SUB_VB <= get_hw_sub_board_id()))
        || machine_is_msm8x25_U8950D()
        )
	{
		compass_gs_position=COMPASS_TOP_GS_TOP;
	}
	/*version A and version B has compass, since version C don't have compass*/
	else if(machine_is_msm7x27a_C8820() && (HW_VER_SUB_VC <= get_hw_sub_board_id()))
	{
		compass_gs_position=COMPASS_NONE_GS_BOTTOM;
	}
	/* add U8655_EMMC, use the u8655 configuration */
	else if (machine_is_msm7x27a_U8655() 
		  || machine_is_msm7x27a_U8655_EMMC()  
		  || machine_is_msm7x27a_C8655_NAND()  
		  || machine_is_msm7x27a_M660()  
		  || machine_is_msm7x27a_U8661()    
		  || machine_is_msm7x27a_C8820()   
		  || machine_is_msm8x25_C8825D()
		  || machine_is_msm7x30_u8800()
		  || machine_is_msm7x30_u8820() 
		  || machine_is_msm7x30_u8800_51()
		  || machine_is_msm8255_u8800_pro()
		  || machine_is_msm8255_u8860() 
		  || machine_is_msm8255_c8860()
		  || machine_is_msm8x25_U8825()
          || machine_is_msm8x25_U8825D()
		  || (machine_is_msm8x25_U8950() && (HW_VER_SUB_VA == get_hw_sub_board_id()))
		  || machine_is_msm8255_u8860lp()
          || machine_is_msm8255_u8860_r()
		  || machine_is_msm8255_u8860_92()            
		  || machine_is_msm8255_u8860_51())
	{
		compass_gs_position=COMPASS_BOTTOM_GS_BOTTOM;
	}
	else if (machine_is_msm7x27a_U8185())	
	{
		compass_gs_position=COMPASS_NONE_GS_TOP;
	}
	else if(machine_is_msm8255_u8680() 
	     || machine_is_msm8255_u8730())
	{
	    compass_gs_position=COMPASS_TOP_GS_TOP;
	}
    else if (machine_is_msm7x27a_C8668D() )	
	{
		compass_gs_position = COMPASS_BOTTOM_GS_TOP;
	}
	return compass_gs_position;
}
static void config_camera_off_gpios_front(void)
{
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
		msm_camera_vreg_config(0);

	config_gpio_table(camera_off_gpio_table,
			ARRAY_SIZE(camera_off_gpio_table));
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	printk("%s: %d\n", __func__, __LINE__);
	if (machine_is_msm8225_cellon()) {
		ret = cellon_auto_detect_lcd_panel(name);
	} else if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
        if (cont_splash_enabled == 1) {
            if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
                ret = 0;
        } else if (cont_splash_enabled == 2) {
            if (!strncmp(name, "mipi_video_nt35510_wvga", 21))
                ret = 0;
        } else {
            if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
                ret = 0;
        }
	} else if (machine_is_msm8625_skua()) {
		if (!strncmp(name, "mipi_video_himax_wvga", 21) && skua_panel_is_himax())
			ret = 0;
		else if (!strncmp(name, "mipi_cmd_nt35510_alaska_wvga", 28) && !skua_panel_is_himax())
			ret = 0;
	} else if (machine_is_msm8625_evt()) {
		if (!strncmp(name, "mipi_video_nt35510_wvga", 23))
			ret = 0;
	}

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif

	return ret;
}
void __init msm7627a_add_io_devices(void)
{
	/* touchscreen */
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

/* MTD-BSP-VT-GPIO-02-[ */
#if 0
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				atmel_ts_i2c_info,
				ARRAY_SIZE(atmel_ts_i2c_info));
#endif
/* MTD-BSP-VT-GPIO-02-] */

#if 0
	/* keypad */
/* FIH-SW-MM-VH-DISPLAY-JB00*[ */
    if (0){
		platform_device_register(&kp_pdev);
	}
/* FIH-SW-MM-VH-DISPLAY-JB00*] */
#endif

	// MTD-BSP-Y.S-Enable drivers
	if( gpio_tlmm_config( GPIO_CFG( 37, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA ), GPIO_CFG_ENABLE ) )
		pr_err( "GKEY: gpio_tlmm_config(37) failed\n" );

	if( gpio_tlmm_config( GPIO_CFG( 38, 0, GPIO_CFG_INPUT, GPIO_CFG_PULL_UP, GPIO_CFG_2MA ), GPIO_CFG_ENABLE ) )
		pr_err( "GKEY: gpio_tlmm_config(38) failed\n" );

	platform_device_register( &GUA_BMB_GPIO_key );
	platform_device_register( &hs_pdev );
	// MTD-BSP-Y.S-Enable drivers

#if 0
	/* LED: configure it as a pdm function */
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

	/* Vibrator */
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa())
		msm_init_pmic_vibrator();
#endif // 0

}
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;

	}
	if (machine_is_msm8625_evb() || machine_is_msm7627a_evb()
				||  machine_is_msm8625_evt()
				|| machine_is_msm7627a_qrd3()
				|| machine_is_msm8625_qrd7()) {
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
	}
	platform_device_register(&msm_camera_server);
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
#if 0
//#ifdef CONFIG_LCDC_TOSHIBA
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
#endif
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
#ifdef CONFIG_FB_MSM_MIPI_DSI_RENESAS
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
#endif
#ifdef CONFIG_FB_MSM_MIPI_DSI_ILI9486
        if (!strncmp(name, "mipi_cmd_ili9486_hvga", 21))
			ret = 0;
#endif
    }else if (machine_is_msm7627a_qrd1()) {
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_evt()) {
		if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
			ret = 0;
	}

#if 0
//#ifdef CONFIG_LCDC_TOSHIBA
#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif
#endif

	return ret;
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;
	#if 1 // #suwg

	printk("xxx %s:%s\n ",__func__,name);
	return ret;
	#endif

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
			ret = 0;
	} else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd()) {
		if (!strncmp(name, "mipi_video_hx8389b_qhd", 22)) 
                        ret = 0;
	} else if (machine_is_msm8625q_skue()) {
		if (!strncmp(name, "mipi_video_otm9605a_qhd", 23))
                        ret = 0;
        }

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif

	return ret;
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() ||
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		#if 1  //#linxc 12-08-23 +++ 
			if (!strncmp(name, "mipi_cmd_novatek_sharp_qhd", 26))    		
	                ret = 0;	
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
				ret = 0;
		#endif
		
	} else if (machine_is_msm8625q_skud()) {
		if (!strncmp(name, "mipi_video_hx8389b_qhd", 22))
                        ret = 0;
        }

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif

	return ret;
}
/* TODO: static struct msm_camera_sensor_info msm_camera_sensor_ov9726_data; */
static int config_camera_on_gpios_rear(void)
{
	int rc = 0;

	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
		msm_camera_vreg_config(1);

	rc = config_gpio_table(camera_on_gpio_table,
			ARRAY_SIZE(camera_on_gpio_table));
	if (rc < 0) {
		pr_err("%s: CAMSENSOR gpio table request"
		"failed\n", __func__);
		return rc;
	}

	return rc;
}
static void __init msm7x27a_init_cam(void)
{
#ifdef CONFIG_HI351
	struct msm_camera_sensor_info *s_info;
#endif

	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
#ifdef CONFIG_MACH_LGE
#ifdef CONFIG_HI351
		sensor_board_info_hi351.cam_vreg = NULL;
		sensor_board_info_hi351.num_vreg = 0;
		s_info = &msm_camera_sensor_hi351_data;
		s_info->sensor_platform_info->ext_power_ctrl =
			msm_camera_7x27a_ext_power_ctrl;
#endif
#else
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
#endif
	}
	platform_device_register(&msm_camera_server);
	platform_device_register(&msm7x27a_device_csic0);
	platform_device_register(&msm7x27a_device_csic1);
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
Example #16
0
static int mipi_dsi_panel_power(int on)
{
	int rc = 0;
	uint32_t lcdc_reset_cfg;

	/* I2C-controlled GPIO Expander -init of the GPIOs very late */
	if (unlikely(!dsi_gpio_initialized)) {
		pmapp_disp_backlight_init();

		rc = gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr");
		if (rc < 0) {
			pr_err("failed to request gpio_disp_pwr\n");
			return rc;
		}

		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, 1);
			if (rc < 0) {
				pr_err("failed to enable display pwr\n");
				goto fail_gpio1;
			}

			rc = gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en");
			if (rc < 0) {
				pr_err("failed to request gpio_bkl_en\n");
				goto fail_gpio1;
			}

			rc = gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
			if (rc < 0) {
				pr_err("failed to enable backlight\n");
				goto fail_gpio2;
			}
		}

		rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_dsi), regs_dsi);
		if (rc) {
			pr_err("%s: could not get regulators: %d\n",
					__func__, rc);
			goto fail_gpio2;
		}

		rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_dsi), regs_dsi);
		if (rc) {
			pr_err("%s: could not set voltages: %d\n",
					__func__, rc);
			goto fail_vreg;
		}
		if (pmapp_disp_backlight_set_brightness(100))
			pr_err("backlight set brightness failed\n");

		dsi_gpio_initialized = 1;
	}

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()) {
		gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
		gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
	} else if (machine_is_msm7x27a_ffa() ||
			 machine_is_msm7625a_ffa()) {
		if (on) {
			/* This line drives an active low pin on FFA */
			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, !on);
			if (rc < 0)
				pr_err("failed to set direction for "
					"display pwr\n");
		} else {
			gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, !on);
			rc = gpio_direction_input(GPIO_DISPLAY_PWR_EN);
			if (rc < 0)
				pr_err("failed to set direction for "
					"display pwr\n");
		}
	}

	if (on) {
		gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);

		if (machine_is_msm7x27a_surf() ||
				 machine_is_msm7625a_surf()) {
			lcdc_reset_cfg = readl_relaxed(lcdc_reset_ptr);
			rmb();
			lcdc_reset_cfg &= ~1;

			writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
			msleep(20);
			wmb();
			lcdc_reset_cfg |= 1;
			writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
		} else {
			gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
			msleep(20);
			gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
		}
	} else {
		gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 1);
	}

	rc = on ? regulator_bulk_enable(ARRAY_SIZE(regs_dsi), regs_dsi) :
		  regulator_bulk_disable(ARRAY_SIZE(regs_dsi), regs_dsi);

	if (rc)
		pr_err("%s: could not %sable regulators: %d\n",
				__func__, on ? "en" : "dis", rc);

	return rc;

fail_vreg:
	regulator_bulk_free(ARRAY_SIZE(regs_dsi), regs_dsi);
fail_gpio2:
	gpio_free(GPIO_BACKLIGHT_EN);
fail_gpio1:
	gpio_free(GPIO_DISPLAY_PWR_EN);
	dsi_gpio_initialized = 0;
	return rc;
}
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifdef CONFIG_MACH_LGE
#ifdef CONFIG_HI542
				sensor_board_info_hi542.cam_vreg = NULL;
				sensor_board_info_hi542.num_vreg = 0;
#endif
#ifdef CONFIG_MT9E013_LGIT
				mt9e013_lgit_sensor_info.cam_vreg = NULL;
				mt9e013_lgit_sensor_info.num_vreg = 0;
#endif
#ifdef CONFIG_MT9V113
		sensor_board_info_mt9v113.cam_vreg = NULL;
		sensor_board_info_mt9v113.num_vreg = 0;
#endif
#else
#ifdef CONFIG_S5K4E1
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
#endif
#ifdef CONFIG_MT9E013
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
#endif
#ifdef CONFIG_WEBCAM_OV9726
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
#endif
#ifdef CONFIG_OV7692
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
#endif
#ifdef CONFIG_OV5647
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
#endif
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()) {
#ifdef CONFIG_OV7692
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
#endif
#ifdef CONFIG_OV5647
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
#endif
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MACH_LGE
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
#endif
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	}
	platform_device_register(&msm_camera_server);
/* LGE_CHANGE_S: 2012/11/2 [email protected] U0 Camera Bring Up */
#ifndef CONFIG_MACH_LGE
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()
			|| machine_is_msm7x27a_u0()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
#endif
	platform_device_register(&msm7x27a_device_csic0);
	platform_device_register(&msm7x27a_device_csic1);
/* LGE_CHANGE_E: 2012/11/2 [email protected] U0 Camera Bring Up */
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
static void __init msm7x27a_init_cam(void)
{
	if (!(machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
				|| machine_is_msm7627a_qrd1()
				|| machine_is_msm8625_ffa())) {
		/*MTD-MM-SL-ImproveFrontCamera-00*{ */
		/*MTD-MM-SL-CameraPorting-00*{ */
		#ifndef CONFIG_FIH_CAMERA
		sensor_board_info_s5k4e1.cam_vreg = NULL;
		sensor_board_info_s5k4e1.num_vreg = 0;
		sensor_board_info_mt9e013.cam_vreg = NULL;
		sensor_board_info_mt9e013.num_vreg = 0;
		sensor_board_info_ov9726.cam_vreg = NULL;
		sensor_board_info_ov9726.num_vreg = 0;
		sensor_board_info_ov7692.cam_vreg = NULL;
		sensor_board_info_ov7692.num_vreg = 0;
		sensor_board_info_ov5647.cam_vreg = NULL;
		sensor_board_info_ov5647.num_vreg = 0;
		sensor_board_info_ov8825.cam_vreg = NULL;
		sensor_board_info_ov8825.num_vreg = 0;
		#else
		#ifdef CONFIG_ISX006
		sensor_board_info_isx006.cam_vreg = NULL;
		sensor_board_info_isx006.num_vreg = 0;
		#endif
		#endif
		/*MTD-MM-SL-CameraPorting-00*} */
		/*MTD-MM-SL-ImproveFrontCamera-00*} */

	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()) {
		#ifndef CONFIG_FIH_CAMERA
		sensor_board_info_ov7692.cam_vreg =
			ov7692_gpio_vreg;
		sensor_board_info_ov7692.num_vreg =
			ARRAY_SIZE(ov7692_gpio_vreg);
		sensor_board_info_ov5647.cam_vreg =
			ov5647_gpio_vreg;
		sensor_board_info_ov5647.num_vreg =
			ARRAY_SIZE(ov5647_gpio_vreg);
		sensor_board_info_ov8825.cam_vreg =
			ov8825_gpio_vreg;
		sensor_board_info_ov8825.num_vreg =
			ARRAY_SIZE(ov8825_gpio_vreg);
		#endif
	}
	platform_device_register(&msm_camera_server);
	if (machine_is_msm8625_surf() || machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7()) {
		platform_device_register(&msm8625_device_csic0);
		platform_device_register(&msm8625_device_csic1);
	} else {
		platform_device_register(&msm7x27a_device_csic0);
		platform_device_register(&msm7x27a_device_csic1);
	}
	if (machine_is_msm8625_evb()
			|| machine_is_msm8625_evt()
			|| machine_is_msm8625_qrd7())
		*(int *) msm7x27a_device_clkctl.dev.platform_data = 1;
	platform_device_register(&msm7x27a_device_clkctl);
	platform_device_register(&msm7x27a_device_vfe);
}
Example #19
0
static void __init msm7x2x_init(void)
{
	msm7x2x_misc_init();

	/* Initialize regulators first so that other devices can use them */
	msm7x27a_init_regulators();

	/* Common functions for SURF/FFA/RUMI3 */
	msm_device_i2c_init();
	msm7x27a_init_ebi2();
	msm7x27a_cfg_uart2dm_serial();
#ifdef CONFIG_SERIAL_MSM_HS
	msm_uart_dm1_pdata.wakeup_irq = gpio_to_irq(UART1DM_RX_GPIO);
	msm_device_uart_dm1.dev.platform_data = &msm_uart_dm1_pdata;
#endif

#ifdef CONFIG_USB_MSM_OTG_72K
	msm_otg_pdata.swfi_latency =
		msm7x27a_pm_data
		[MSM_PM_SLEEP_MODE_RAMP_DOWN_AND_WAIT_FOR_INTERRUPT].latency;
	msm_device_otg.dev.platform_data = &msm_otg_pdata;
#endif
	msm_device_gadget_peripheral.dev.platform_data =
		&msm_gadget_pdata;
	msm7x27a_cfg_smsc911x();
	platform_add_devices(msm_footswitch_devices,
			msm_num_footswitch_devices);
	platform_add_devices(surf_ffa_devices,
			ARRAY_SIZE(surf_ffa_devices));
	/* Ensure ar6000pm device is registered before MMC/SDC */
	msm7x27a_init_ar6000pm();
#ifdef CONFIG_MMC_MSM
	msm7627a_init_mmc();
#endif
	msm_fb_add_devices();
#ifdef CONFIG_USB_EHCI_MSM_72K
	msm7x2x_init_host();
#endif

	msm_pm_set_platform_data(msm7x27a_pm_data,
				ARRAY_SIZE(msm7x27a_pm_data));
	BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));

#if defined(CONFIG_I2C) && defined(CONFIG_GPIO_SX150X)
	register_i2c_devices();
#endif
#if defined(CONFIG_BT) && defined(CONFIG_MARIMBA_CORE)
	msm7627a_bt_power_init();
#endif
	if (machine_is_msm7625a_surf() || machine_is_msm7625a_ffa()) {
		atmel_ts_pdata.min_x = 0;
		atmel_ts_pdata.max_x = 480;
		atmel_ts_pdata.min_y = 0;
		atmel_ts_pdata.max_y = 320;
	}

	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
		atmel_ts_i2c_info,
		ARRAY_SIZE(atmel_ts_i2c_info));

#if defined(CONFIG_MSM_CAMERA)
	msm7627a_camera_init();
#endif
	platform_device_register(&kp_pdev);
	platform_device_register(&hs_pdev);

	/* configure it as a pdm function*/
	if (gpio_tlmm_config(GPIO_CFG(LED_GPIO_PDM, 3,
				GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
				GPIO_CFG_8MA), GPIO_CFG_ENABLE))
		pr_err("%s: gpio_tlmm_config for %d failed\n",
			__func__, LED_GPIO_PDM);
	else
		platform_device_register(&led_pdev);

#ifdef CONFIG_MSM_RPC_VIBRATOR
	if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa())
		msm_init_pmic_vibrator();
#endif
	/*7x25a kgsl initializations*/
	msm7x25a_kgsl_3d0_init();
}
static int mipi_dsi_panel_msm_power(int on)
{
	/*++ Huize - 20120927 Modify for identifying what the code is used by customization ++*/
	#ifdef DISPLAY_CUSTOMIZATION
	int rc = 0;
	if (unlikely(!dsi_gpio_initialized)) {
		pr_emerg("%s\n", __func__);
		#ifndef CONFIG_LEDS_CHIP_LM3533
		rc = gpio_request(GPIO_BACKLIGHT_EN, "gpio_bl_en");
		if (rc < 0) {
			pr_err("failed to request gpio_bl_en\n");
			return rc;
		}
		rc = gpio_tlmm_config(
			GPIO_CFG(GPIO_BACKLIGHT_EN,0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA),
			GPIO_CFG_ENABLE);
		#endif	
		if (rc) {
			pr_err("Failed to enable gpio_bl_en\n");
			goto fail_gpio1;
		}
		rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_dsi), regs_dsi);
		if (rc) {
			pr_err("%s: could not get regulators: %d\n",
					__func__, rc);
			goto fail_gpio2;
		}

		rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_dsi), regs_dsi);
		if (rc) {
			pr_err("%s: could not set voltages: %d\n",
					__func__, rc);
			goto fail_vreg;
		}

		dsi_gpio_initialized = 1;
	}
	#else
	int rc = 0;
	uint32_t lcdc_reset_cfg;

	/* I2C-controlled GPIO Expander -init of the GPIOs very late */
	if (unlikely(!dsi_gpio_initialized)) {
		pmapp_disp_backlight_init();

		rc = gpio_request(GPIO_DISPLAY_PWR_EN, "gpio_disp_pwr");
		if (rc < 0) {
			pr_err("failed to request gpio_disp_pwr\n");
			return rc;
		}

		if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf()
				|| machine_is_msm8625_surf()) {
			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, 1);
			if (rc < 0) {
				pr_err("failed to enable display pwr\n");
				goto fail_gpio1;
			}

			rc = gpio_request(GPIO_BACKLIGHT_EN, "gpio_bkl_en");
			if (rc < 0) {
				pr_err("failed to request gpio_bkl_en\n");
				goto fail_gpio1;
			}

			rc = gpio_direction_output(GPIO_BACKLIGHT_EN, 1);
			if (rc < 0) {
				pr_err("failed to enable backlight\n");
				goto fail_gpio2;
			}
		}

		rc = regulator_bulk_get(NULL, ARRAY_SIZE(regs_dsi), regs_dsi);
		if (rc) {
			pr_err("%s: could not get regulators: %d\n",
					__func__, rc);
			goto fail_gpio2;
		}

		rc = regulator_bulk_set_voltage(ARRAY_SIZE(regs_dsi),
						regs_dsi);
		if (rc) {
			pr_err("%s: could not set voltages: %d\n",
					__func__, rc);
			goto fail_vreg;
		}
		if (pmapp_disp_backlight_set_brightness(100))
			pr_err("backlight set brightness failed\n");

		dsi_gpio_initialized = 1;
	}
	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, on);
		gpio_set_value_cansleep(GPIO_BACKLIGHT_EN, on);
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (on) {
			/* This line drives an active low pin on FFA */
			rc = gpio_direction_output(GPIO_DISPLAY_PWR_EN, !on);
			if (rc < 0)
				pr_err("failed to set direction for "
					"display pwr\n");
		} else {
			gpio_set_value_cansleep(GPIO_DISPLAY_PWR_EN, !on);
			rc = gpio_direction_input(GPIO_DISPLAY_PWR_EN);
			if (rc < 0)
				pr_err("failed to set direction for "
					"display pwr\n");
		}
	}

	if (on) {
		gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 0);

		if (machine_is_msm7x27a_surf() ||
				 machine_is_msm7625a_surf() ||
				 machine_is_msm8625_surf()) {
			lcdc_reset_cfg = readl_relaxed(lcdc_reset_ptr);
			rmb();
			lcdc_reset_cfg &= ~1;

			writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
			msleep(20);
			wmb();
			lcdc_reset_cfg |= 1;
			writel_relaxed(lcdc_reset_cfg, lcdc_reset_ptr);
		} else {
			gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 0);
			msleep(20);
			gpio_set_value_cansleep(GPIO_LCDC_BRDG_RESET_N, 1);
		}
	} else {
		gpio_set_value_cansleep(GPIO_LCDC_BRDG_PD, 1);
	}
	#endif
	/*-- Huize - 20120927 Modify for identifying what the code is used by customization --*/

	rc = on ? regulator_bulk_enable(ARRAY_SIZE(regs_dsi), regs_dsi) :
		  regulator_bulk_disable(ARRAY_SIZE(regs_dsi), regs_dsi);

	if (rc)
		pr_err("%s: could not %sable regulators: %d\n",
				__func__, on ? "en" : "dis", rc);

	return rc;
fail_vreg:
	regulator_bulk_free(ARRAY_SIZE(regs_dsi), regs_dsi);
fail_gpio2:
	gpio_free(GPIO_BACKLIGHT_EN);
fail_gpio1:
//Jordan-20111230 , remove 	
//	gpio_free(GPIO_DISPLAY_PWR_EN);
	dsi_gpio_initialized = 0;
	return rc;
}
static int msm_fb_detect_panel(const char *name)
{
	int ret = -ENODEV;

	if (machine_is_msm7x27a_surf() || machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
		if (!strncmp(name, "lcdc_toshiba_fwvga_pt", 21) ||
				!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7x27a_ffa() || machine_is_msm7625a_ffa()
					|| machine_is_msm8625_ffa()) {
		if (!strncmp(name, "mipi_cmd_renesas_fwvga", 22))
			ret = 0;
	} else if (machine_is_msm7627a_qrd1()) {
		if (!strncmp(name, "mipi_video_truly_wvga", 21))
			ret = 0;
	} else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		if (!strncmp(name, "lcdc_truly_hvga_ips3p2335_pt", 28))
			ret = 0;
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
        if (cont_splash_enabled == 1) {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif
                ret = 0;
        } else if (cont_splash_enabled == 2) {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif
                ret = 0;
        } else {
		#if defined CONFIG_FB_MSM_MIPI_TCL_TD_TNFW4602_2_VIDEO_MODE
			if (!strncmp(name, LCD_MODULE_NAME, strlen(LCD_MODULE_NAME)))
		#else
			if (!strncmp(name, "mipi_cmd_nt35510_wvga", 21))
		#endif

                ret = 0;
        }
	} else if (machine_is_msm8625_skua()) {
		if (!strncmp(name, "mipi_video_himax_wvga", 21) && skua_panel_is_himax())
			ret = 0;
		else if (!strncmp(name, "mipi_cmd_nt35510_alaska_wvga", 28) && !skua_panel_is_himax())
			ret = 0;
	} else if (machine_is_msm8625_evt()) {
		if (!strncmp(name, "mipi_video_nt35510_wvga", 23))
			ret = 0;
	}

#if !defined(CONFIG_FB_MSM_LCDC_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_MIPI_PANEL_AUTO_DETECT) && \
	!defined(CONFIG_FB_MSM_LCDC_MIPI_PANEL_AUTO_DETECT)
		if (machine_is_msm7x27a_surf() ||
			machine_is_msm7625a_surf() ||
			machine_is_msm8625_surf()) {
			if (!strncmp(name, LCDC_TOSHIBA_FWVGA_PANEL_NAME,
				strnlen(LCDC_TOSHIBA_FWVGA_PANEL_NAME,
					PANEL_NAME_MAX_LEN)))
				return 0;
		}
#endif

	return ret;
}