rk fb: send uevent when change video mode
authorhjc <hjc@rock-chips.com>
Mon, 13 Apr 2015 03:54:36 +0000 (11:54 +0800)
committerhjc <hjc@rock-chips.com>
Mon, 13 Apr 2015 08:01:18 +0000 (16:01 +0800)
Signed-off-by: hjc <hjc@rock-chips.com>
drivers/video/rockchip/rk_fb.c

index 1ff46f27d4ba1e3df3e424499a0b17752926d20d..610b8b21cfdd6179a05e25bc207b66c6d8d95762 100755 (executable)
@@ -3166,6 +3166,7 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id)
        struct rk_lcdc_driver *dev_drv = NULL;
        char name[6] = {0};
        int i, win_id, load_screen = 0;
+       char *envp[3];
 
        if (unlikely(!rk_fb) || unlikely(!screen))
                return -ENODEV;
@@ -3192,6 +3193,16 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id)
                return 0;
        hdmi_switch_state = 0;
        dev_drv->hdmi_switch = 1;
+#ifdef CONFIG_SWITCH
+       envp[0] = "switch screen";
+       envp[1] = kmalloc(32, GFP_KERNEL);
+       if (envp[1] == NULL)
+               return 0;
+       sprintf(envp[1], "SCREEN=%d", screen->type);
+       envp[2] = NULL;
+       kobject_uevent_env(&dev_drv->dev->kobj, KOBJ_CHANGE, envp);
+       kfree(envp[1]);
+#endif
        if ((rk_fb->disp_mode == ONE_DUAL) ||
            (rk_fb->disp_mode == NO_DUAL)) {
                if ((dev_drv->ops->backlight_close) &&