From: Huang Jiachai Date: Sun, 9 Oct 2016 02:28:03 +0000 (+0800) Subject: video: rockchip: rk fb: add hot plug state indicate extent screen state X-Git-Tag: firefly_0821_release~1445 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f670e7e264e0d89325aeec195549485bcf04966;p=firefly-linux-kernel-4.4.55.git video: rockchip: rk fb: add hot plug state indicate extent screen state Change-Id: If7dea36a420ef21763c309d12d64d95574b3dcf3 Signed-off-by: Huang Jiachai --- diff --git a/drivers/video/rockchip/rk_fb.c b/drivers/video/rockchip/rk_fb.c index 4a838803dc1e..4e0641876baf 100644 --- a/drivers/video/rockchip/rk_fb.c +++ b/drivers/video/rockchip/rk_fb.c @@ -3590,6 +3590,7 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id) enable, lcdc_id, screen->type, dev_drv->cur_screen->type); mutex_lock(&dev_drv->switch_screen); + dev_drv->hot_plug_state = enable; hdmi_switch_state = 0; dev_drv->hdmi_switch = 1; if (!dev_drv->uboot_logo) { diff --git a/drivers/video/rockchip/rkfb_sysfs.c b/drivers/video/rockchip/rkfb_sysfs.c index d40d98a1fa85..965e2df1a670 100644 --- a/drivers/video/rockchip/rkfb_sysfs.c +++ b/drivers/video/rockchip/rkfb_sysfs.c @@ -1205,6 +1205,17 @@ static ssize_t show_dsp_mode(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", dev_drv->dsp_mode); } +static ssize_t show_hot_plug_state(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct fb_info *fbi = dev_get_drvdata(dev); + struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par; + struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv; + + return snprintf(buf, PAGE_SIZE, "%d\n", dev_drv->hot_plug_state); +} + static ssize_t show_win_property(struct device *dev, struct device_attribute *attr, char *buf) @@ -1262,6 +1273,7 @@ static struct device_attribute rkfb_attrs[] = { __ATTR(win_property, S_IRUGO, show_win_property, NULL), __ATTR(car_reverse, S_IWUSR, NULL, set_car_reverse), __ATTR(dsp_mode, S_IRUGO, show_dsp_mode, NULL), + __ATTR(hot_plug_state, S_IRUGO, show_hot_plug_state, NULL), }; int rkfb_create_sysfs(struct fb_info *fbi) diff --git a/include/linux/rk_fb.h b/include/linux/rk_fb.h index 902b978d81cd..086e744d23ce 100755 --- a/include/linux/rk_fb.h +++ b/include/linux/rk_fb.h @@ -702,6 +702,7 @@ struct rk_lcdc_driver { struct device *mmu_dev; int iommu_enabled; int dsp_mode; + bool hot_plug_state; struct rk_fb_reg_area_data reg_area_data; /*