[linux-dvb] Device Modes and locking

Markus Rechberger mrechberger at gmail.com
Fri Apr 28 23:49:43 CEST 2006


Hey,

to make it short I had a discussion about locking for hybrid devices
and I looked at some source code but I didn't find what I was looking
for.

My situation:
I have a USB hybrid device (which is supported by the
em28xx/em2880-dvb module which is available at
http://linuxtv.org/hg/~mrechberger/v4l-dvb) that only supports one
mode at a time, Mauro pointed out that he wants both subsystems beeing
registered all the time and I also agree with that.
A gpio write controls which device will show up on the i2c bus. Either
the analogue videodecoder or the dvb-t demodulator, both will never
show up at the same time.
At the moment people have to load the em28xx module using "modprobe
em28xx device_mode=1" to get the firmware uploaded correctly and the
DVB-T demodulator shown up on the i2c bus, "modprobe em2880-dvb" will
finally make DVB-T work.

The problem is it shouldn't be possible to open a v4l device
(/dev/video[n]) and a DVB device concurrently, one should return
-EBUSY.
Goal is to make that dynamically as possible, so if someone closes the
DVB-T device and opens the analogue device file I want to reupload the
firmware set up the device correctly and make only analogue TV work.
While using analogue TV all registered DVB-T files should return
-EBUSY.
Is there already a solution for such a problem available?

thanks,
Markus



More information about the linux-dvb mailing list