1 #include <lib/driver/avswitch.h>
7 #include <lib/base/init.h>
8 #include <lib/base/init_num.h>
9 #include <lib/base/econfig.h>
10 #include <lib/base/eerror.h>
12 eAVSwitch *eAVSwitch::instance = 0;
14 eAVSwitch::eAVSwitch()
20 eAVSwitch::~eAVSwitch()
24 eAVSwitch *eAVSwitch::getInstance()
29 void eAVSwitch::setColorFormat(int format)
38 char *svideo="svideo";
41 if((fd = open("/proc/stb/avs/0/colorformat", O_WRONLY)) < 0) {
42 printf("cannot open /proc/stb/avs/0/colorformat\n");
47 write(fd, cvbs, strlen(cvbs));
50 write(fd, rgb, strlen(rgb));
53 write(fd, svideo, strlen(svideo));
59 void eAVSwitch::setAspectRatio(int ratio)
73 if((fd = open("/proc/stb/video/aspect", O_WRONLY)) < 0) {
74 printf("cannot open /proc/stb/video/aspect\n");
79 write(fd, any, strlen(any));
82 write(fd, norm, strlen(norm));
86 write(fd, wide, strlen(wide));
92 void eAVSwitch::setVideomode(int mode)
99 //FIXME: bug in driver (cannot set PAL)
100 if((fd = open("/proc/stb/video/videomode", O_WRONLY)) < 0) {
101 printf("cannot open /proc/stb/video/videomode\n");
106 write(fd, pal, strlen(pal));
109 write(fd, ntsc, strlen(ntsc));
115 //FIXME: correct "run/startlevel"
116 eAutoInitP0<eAVSwitch> init_avswitch(eAutoInitNumbers::rc, "AVSwitch Driver");