diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/edid.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/common/edid.c b/common/edid.c index e66108f..df797fc 100644 --- a/common/edid.c +++ b/common/edid.c @@ -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) |