static int dsi_a_1080p_11_6_enable(struct device *dev) { int err = 0; err = dalmore_dsi_regulator_get(dev); if (err < 0) { pr_err("dsi regulator get failed\n"); goto fail; } err = dalmore_dsi_gpio_get(); if (err < 0) { pr_err("dsi gpio request 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; } } err = dalmore_dsi2edp_bridge_enable(dev); if (err < 0) { pr_err("bridge 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; } } #if DSI_PANEL_RESET gpio_direction_output(dsi_a_1080p_11_6_pdata.dsi_panel_rst_gpio, 1); usleep_range(1000, 5000); gpio_set_value(dsi_a_1080p_11_6_pdata.dsi_panel_rst_gpio, 0); msleep(150); gpio_set_value(dsi_a_1080p_11_6_pdata.dsi_panel_rst_gpio, 1); msleep(1500); #endif gpio_direction_output(dsi_a_1080p_11_6_pdata.dsi_panel_bl_pwm_gpio, 1); return 0; fail: return err; }
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_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; }