]> git.karo-electronics.de Git - linux-beck.git/commitdiff
video: Check EDID for HDMI connection
authorDavid Ung <davidu@nvidia.com>
Wed, 26 Mar 2014 22:35:37 +0000 (15:35 -0700)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 22 Apr 2014 05:51:29 +0000 (08:51 +0300)
Check EDID Vendor Specific Data Block bytes to see if the connection
is HDMI and set FB_MISC_HDMI.

Signed-off-by: David Ung <davidu@nvidia.com>
Signed-off-by: Christopher Freeman <cfreeman@nvidia.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/fbdev/core/fbmon.c
include/linux/fb.h

index c204ebe6187e9f021740e38dcb082a1f07a8caf5..5b0e313849bd225d7df251ce40634e8563f6591a 100644 (file)
@@ -1012,13 +1012,20 @@ void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs)
        while (pos < edid[2]) {
                u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7;
                pr_debug("Data block %u of %u bytes\n", type, len);
-               if (type == 2)
+               if (type == 2) {
                        for (i = pos; i < pos + len; i++) {
                                u8 idx = edid[pos + i] & 0x7f;
                                svd[svd_n++] = idx;
                                pr_debug("N%sative mode #%d\n",
                                         edid[pos + i] & 0x80 ? "" : "on-n", idx);
                        }
+               } else if (type == 3 && len >= 3) {
+                       /* Check Vendor Specific Data Block.  For HDMI,
+                          it is always 00-0C-03 for HDMI Licensing, LLC. */
+                       if (edid[pos + 1] == 3 && edid[pos + 2] == 0xc &&
+                           edid[pos + 3] == 0)
+                               specs->misc |= FB_MISC_HDMI;
+               }
                pos += len + 1;
        }
 
index fe6ac956550e4e099a04889e9b33bf0f9a917c2e..506242979eea055af385bdc4aecbba38809496ec 100644 (file)
@@ -47,6 +47,7 @@ struct device_node;
 
 #define FB_MISC_PRIM_COLOR     1
 #define FB_MISC_1ST_DETAIL     2       /* First Detailed Timing is preferred */
+#define FB_MISC_HDMI           4
 struct fb_chroma {
        __u32 redx;     /* in fraction of 1024 */
        __u32 greenx;