update hdmi driver
authorkfx <kfx@rock-chips.com>
Fri, 24 Dec 2010 02:12:35 +0000 (10:12 +0800)
committerkfx <kfx@rock-chips.com>
Fri, 24 Dec 2010 02:12:35 +0000 (10:12 +0800)
drivers/video/hdmi/chips/anx7150.c
drivers/video/hdmi/chips/anx7150_hw.c
drivers/video/hdmi/hdmi-core.c
drivers/video/hdmi/hdmi-fb.c
include/linux/hdmi.h

index 11ccb27bdc67a41a780381ae55fbd15ef5e28e06..2c412bfbe13e62ea7f81a00fb81b3095eb9e0ea2 100755 (executable)
@@ -392,7 +392,7 @@ static int anx7150_i2c_probe(struct i2c_client *client,const struct i2c_device_i
                ANX7150_API_Initial(client);\r
                queue_delayed_work(anx->dev.workqueue, &anx->dev.delay_work, 200);\r
        }\r
-    hdmi_dbg(&client->dev, "anx7150 i2c probe ok\n");\r
+    dev_info(&client->dev, "anx7150 i2c probe ok\n");\r
     return 0;\r
        \r
 err_request_irq:\r
index 61372581ebd8b85a1815fc8a2106d5552ab15ec4..f2bafff90617c181e2c577989c5418b515faba7a 100755 (executable)
@@ -1064,6 +1064,7 @@ int ANX7150_Interrupt_Process(struct anx7150_pdata *anx, int cur_state)
                anx->dev.HPD_change_cnt = 0;\r
                anx->dev.HPD_status = hot_plug;\r
        }\r
+       return state;\r
        if(state != HDMI_INITIAL && state != WAIT_HOTPLUG){\r
                if(interrupt_staus.video_format_change){\r
                        if(state > SYSTEM_CONFIG){\r
index 047a22eb7792443f99c416399bd3db85a3b7b848..59d17e4fab89273e9f2f480313fc45245c6a9007 100755 (executable)
@@ -7,6 +7,7 @@
 \r
 struct class *hdmi_class;\r
 struct hdmi_id_ref_info {\r
+       struct hdmi *hdmi;\r
        int id;\r
        int ref;\r
 }ref_info[HDMI_MAX_ID];\r
@@ -76,6 +77,7 @@ int hdmi_register(struct device *parent, struct hdmi *hdmi)
        }\r
 \r
        dev_set_drvdata(hdmi->dev, hdmi);\r
+       ref_info[i].hdmi = hdmi;\r
 \r
        INIT_WORK(&hdmi->changed_work, hdmi_changed_work);\r
 \r
@@ -99,8 +101,15 @@ void hdmi_unregister(struct hdmi *hdmi)
        hdmi_remove_attrs(hdmi);\r
        device_unregister(hdmi->dev);\r
        ref_info[hdmi->id].ref = 0;\r
+       ref_info[hdmi->id].hdmi = NULL;\r
+}\r
+struct hdmi *get_hdmi_struct(int nr)\r
+{\r
+       if(ref_info[nr].ref == 0)\r
+               return NULL;\r
+       else\r
+               return ref_info[nr].hdmi;\r
 }\r
-\r
 static int __init hdmi_class_init(void)\r
 {\r
        int i;\r
@@ -112,6 +121,7 @@ static int __init hdmi_class_init(void)
        for(i = 0; i < HDMI_MAX_ID; i++) {\r
                ref_info[i].id = i;\r
                ref_info[i].ref = 0;\r
+               ref_info[i].hdmi = NULL;\r
        }\r
        return 0;\r
 }\r
index b0728689e507e35850e10e372f6224f86681303a..c937dc72a512d3babc64f1efe4747762574b88fe 100755 (executable)
@@ -7,9 +7,11 @@
 
 
 /* Base */
+#define LCD_ACLK               312000000
+
 #define OUT_TYPE               SCREEN_RGB
 #define OUT_FACE               OUT_P888
-#define DCLK_POL               0
+#define DCLK_POL               1
 #define SWAP_RB                        0
 
 /* 720p@60Hz Timing */
@@ -86,6 +88,7 @@ static void hdmi_set_info(struct rk29fb_screen *screen)
 
     /* Timing */
     screen->pixclock = OUT_CLK;
+       screen4->lcdc_aclk = LCD_ACLK;
        screen->left_margin = H_BP;
        screen->right_margin = H_FP;
        screen->hsync_len = H_PW;
@@ -122,6 +125,7 @@ static void hdmi_set_info(struct rk29fb_screen *screen)
 
     /* Timing */
     screen2->pixclock = OUT_CLK2;
+       screen2->lcdc_aclk = LCD_ACLK;
        screen2->left_margin = H_BP2;
        screen2->right_margin = H_FP2;
        screen2->hsync_len = H_PW2;
@@ -157,6 +161,7 @@ static void hdmi_set_info(struct rk29fb_screen *screen)
 
        /* Timing */
        screen3->pixclock = OUT_CLK3;
+       screen3->lcdc_aclk = LCD_ACLK;
        screen3->left_margin = H_BP3;
        screen3->right_margin = H_FP3;
        screen3->hsync_len = H_PW3;
@@ -191,6 +196,7 @@ static void hdmi_set_info(struct rk29fb_screen *screen)
 
        /* Timing */
        screen4->pixclock = OUT_CLK4;
+       screen4->lcdc_aclk = LCD_ACLK;
        screen4->left_margin = H_BP4;
        screen4->right_margin = H_FP4;
        screen4->hsync_len = H_PW4;
@@ -243,4 +249,21 @@ int hdmi_switch_fb(int resolution, int type)
        }
        return rc;
 }
-
+int hdmi_resolution_changed(struct hdmi *hdmi, int xres, int yres)
+{
+       if(xres > 1280 && hdmi->resolution != HDMI_1920x1080p_50Hz) {
+               hdmi->resolution = HDMI_1920x1080p_50Hz;
+               hdmi->display_on = 1;
+               hdmi->hdmi_set_param(hdmi);
+       }
+       else if(xres >1024 && hdmi->resolution != HDMI_1280x720p_50Hz){
+               hdmi->resolution = HDMI_1280x720p_50Hz;
+               hdmi->display_on = 1;
+               hdmi->hdmi_set_param(hdmi);
+       }
+       else {
+               if(hdmi->display_on == 1)
+                       hdmi->hdmi_display_off(hdmi);
+       }
+       return 0;
+}
index cf64568b42efacc0e94a985053dfd75720c86410..bf5194fb9740bb4ebe383ced1cccf54019713318 100755 (executable)
@@ -67,6 +67,8 @@ extern int hdmi_codec_set_audio_fs(unsigned char audio_fs);
 extern int hdmi_fb_set_resolution(unsigned char resolution);\r
 \r
 extern int hdmi_switch_fb(int resolution, int type);\r
+extern int hdmi_resolution_changed(struct hdmi *hdmi, int xres, int yres);\r
 \r
+extern struct hdmi *get_hdmi_struct(int nr);\r
 \r
 #endif\r