пʼятницю, 9 вересня 2011 р.

Build kernel modules saa716x

I have linux OpenSUSE 11.4, kernel 2.6.37 and PCIe carte SkyStar 2 eXpress HD.
Audio video capture bridge -  saa7160ET (http://www.tridentmicro.com/producttree/tv/pc-tv/saa/saa7160/)
frontend
satellite tuner - stv6110a (http://www.st.com/internet/imag_video/product/216983.jsp)

stv0903b - Multi-standard advanced demodulator
for satellite digital TV and data services set-top boxes


lspci -v
03:00.0 Multimedia controller: Philips Semiconductors SAA7160 (rev 03)
    Subsystem: Device 1ae4:0700
    Flags: bus master, fast devsel, latency 0, IRQ 11
    Memory at fea00000 (64-bit, non-prefetchable) [size=1M]
    Capabilities: [40] MSI: Enable- Count=1/32 Maskable- 64bit+
    Capabilities: [50] Express Endpoint, MSI 00
    Capabilities: [74] Power Management version 2
    Capabilities: [80] Vendor Specific Information: Len=50 <?>
    Capabilities: [100] Vendor Specific Information: ID=0000 Rev=0 Len=088 <?>
 


Kernel modules for it, I found none.

I want  to build the kernel module saa716x .  Used tree Manu Abraham from project Linuxtv. http://jusst.de/hg/saa716x/shortlog/1d4e1f927992

http://linuxtv.org/wiki/index.php/NXP_SAA716x#Driver_Development

I also used a source of the tree Igor Liplianin. 


download  source stable dvb kernel-modules

$ git clone git://linuxtv.org/liplianin/media_tree.git

Download source for saa716x

$ hg clone  http://jusst.de/hg/saa716x/

copy source support for Remote Controllers on Linux

$ cd liplianin/media_tree
$ cp -a /usr/src/linux-2.6.37.6-0.7/drivers/media/IR drivers/media/
$ cp -a /usr/src/linux-2.6.37.6-0.7/include/media/ir-common.h include/media/
$ cp -a /usr/src/linux-2.6.37.6-0.7/include/media/ir-core.h include/media/
$ cp -a /usr/src/linux-2.6.37.6-0.7/include/media/ir-kbd-i2c.h include/media/


copy source saa716x
$ cp -a ../../saa716x/linux/drivers/media/common/saa716x drivers/media/common/

create link headers file
$ cd drivers/media/common/saa716x/
$ for i in `ls  ../../dvb/frontends/ | grep h$ | tr "\012" " "`; do ln -s ../../dvb/frontends/$i $i; done

edit the file drivers/media/common/saa716x/saa716x_i2c.c
remove the line containing I2C_CLASSCLASS_TV_DIGITAL

edit the file drivers/media/common/Makefile
add the line
obj-$(CONFIG_SAA716X_CORE) += saa716x/

change file osd.h (The headers file includes an ad structure osd_raw_data_t)
$ rm -f  include/linux/dvb/osd.h
$ cp -a ../../saa716x/linux/include/linux/dvb/osd.h include/linux/dvb/


$ cd media_tree
$ cp -a  /boot/config-2.6.37.6-0.7-desktop ./.config
$ make menuconfig
Configure
Device Drivers -> Multimedia Suport -> Support for SAA716x family from NXP Philips
<M> <M> <M> <M>

$ make

modules saa716x_hybrid.ko saa716x_core.ko saa716x_budget.ko assembled

$ find /lib/modules/ | grep saa716x
/lib/modules/2.6.37.6-0.7-desktop/kernel/drivers/media/common/saa716x/saa716x_hybrid.ko
/lib/modules/2.6.37.6-0.7-desktop/kernel/drivers/media/common/saa716x/saa716x_core.ko
/lib/modules/2.6.37.6-0.7-desktop/kernel/drivers/media/common/saa716x/saa716x_budget.ko

But saa716x_ff.ko module is not created.

Message compiler:
  LD [M]  drivers/media/common/saa716x/saa716x_core.o
  CC [M]  drivers/media/common/saa716x/saa716x_budget.o
  CC [M]  drivers/media/common/saa716x/saa716x_hybrid.o
  CC [M]  drivers/media/common/saa716x/saa716x_ff.o
drivers/media/common/saa716x/saa716x_ff.c:480:2: error: unknown field ‘ioctl’ specified in initializer
drivers/media/common/saa716x/saa716x_ff.c:480:2: warning: initialization from incompatible pointer type
drivers/media/common/saa716x/saa716x_ff.c:490:2: warning: initialization from incompatible pointer type
drivers/media/common/saa716x/saa716x_ff.c:538:2: error: unknown field ‘ioctl’ specified in initializer
drivers/media/common/saa716x/saa716x_ff.c:538:2: warning: initialization from incompatible pointer type
drivers/media/common/saa716x/saa716x_ff.c:548:2: warning: initialization from incompatible pointer type
drivers/media/common/saa716x/saa716x_ff.c:686:2: error: unknown field ‘ioctl’ specified in initializer
drivers/media/common/saa716x/saa716x_ff.c:686:2: warning: initialization from incompatible pointer type
drivers/media/common/saa716x/saa716x_ff.c:697:2: warning: initialization from incompatible pointer type

It happens here in this:


 static struct file_operations dvb_osd_fops = {
        .owner          = THIS_MODULE,
        .ioctl          = dvb_generic_ioctl,
        .open           = dvb_generic_open,
        .release        = dvb_generic_release,
};