add avswitch calls
[enigma2.git] / lib / driver / avswitch.cpp
1 #include <lib/driver/avswitch.h>
2
3 #include <unistd.h>
4 #include <fcntl.h>
5 #include <sys/ioctl.h>
6
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>
11
12 eAVSwitch *eAVSwitch::instance = 0;
13
14 eAVSwitch::eAVSwitch()
15 {
16         ASSERT(!instance);
17         instance = this;
18         
19         avsfd = open("/dev/dbox/avs0", O_RDWR);
20 }
21
22 eAVSwitch::~eAVSwitch()
23 {
24         if(avsfd > 0)
25                 close(avsfd);
26 }
27
28 eAVSwitch *eAVSwitch::getInstance()
29 {
30         return instance;
31 }
32
33 void eAVSwitch::setColorFormat(int format)
34 {
35         printf("eAVSwitch::setColorFormat(%d)\n",format);
36         /*there are no ioctl for controling this in avs - scart api needed 
37                 no, not the gillem one */
38 }
39
40 //FIXME: correct "run/startlevel"
41 eAutoInitP0<eAVSwitch> init_avswitch(eAutoInitNumbers::rc, "AVSwitch Driver");