fix hdmi bug : wake up , the hdmi screen probabilistic flash of white
authoryzq <yzq@rock-chips.com>
Sat, 16 Jul 2011 15:40:20 +0000 (08:40 -0700)
committerroot <root@ubuntu.(none)>
Sun, 17 Jul 2011 07:35:56 +0000 (15:35 +0800)
18 files changed:
arch/arm/mach-rk29/board-rk29-ddr3sdk.c
drivers/hid/hid-core.c
drivers/input/touchscreen/eeti_egalax_i2c.c
drivers/video/hdmi/Kconfig
drivers/video/hdmi/hdmi-new/chips/anx7150.c
drivers/video/hdmi/hdmi-new/chips/anx7150.h
drivers/video/hdmi/hdmi-new/chips/anx7150_hw.c
drivers/video/hdmi/hdmi-new/chips/anx7150_hw.h
drivers/video/hdmi/hdmi-new/hdmi-backlight.c
drivers/video/hdmi/hdmi-new/hdmi-codec.c
drivers/video/hdmi/hdmi-new/hdmi-core.c
drivers/video/hdmi/hdmi-new/hdmi-sysfs.c
drivers/video/hdmi/hdmi-old/chips/anx7150.c
drivers/video/hdmi/hdmi-old/chips/anx7150.h
drivers/video/hdmi/hdmi-old/chips/anx7150_hw.c
drivers/video/hdmi/hdmi-old/hdmi-core.c
drivers/video/rk29_fb.c
include/linux/hdmi-new.h

index 4fb9faf0dbd3739dbc009f393a9798eb2a76ab6c..22f03a8b786f0ec36a418e282d9ae45e25a81f28 100755 (executable)
 #endif
 #define MEM_FB_SIZE         (3*SZ_2M)
 #ifdef CONFIG_FB_WORK_IPP
-#define MEM_FBIPP_SIZE      SZ_8M   //1920 x 1080 x 2 x 2  //RGB565 = x2;RGB888 = x4
+#define MEM_FBIPP_SIZE      SZ_16M   //1920 x 1080 x 2 x 2  //RGB565 = x2;RGB888 = x4
 #else
 #define MEM_FBIPP_SIZE      0
 #endif
index f3f14159a7391c9631a49fbd08f319491cb3c0ae..f86f96443df9f98fb7577d925644014a113b8e02 100644 (file)
@@ -32,7 +32,7 @@
 #include <linux/hiddev.h>
 #include <linux/hid-debug.h>
 #include <linux/hidraw.h>
-
+#include <linux/hdmi-new.h>
 #include "hid-ids.h"
 
 /*
@@ -44,6 +44,7 @@
 #define DRIVER_DESC "HID core driver"
 #define DRIVER_LICENSE "GPL"
 
+static unsigned int is_left_down = 0;
 int hid_debug = 0;
 module_param_named(debug, hid_debug, int, 0600);
 MODULE_PARM_DESC(debug, "toggle HID debugging messages");
@@ -1120,6 +1121,13 @@ int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int i
        kfree(buf);
 
 nomem:
+       if(is_left_down == 0 && data[0] == 1){
+               is_left_down = 1;
+               data[1] = 0;
+               data[2] = 0;
+       }
+       if(data[0] == 0)
+               is_left_down = 0;
        if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) {
                ret = hdrv->raw_event(hid, report, data, size);
                if (ret != 0)
@@ -1127,7 +1135,7 @@ nomem:
        }
 
        hid_report_raw_event(hid, type, data, size, interrupt);
-
+//hdmi_set_scale(HDMI_MOUSE_EVENT, data, size); //mod by kfx
        return 0;
 }
 EXPORT_SYMBOL_GPL(hid_input_report);
@@ -1287,12 +1295,6 @@ static const struct hid_device_id hid_blacklist[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ANSI) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_ISO) },
        { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_WIRELESS_2009_JIS) },
@@ -1303,7 +1305,6 @@ static const struct hid_device_id hid_blacklist[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_TACTICAL_PAD) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_1) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_2) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_BARCODE_3) },
        { HID_USB_DEVICE(USB_VENDOR_ID_CYPRESS, USB_DEVICE_ID_CYPRESS_MOUSE) },
        { HID_USB_DEVICE(USB_VENDOR_ID_DRAGONRISE, 0x0006) },
        { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) },
@@ -1711,12 +1712,6 @@ static const struct hid_device_id hid_mouse_ignore_list[] = {
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ANSI) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_ISO) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING3_JIS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_ISO) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4_JIS) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ANSI) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_ISO) },
-       { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_FOUNTAIN_TP_ONLY) },
        { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) },
        { }
index 026c18bfe5dffe8f9ebbe9b863506a4fbd19bd10..19b3b64395913295c799ede6cc7df090e6033f29 100755 (executable)
@@ -40,7 +40,7 @@
 #include <linux/irq.h>
 #include <linux/async.h>
 #include <mach/board.h>
-
+#include <linux/hdmi-new.h>
 //#define DEBUG
 #ifdef CONFIG_EETI_EGALAX_DEBUG
        #define TS_DEBUG(fmt,args...)  printk( KERN_DEBUG "[egalax_i2c]: " fmt, ## args)
@@ -338,6 +338,7 @@ static void ProcessReport(unsigned char *buf, int buflen)
 {
        int i;
        short X=0, Y=0, ContactID=0, Status=0;
+       int x, y, scale;
        if(buflen!=MAX_I2C_LEN || buf[0]!=0x04) // check buffer len & header
                return;
 
@@ -362,9 +363,20 @@ static void ProcessReport(unsigned char *buf, int buflen)
                                input_report_abs(input_dev, ABS_MT_TRACKING_ID, i);                     
                                input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, PointBuf[i].Status);
                                input_report_abs(input_dev, ABS_MT_WIDTH_MAJOR, 0);
+#if 1 //mod by kfx
+                               scale = hdmi_get_scale();
+                               x = PointBuf[i].X * 100 / scale;
+                               x -= CONFIG_EETI_EGALAX_MAX_X * (100-scale)/200;
+                               x = (x<0)?0:x;
+                               y = PointBuf[i].Y * 100 / scale;
+                               y -= CONFIG_EETI_EGALAX_MAX_Y * (100-scale)/200;
+                               y = (y<0)?0:y;
+                               input_report_abs(input_dev, ABS_MT_POSITION_X, x);
+                               input_report_abs(input_dev, ABS_MT_POSITION_Y, y);
+#else
                                input_report_abs(input_dev, ABS_MT_POSITION_X, PointBuf[i].X);
                                input_report_abs(input_dev, ABS_MT_POSITION_Y, PointBuf[i].Y);
-
+#endif
                                input_mt_sync(input_dev);
 
                                if(PointBuf[i].Status == 0)
index b62e7dacf3c09c0019860118415c16ecb8474bc1..f26959e52318bed892a5625975718778dbb21397 100644 (file)
@@ -8,14 +8,14 @@ config HDMI
     
 if HDMI
 
-config HDMI_OLD
-       default y
-       bool "old hdmi support"
-       help
-               nothing
-if HDMI_OLD
-source "drivers/video/hdmi/hdmi-old/Kconfig"
-endif
+#config HDMI_OLD
+#      default y
+#      bool "old hdmi support"
+#      help
+#              nothing
+#if HDMI_OLD
+#source "drivers/video/hdmi/hdmi-old/Kconfig"
+#endif
 
 config HDMI_NEW
        bool "new hdmi support"
@@ -24,7 +24,10 @@ config HDMI_NEW
 if HDMI_NEW
 source "drivers/video/hdmi/hdmi-new/Kconfig"
 endif
-
+config HDMI_DUAL_DISP
+       bool "hdmi support dual display"
+       help
+       nothing
 config HDMI_DEBUG
        bool "hdmi debug"
 
index 779cef9f54794bf87285858ce44abdb1a2ed35e4..f970b1262f6880b78419279187f1a52f2b11d1e8 100755 (executable)
@@ -12,7 +12,6 @@
 \r
 #include "anx7150.h"\r
 #include "anx7150_hw.h"\r
-\r
 int anx7150_i2c_read_p0_reg(struct i2c_client *client, char reg, char *val)\r
 {\r
        client->addr = ANX7150_I2C_ADDR0;\r
@@ -34,13 +33,22 @@ int anx7150_i2c_write_p1_reg(struct i2c_client *client, char reg, char *val)
        return i2c_master_reg8_send(client, reg, val, 1, ANX7150_SCL_RATE) > 0? 0: -EINVAL;\r
 }\r
 \r
-static int anx7150_param_chg(struct anx7150_pdata *anx)\r
+static int anx7150_hdmi_precent(struct hdmi *hdmi)\r
 {\r
-       int resolution_real;\r
+       struct anx7150_pdata *anx = hdmi_priv(hdmi);\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
+       return gpio_get_value(anx->client->irq)?0:1;\r
+}\r
+static int anx7150_param_chg(struct anx7150_pdata *anx)\r
+{\r
+       int resolution_real, enable;\r
+       \r
+       if(anx->hdmi->mode == DISP_ON_LCD)\r
+               anx->hdmi->scale = 100;\r
+       enable = ((anx->hdmi->mode!= DISP_ON_LCD) && anx->hdmi->display_on && anx7150_hdmi_precent(anx->hdmi))?1:0;\r
+       hdmi_set_spk(!enable);  //if(hdmi mode) turn off spk\r
+       hdmi_set_backlight(!enable); //if(hdmi mode) trun off backlight\r
+       hdmi_switch_fb(anx->hdmi, enable);\r
        resolution_real = ANX7150_Get_Optimal_resolution(anx->hdmi->resolution);\r
        HDMI_Set_Video_Format(resolution_real);\r
        HDMI_Set_Audio_Fs(anx->hdmi->audio_fs);\r
@@ -61,23 +69,24 @@ static int anx7150_insert(struct hdmi *hdmi)
        int tmo = 10;\r
        struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
 \r
-       anx7150_plug(anx->client);\r
-       if(ANX7150_Parse_EDID(anx->client,&anx->dev) < 0)\r
-       {\r
-               dev_info(&anx->client->dev, "parse EDID error\n");\r
-               anx7150_unplug(anx->client);\r
-               return -1;\r
-       }\r
+       if(anx->edid_read_ok == 0) {\r
+               anx7150_plug(anx->client);\r
+               if(ANX7150_Parse_EDID(anx->client,&anx->dev) < 0)\r
+               {\r
+                       dev_info(&anx->client->dev, "parse EDID error\n");\r
+                       anx7150_unplug(anx->client);\r
+                       return -1;\r
+               }\r
                \r
-       while(--tmo && ANX7150_GET_SENSE_STATE(anx->client) != 1)\r
-               mdelay(10);\r
-       if(tmo <= 0)\r
-       {\r
-               anx7150_unplug(anx->client);\r
-               return -1;\r
+               while(--tmo && ANX7150_GET_SENSE_STATE(anx->client) != 1)\r
+                       mdelay(10);\r
+               if(tmo <= 0)\r
+               {\r
+                       anx7150_unplug(anx->client);\r
+                       return -1;\r
+               }\r
+               anx->edid_read_ok = 1;\r
        }\r
-       if(!hdmi->display_on)\r
-               return 0;\r
        anx7150_param_chg(anx);\r
        return 0;\r
 }\r
@@ -86,9 +95,11 @@ static int anx7150_remove(struct hdmi *hdmi)
        struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
 \r
        anx7150_unplug(anx->client);\r
-       hdmi_set_spk(HDMI_DISABLE);\r
-       hdmi_set_backlight(HDMI_ENABLE);\r
+       anx->edid_read_ok = 0;\r
+       hdmi->scale = 100;\r
+       hdmi_set_spk(HDMI_ENABLE);\r
        hdmi_switch_fb(hdmi, HDMI_DISABLE);\r
+       hdmi_set_backlight(HDMI_ENABLE);\r
 \r
        return 0;\r
 }\r
@@ -97,26 +108,23 @@ static int anx7150_shutdown(struct hdmi *hdmi)
        struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
        \r
        anx7150_unplug(anx->client);\r
+       anx->edid_read_ok = 0;\r
+       hdmi->scale = 100;\r
 \r
        return 0;\r
 }\r
 static int anx7150_display_on(struct hdmi* hdmi)\r
 {\r
-       struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
        hdmi->display_on = HDMI_ENABLE;\r
        hdmi_dbg(hdmi->dev, "hdmi display on\n");\r
-       anx7150_param_chg(anx);\r
+       anx7150_insert(hdmi);\r
        return 0;\r
 }\r
 static int anx7150_display_off(struct hdmi* hdmi)\r
 {\r
-       struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
        hdmi->display_on = HDMI_DISABLE;\r
-       anx->dev.hdmi_enable = HDMI_DISABLE;\r
        hdmi_dbg(hdmi->dev, "hdmi display off\n");\r
-       anx7150_param_chg(anx);\r
+       anx7150_remove(hdmi);\r
        return 0;\r
 }\r
 static int anx7150_set_param(struct hdmi *hdmi)\r
@@ -127,12 +135,6 @@ static int anx7150_set_param(struct hdmi *hdmi)
        return 0;\r
 }\r
 \r
-static int anx7150_hdmi_precent(struct hdmi *hdmi)\r
-{\r
-       struct anx7150_pdata *anx = hdmi_priv(hdmi);\r
-\r
-       return gpio_get_value(anx->client->irq)?0:1;\r
-}\r
 static struct hdmi_ops anx7150_ops = {\r
        .display_on = anx7150_display_on,\r
        .display_off = anx7150_display_off,\r
@@ -151,10 +153,12 @@ static void anx7150_detect_work(struct work_struct *work)
        free_irq(anx->irq, anx);\r
        ret = request_irq(anx->irq, anx7150_detect_irq,\r
                anx7150_hdmi_precent(anx->hdmi)? IRQF_TRIGGER_RISING : IRQF_TRIGGER_FALLING,NULL,anx);\r
-       dev_info(&anx->client->dev, "det = %d,hpd_status = %d\n", \r
+       dev_dbg(&anx->client->dev, "det = %d,hpd_status = %d\n", \r
                gpio_get_value(anx->client->irq), anx7150_get_hpd(anx->client));\r
+       if(gpio_get_value(anx->client->irq) == anx7150_get_hpd(anx->client))\r
+               return;\r
        anx->is_changed = 1;\r
-       if(!anx->is_early_suspend)\r
+       if(!anx->is_early_suspend && anx->hdmi->display_on == HDMI_ENABLE)\r
                hdmi_changed(anx->hdmi, 0);\r
 }\r
 \r
@@ -216,8 +220,11 @@ static int anx7150_i2c_probe(struct i2c_client *client,const struct i2c_device_i
        hdmi->hdcp_on = HDMI_DISABLE;\r
        hdmi->audio_fs = HDMI_I2S_DEFAULT_Fs;\r
        hdmi->resolution = HDMI_DEFAULT_RESOLUTION;\r
+       hdmi->dual_disp = DUAL_DISP_CAP;\r
+       hdmi->mode = HDMI_DEFAULT_MODE;\r
        \r
        anx = hdmi_priv(hdmi);\r
+       anx->edid_read_ok = 0;\r
        anx->hdmi = hdmi;\r
        i2c_set_clientdata(client, anx);\r
        anx->client = client;\r
@@ -253,8 +260,9 @@ static int anx7150_i2c_probe(struct i2c_client *client,const struct i2c_device_i
 #endif\r
        anx->is_early_suspend = 0;\r
        anx->is_changed = 1;\r
+       anx7150_initial(anx->client);\r
 \r
-       hdmi_changed(hdmi, 200);\r
+       //hdmi_changed(hdmi, 200);\r
     dev_info(&client->dev, "anx7150 i2c probe ok\n");\r
     return 0;\r
 err_free_irq:\r
index 77b07d90f779216537ce1baa04c2db84630553db..dc33433969293f5987c2a4bd43e872a0a6b4fa25 100755 (executable)
@@ -81,6 +81,7 @@ struct anx7150_pdata {
        int init;\r
        int is_early_suspend;\r
        int is_changed;\r
+       int edid_read_ok;
        struct delayed_work             work;\r
        struct hdmi *hdmi;\r
        struct i2c_client *client;\r
index 537be6412a465d6e8a06614674b3fa35b673d4f7..ece170dc8e49d383d3ed0ca164e49d4e355e2f4e 100755 (executable)
@@ -494,6 +494,14 @@ int anx7150_rst_ddcchannel(struct i2c_client *client)
        return rc;\r
 }\r
 \r
+int anx7150_initial(struct i2c_client *client)
+{
+    ANX7150_Variable_Initial();   //simon\r
+    ANX7150_HW_Interface_Variable_Initial();  //simon\r
+    \r
+    anx7150_hardware_initial(client);   //simon\r
+       return 0;
+}
 int anx7150_unplug(struct i2c_client *client)\r
 {\r
        int rc = 0;\r
@@ -1298,7 +1306,7 @@ static int ANX7150_Read_EDID(struct i2c_client *client)
     u8 edid_segment,segmentpointer,k;\r
 \r
     rc = anx7150_rst_ddcchannel(client);\r
-       mdelay(1);\r
+       mdelay(5);\r
 \r
     edid_segment = ANX7150_edid_length / 256;\r
     if (edid_segment==0)                                                                                                                                                       //update\r
@@ -1310,11 +1318,11 @@ static int ANX7150_Read_EDID(struct i2c_client *client)
     for (k = 0; k <= segmentpointer; k ++)\r
     {\r
         rc =anx7150_initddc_read(client, 0xa0, k, 0x00, 0x80, 0x00);\r
-               mdelay(1);\r
+               mdelay(10);\r
         rc = ANX7150_DDC_Mass_Read(client, 128, k);\r
                //mdelay(10);\r
         rc = anx7150_initddc_read(client, 0xa0, k, 0x80, 0x80, 0x00);\r
-               mdelay(1);\r
+               mdelay(10);\r
         rc = ANX7150_DDC_Mass_Read(client, 128, k + 1);\r
                //mdelay(10);\r
     }\r
index baf289e389f3282fd288d82cf3e94e9f26a992c4..4c2b97e6cd1fa2029bae7c923b92cae51624af55 100755 (executable)
@@ -1263,6 +1263,6 @@ void  HDMI_Set_Audio_Fs( u8 audio_fs);
 int ANX7150_PLAYBACK_Process(void);\r
 int ANX7150_Blue_Screen(struct anx7150_pdata *anx);\r
 int anx7150_set_avmute(struct i2c_client *client);\r
-\r
+int anx7150_initial(struct i2c_client *client);\r
 \r
 #endif\r
index 8ea28730055b864a23a2c7084d9e3a02734559d7..f308f414bbf2a1a9cd2d7d73f7fd500943d78155 100755 (executable)
@@ -4,4 +4,4 @@ extern void rk29_backlight_set(bool on);
 void hdmi_set_backlight(int on)
 {
        rk29_backlight_set(on);
-}
\ No newline at end of file
+}
index c516890c1e2b917e54571e1448fff47fc9587a7a..c6c1c783c04a475096a8fa1a06364895a6cec53c 100755 (executable)
@@ -1,11 +1,7 @@
 #include <linux/hdmi-new.h>
 extern void codec_set_spk(bool on);
 
-int hdmi_codec_set_audio_fs(unsigned char audio_fs)
-{
-       return 0;
-}
 void hdmi_set_spk(int on)
 {
-       codec_set_spk(!on);
+       codec_set_spk(on);
 }
index 992d42b2ba25239e63d4fab47c06459df61a88dc..c4e978e84891407fa5e4b5247a36d14b338738b9 100755 (executable)
@@ -4,6 +4,8 @@
 #include <linux/err.h>\r
 \r
 #include <linux/hdmi-new.h>\r
+#include <linux/input.h>\r
+\r
 \r
 struct class *hdmi_class;\r
 struct hdmi_id_ref_info {\r
@@ -24,7 +26,7 @@ static inline void hdmi_remove_attrs(struct hdmi *hdmi) {}
 \r
 #endif /* CONFIG_SYSFS */\r
 \r
-\r
+extern struct input_dev *gsensor_input_dev;\r
 void hdmi_changed(struct hdmi *hdmi, int msec)\r
 {\r
        schedule_delayed_work(&hdmi->changed_work, msecs_to_jiffies(msec));\r
@@ -55,7 +57,7 @@ static void hdmi_changed_work(struct work_struct *work)
        else\r
                ret = hdmi->ops->remove(hdmi);\r
        if(ret < 0)\r
-               dev_dbg(hdmi->dev, "hdmi changed error\n");\r
+               dev_warn(hdmi->dev, "hdmi changed error\n");\r
        kobject_uevent(&hdmi->dev->kobj, KOBJ_CHANGE);\r
 }\r
 \r
@@ -113,6 +115,7 @@ dev_create_failed:
        kfree(hdmi);\r
        return NULL;\r
 success:\r
+       hdmi->scale = 100;\r
        return hdmi;\r
 }\r
 void hdmi_unregister(struct hdmi *hdmi)\r
@@ -147,6 +150,40 @@ int hdmi_is_insert(void)
        else\r
                return 0;\r
 }\r
+int hdmi_get_scale(void)\r
+{\r
+       struct hdmi* hdmi = get_hdmi_struct(0);\r
+       if(!hdmi)\r
+               return 100;\r
+       else if(!hdmi->display_on || !hdmi->ops->hdmi_precent(hdmi))\r
+               return 100;\r
+       else\r
+               return hdmi->scale;\r
+}\r
+\r
+int hdmi_set_scale(int event, char *data, int len)\r
+{\r
+       int result;\r
+       struct hdmi* hdmi = get_hdmi_struct(0);\r
+\r
+       if(!hdmi)\r
+               return -1;\r
+       if(len != 4)\r
+               return -1;\r
+       if(fb_get_video_mode() || !hdmi->display_on || !hdmi->ops->hdmi_precent(hdmi))\r
+               return -1;\r
+\r
+       result = data[0] | data[1]<<1 | data[2]<<2;\r
+       if(event != MOUSE_NONE && (result & event) != event)\r
+               return -1;\r
+\r
+       hdmi->scale += data[3];\r
+       \r
+       hdmi->scale = (hdmi->scale>100)?100:hdmi->scale;\r
+       hdmi->scale = (hdmi->scale<MIN_SCALE)?MIN_SCALE:hdmi->scale;\r
+       return 0;       \r
+}\r
+\r
 static int __init hdmi_class_init(void)\r
 {\r
        int i;\r
index dc86fe0e41fb61d2f20dc1e7abc880c66d24ff7f..2597ff3e87085d355f9c75ccb72fb0bd6b5b9526 100755 (executable)
@@ -12,23 +12,29 @@ static ssize_t hdmi_show_state_attrs(struct device *dev,
        return sprintf(buf, "display_on=%d\n"\r
                                                "plug=%d\n"\r
                                                "auto_switch=%d\n"\r
+                                               "dual_disp=%d\n"\r
+                                               "mode=%d\n"\r
                                                "hdcp_on=%d\n"\r
                                                "audio_fs=%d\n"\r
+                                               "scale=%d\n"\r
                                                "resolution=%d\n"\r
                                                "--------------------------\n"\r
                                                "resolution support:\n"\r
-                                               "HDMI_1280x720p_50Hz        0\n"\r
-                                               "HDMI_1280x720p_60Hz        1\n"\r
-                                               "HDMI_720x576p_50Hz_4x3     2\n"\r
-                                               "HDMI_720x576p_50Hz_16x9    3\n"\r
-                                               "HDMI_720x480p_60Hz_4x3     4\n"\r
-                                               "HDMI_720x480p_60Hz_16x9    5\n"\r
-                                               "HDMI_1920x1080p_50Hz       6\n"\r
-                                               "HDMI_1920x1080p_60Hz       7\n"\r
+                                               "HDMI_1920x1080p_50Hz       0\n"\r
+                                               "HDMI_1920x1080p_60Hz       1\n"\r
+                                               "HDMI_1280x720p_50Hz        2\n"\r
+                                               "HDMI_1280x720p_60Hz        3\n"\r
+                                               "HDMI_720x576p_50Hz_4x3     4\n"\r
+                                               "HDMI_720x576p_50Hz_16x9    5\n"\r
+                                               "HDMI_720x480p_60Hz_4x3     6\n"\r
+                                               "HDMI_720x480p_60Hz_16x9    7\n"\r
                                                "--------------------------\n", \r
                                                hdmi->display_on,hdmi->ops->hdmi_precent(hdmi),\r
-                                               hdmi->auto_switch, hdmi->hdcp_on,\r
-                                               hdmi->audio_fs, hdmi->resolution);\r
+                                               hdmi->auto_switch,hdmi->dual_disp,\r
+                                           hdmi->mode, \r
+                                               hdmi->hdcp_on,\r
+                                               hdmi->audio_fs, (hdmi->ops->hdmi_precent(hdmi) && hdmi->display_on)?hdmi->scale:100, \r
+                                               hdmi->resolution);\r
 }\r
 static ssize_t hdmi_restore_state_attrs(struct device *dev, \r
                                                struct device_attribute *attr,\r
@@ -38,17 +44,32 @@ static ssize_t hdmi_restore_state_attrs(struct device *dev,
        struct hdmi *hdmi = dev_get_drvdata(dev);\r
        char *p;\r
        const char *q;\r
-       int auto_switch = -1, hdcp_on = -1, audio_fs = -1, resolution = -1;\r
+       int set_param = 0, tmp = 0;\r
+\r
+       hdmi_dbg(hdmi->dev, "func:%s-->buf = \n%s\n", __func__, buf);   \r
        \r
+       if(hdmi->display_on == HDMI_DISABLE)\r
+       {\r
+               dev_err(dev, "hdmi is off\n");\r
+               ret = -EINVAL;\r
+               goto exit;\r
+       }\r
+\r
        q = buf;\r
        do\r
        {\r
-               if((p = strstr(q, "auto_switch=")) != NULL)\r
+               if((p = strstr(q, "mode=")) != NULL)\r
                {\r
-                       q = p + 12;\r
-                       if((sscanf(q, "%d", &auto_switch) == 1) &&\r
-                          (auto_switch == 0 || auto_switch == 1))\r
-                               hdmi->auto_switch = auto_switch;\r
+                       q = p + 5;\r
+\r
+                       if((sscanf(q, "%d", &tmp) == 1) && (tmp >= 0 && tmp <= 3))\r
+                       {\r
+                               if(tmp != hdmi->mode)\r
+                               {\r
+                                       set_param |= 1;\r
+                                       hdmi->mode = tmp;\r
+                               }\r
+                       }\r
                        else\r
                        {\r
                                dev_err(dev, "failed to set hdmi configuration\n");\r
@@ -56,38 +77,57 @@ static ssize_t hdmi_restore_state_attrs(struct device *dev,
                                goto exit;\r
                        }\r
                }\r
+\r
                else if((p = strstr(q, "hdcp_on=")) != NULL)\r
                {\r
                        q = p + 8;\r
-                       if((sscanf(q, "%d", &hdcp_on) == 1) &&\r
-                          (hdcp_on == 0 || hdcp_on == 1))\r
-                               hdmi->hdcp_on = hdcp_on;\r
+#if 0\r
+                       if((sscanf(q, "%d", &tmp) == 1) && (tmp == 0 || tmp ==1))\r
+                       {\r
+                               if(tmp != hdmi->hdcp_on)\r
+                               {\r
+                                       set_param |= 1;\r
+                                       hdmi->hdcp_on = tmp;\r
+                               }\r
+                       }\r
                        else\r
                        {\r
                                dev_err(dev, "failed to set hdmi configuration\n");\r
                                ret = -EINVAL;\r
                                goto exit;\r
                        }\r
+#endif\r
                }\r
-               else if((p = strstr(q, "audio_fs=")) != NULL)\r
+\r
+\r
+               else if((p = strstr(q, "scale=")) != NULL)\r
                {\r
-                       q = p + 9;\r
-                       if((sscanf(q, "%d", &audio_fs) == 1) &&\r
-                          (audio_fs >= 0))\r
-                               hdmi->audio_fs = audio_fs;\r
+                       q = p + 6;\r
+#if 1\r
+                       if((sscanf(q, "%d", &tmp) == 1) && (tmp >=MIN_SCALE && tmp <= 100))\r
+                       {\r
+                               hdmi->scale = tmp;\r
+                               hdmi->scale = (hdmi->ops->hdmi_precent(hdmi) && hdmi->display_on)?hdmi->scale:100;\r
+                       }\r
                        else\r
                        {\r
                                dev_err(dev, "failed to set hdmi configuration\n");\r
                                ret = -EINVAL;\r
                                goto exit;\r
                        }\r
+#endif\r
                }\r
                else if((p = strstr(q, "resolution=")) != NULL)\r
                {\r
                        q = p + 11;\r
-                       if((sscanf(q, "%d", &resolution) == 1) &&\r
-                          (resolution >= 0))\r
-                               hdmi->resolution = resolution;\r
+                       if((sscanf(q, "%d", &tmp) == 1) && (tmp >= 0))\r
+                       {\r
+                               if(hdmi->resolution != tmp)\r
+                               {\r
+                                       set_param |= 1;\r
+                                       hdmi->resolution = tmp;\r
+                               }\r
+                       }\r
                        else\r
                        {\r
                                dev_err(dev, "failed to set hdmi configuration\n");\r
@@ -99,22 +139,8 @@ static ssize_t hdmi_restore_state_attrs(struct device *dev,
                        break;\r
                \r
        }while(*q != 0);\r
-       if(auto_switch == -1 &&\r
-          hdcp_on == -1 &&\r
-          audio_fs == -1 &&\r
-          resolution == -1)\r
-       {\r
-               dev_err(dev, "failed to set hdmi configuration\n");\r
-               ret = -EINVAL;\r
-               goto exit;\r
-       }\r
-       if(hdmi->ops->set_param)\r
+       if(hdmi->ops->set_param && set_param != 0)\r
                ret = hdmi->ops->set_param(hdmi);\r
-       else\r
-       {\r
-               dev_err(dev, "hdmi device is not exist\n");\r
-               return ret = 0;\r
-       }\r
 exit:\r
        if(ret < 0)\r
                dev_err(dev, "hdmi_restore_state_attrs err\n");\r
index 4e8212e00329030e45864ce7c9fb55ab1053d2bb..9ef5a8f9a7ed27f3ce2dda3368f7b8358f6424ef 100755 (executable)
@@ -8,7 +8,7 @@
 #include <mach/gpio.h>\r
 #include <mach/iomux.h>\r
 \r
-#include "anx7150.h"\r
+#include "linux/anx7150.h"\r
 #include "anx7150_hw.h"\r
 \r
 int anx7150_i2c_read_p0_reg(struct i2c_client *client, char reg, char *val)\r
@@ -99,7 +99,13 @@ static irqreturn_t anx7150_detect_irq(int irq, void *dev_id)
 \r
     return IRQ_HANDLED;\r
 }\r
-\r
+#if 1//eboda zlj add for test 110518\r
+struct anx7150_dev_s *anx7150_dev;\r
+int anx7150_get_output_status(void)\r
+{\r
+    return anx7150_dev->rk29_output_status;\r
+}\r
+#endif\r
 void anx7150_task(struct anx7150_pdata *anx)\r
 {\r
        int state;\r
index 1122861d799e0ab09b14abfd2d51ce21aed63d01..38fe18940f8dcd085dc1ec853d78c7d77c3129b7 100755 (executable)
@@ -90,4 +90,5 @@ int anx7150_i2c_write_p0_reg(struct i2c_client *client, char reg, char *val);
 int anx7150_i2c_read_p1_reg(struct i2c_client *client, char reg, char *val);\r
 int anx7150_i2c_write_p1_reg(struct i2c_client *client, char reg, char *val);\r
 \r
+int anx7150_get_output_status(void);//eboda zlj add for test 110518\r
 #endif\r
index a40bd02d9090a9e19024639d2606c16a584673ae..0ff799a04e0dc94a6ef6258623052856f61a87ea 100755 (executable)
@@ -1,9 +1,11 @@
 #include <linux/delay.h>\r
 #include <linux/i2c.h>\r
 #include <linux/hdmi.h>\r
-\r
-\r
-#include "anx7150.h"\r
+#if 1 // eboda twp\r
+#include <mach/gpio.h>\r
+#include <mach/iomux.h>\r
+#endif\r
+#include "linux/anx7150.h"\r
 #include "anx7150_hw.h"\r
 //#ifdef ITU656\r
 struct ANX7150_video_timingtype ANX7150_video_timingtype_table =\r
@@ -292,7 +294,7 @@ static void ANX7150_Variable_Initial(void)
     //********************end of video config*********\r
 \r
     //********************for edid parse***********\r
-    ANX7150_edid_result.is_HDMI = 0;\r
+    ANX7150_edid_result.is_HDMI = 1;//  0->1,eboda zlj add for test 110413\r
     ANX7150_edid_result.ycbcr422_supported = 0;\r
     ANX7150_edid_result.ycbcr444_supported = 0;\r
     ANX7150_edid_result.supported_720p_60Hz = 0;\r
@@ -520,7 +522,12 @@ int anx7150_unplug(struct i2c_client *client)
     ANX7150_parse_edid_done = 0;\r
 //    ANX7150_system_config_done = 0;\r
     ANX7150_srm_checked = 0;\r
-\r
+       #if 1 //eboda twp \r
+               // gpio_direction_output(RK29_PIN6_PD1, 0);\r
+               //gpio_set_value(RK29_PIN6_PD1, 1);\r
+                rk29_mux_api_set(GPIO1B5_PWM0_NAME, GPIO1L_PWM0);\r
+               //printk("turn on LCD\n");\r
+       #endif  \r
        return rc;\r
 }\r
 int anx7150_plug(struct i2c_client *client)\r
@@ -1678,7 +1685,7 @@ static void ANX7150_Parse_VendorSTD(void)
     }\r
     else\r
     {\r
-        ANX7150_edid_result.is_HDMI = 0;\r
+        ANX7150_edid_result.is_HDMI = 1;// 0->1,eboda zlj add for test 110413\r
         //ANX7150_i2c_read_p0_reg(ANX7150_SYS_CTRL1_REG, &c);\r
         //ANX7150_i2c_write_p0_reg(ANX7150_SYS_CTRL1_REG, c & (~ANX7150_SYS_CTRL1_HDMI));\r
     }\r
@@ -2818,6 +2825,16 @@ int ANX7150_Config_Video(struct i2c_client *client)
                c |= (0x02);\r
                rc = anx7150_i2c_write_p0_reg(client, ANX7150_SYS_CTRL1_REG, &c);\r
         hdmi_dbg(&client->dev,"ANX7150 is set to HDMI mode\n");\r
+       #if 1 //eboda twp \r
+               //gpio_direction_output(RK29_PIN6_PD1, GPIO1L_GPIO1B5);\r
+               //gpio_set_value(RK29_PIN6_PD1, 0);\r
+       rk29_mux_api_set(GPIO1B5_PWM0_NAME, 0);\r
+       if (gpio_request(RK29_PIN1_PB5, NULL)) {\r
+               printk("func %s, line %d: request gpio fail\n", __FUNCTION__, __LINE__);\r
+       }\r
+       gpio_direction_output(RK29_PIN1_PB5, 0);\r
+               //printk("turn off LCD\n");\r
+       #endif  \r
     }\r
        rc = anx7150_i2c_read_p0_reg(client, ANX7150_SYS_CTRL1_REG, &c);\r
     TX_is_HDMI = c & 0x02;\r
index 6b03ab29562e413e46677d58ce8104aba7c5c35d..cca51dd318349f93afa9dc5dd7956bd4de2c5e5c 100755 (executable)
@@ -115,6 +115,10 @@ struct hdmi *get_hdmi_struct(int nr)
        else\r
                return ref_info[nr].hdmi;\r
 }\r
+int hdmi_get_scale(void)\r
+{\r
+       return 100;\r
+}\r
 static int __init hdmi_class_init(void)\r
 {\r
        int i;\r
index 7ea52aab56c9429768b52cf2457faa53022986e6..26ad7b93ccf87da53d3a4af8317e4c039709a6fe 100755 (executable)
@@ -48,7 +48,7 @@
 #ifdef CONFIG_HDMI
 #include <linux/completion.h>
 
-#include <linux/hdmi.h>
+#include <linux/hdmi-new.h>
 #endif
 
 #include <mach/iomux.h>
@@ -937,6 +937,21 @@ int rk29_set_cursor(struct fb_info *info, struct fb_cursor *cursor)
 }
 #endif
 
+static void hdmi_set_fbscale(struct fb_info *info)
+{
+    struct rk29fb_inf *inf = dev_get_drvdata(info->device);
+    struct rk29fb_screen *screen = inf->cur_screen;
+    struct win0_par *par = info->par;
+       int scale;
+       
+       scale = hdmi_get_scale();
+       if(scale == 100)
+               return;
+       par->xpos += screen->x_res * (100-scale) / 200;
+       par->ypos += screen->y_res * (100-scale) / 200;
+       par->xsize = par->xsize *scale /100;
+       par->ysize = par->ysize *scale /100;
+}
 static int win0_blank(int blank_mode, struct fb_info *info)
 {
     struct rk29fb_inf *inf = dev_get_drvdata(info->device);
@@ -967,21 +982,24 @@ static int win0_set_par(struct fb_info *info)
     struct fb_var_screeninfo *var = &info->var;
     struct fb_fix_screeninfo *fix = &info->fix;
     struct win0_par *par = info->par;
-
-       u32 xact = var->xres;                       /* visible resolution               */
-       u32 yact = var->yres;
-       u32 xvir = var->xres_virtual;           /* virtual resolution           */
-       u32 yvir = var->yres_virtual;
+       u32 xact, yact, xvir, yvir, xpos, ypos, ScaleYrgbX,ScaleYrgbY, ScaleCbrX, ScaleCbrY, y_addr,uv_addr;
+       hdmi_set_fbscale(info);
+       xact = var->xres;                           /* visible resolution               */
+       yact = var->yres;
+       xvir = var->xres_virtual;               /* virtual resolution           */
+       yvir = var->yres_virtual;
        //u32 xact_st = var->xoffset;         /* offset from virtual to visible */
        //u32 yact_st = var->yoffset;         /* resolution                     */
-    u32 xpos = par->xpos;
-    u32 ypos = par->ypos;
+    xpos = par->xpos;
+    ypos = par->ypos;
 
-    u32 ScaleYrgbX=0x1000,ScaleYrgbY=0x1000;
-    u32 ScaleCbrX=0x1000, ScaleCbrY=0x1000;
+    ScaleYrgbX=0x1000;
+       ScaleYrgbY=0x1000;
+    ScaleCbrX=0x1000;
+       ScaleCbrY=0x1000;
 
-    u32 y_addr = 0;       //user alloc buf addr y
-    u32 uv_addr = 0;
+    y_addr = 0;       //user alloc buf addr y
+    uv_addr = 0;
 
     fbprintk(">>>>>> %s : %s\n", __FILE__, __FUNCTION__);
 
@@ -1132,28 +1150,31 @@ static int win1_set_par(struct fb_info *info)
     struct rk29fb_screen *screen = inf->cur_screen;
     struct win0_par *par = info->par;
     struct fb_var_screeninfo *var = &info->var;
-
+       u32 addr;
+       u16 xres_virtual,xpos,ypos;
+       u8 trspval,trspmode;
+       hdmi_set_fbscale(info);
     //u32 offset=0, addr=0, map_size=0, smem_len=0;
-    u32 addr=0;
-    u16 xres_virtual = 0;      //virtual screen size
+    addr=0;
+    xres_virtual = 0;      //virtual screen size
 
     //u16 xpos_virtual = var->xoffset;           //visiable offset in virtual screen
     //u16 ypos_virtual = var->yoffset;
 
-    u16 xpos = par->xpos;                 //visiable offset in panel
-    u16 ypos = par->ypos;
+    xpos = par->xpos;                 //visiable offset in panel
+    ypos = par->ypos;
 
-    u8 trspmode = TRSP_CLOSE;
-    u8 trspval = 0;
+    trspmode = TRSP_CLOSE;
+    trspval = 0;
 
     //fbprintk(">>>>>> %s : %s\n", __FILE__, __FUNCTION__);
 
    #ifdef CONFIG_FB_SCALING_OSD
     if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
-        && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+        && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
     {
-        addr = fix->mmio_start + par->y_offset;
-        xres_virtual = screen->x_res;      //virtual screen size
+        addr = fix->mmio_start + par->y_offset* hdmi_get_scale()/100;
+        xres_virtual = screen->x_res* hdmi_get_scale()/100;      //virtual screen size
     }
     else
    #endif
@@ -1208,9 +1229,9 @@ static int win1_pan( struct fb_info *info )
     struct rk29fb_screen *screen = inf->cur_screen;
     struct fb_var_screeninfo *var = &info->var;
     if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
-        && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+        && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
     {
-        addr = fix1->mmio_start + par->y_offset;
+        addr = fix1->mmio_start + par->y_offset* hdmi_get_scale()/100;
     }
     else
     #endif
@@ -1372,7 +1393,7 @@ static int fb0_set_par(struct fb_info *info)
     {
         #ifdef CONFIG_FB_SCALING_OSD
         if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
-        && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+        && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
         {
             par->xpos = 0;
             par->ypos = 0;
@@ -1384,9 +1405,9 @@ static int fb0_set_par(struct fb_info *info)
             ipp_req.src0.w = var->xres;
             ipp_req.src0.h = var->yres;
 
-            ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset;
-            ipp_req.dst0.w = screen->x_res;
-            ipp_req.dst0.h = screen->y_res;
+            ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset* hdmi_get_scale()/100;
+            ipp_req.dst0.w = screen->x_res* hdmi_get_scale()/100;
+            ipp_req.dst0.h = screen->y_res* hdmi_get_scale()/100;
 
             ipp_req.src_vir_w = ipp_req.src0.w;
             ipp_req.dst_vir_w = ipp_req.dst0.w;
@@ -1432,7 +1453,7 @@ static int fb0_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
    #ifdef CONFIG_FB_SCALING_OSD
     struct fb_fix_screeninfo *fix = &info->fix;
     struct rk29_ipp_req ipp_req;
-    u32 dstoffset = 0
+    u32 dstoffset = 0;
    #endif
        //fbprintk(">>>>>> %s : %s \n", __FILE__, __FUNCTION__);
 
@@ -1470,7 +1491,7 @@ static int fb0_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
     {
         #ifdef CONFIG_FB_SCALING_OSD
         if(((screen->x_res != var->xres) || (screen->y_res != var->yres))
-        && !((screen->x_res>1280) && (var->bits_per_pixel == 32)))
+        && !((screen->x_res>1920) && (var->bits_per_pixel == 32)))
         {
             par->y_offset = dstoffset;
 
@@ -1478,9 +1499,9 @@ static int fb0_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
             ipp_req.src0.w = var->xres;
             ipp_req.src0.h = var->yres;
 
-            ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset;
-            ipp_req.dst0.w = screen->x_res;
-            ipp_req.dst0.h = screen->y_res;
+            ipp_req.dst0.YrgbMst = fix->mmio_start + dstoffset* hdmi_get_scale()/100;
+            ipp_req.dst0.w = screen->x_res* hdmi_get_scale()/100;
+            ipp_req.dst0.h = screen->y_res* hdmi_get_scale()/100;
 
             ipp_req.src_vir_w = ipp_req.src0.w;
             ipp_req.dst_vir_w = ipp_req.dst0.w;
@@ -1618,7 +1639,7 @@ static int fb1_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
     u16 xlcd = screen->x_res;        //size of panel
     u16 ylcd = screen->y_res;
     u16 yres = 0;
-#ifdef CONFIG_HDMI
+#if 0
        struct hdmi *hdmi = get_hdmi_struct(0);
 #endif
 
@@ -1729,7 +1750,7 @@ static int fb1_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
     {
         return -EINVAL;        // multiple of scale down or scale up can't exceed 8
     }
-#ifdef CONFIG_HDMI
+#if 0
        if(inf->video_mode == 1) {
                if(hdmi_resolution_changed(hdmi,var->xres,var->yres, 1) == 1)
                {
@@ -2195,6 +2216,14 @@ static struct fb_ops fb0_ops = {
        //.fb_cursor      = rk29_set_cursor,
 };
 
+int fb_get_video_mode(void)
+{
+       struct rk29fb_inf *inf;
+       if(!g_pdev)
+               return 0;
+       inf = platform_get_drvdata(g_pdev);
+       return inf->video_mode;
+}
 /*
 enable: 1, switch to tv or hdmi; 0, switch to lcd
 */
index 561e25ca8da2bb9840d9926aa98380216dee08ae..5ca995b29f4e2b5754f770650b64ebeb4f7f05b2 100755 (executable)
@@ -31,15 +31,35 @@ typedef int                 BOOL;
 #define FALSE          0\r
 #define HDMI_DISABLE   0\r
 #define HDMI_ENABLE    1\r
+\r
+#define MIN_SCALE              80\r
+/* mouse event */\r
+#define MOUSE_NONE                     0x00\r
+#define MOUSE_LEFT_PRESS       0x01\r
+#define MOUSE_RIGHT_PRESS      0x02\r
+#define MOUSE_MIDDLE_PRESS     0x04\r
+#define HDMI_MOUSE_EVENT       MOUSE_NONE      \r
+/* mode */\r
+#define DISP_ON_LCD                            0\r
+#define DISP_ON_HDMI                   1\r
+#define DISP_ON_LCD_AND_HDMI   2\r
+/* dual display */\r
+#ifdef CONFIG_HDMI_DUAL_DISP\r
+#define DUAL_DISP_CAP          HDMI_ENABLE \r
+#define HDMI_DEFAULT_MODE      DISP_ON_LCD_AND_HDMI\r
+#else\r
+#define DUAL_DISP_CAP          HDMI_DISABLE \r
+#define HDMI_DEFAULT_MODE      DISP_ON_HDMI\r
+#endif\r
 /* resolution */\r
-#define HDMI_1280x720p_50Hz    0\r
-#define HDMI_1280x720p_60Hz            1\r
-#define HDMI_720x576p_50Hz_4x3 2\r
-#define HDMI_720x576p_50Hz_16x9        3\r
-#define HDMI_720x480p_60Hz_4x3 4\r
-#define HDMI_720x480p_60Hz_16x9        5\r
-#define HDMI_1920x1080p_50Hz   6\r
-#define HDMI_1920x1080p_60Hz   7\r
+#define HDMI_1920x1080p_50Hz   0\r
+#define HDMI_1920x1080p_60Hz   1\r
+#define HDMI_1280x720p_50Hz    2\r
+#define HDMI_1280x720p_60Hz            3\r
+#define HDMI_720x576p_50Hz_4x3 4\r
+#define HDMI_720x576p_50Hz_16x9        5\r
+#define HDMI_720x480p_60Hz_4x3 6\r
+#define HDMI_720x480p_60Hz_16x9        7\r
 \r
 /* HDMI default resolution */\r
 #define HDMI_DEFAULT_RESOLUTION HDMI_1280x720p_50Hz\r
@@ -72,7 +92,10 @@ struct hdmi {
        BOOL param_conf;\r
 \r
        u8 resolution;\r
+       u8 scale;\r
        u8 audio_fs;\r
+       int mode;\r
+       int dual_disp;\r
 \r
        int hdmi_stay_awake;\r
 \r
@@ -102,5 +125,7 @@ extern struct hdmi *get_hdmi_struct(int nr);
 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
+extern int hdmi_get_scale(void);\r
+extern int hdmi_set_scale(int event, char *data, int len);\r
+extern int fb_get_video_mode(void);\r
 #endif\r