static int dsi_s_wqxga_10_1_postpoweron(struct device *dev)
{
	int err = 0;

	if (machine_is_macallan())
		err = macallan_dsi_regulator_get(dev);
	else
		err = dalmore_dsi_regulator_get(dev);
	if (err < 0) {
		pr_err("dsi regulator get failed\n");
		goto fail;
	}

	err = tegra_panel_gpio_get_dt("s,wqxga-10-1", &panel_of);
	if (err < 0) {
		/* try to get gpios from board file */
		if (machine_is_macallan())
			err = macallan_dsi_gpio_get();
		else
			err = dalmore_dsi_gpio_get();
		if (err < 0) {
			pr_err("dsi gpio request failed\n");
			goto fail;
		}
	}

	if (vdd_ds_1v8) {
		err = regulator_enable(vdd_ds_1v8);
		if (err < 0) {
			pr_err("vdd_ds_1v8 regulator enable failed\n");
			goto fail;
		}
	}

	if (dvdd_lcd_1v8) {
		err = regulator_enable(dvdd_lcd_1v8);
		if (err < 0) {
			pr_err("dvdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	if (avdd_lcd_3v3) {
		err = regulator_enable(avdd_lcd_3v3);
		if (err < 0) {
			pr_err("avdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	/* panel ic requirement after vcc enable */
	msleep(260);

	if (vdd_lcd_bl) {
		err = regulator_enable(vdd_lcd_bl);
		if (err < 0) {
			pr_err("vdd_lcd_bl regulator enable failed\n");
			goto fail;
		}
	}

	if (vdd_lcd_bl_en) {
		err = regulator_enable(vdd_lcd_bl_en);
		if (err < 0) {
			pr_err("vdd_lcd_bl_en regulator enable failed\n");
			goto fail;
		}
	}

	msleep(20);
#if DSI_PANEL_RESET
	err = tegra_panel_reset(&panel_of, 20);
	if (err < 0) {
		/* use platform data */
		gpio_direction_output(
			dsi_s_wqxga_10_1_pdata.dsi_panel_rst_gpio, 1);
		usleep_range(1000, 5000);
		gpio_set_value(dsi_s_wqxga_10_1_pdata.dsi_panel_rst_gpio, 0);
		usleep_range(1000, 5000);
		gpio_set_value(dsi_s_wqxga_10_1_pdata.dsi_panel_rst_gpio, 1);
		msleep(20);
	}
#endif

	return 0;
fail:
	return err;
}
static int dsi_p_wuxga_10_1_enable(struct device *dev)
{
	int err = 0;

	if (machine_is_dalmore())
		err = dalmore_dsi_regulator_get(dev);
	else if (machine_is_macallan())
		err = macallan_dsi_regulator_get(dev);
	if (err < 0) {
		pr_err("dsi regulator get failed\n");
		goto fail;
	}
	if (machine_is_dalmore())
		err = dalmore_dsi_gpio_get();
	else if (machine_is_macallan())
		err = macallan_dsi_gpio_get();
	if (err < 0) {
		pr_err("dsi gpio request failed\n");
		goto fail;
	}

	if (vdd_ds_1v8) {
		err = regulator_enable(vdd_ds_1v8);
		if (err < 0) {
			pr_err("vdd_ds_1v8 regulator enable failed\n");
			goto fail;
		}
	}

	if (dvdd_lcd_1v8) {
		err = regulator_enable(dvdd_lcd_1v8);
		if (err < 0) {
			pr_err("dvdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	if (avdd_lcd_3v3) {
		err = regulator_enable(avdd_lcd_3v3);
		if (err < 0) {
			pr_err("avdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	if (vdd_lcd_bl) {
		err = regulator_enable(vdd_lcd_bl);
		if (err < 0) {
			pr_err("vdd_lcd_bl regulator enable failed\n");
			goto fail;
		}
	}

	if (vdd_lcd_bl_en) {
		err = regulator_enable(vdd_lcd_bl_en);
		if (err < 0) {
			pr_err("vdd_lcd_bl_en regulator enable failed\n");
			goto fail;
		}
	}

	msleep(100);
#if DSI_PANEL_RESET
	gpio_direction_output(gpio_lcd_rst, 1);
	usleep_range(1000, 5000);
	gpio_set_value(gpio_lcd_rst, 0);
	msleep(150);
	gpio_set_value(gpio_lcd_rst, 1);
	msleep(20);
#endif

	return 0;
fail:
	return err;
}
static int dsi_p_900x1440_7_0_enable(struct device *dev)
{
	int err = 0;
	if(!atomic_read(&tegra_release_bootloader_fb_flag)) {
		tegra_release_bootloader_fb();
		atomic_set(&tegra_release_bootloader_fb_flag, 1);
	}

	err = macallan_dsi_regulator_get(dev);
	if (err < 0) {
		pr_err("dsi regulator get failed\n");
		goto fail;
	}
	err = macallan_dsi_gpio_get();
	if (err < 0) {
		pr_err("dsi gpio request failed\n");
		goto fail;
	}

	if (vdd_ds_1v8) {
		err = regulator_enable(vdd_ds_1v8);
		if (err < 0) {
			pr_err("vdd_ds_1v8 regulator enable failed\n");
			goto fail;
		}
	}

	if (dvdd_lcd_1v8) {
		err = regulator_enable(dvdd_lcd_1v8);
		if (err < 0) {
			pr_err("dvdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	if (avdd_lcd_3v3) {
		err = regulator_enable(avdd_lcd_3v3);
		if (err < 0) {
			pr_err("avdd_lcd regulator enable failed\n");
			goto fail;
		}
	}
	if(gpio_lcd_rst>0){
		gpio_set_value(gpio_lcd_rst, 1);
	}
	
    msleep(300);

	if (vdd_lcd_bl) {
		err = regulator_enable(vdd_lcd_bl);
		if (err < 0) {
			pr_err("vdd_lcd_bl regulator enable failed\n");
			goto fail;
		}
	}

	if(gpio_bl_en>0){
		gpio_set_value(gpio_bl_en, 1);
	}
	
	if(gpio_bl_pwm>0){
		//gpio_set_value(gpio_bl_pwm, 1);
	}

	if(gpio_lcd_bl_en>0){
		gpio_set_value(gpio_lcd_bl_en, 1);
	}

	if (vdd_lcd_bl_en) {
		err = regulator_enable(vdd_lcd_bl_en);
		if (err < 0) {
			pr_err("vdd_lcd_bl_en regulator enable failed\n");
			goto fail;
		}
	}

	msleep(210);
	if(gpio_bridge_mip_en>0){
	gpio_set_value(gpio_bridge_mip_en, 1);
	msleep(50);
	gpio_set_value(gpio_bridge_mip_en, 0);
	msleep(50);
	gpio_set_value(gpio_bridge_mip_en, 1);
	}
	
#if DSI_PANEL_RESET
	gpio_direction_output(gpio_lcd_rst, 1);
	usleep_range(1000, 5000);
	gpio_set_value(gpio_lcd_rst, 0);
	msleep(150);
	gpio_set_value(gpio_lcd_rst, 1);
	msleep(20);
#endif

	return 0;
fail:
	return err;
}
Exemplo n.º 4
0
static int dsi_s_wqxga_10_1_postpoweron(struct device *dev)
{
	int err = 0;

	if (machine_is_maya())
		err = maya_dsi_regulator_get(dev);
#ifndef CONFIG_MACH_MAYA
	else if (machine_is_dalmore())
		err = dalmore_dsi_regulator_get(dev);
	else if (machine_is_macallan())
		err = macallan_dsi_regulator_get(dev);
#endif
	if (err < 0) {
		pr_err("dsi regulator get failed\n");
		goto fail;
	}
	if (machine_is_maya())
		err = maya_dsi_gpio_get();
#ifndef CONFIG_MACH_MAYA
	if (machine_is_dalmore())
		err = dalmore_dsi_gpio_get();
	else if (machine_is_macallan())
		err = macallan_dsi_gpio_get();
#endif
	if (err < 0) {
		pr_err("dsi gpio request failed\n");
		goto fail;
	}

	if (vdd_ds_1v8) {
		err = regulator_enable(vdd_ds_1v8);
		if (err < 0) {
			pr_err("vdd_ds_1v8 regulator enable failed\n");
			goto fail;
		}
	}

	if (dvdd_lcd_1v8) {
		err = regulator_enable(dvdd_lcd_1v8);
		if (err < 0) {
			pr_err("dvdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	if (avdd_lcd_3v3) {
		err = regulator_enable(avdd_lcd_3v3);
		if (err < 0) {
			pr_err("avdd_lcd regulator enable failed\n");
			goto fail;
		}
	}

	/* panel ic requirement after vcc enable */
	msleep(260);

	if (vdd_lcd_bl) {
		err = regulator_enable(vdd_lcd_bl);
		if (err < 0) {
			pr_err("vdd_lcd_bl regulator enable failed\n");
			goto fail;
		}
	}

	if (vdd_lcd_bl_en) {
		err = regulator_enable(vdd_lcd_bl_en);
		if (err < 0) {
			pr_err("vdd_lcd_bl_en regulator enable failed\n");
			goto fail;
		}
	}

	msleep(20);
#if DSI_PANEL_RESET
	gpio_direction_output(DSI_PANEL_RST_GPIO, 1);
	usleep_range(1000, 5000);
	gpio_set_value(DSI_PANEL_RST_GPIO, 0);
	usleep_range(1000, 5000);
	gpio_set_value(DSI_PANEL_RST_GPIO, 1);
	msleep(20);
#endif

	return 0;
fail:
	return err;
}