经本人好几天,辛苦捣鼓,终于把我的电视精灵2(芯片:saa7130HL)弄到linux上了。
特将本人心得与大家分享。
我的环境是2.6.16,最新的kernel。
一般的PCI电视卡,在2.6.x系列的kernel上,均可以自己认出。不过你需要就是在insmod的时候,指定card=xxx,tuner=xxx
这很重要的,默认的值都不大对的,需要自己手工调的。
这几个值,可以参照linux内核的Documents/video4linux/CARDLIST.xxxx文档。
假如我们要在开机的时候,自己让系统insmod你的模块,只需在创建/etc/modprobe.d/saa7134文件,把你的设置写进去就可以了。我的saa7134内容:
options saa7134 card=21 tuner=38 i2c_scan=1
*NOTE* 在2.6.18以后的内核最好加上i2c_scan=1
install saa7134 /sbin/modprobe --ignore-install saa7134; /sbin/modprobe saa7134-alsa
options saa7134-alsa
这样你的linux重启后,就可以用tvtime来看电视了。这很简单哦,呵呵。
由于遥控器都是厂家自己定制的,所以处理起来比较累。像我的天敏出品的就没有支持的,只好自己动手了。
How to add remote control support to a card (GPIO remotes)
The operation is as follows (at least it is how i did it):
1. you make detinitions of your board to have remote control (in saa7134-cards.c).
2. in saa7134-input.c, you add a case for it into the switch statement, with mask_keycode=0. Use any ir_codes array for the start. Well, you should also determine whenever polling is needed, too.
**NOTE** 你没有gpio数据输出的时候,则加上polling
3. Load saa7134 module with ir_debug=1 parameter.
4. press the keys on your remote control and watch syslog (dmesg). You will see something like
build_key gpio=0x12345 mask=0x0 data=0
in dmesg output after each key press/release.
Pay attention to gpio=0x... stuff. You will see some bits which does not change, and some which do. The ones which changes should be in your mask_keycode and mask_keydown (mask_keycode should contain not more than 8 bits set to 1, others should be set to 0). Mask_keyup and mask_keydown - those are easy to determine if you see some bit is always on when you press a key and off when you release it, or the reverse.
Ie, you will have to determine which bits in gpio value represents the key# pressed/released, and which indicate whenever it is the press or release.
After this, recompile saa7134 module with correct mask_* stuff in your saa7134_input_init1() routine. Now, the dmesg output should look like
build_key gpio=0x12345 mask=0x
Ensure the data= value is different for each key, if not, you'll have to modify mask_keycode again.
Next, build the key table, by writing a file with one line for every of your key, with two fields -- key name and the data=value assotiated with it.
Try to find existing table matching your one. If there's one, use it. If none is found, build your own.
That's basically it.
以上内容来自V4L的Wiki,很有帮助的。
主要是调整mask_keycode和mask_keyup这几个值,比较累。没有厂家的资料,我们自己猜,呵呵。
修改好,make modules; make modules_install即可。
吴汝旭 于2006.05.03凌晨
没有评论:
发表评论