update hdmi driver: backlight control
authorkfx <kfx@rock-chips.com>
Wed, 11 May 2011 09:03:31 +0000 (17:03 +0800)
committerkfx <kfx@rock-chips.com>
Wed, 11 May 2011 09:03:31 +0000 (17:03 +0800)
drivers/video/backlight/rk29_backlight.c
drivers/video/hdmi/hdmi-new/Makefile
drivers/video/hdmi/hdmi-new/chips/anx7150.c
drivers/video/hdmi/hdmi-new/hdmi-backlight.c [new file with mode: 0755]
drivers/video/hdmi/hdmi-new/hdmi-core.c
include/linux/hdmi-new.h

index c83ecf426f8fc6cb85d95391a03f8f52e7e91cd7..f8057f0777347dd7d44b4f07e17196bc629f443d 100755 (executable)
@@ -127,6 +127,13 @@ static void rk29_bl_suspend(struct early_suspend *h)
        suspend_flag = 1;
 }
 
+void rk29_backlight_set(bool on)
+{
+       printk("%s: set %d\n", __func__, on);
+       return;
+}
+EXPORT_SYMBOL(rk29_backlight_set);
+
 static void rk29_bl_resume(struct early_suspend *h)
 {
        struct rk29_bl_info *rk29_bl_info = bl_get_data(rk29_bl);
index 350604f638943944f8410a122974c83cd3b6e14f..3178a0df5bd556ccd67d08b03fdf172b38d3f162 100644 (file)
@@ -1,2 +1,2 @@
-obj-y          += hdmi-core.o hdmi-sysfs.o hdmi-fb.o hdmi-codec.o
+obj-y          += hdmi-core.o hdmi-sysfs.o hdmi-fb.o hdmi-codec.o hdmi-backlight.o
 obj-y      += chips/
index f977d7f41974add268920dab91ee5c3b966dcc3c..a87bc0dc7560288d61bbf4d0c3b27a89520fc335 100755 (executable)
@@ -39,6 +39,7 @@ static int anx7150_param_chg(struct anx7150_pdata *anx)
        int resolution_real;\r
 \r
        hdmi_set_spk(anx->hdmi->display_on);\r
+       hdmi_set_backlight(anx->hdmi->display_on);\r
        hdmi_switch_fb(anx->hdmi, anx->hdmi->display_on);\r
        resolution_real = ANX7150_Get_Optimal_resolution(anx->hdmi->resolution);\r
        HDMI_Set_Video_Format(resolution_real);\r
@@ -86,11 +87,19 @@ static int anx7150_remove(struct hdmi *hdmi)
 \r
        anx7150_unplug(anx->client);\r
        hdmi_set_spk(HDMI_DISABLE);\r
+       hdmi_set_backlight(HDMI_DISABLE);\r
        hdmi_switch_fb(hdmi, HDMI_DISABLE);\r
 \r
        return 0;\r
 }\r
+static int anx7150_shutdown(struct hdmi *hdmi)\r
+{\r
+       struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
+       \r
+       anx7150_unplug(anx->client);\r
 \r
+       return 0;\r
+}\r
 static int anx7150_display_on(struct hdmi* hdmi)\r
 {\r
        struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
@@ -131,6 +140,7 @@ static struct hdmi_ops anx7150_ops = {
        .hdmi_precent = anx7150_hdmi_precent,\r
        .insert = anx7150_insert,\r
        .remove = anx7150_remove,\r
+       .shutdown = anx7150_shutdown,\r
 };\r
 static irqreturn_t anx7150_detect_irq(int irq, void *dev_id);\r
 static void anx7150_detect_work(struct work_struct *work)\r
diff --git a/drivers/video/hdmi/hdmi-new/hdmi-backlight.c b/drivers/video/hdmi/hdmi-new/hdmi-backlight.c
new file mode 100755 (executable)
index 0000000..8ea2873
--- /dev/null
@@ -0,0 +1,7 @@
+#include <linux/hdmi-new.h>
+
+extern void rk29_backlight_set(bool on);
+void hdmi_set_backlight(int on)
+{
+       rk29_backlight_set(on);
+}
\ No newline at end of file
index f5d64984d51988694ca59f4add12640329f2b429..b134ae422129609aa57f8023d2b8449364ce54cd 100755 (executable)
@@ -32,7 +32,7 @@ void hdmi_changed(struct hdmi *hdmi, int msec)
 int hdmi_suspend(struct hdmi *hdmi)\r
 {\r
        flush_delayed_work(&hdmi->changed_work);\r
-       return hdmi->ops->remove(hdmi);\r
+       return hdmi->ops->shutdown(hdmi);\r
 }\r
 int hdmi_resume(struct hdmi *hdmi)\r
 {\r
index 9c6a534fb90b84f635b52348aba903313388b40b..985a6ed16fa588c757d58a5e701d551a75c0221d 100755 (executable)
@@ -55,6 +55,7 @@ struct hdmi_ops{
        int (*insert)(struct hdmi *);\r
        int (*remove)(struct hdmi *);\r
        int (*power_off)(struct hdmi *);\r
+       int (*shutdown)(struct hdmi *);\r
 };\r
 struct hdmi {\r
        int id;\r
@@ -95,5 +96,6 @@ extern struct hdmi *get_hdmi_struct(int nr);
 \r
 extern int hdmi_get_default_resolution(void *screen);\r
 extern void hdmi_set_spk(int on);\r
+extern void hdmi_set_backlight(int on);\r
 \r
 #endif\r