From 72cb87a32ea910b6c00f24173a333c39cc0534e4 Mon Sep 17 00:00:00 2001 From: Huang Jiachai Date: Wed, 12 Oct 2016 16:53:08 +0800 Subject: [PATCH] video: rockchip: screen: add refresh mode for cmd mode screen Change-Id: I4643eb1272a1f504ba4b36eb31a4125fa22390f3 Signed-off-by: Huang Jiachai --- drivers/video/of_display_timing.c | 4 ++++ drivers/video/rockchip/rk_fb.c | 1 + include/linux/rk_screen.h | 9 +++++---- include/video/display_timing.h | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/video/of_display_timing.c b/drivers/video/of_display_timing.c index e393412faf66..b253875e99c7 100644 --- a/drivers/video/of_display_timing.c +++ b/drivers/video/of_display_timing.c @@ -107,6 +107,10 @@ static int of_parse_display_timing(const struct device_node *np, dt->flags |= val ? DISPLAY_FLAGS_SWAP_RB : 0; if (!of_property_read_u32(np, "screen-type", &val)) dt->screen_type = val; + if (!of_property_read_u32(np, "refresh-mode", &val)) + dt->refresh_mode = val; + else + dt->refresh_mode = 0; if (!of_property_read_u32(np, "lvds-format", &val)) dt->lvds_format = val; if (!of_property_read_u32(np, "out-face", &val)) diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 4e0641876baf..32625a8b1137 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -500,6 +500,7 @@ int rk_fb_video_mode_from_timing(const struct display_timing *dt, screen->mode.yres = dt->vactive.typ; screen->mode.vsync_len = dt->vsync_len.typ; screen->type = dt->screen_type; + screen->refresh_mode = dt->refresh_mode; screen->lvds_format = dt->lvds_format; screen->face = dt->face; screen->color_mode = dt->color_mode; diff --git a/include/linux/rk_screen.h b/include/linux/rk_screen.h index af0ffe7d70d0..5e5cd30d08ed 100644 --- a/include/linux/rk_screen.h +++ b/include/linux/rk_screen.h @@ -54,7 +54,7 @@ struct overscan { unsigned char bottom; }; -/* Screen description +/* Screen description *type:LVDS,RGB,MIPI,MCU *lvds_fromat:lvds data format,set it if the screen is lvds *face:thi display output face,18bit,24bit,etc @@ -62,11 +62,12 @@ struct overscan { */ struct rk_screen { u16 type; - u16 lvds_format; + u16 refresh_mode; + u16 lvds_format; u16 face; u16 color_mode; - u8 lcdc_id; - u8 screen_id; + u8 lcdc_id; + u8 screen_id; struct fb_videomode mode; u32 post_dsp_stx; u32 post_dsp_sty; diff --git a/include/video/display_timing.h b/include/video/display_timing.h index 0ff62c5e16f8..e9e168a56c5c 100644 --- a/include/video/display_timing.h +++ b/include/video/display_timing.h @@ -78,6 +78,7 @@ struct display_timing { enum display_flags flags; /* display flags */ #if defined(CONFIG_FB_ROCKCHIP) u16 screen_type; /*screen type*/ + u16 refresh_mode; /* 0: video mode 1: cmd mode */ u16 screen_widt; /* screen physical size */ u16 screen_hight; u16 lvds_format; /*lvds data format for lvds screen*/ -- 2.34.1