static void __init add_platform_devices(void)
{
	if (machine_is_msm8625_evb() || machine_is_msm8625_qrd7()
				|| machine_is_msm8625_qrd5() || machine_is_msm8625q_skud()
				|| machine_is_msm8625q_skue()) {
		platform_add_devices(msm8625_evb_devices,
				ARRAY_SIZE(msm8625_evb_devices));
		platform_add_devices(qrd3_devices,
				ARRAY_SIZE(qrd3_devices));
	}
	else {
		platform_add_devices(qrd7627a_devices,
				ARRAY_SIZE(qrd7627a_devices));
	}

	if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb())
		platform_add_devices(qrd3_devices,
				ARRAY_SIZE(qrd3_devices));
/*start by lf 2012.12.26 for button-backlight*/	
		if (machine_is_msm8625_qrd5()){
		#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)	
			keyboard_leds_init();
		#endif
/*end by lf 2012.12.26 */		
	}
	platform_add_devices(common_devices,
			ARRAY_SIZE(common_devices));
}
static void __init add_platform_devices(void)
{
	if (machine_is_msm8625_evb() || machine_is_msm8625_qrd7()
				|| machine_is_msm8625_qrd5()
				|| machine_is_msm8625q_evbd()
				|| machine_is_msm8625q_skud()
				|| machine_is_msm8625q_skue()) {
		platform_add_devices(msm8625_evb_devices,
				ARRAY_SIZE(msm8625_evb_devices));
		platform_add_devices(qrd3_devices,
				ARRAY_SIZE(qrd3_devices));
	}
	else {
		platform_add_devices(qrd7627a_devices,
				ARRAY_SIZE(qrd7627a_devices));
	}

        if (machine_is_msm8625_evb() || machine_is_msm8625_qrd5())
                platform_add_devices(msm8625_lcd_camera_devices,
                        ARRAY_SIZE(msm8625_lcd_camera_devices));
        else if (machine_is_msm8625q_evbd())
                platform_add_devices(msm8625q_lcd_camera_devices,
                        ARRAY_SIZE(msm8625q_lcd_camera_devices));

	if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb())
		platform_add_devices(qrd3_devices,
				ARRAY_SIZE(qrd3_devices));
	platform_add_devices(common_devices,
			ARRAY_SIZE(common_devices));
}
void __init msm_fb_add_devices(void)
{
	/* Using continuous splash or not */
	if (machine_is_msm8625_qrd7() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5()) {
            if (cont_splash_enabled) {
                    /* increase ref count of ext power */
                    qrd_lcd_splash_power_vote(1);
                    mdp_pdata.cont_splash_enabled = 1;
                    /* FIXME: Need these flags to indicate backlight driver the initial backlight level */
                    mipi_NT35510_pdata.cont_splash_enabled = 1;
                    mipi_NT35510_alaska_pdata.cont_splash_enabled = 1;
                    mipi_himax_pdata.cont_splash_enabled = 1;
            }
    }

	/* default is NT35510 */
	if (machine_is_msm8625_skua() && skua_panel_is_himax()) {
		skua_fb_devices[1] = &mipi_dsi_himax_panel_device;
		skua_backlight_device.dev.platform_data = &mipi_himax_pdata;
	}

	msm7x27a_set_display_params(prim_panel_name);
	if (machine_is_msm8225_cellon())
		platform_add_devices(c8680_fb_devices,
				ARRAY_SIZE(c8680_fb_devices));
	else if (machine_is_msm7627a_qrd1())
		platform_add_devices(qrd_fb_devices,
				ARRAY_SIZE(qrd_fb_devices));
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || 
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() || 
			machine_is_msm8625_evt()) {
		platform_add_devices(evb_fb_devices,
				ARRAY_SIZE(evb_fb_devices));
	} else if (machine_is_msm8625_skua())
		platform_add_devices(skua_fb_devices,
				ARRAY_SIZE(skua_fb_devices));
	else if (machine_is_msm7627a_qrd3() || machine_is_msm8625_qrd7()) {
		platform_add_devices(qrd3_fb_devices,
						ARRAY_SIZE(qrd3_fb_devices));
	} else
		platform_add_devices(msm_fb_devices,
				ARRAY_SIZE(msm_fb_devices));

	msm_fb_register_device("mdp", &mdp_pdata);
	if (machine_is_msm7625a_surf() || machine_is_msm7x27a_surf()
		|| machine_is_msm8625_surf() || machine_is_msm7627a_qrd3()
		|| machine_is_msm8625_qrd7())
		msm_fb_register_device("lcdc", &lcdc_pdata);
#ifdef CONFIG_FB_MSM_MIPI_DSI
	msm_fb_register_device("mipi_dsi", &mipi_dsi_pdata);
#endif
}
Exemplo n.º 4
0
static void led_brightness_set_flash(struct led_classdev *led_cdev,
				     enum led_brightness brightness)
{
	if(brightness){
		if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
			gpio_set_value(qrd5_led_flash_en1, 1);
		else if(machine_is_msm8625_qrd7())
			gpio_set_value(qrd7_led_flash_en, 1);
	} else {
		if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
			gpio_set_value(qrd5_led_flash_en1, 0);
		else if(machine_is_msm8625_qrd7())
			gpio_set_value(qrd7_led_flash_en, 0);
	}
}
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_qrd5() || machine_is_msm7x27a_qrd5a()
                        || machine_is_msm8625q_skue()
                        )
		fb_size = MSM8x25_MSM_FB_SIZE;
	else if (machine_is_msm8625q_evbd() || machine_is_msm8625q_skud())
		fb_size = MSM8x25Q_MSM_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

}
static int mipi_NT35510_rotate_panel(void)
{
	int rotate = 0;
	if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		rotate = 1;

	return rotate;
}
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;
}
static int __init qrd_wlan_init(void)
{
	int rc;

	pr_info("WLAN power init\n");
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config %d failed,error = %d\n",
				__func__, gpio_wlan_sys_rest_en, rc);
			goto exit;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 0);
	} else {
		gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		rc = setup_wlan_gpio(false);
		gpio_free(gpio_wlan_sys_rest_en);
		if (rc) {
			pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
			goto exit;
		}
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config %d failed,error = %d\n",
				__func__, GPIO_WLAN_3V3_EN, rc);
			goto exit;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 0);
	}

    /*ATH6KL_USES_PREALLOCATE_MEM*/
#ifdef CONFIG_ATH6KL_USES_PREALLOCATE_MEM
	wlan_init_memory();
#endif
	/* NV mac init */
	msm_read_nv(NV_ITEM_WLAN_MAC_ADDR,wlan_mac_addr);
        printk("MAC from NV %02X:%02X:%02X:%02X:%02X:%02X\n",
                     wlan_mac_addr[0], wlan_mac_addr[1], wlan_mac_addr[2],
                     wlan_mac_addr[3], wlan_mac_addr[4], wlan_mac_addr[5]);
exit:
	return rc;
}
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_dsi_client_reset(void)
{
	int rc = 0;

	if (machine_is_msm7627a_qrd1())
		rc = msm_fb_dsi_client_qrd1_reset();
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
                        || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
       #if 1
		rc = msm_fb_dsi_client_D9_reset();
	#else	
	       rc = msm_fb_dsi_client_qrd3_reset();
	#endif
        else if (machine_is_msm8625q_skud())
static void gpio_wlan_config(void)
{
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5()
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7())
		gpio_wlan_sys_rest_en = 124;
	else if(machine_is_msm8625q_evbd()
					|| machine_is_msm8625q_skue()
					|| machine_is_msm8625q_skud())
		gpio_wlan_sys_rest_en = 124;
}
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;
}
static int mipi_dsi_panel_power(int on)
{
	int rc = 0;

	if (machine_is_msm7627a_qrd1())
		rc = mipi_dsi_panel_qrd1_power(on);
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || 
			machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() || 
			machine_is_msm8625_evt())
		rc = mipi_dsi_panel_qrd3_power(on);
	else if(machine_is_msm8625_skua())
		rc = mipi_dsi_panel_skua_power(on);
	else
		rc = mipi_dsi_panel_msm_power(on);
	return rc;
}
static int __init qrd_wlan_init(void)
{
	int rc;

	pr_info("WLAN power init\n");
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()
					|| machine_is_msm8625q_skud()
					|| machine_is_msm8625q_skue()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config %d failed,error = %d\n",
				__func__, gpio_wlan_sys_rest_en, rc);
			goto exit;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 0);
	} else {
		gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		rc = setup_wlan_gpio(false);
		gpio_free(gpio_wlan_sys_rest_en);
		if (rc) {
			pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
			goto exit;
		}
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config %d failed,error = %d\n",
				__func__, GPIO_WLAN_3V3_EN, rc);
			goto exit;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 0);
	}
exit:
	return rc;
}
static void gpio_wlan_config(void)
{
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7())
#ifndef CONFIG_CELLON_PRJ_C8681
		gpio_wlan_sys_rest_en = 124;
#else 
		gpio_wlan_sys_rest_en = 16;
#endif
	pr_info("wlan rest gpio - %d\n", gpio_wlan_sys_rest_en);
}
static int msm_fb_dsi_client_reset(void)
{
	int rc = 0;

	if (machine_is_msm7627a_qrd1())
		rc = msm_fb_dsi_client_qrd1_reset();
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || 
			machine_is_msm8625_qrd5()|| machine_is_msm7x27a_qrd5a() || 
			machine_is_msm8625_evt())
		rc = msm_fb_dsi_client_qrd3_reset();
	else if (machine_is_msm8625_skua())
		rc = msm_fb_dsi_client_skua_reset();
	else
		rc = msm_fb_dsi_client_msm_reset();

	return rc;
}
Exemplo n.º 17
0
static void __init msm_pm_init(void)
{
#if 0
	if (machine_is_msm8625_qrd7())
		return;
#endif

	if (!(machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm8625_skua() || machine_is_msm8625_qrd7() || machine_is_msm8625_skub())) {
		msm_pm_set_platform_data(msm7627a_pm_data,
				ARRAY_SIZE(msm7627a_pm_data));
		BUG_ON(msm_pm_boot_init(&msm_pm_boot_pdata));
	} else {
		msm_pm_set_platform_data(msm8625_pm_data,
				ARRAY_SIZE(msm8625_pm_data));
		BUG_ON(msm_pm_boot_init(&msm_pm_8625_boot_pdata));
		msm8x25_spm_device_init();
	}
}
static int tricolor_leds_gpio_setup(void) {
	int ret = 0;
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
	{
		tricolor_leds_gpio_cfg_data[0].gpio_cfg = GPIO_CFG(LED_FLASH_EN1, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	}
	else if(machine_is_msm8625_qrd7())
	{
		tricolor_leds_gpio_cfg_data[0].gpio_cfg = GPIO_CFG(QRD7_LED_FLASH_EN, 0, GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL, GPIO_CFG_2MA);
	}

	ret = msm_gpios_request_enable(tricolor_leds_gpio_cfg_data,
			sizeof(tricolor_leds_gpio_cfg_data)/sizeof(struct msm_gpio));
	if( ret<0 )
		printk(KERN_ERR "%s: Failed to obtain tricolor_leds GPIO . Code: %d\n",
				__func__, ret);
	return ret;
}
Exemplo n.º 19
0
static void __init msm7627a_init_regulators(void)
{
	int rc = 0;
	printk("%s\n", __func__); 

	rc = platform_device_register(&msm_proccomm_regulator_dev);
	if (rc)
		pr_err("%s: could not register msm_proccomm_regulator_dev: %d\n",
				__func__, rc);

	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		rc = platform_device_register(&evb_device_ext_2v8_vreg);
		if (rc)
			pr_err("%s: could not register evb_device_ext_2v8_vreg: %d\n",
					__func__, rc);

		rc = platform_device_register(&evb_device_ext_1v8_vreg);
		if (rc)
			pr_err("%s: could not register evb_device_ext_1v8_vreg: %d\n",
					__func__, rc);
	} else if (machine_is_msm8625_qrd7()) {
		rc = platform_device_register(&sku7_device_ext_2v8_vreg);
		if (rc)
			pr_err("%s: could not register sku7_device_ext_2v8_vreg: %d\n",
					__func__, rc);

		rc = platform_device_register(&sku7_device_ext_1v8_vreg);
		if (rc)
			pr_err("%s: could not register sku7_device_ext_1v8_vreg: %d\n",
					__func__, rc);
	} else if (machine_is_msm7627a_qrd3()) {
		rc = platform_device_register(&sku3_device_ext_2v8_vreg);
		if (rc)
			pr_err("%s: could not register sku3_device_ext_2v8_vreg: %d\n",
					__func__, rc);

		rc = platform_device_register(&sku3_device_ext_1v8_vreg);
		if (rc)
			pr_err("%s: could not register sku3_device_ext_1v8_vreg: %d\n",
					__func__, rc);
	}

	return;
}
static void gpio_wlan_config(void)
{
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5()
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7())
		gpio_wlan_sys_rest_en = 124;
	else if(machine_is_msm8625q_evbd()
					|| machine_is_msm8625q_skue()
					|| machine_is_msm8625q_skud())
		/*TYDRV:chenjp 2012.12.26 modify for QCT support*/
		#if defined(TYQ_QCT_SUPPORT)
		gpio_wlan_sys_rest_en = 124;
		#else
		gpio_wlan_sys_rest_en = 38;
		#endif
}
Exemplo n.º 21
0
static void gpio_bt_config(void)
{
	u32 socinfo = socinfo_get_platform_version();
	if (machine_is_msm7627a_qrd1())
		gpio_bt_sys_rest_en = 114;
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
				|| machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		gpio_bt_sys_rest_en = 16;
	if(machine_is_msm8625q_skud() || machine_is_msm8625q_skue() || machine_is_msm8625q_evbd())
		gpio_bt_sys_rest_en = 35;
	if (machine_is_msm8625_qrd7())
		gpio_bt_sys_rest_en = 88;
	if (machine_is_msm7627a_qrd3()) {
		if (socinfo == 0x70002)
			gpio_bt_sys_rest_en = 88;
		 else
			gpio_bt_sys_rest_en = 85;
	}
}
Exemplo n.º 22
0
static void __init add_platform_devices(void)
{
	if (machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || 
		machine_is_msm8625_skua() || machine_is_msm8625_qrd7() || 
		machine_is_msm8625_skub() || machine_is_msm8625_evt())

		platform_add_devices(msm8625_evb_devices,
				ARRAY_SIZE(msm8625_evb_devices));


	else {
		platform_add_devices(qrd7627a_devices,
				ARRAY_SIZE(qrd7627a_devices));
	}
	if (machine_is_msm7627a_qrd3() || machine_is_msm7627a_evb() || machine_is_msm8625_qrd7() || machine_is_msm8625_skub())
		platform_add_devices(qrd3_devices,
				ARRAY_SIZE(qrd3_devices));
	platform_add_devices(common_devices,
			ARRAY_SIZE(common_devices));
}
int __init msm_add_sdcc(unsigned int controller, struct mmc_platform_data *plat)
{
	struct platform_device	*pdev;

	if (controller < 1 || controller > 4)
		return -EINVAL;

	if (machine_is_msm8625_skua() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm8625_skub())
	{
		msm8625_device_sdc3.resource[2].start = DMOV_NAND_CHAN;
		msm8625_device_sdc3.resource[2].end = DMOV_NAND_CHAN;
	}

	if (cpu_is_msm8625())
		pdev = msm8625_sdcc_devices[controller-1];
	else
		pdev = msm_sdcc_devices[controller-1];

	pdev->dev.platform_data = plat;
	return platform_device_register(pdev);
}
static int msm_fb_dsi_client_reset(void)
{
	int rc = 0;
#if 1 // #suwg.
	printk("xxx %s \n",__func__);
	return rc;
#endif
	if (machine_is_msm7627a_qrd1())
		rc = msm_fb_dsi_client_qrd1_reset();
	else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb()
                        || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		rc = msm_fb_dsi_client_qrd3_reset();
        else if (machine_is_msm8625q_skud() || machine_is_msm8625q_evbd())
                rc = msm_fb_dsi_client_skud_reset();
        else if (machine_is_msm8625q_skue())
                rc = msm_fb_dsi_client_skue_reset();
	else
		rc = msm_fb_dsi_client_msm_reset();

	return rc;

}
static int mpu3050_gpio_setup(void) {
	int ret = 0;
	ret = msm_gpios_request_enable(mpu3050_gpio_cfg_data,
				 sizeof(mpu3050_gpio_cfg_data)/sizeof(struct msm_gpio));
	if( ret<0 )
		printk(KERN_ERR "Failed to obtain mpu3050 int GPIO!\n");
	else
		printk("mpu3050 int GPIO request!\n");
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ) {
		if (ARRAY_SIZE(mpu3050_boardinfo_qrd5))
			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
						mpu3050_boardinfo_qrd5,
						ARRAY_SIZE(mpu3050_boardinfo_qrd5));
	} else {
		if (ARRAY_SIZE(mpu3050_boardinfo))
			i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
						mpu3050_boardinfo,
						ARRAY_SIZE(mpu3050_boardinfo));
	}
	printk("i2c_register_board_info for MPU3050\n");

	return ret;
}
Exemplo n.º 26
0
static void msm7627a_add_io_devices(void)
{
	int rc;

	/* touchscreen */
	if (machine_is_msm7627a_qrd1()) {
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					synaptic_i2c_clearpad3k,
					ARRAY_SIZE(synaptic_i2c_clearpad3k));
	} else if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		if (machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
			mxt_config_array[0].config = mxt_config_data_qrd5;
			mxt_config_array[0].config_length = ARRAY_SIZE(mxt_config_data_qrd5);
			mxt_touchpad_setup();
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_IRQ_GPIO, 0,
					GPIO_CFG_INPUT, GPIO_CFG_PULL_UP,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_IRQ_GPIO);
		}

		rc = gpio_tlmm_config(GPIO_CFG(MXT_TS_RESET_GPIO, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_PULL_DOWN,
					GPIO_CFG_8MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
					__func__, MXT_TS_RESET_GPIO);
		}

		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				mxt_device_info,
				ARRAY_SIZE(mxt_device_info));

	}else if (machine_is_msm7627a_qrd3() || 
			machine_is_msm8625_skua() ||
			machine_is_msm8625_qrd7()){
		ft5x06_touchpad_setup();
	}

	/* headset */
	platform_device_register(&hs_pdev);

	/* vibrator */
#ifdef CONFIG_MSM_RPC_VIBRATOR
	msm_init_pmic_vibrator();
#endif

	/* change the keymap for qrd sku5 */
	if(machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a())
		kp_matrix_info_8625.keymap = keymap_8625_qrd5;

	/* keypad */
	if (machine_is_msm7627a_evb() ||
		 machine_is_msm8625_evb()||
		 machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a() ||
		 machine_is_msm8625_qrd7() ||
		 machine_is_msm8625_skua())
		platform_device_register(&kp_pdev_8625);

	/* leds */
/* disable the AP leds
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5()) {
		rc = gpio_tlmm_config(GPIO_CFG(LED_RED_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_RED_GPIO_8625);
		}

		rc = gpio_tlmm_config(GPIO_CFG(LED_GREEN_GPIO_8625, 0,
				GPIO_CFG_OUTPUT, GPIO_CFG_PULL_UP,
				GPIO_CFG_16MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s: gpio_tlmm_config for %d failed\n",
				__func__, LED_GREEN_GPIO_8625);
		}

		platform_device_register(&gpio_leds_8625);
	}
*/
#ifdef CONFIG_LEDS_TRICOLOR_FLAHSLIGHT
	    /*tricolor leds init*/
	tricolor_leds_gpio_setup();
#endif
}
static unsigned int msm_AR600X_shutdown_power(bool on)
{
	int rc = 0;

	/* Disable the A0 clock */
	rc = setup_wlan_clock(on);
	if (rc) {
		pr_err("%s: setup_wlan_clock = %d\n", __func__, rc);
		goto set_clock_fail;
	}

	/*
	 * gpio_wlan_sys_rest_en is not from the GPIO expander for QRD7627a,
	 * EVB1.0 and QRD8625,so the below step is required for those devices.
	 */
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto gpio_fail;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 0);
	} else {
		rc = gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		if (!rc) {
			rc = setup_wlan_gpio(on);
			if (rc) {
				pr_err("%s: setup_wlan_gpio = %d\n",
					__func__, rc);
				goto set_gpio_fail;
			}
			gpio_free(gpio_wlan_sys_rest_en);
		}
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto qrd_gpio_fail;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 0);
	}

	rc = wlan_switch_regulators(on);
	if (rc) {
		pr_err("%s: wlan_switch_regulators error = %d\n",
			__func__, rc);
		goto reg_disable;
	}

	pr_info("WLAN power-down success\n");
	return 0;
set_clock_fail:
	setup_wlan_clock(0);
set_gpio_fail:
	setup_wlan_gpio(0);
gpio_fail:
	gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1())
		gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
	wlan_switch_regulators(0);
	pr_info("WLAN power-down failed\n");
	return rc;
}
static unsigned int msm_AR600X_setup_power(bool on)
{
	int rc = 0;
	static bool init_done;

	if (unlikely(!init_done)) {
		gpio_wlan_config();
		rc = qrf6285_init_regs();
		if (rc) {
			pr_err("%s: qrf6285 init failed = %d\n", __func__, rc);
			return rc;
		} else {
			init_done = true;
		}
	}

	rc = wlan_switch_regulators(on);
	if (rc) {
		pr_err("%s: wlan_switch_regulators error = %d\n", __func__, rc);
		goto out;
	}

	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1()) {
		rc = gpio_tlmm_config(GPIO_CFG(GPIO_WLAN_3V3_EN, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto reg_disable;
		}
		gpio_set_value(GPIO_WLAN_3V3_EN, 1);
	}

	/*
	 * gpio_wlan_sys_rest_en is not from the GPIO expander for QRD7627a,
	 * EVB1.0 and QRD8625,so the below step is required for those devices.
	 */
	if (machine_is_msm7627a_qrd1() || machine_is_msm7627a_evb()
					|| machine_is_msm8625_evb()
					|| machine_is_msm8625_qrd5() 
					|| machine_is_msm7x27a_qrd5a()  
					|| machine_is_msm8625_skua()
					|| machine_is_msm8625_evt()
					|| machine_is_msm7627a_qrd3()
					|| machine_is_msm8625_qrd7()) {
		rc = gpio_tlmm_config(GPIO_CFG(gpio_wlan_sys_rest_en, 0,
					GPIO_CFG_OUTPUT, GPIO_CFG_NO_PULL,
					GPIO_CFG_2MA), GPIO_CFG_ENABLE);
		if (rc) {
			pr_err("%s gpio_tlmm_config 119 failed,error = %d\n",
				__func__, rc);
			goto qrd_gpio_fail;
		}
		gpio_set_value(gpio_wlan_sys_rest_en, 1);
	} else {
		rc = gpio_request(gpio_wlan_sys_rest_en, "WLAN_DEEP_SLEEP_N");
		if (rc) {
			pr_err("%s: WLAN sys_rest_en GPIO %d request failed %d\n",
				__func__,
				gpio_wlan_sys_rest_en, rc);
			goto qrd_gpio_fail;
		}
		rc = setup_wlan_gpio(on);
		if (rc) {
			pr_err("%s: wlan_set_gpio = %d\n", __func__, rc);
			goto gpio_fail;
		}
		gpio_free(gpio_wlan_sys_rest_en);
	}

	/* Enable the A0 clock */
	rc = setup_wlan_clock(on);
	if (rc) {
		pr_err("%s: setup_wlan_clock = %d\n", __func__, rc);
		goto set_gpio_fail;
	}

	/* Configure A0 clock to be slave to WLAN_CLK_PWR_REQ */
	rc = pmapp_clock_vote(id, PMAPP_CLOCK_ID_A0,
				 PMAPP_CLOCK_VOTE_PIN_CTRL);
	if (rc) {
		pr_err("%s: Configuring A0 to Pin controllable failed %d\n",
				__func__, rc);
		goto set_clock_fail;
	}

	pr_info("WLAN power-up success\n");
	return 0;
set_clock_fail:
	setup_wlan_clock(0);
set_gpio_fail:
	setup_wlan_gpio(0);
gpio_fail:
	gpio_free(gpio_wlan_sys_rest_en);
qrd_gpio_fail:
	/* GPIO_WLAN_3V3_EN is only required for the QRD7627a */
	if (machine_is_msm7627a_qrd1())
		gpio_free(GPIO_WLAN_3V3_EN);
reg_disable:
	wlan_switch_regulators(0);
out:
	pr_info("WLAN power-up failed\n");
	return rc;
}
void __init msm7627a_sensor_init(void)
{
#ifdef CONFIG_AVAGO_APDS990X
	if ( machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		pr_info("i2c_register_board_info APDS990X\n");
		apds990x_setup();
	}
#endif

#ifdef CONFIG_MPU_SENSORS_MPU3050
	if (machine_is_msm7627a_evb() || machine_is_msm8625_evb() || machine_is_msm8625_qrd5() || machine_is_msm7x27a_qrd5a()) {
		pr_info("i2c_register_board_info MPU3050\n");
		mpu3050_gpio_setup();
	}
#endif

#ifdef CONFIG_BOSCH_BMA250
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3() || machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info BMA250 ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					bma250_i2c_info,
					ARRAY_SIZE(bma250_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_ISL29028
	if (machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info ISL29028 ALP sensor!\n");
		i2c_register_board_info(MSM_GSBI0_QUP_I2C_BUS_ID,
					isl29028_i2c_info,
					ARRAY_SIZE(isl29028_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_LIS3DH
	if (machine_is_msm8625q_skue()) {
		lis3dh_acc_gpio_setup();
		pr_info("i2c_register_board_info LIS3DH ACC\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
					lis3dh_acc_i2c_info,
					ARRAY_SIZE(lis3dh_acc_i2c_info));
	}
#endif

#ifdef CONFIG_SENSORS_BMA250
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				bma250_i2c_info,
				ARRAY_SIZE(bma250_i2c_info));
#endif
#ifdef CONFIG_SENSORS_BMM050
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				bmm050_i2c_info,
				ARRAY_SIZE(bmm050_i2c_info));
#endif

#ifdef CONFIG_INPUT_LTR502
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3()) {
		pr_info("i2c_register_board_info LTR502\n");
		ltr502_light_gpio_setup();
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				ltr502_light_i2c_info,
				ARRAY_SIZE(ltr502_light_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_LTR558_D9
	printk("i2c_register_board_info LTR558 weiqingdan\n");
	i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				ltr558_light_i2c_info,
				ARRAY_SIZE(ltr558_light_i2c_info));
#endif

#ifdef CONFIG_SENSORS_AK8975
	if (machine_is_msm8625_qrd7() || machine_is_msm7627a_qrd3() || machine_is_msm8625q_skud()) {
		pr_info("i2c_register_board_info AKM8975\n");
		akm_gpio_setup();
		akm_platform_data_8975.gpio_DRDY = 18;
		akm8975_i2c_info[0].irq = gpio_to_irq(akm_platform_data_8975.gpio_DRDY);
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
				akm8975_i2c_info,
				ARRAY_SIZE(akm8975_i2c_info));
	}
#endif

#ifdef CONFIG_INPUT_KXTJ9
	if(machine_is_msm8625_skua()) {
	pr_info("i2c_register_board_info KXTJ9\n");
		i2c_register_board_info(MSM_GSBI1_QUP_I2C_BUS_ID,
			accel_kxtj9_i2c_info,
			ARRAY_SIZE(accel_kxtj9_i2c_info));
	}
#endif


}
static int msm_fb_dsi_client_qrd3_reset(void)
{
	int rc = 0;

    pr_debug("%s: cont_splash_enabled = %d\n", __func__, cont_splash_enabled);

    rc = gpio_request(GPIO_QRD3_LCD_BRDG_RESET_N, "qrd3_lcd_brdg_reset_n");
    if (rc < 0) {
        pr_err("Failed to request qrd3_lcd_brdg_reset_n\n");
        return rc;
    }

    rc = gpio_tlmm_config(qrd3_mipi_dsi_gpio[0], GPIO_CFG_ENABLE);
    if (rc < 0) {
        pr_err("Failed to config qrd3_gpio_bkl_en\n");
        goto gpio_fail1;
    }

    if (!cont_splash_enabled)
        rc = gpio_direction_output(GPIO_QRD3_LCD_BRDG_RESET_N, 0);
    else
        rc = gpio_direction_output(GPIO_QRD3_LCD_BRDG_RESET_N, 1);

    if (rc < 0) {
        pr_err("Failed to direction qrd3_gpio_bkl_en\n");
        goto gpio_fail1;
    }

    rc = gpio_request(GPIO_QRD3_LCD_BACKLIGHT_EN,
            "qrd3_gpio_bkl_en");
    if (rc < 0) {
        pr_err("Failed to request qrd3_gpio_bkl_en\n");
        goto gpio_fail1;
    }

    if((machine_is_msm8625_qrd5() && hw_version_is(3, 0)) || (machine_is_msm7x27a_qrd5a() && hw_version_is(3, 0))) {
        rc = gpio_tlmm_config(qrd3_mipi_dsi_gpio[2], GPIO_CFG_ENABLE);
        if (rc < 0) {
            pr_err("Failed to config qrd3_gpio_bkl_en\n");
            goto gpio_fail2;
        }
        rc = gpio_direction_input(GPIO_QRD3_LCD_BACKLIGHT_EN);
        if (rc < 0) {
            pr_err("Failed to direction qrd3_gpio_bkl_en\n");
            goto gpio_fail2;
        }
    } else {
        rc = gpio_tlmm_config(qrd3_mipi_dsi_gpio[1], GPIO_CFG_ENABLE);
        if (rc < 0) {
            pr_err("Failed to config qrd3_gpio_bkl_en\n");
            goto gpio_fail2;
        }

        if (!cont_splash_enabled)
            rc = gpio_direction_output(GPIO_QRD3_LCD_BACKLIGHT_EN, 0);
        else
            rc = gpio_direction_output(GPIO_QRD3_LCD_BACKLIGHT_EN, 1);

        if (rc < 0) {
            pr_err("Failed to direction qrd3_gpio_bkl_en\n");
            goto gpio_fail2;
        }
    }

    return rc;

gpio_fail2:
	gpio_free(GPIO_QRD3_LCD_BACKLIGHT_EN);
gpio_fail1:
	gpio_free(GPIO_QRD3_LCD_BRDG_RESET_N);
	return rc;
}