hdmi->early_suspend.level = EARLY_SUSPEND_LEVEL_DISABLE_FB - 10;\r
register_early_suspend(&hdmi->early_suspend);\r
#endif\r
- \r
- \r
+ \r
hdmi_register_display_sysfs(hdmi, hdmi->dev);\r
- \r
+ #ifdef CONFIG_SWITCH\r
+ hdmi->switch_hdmi.name="hdmi";\r
+ switch_dev_register(&(hdmi->switch_hdmi));\r
+ #endif\r
+ \r
spin_lock_init(&hdmi->irq_lock);\r
mutex_init(&hdmi->enable_mutex);\r
\r
hdmi_dbg(hdmi->dev, "rk30 hdmi probe sucess.\n");\r
return 0;\r
err2:\r
-#ifdef CONFIG_HAS_EARLYSUSPEND\r
+ #ifdef CONFIG_SWITCH\r
+ switch_dev_unregister(&(hdmi->switch_hdmi));\r
+ #endif\r
+ #ifdef CONFIG_HAS_EARLYSUSPEND\r
unregister_early_suspend(&hdmi->early_suspend);\r
-#endif\r
+ #endif\r
iounmap((void*)hdmi->regbase);\r
err1:\r
release_mem_region(res->start,(res->end - res->start) + 1);\r
{\r
flush_scheduled_work();\r
destroy_workqueue(hdmi->workqueue);\r
+ #ifdef CONFIG_SWITCH\r
+ switch_dev_unregister(&(hdmi->switch_hdmi));\r
+ #endif\r
#ifdef CONFIG_HAS_EARLYSUSPEND\r
unregister_early_suspend(&hdmi->early_suspend);\r
#endif\r
#ifndef __RK30_HDMI_H__
#define __RK30_HDMI_H__
+#include <linux/kernel.h>
#include <linux/fb.h>
#include <linux/spinlock.h>
#include <linux/mutex.h>
#include <linux/device.h>
#include <linux/workqueue.h>
#include <linux/display-sys.h>
-
+#ifdef CONFIG_SWITCH
+#include <linux/switch.h>
+#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
#include <linux/earlysuspend.h>
#endif
-//#include "../../display/screen/screen.h"
#include<linux/rk_screen.h>
#include <linux/rk_fb.h>
#include "rk_hdmi.h"
int irq;
struct rk_lcdc_device_driver *lcdc;
+ #ifdef CONFIG_SWITCH
+ struct switch_dev switch_hdmi;
+ #endif
+
struct workqueue_struct *workqueue;
struct delayed_work delay_work;
memset(&hdmi->edid, 0, sizeof(struct hdmi_edid));
INIT_LIST_HEAD(&hdmi->edid.modelist);
hdmi->display = HDMI_DISABLE;
+ kobject_uevent_env(&hdmi->dev->kobj, KOBJ_REMOVE, envp);
+ #ifdef CONFIG_SWITCH
+ switch_set_state(&(hdmi->switch_hdmi), 0);
+ #endif
}
static void hdmi_sys_sleep(void)
complete(&hdmi->complete);
hdmi->wait = 0;
}
- kobject_uevent_env(&hdmi->dev->kobj, KOBJ_REMOVE, envp);
mutex_unlock(&work_mutex);
return;
}
{
hdmi->state = SYSTEM_CONFIG;
kobject_uevent_env(&hdmi->dev->kobj, KOBJ_ADD, envp);
+ #ifdef CONFIG_SWITCH
+ switch_set_state(&(hdmi->switch_hdmi), 1);
+ #endif
}
break;
case SYSTEM_CONFIG: