Skip to content

Commit 7f670e7

Browse files
sandy-huangrkhuangtao
authored andcommitted
video: rockchip: rk fb: add hot plug state indicate extent screen state
Change-Id: If7dea36a420ef21763c309d12d64d95574b3dcf3 Signed-off-by: Huang Jiachai <hjc@rock-chips.com>
1 parent 2c2d00a commit 7f670e7

3 files changed

Lines changed: 14 additions & 0 deletions

File tree

drivers/video/rockchip/rk_fb.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3590,6 +3590,7 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id)
35903590
enable, lcdc_id, screen->type, dev_drv->cur_screen->type);
35913591

35923592
mutex_lock(&dev_drv->switch_screen);
3593+
dev_drv->hot_plug_state = enable;
35933594
hdmi_switch_state = 0;
35943595
dev_drv->hdmi_switch = 1;
35953596
if (!dev_drv->uboot_logo) {

drivers/video/rockchip/rkfb_sysfs.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1205,6 +1205,17 @@ static ssize_t show_dsp_mode(struct device *dev,
12051205
return snprintf(buf, PAGE_SIZE, "%d\n", dev_drv->dsp_mode);
12061206
}
12071207

1208+
static ssize_t show_hot_plug_state(struct device *dev,
1209+
struct device_attribute *attr,
1210+
char *buf)
1211+
{
1212+
struct fb_info *fbi = dev_get_drvdata(dev);
1213+
struct rk_fb_par *fb_par = (struct rk_fb_par *)fbi->par;
1214+
struct rk_lcdc_driver *dev_drv = fb_par->lcdc_drv;
1215+
1216+
return snprintf(buf, PAGE_SIZE, "%d\n", dev_drv->hot_plug_state);
1217+
}
1218+
12081219
static ssize_t show_win_property(struct device *dev,
12091220
struct device_attribute *attr,
12101221
char *buf)
@@ -1262,6 +1273,7 @@ static struct device_attribute rkfb_attrs[] = {
12621273
__ATTR(win_property, S_IRUGO, show_win_property, NULL),
12631274
__ATTR(car_reverse, S_IWUSR, NULL, set_car_reverse),
12641275
__ATTR(dsp_mode, S_IRUGO, show_dsp_mode, NULL),
1276+
__ATTR(hot_plug_state, S_IRUGO, show_hot_plug_state, NULL),
12651277
};
12661278

12671279
int rkfb_create_sysfs(struct fb_info *fbi)

include/linux/rk_fb.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,6 +702,7 @@ struct rk_lcdc_driver {
702702
struct device *mmu_dev;
703703
int iommu_enabled;
704704
int dsp_mode;
705+
bool hot_plug_state;
705706

706707
struct rk_fb_reg_area_data reg_area_data;
707708
/*

0 commit comments

Comments
 (0)