mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
spark: improve hardware_caps detection
This commit is contained in:
@@ -13,8 +13,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <aotom_main.h>
|
||||||
|
|
||||||
#include <hardware_caps.h>
|
#include <hardware_caps.h>
|
||||||
|
|
||||||
|
#define FP_DEV "/dev/vfd"
|
||||||
static int initialized = 0;
|
static int initialized = 0;
|
||||||
static hw_caps_t caps;
|
static hw_caps_t caps;
|
||||||
|
|
||||||
@@ -33,7 +37,7 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
strcpy(caps.boxvendor, "SPARK");
|
strcpy(caps.boxvendor, "SPARK");
|
||||||
const char *tmp;
|
const char *tmp;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int len = -1;
|
int len = -1, ret, val;
|
||||||
int fd = open("/proc/cmdline", O_RDONLY);
|
int fd = open("/proc/cmdline", O_RDONLY);
|
||||||
if (fd != -1) {
|
if (fd != -1) {
|
||||||
len = read(fd, buf, sizeof(buf) - 1);
|
len = read(fd, buf, sizeof(buf) - 1);
|
||||||
@@ -72,5 +76,16 @@ hw_caps_t *get_hwcaps(void)
|
|||||||
tmp = "(NO STB_ID FOUND)";
|
tmp = "(NO STB_ID FOUND)";
|
||||||
strcpy(caps.boxname, tmp);
|
strcpy(caps.boxname, tmp);
|
||||||
}
|
}
|
||||||
|
fd = open (FP_DEV, O_RDWR);
|
||||||
|
if (fd != -1) {
|
||||||
|
ret = ioctl(fd, VFDGETVERSION, &val);
|
||||||
|
if (ret < 0)
|
||||||
|
fprintf(stderr, "[hardware_caps] %s: VFDGETVERSION %m\n", __func__);
|
||||||
|
else if (val == 1) { /* VFD, others not yet seen in the wild */
|
||||||
|
caps.display_type = HW_DISPLAY_LINE_TEXT;
|
||||||
|
caps.display_xres = 8;
|
||||||
|
}
|
||||||
|
close(fd);
|
||||||
|
}
|
||||||
return ∩︀
|
return ∩︀
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user