mirror of
https://github.com/tuxbox-neutrino/libstb-hal.git
synced 2025-08-26 23:13:16 +02:00
libspark/hw_caps: check vfd version first (needed to discriminate between Pingulux and Pingulux Plus)
This commit is contained in:
@@ -38,7 +38,18 @@ hw_caps_t *get_hwcaps(void)
|
||||
const char *tmp;
|
||||
char buf[1024];
|
||||
int len = -1, ret, val;
|
||||
int fd = open("/proc/cmdline", O_RDONLY);
|
||||
int 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);
|
||||
}
|
||||
fd = open("/proc/cmdline", O_RDONLY);
|
||||
if (fd != -1) {
|
||||
len = read(fd, buf, sizeof(buf) - 1);
|
||||
close(fd);
|
||||
@@ -60,6 +71,9 @@ hw_caps_t *get_hwcaps(void)
|
||||
break;
|
||||
case 0x090008:
|
||||
tmp = "Edision Pingulux";
|
||||
caps.has_SCART = 1; // RCA qualifies ... --martii
|
||||
if (caps.display_type == HW_DISPLAY_LINE_TEXT)
|
||||
tmp = "Edision Pingulux Plus";
|
||||
break;
|
||||
case 0x09000a:
|
||||
tmp = "Amiko Alien SDH8900";
|
||||
@@ -140,16 +154,5 @@ hw_caps_t *get_hwcaps(void)
|
||||
tmp = "(NO STB_ID FOUND)";
|
||||
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 ∩︀
|
||||
}
|
||||
|
Reference in New Issue
Block a user