]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - common/edid.c
gpio: remove gpiolib.c and define remaining functions as static inline in asm/gpio.h
[karo-tx-uboot.git] / common / edid.c
index e66108f24a482b61ae99febd321418e38fe275c3..df797fcdd5bae35e1eaea9c2f6d3d631c0bff73a 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <common.h>
 #include <edid.h>
+#include <errno.h>
 #include <linux/ctype.h>
 #include <linux/string.h>
 
@@ -29,6 +30,17 @@ int edid_check_info(struct edid1_info *edid_info)
        return 0;
 }
 
+int edid_check_checksum(u8 *edid_block)
+{
+       u8 checksum = 0;
+       int i;
+
+       for (i = 0; i < 128; i++)
+               checksum += edid_block[i];
+
+       return (checksum == 0) ? 0 : -EINVAL;
+}
+
 int edid_get_ranges(struct edid1_info *edid, unsigned int *hmin,
                    unsigned int *hmax, unsigned int *vmin,
                    unsigned int *vmax)