mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-libstb-hal.git
synced 2025-08-26 23:12:44 +02:00
spark: improve hardware_caps detection
Origin commit data
------------------
Branch: master
Commit: f0a9b76ef1
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2012-09-16 (Sun, 16 Sep 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -13,8 +13,12 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <aotom_main.h>
|
||||
|
||||
#include <hardware_caps.h>
|
||||
|
||||
#define FP_DEV "/dev/vfd"
|
||||
static int initialized = 0;
|
||||
static hw_caps_t caps;
|
||||
|
||||
@@ -33,7 +37,7 @@ hw_caps_t *get_hwcaps(void)
|
||||
strcpy(caps.boxvendor, "SPARK");
|
||||
const char *tmp;
|
||||
char buf[1024];
|
||||
int len = -1;
|
||||
int len = -1, ret, val;
|
||||
int fd = open("/proc/cmdline", O_RDONLY);
|
||||
if (fd != -1) {
|
||||
len = read(fd, buf, sizeof(buf) - 1);
|
||||
@@ -72,5 +76,16 @@ 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