static int __init mcde_subsystem_init(void) { int ret; pr_info("MCDE subsystem init begin\n"); /* MCDE module init sequence */ ret = mcde_init(); if (ret) goto mcde_failed; ret = mcde_display_init(); if (ret) goto mcde_display_failed; ret = mcde_dss_init(); if (ret) goto mcde_dss_failed; #ifdef CONFIG_FB_MCDE ret = mcde_fb_init(); if (ret) goto mcde_fb_failed; #endif pr_info("MCDE subsystem init done\n"); goto done; #ifdef CONFIG_FB_MCDE mcde_fb_failed: mcde_dss_exit(); #endif mcde_dss_failed: mcde_display_exit(); mcde_display_failed: mcde_exit(); mcde_failed: done: return ret; }
int mcde_splash_image(void) { int ret = -ENODEV; struct mcde_rectangle rect; debug("%s: enter\n", __func__); if (main_display.port->type == MCDE_PORTTYPE_DSI) ret = mcde_startup_dsi(&platform_data); else if (main_display.port->type == MCDE_PORTTYPE_DPI) ret = mcde_startup_dpi(&platform_data); if (ret != 0) { printf("%s: mcde_startup... -> %d\n", __func__, ret); return ret; } /* dss enable display */ chnl = mcde_chnl_get(main_display.chnl_id, main_display.fifo, main_display.port); if (IS_ERR(chnl)) { ret = PTR_ERR(chnl); printf("%s: Failed to acquire MCDE channel ret=%d\n", __func__, ret); goto get_chnl_failed; } ret = mcde_chnl_set_power_mode(chnl, MCDE_DISPLAY_PM_STANDBY); if (ret) { printf("%s: mcde_chnl_set_power_mode() -> %d\n", __func__, ret); goto get_chnl_failed; } /* dss set video mode */ ret = mcde_chnl_set_video_mode(chnl, &video_mode); if (ret < 0) { printf("%s:Failed to set video mode on channel ret=%d\n", __func__, ret); goto set_video_mode_failed; } mcde_chnl_set_pixel_format(chnl, main_display.port_pixel_format); mcde_chnl_set_update_area(chnl, 0, 0, main_display.native_x_res, main_display.native_y_res); mcde_chnl_apply(chnl); /* chnl setup ok, display image */ ret = mcde_display_image(chnl); if (ret != 0) { debug("%s: mcde_display_image() -> %d\n", __func__, ret); goto display_image_failed; } #if defined(BOARD_C7_P0) /* vdd power on */ db8500_gpio_set_output(GPIO167_GPIO, 1); udelay(400); /* stbyb pull high */ db8500_gpio_set_output(GPIO154_GPIO, 1); udelay(400); /* reset pull high */ db8500_gpio_set_output(GPIO139_GPIO, 1); mdelay(20); db8500_gpio_set_output(GPIO156_GPIO, 1); mdelay(20); db8500_gpio_set_output(GPIO168_GPIO, 1); mdelay(20); db8500_gpio_set_output(GPIO218_GPIO, 1); mdelay(20); db8500_gpio_set_output(GPIO157_GPIO, 1); mdelay(20); #endif #ifdef CONFIG_VIA_DISPLAY_DSI ret = mcde_turn_on_display(); if (ret) { printf("%s: mcde_turn_on_display() -> %d\n", __func__, ret); goto get_chnl_failed; } #endif #if defined(BOARD_C7_P0) /* avdd vcom vgl vgh is on */ db8500_gpio_set_output(GPIO153_GPIO, 1); mdelay(40); db8500_gpio_set_output(GPIO139_GPIO, 0); mdelay(1); db8500_gpio_set_output(GPIO139_GPIO, 1); #endif mcde_chnl_apply(chnl); rect.x = 0; rect.y = 0; rect.w = main_display.native_x_res; rect.h = main_display.native_y_res; mcde_chnl_update(chnl, &rect); #ifndef CONFIG_VIA_DISPLAY_DSI ret = mcde_turn_on_display(); if (ret) { printf("%s: mcde_turn_on_display() -> %d\n", __func__, ret); goto get_chnl_failed; } #endif ret = mcde_chnl_set_power_mode(chnl, MCDE_DISPLAY_PM_ON); if (ret) { printf("%s: mcde_chnl_set_power_mode() -> %d\n", __func__, ret); goto get_chnl_failed; } mdelay(50); db8500_gpio_set_output(GPIO68_GPIO, 1); return ret; get_chnl_failed: display_image_failed: set_video_mode_failed: mcde_exit(); return ret; }
static void __exit mcde_module_exit(void) { mcde_exit(); mcde_display_exit(); mcde_dss_exit(); }