diff options
Diffstat (limited to 'open_firmware.c')
-rw-r--r-- | open_firmware.c | 55 |
1 files changed, 0 insertions, 55 deletions
diff --git a/open_firmware.c b/open_firmware.c deleted file mode 100644 index 2170e70..0000000 --- a/open_firmware.c +++ /dev/null @@ -1,55 +0,0 @@ -#include <sys/types.h> -#include <sys/mman.h> -#include <netinet/in.h> -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <assert.h> -#include <limits.h> -#include <ctype.h> -#include <fcntl.h> -#include <sys/ioctl.h> -#include <linux/fb.h> -#include "get-edid.h" -#include "minifind.h" - -int get_edid(char *edid) -{ - struct pathNode *n; - struct findNode *list; - FILE* edid_file = NULL; - char *path = NULL; - - list = (struct findNode *) malloc(sizeof(struct findNode)); - list->result = (struct pathNode *) malloc(sizeof(struct pathNode)); - list->result->path = NULL; - list->result->next = list->result; - - minifind("/proc/device-tree", "EDID", list); - - for (n = list->result->next; n != list->result; n = n->next) - { - path = n->path; - break; - } - - if (path) - edid_file = fopen(path, "rb"); - - if (edid_file) - { - int size = fread(edid, sizeof(unsigned char), 0x80, edid_file); - fclose(edid_file); - return size == 0x80 ? 0x80 : 0; - } else - return 0; - -#if 0 - memcpy(&man, &ret->manufacturer_name, 2); - man = ntohs(man); - memcpy(&ret->manufacturer_name, &man, 2); - - /* byteswap to match the contents of MonitorsDB */ - ret->product_code = ((ret->product_code >> 8) & 0xff) | ((ret->product_code & 0xff) << 8); -#endif -} |