mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
rkhdmi:modify to compatible for platform which have only one lcdc but need to implement dual display like rk2928
This commit is contained in:
@@ -493,19 +493,21 @@ const char *hdmi_get_video_mode_name(unsigned char vic)
|
||||
int hdmi_switch_fb(struct hdmi *hdmi, int vic)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
rk_screen *screen;
|
||||
|
||||
|
||||
screen = kzalloc(sizeof(struct rk29fb_screen), GFP_KERNEL);
|
||||
if(screen == NULL)
|
||||
return -1;
|
||||
|
||||
if(hdmi->vic == 0)
|
||||
hdmi->vic = HDMI_VIDEO_DEFAULT_MODE;
|
||||
|
||||
if(hdmi->lcdc == NULL || hdmi->lcdc->screen == NULL) {
|
||||
dev_err(hdmi->dev, "lcdc %d not exist\n", HDMI_SOURCE_DEFAULT);
|
||||
return -1;
|
||||
}
|
||||
|
||||
rc = hdmi_set_info(hdmi->lcdc->screen, hdmi->vic);
|
||||
rc = hdmi_set_info(screen, hdmi->vic);
|
||||
|
||||
if(rc == 0) {
|
||||
rk_fb_switch_screen(hdmi->lcdc->screen, 1, HDMI_SOURCE_DEFAULT);
|
||||
rk_fb_switch_screen(screen, 1, HDMI_SOURCE_DEFAULT);
|
||||
rk_fb_disp_scale(hdmi->xscale, hdmi->yscale, HDMI_SOURCE_DEFAULT);
|
||||
}
|
||||
return rc;
|
||||
|
||||
@@ -80,7 +80,7 @@ void hdmi_sys_remove(void)
|
||||
memset(&hdmi->edid, 0, sizeof(struct hdmi_edid));
|
||||
INIT_LIST_HEAD(&hdmi->edid.modelist);
|
||||
hdmi->display = HDMI_DISABLE;
|
||||
rk_fb_switch_screen(hdmi->lcdc->screen, 0, HDMI_SOURCE_DEFAULT);
|
||||
rk_fb_switch_screen(hdmi->lcdc->screen1, 0, HDMI_SOURCE_DEFAULT);
|
||||
kobject_uevent_env(&hdmi->dev->kobj, KOBJ_REMOVE, envp);
|
||||
#ifdef CONFIG_SWITCH
|
||||
switch_set_state(&(hdmi->switch_hdmi), 0);
|
||||
|
||||
Reference in New Issue
Block a user