Re: (Saa7134) Re: ADS-Tech Instant TV PCI, no remote support, giving up.

2009-09-12 Thread Morvan Le Meut
Since i don't know where to look, i finally decided to use a basic 
incorrect keymap :

/* ADS Tech Instant TV PCI Remote */
static struct ir_scancode ir_codes_adstech_pci[] = {
   /* too many repeating codes : incorrect gpio ?. */
  
   { 0x1f, KEY_MUTE },

   { 0x1d, KEY_SEARCH },
   { 0x17, KEY_EPG },/* Guide */
   { 0x0f, KEY_UP },
   { 0x6, KEY_DOWN },
   { 0x16, KEY_LEFT },
   { 0x1e, KEY_RIGHT },
   { 0x0e, KEY_SELECT },/* Enter */
   { 0x1a, KEY_INFO },
   { 0x12, KEY_EXIT },
   { 0x19, KEY_PREVIOUS },
   { 0x11, KEY_NEXT },
   { 0x18, KEY_REWIND },
   { 0x10, KEY_FORWARD },
   { 0x4, KEY_PLAYPAUSE },
   { 0x07, KEY_STOP },
   { 0x1b, KEY_RECORD },
   { 0x13, KEY_TUNER },/* Live */
   { 0x0a, KEY_A },
   { 0x03, KEY_PROG1 },/* 1 */
   { 0x01, KEY_PROG2 },/* 2 */
   { 0x0, KEY_VIDEO },
   { 0x0b, KEY_CHANNELUP },
   { 0x08, KEY_CHANNELDOWN },
   { 0x15, KEY_VOLUMEUP },
   { 0x1c, KEY_VOLUMEDOWN },
};

struct ir_scancode_table ir_codes_adstech_pci_table = {
   .scan = ir_codes_adstech_pci,
   .size = ARRAY_SIZE(ir_codes_adstech_pci),
};
EXPORT_SYMBOL_GPL(ir_codes_adstech_pci_table);

No numbers in favor of arrows and ch+/- Vol+/- . Well 246 will be arrows 
and  5 select, 7 and 8 are undefined, 9 become vol-, 1 epg and 3 is tuner.
If someone, one day, wants to find that missig bit, i'll be happy to 
help. ( Strange anyway : it's as if there was a 0x7f mask even when i 
specify a 0xff one )

Feel free to write a patch.

Morvan Le Meut a écrit :

um .. help, please ?
how can i make the driver read 1011011 instead of 011011 when i press 
Power instead of record on the remote ?


thanks




--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html





--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: ZC0301 webcam, successful trace from spca5xx driver

2009-09-12 Thread test.r test.r
Hi,

Using the old spca5xx with Debian kernel 2.6.18 the webcam is working.
Release 0.60.00 as spca5xx-v4l1-goodbye available in Debian etch.
The traces below may help someone wanting to port this webcam to the
new driver architecture.

Have a good day,
Guillaume


Below, the dmesg after modprobe spca5xx debug=5 and plugging the webcam:
usbcore: registered new driver spca5xx
/usr/src/modules/spca5xx/drivers/usb/spca5xx.c: spca5xx driver
00.60.00 registered
usb 1-1: new full speed USB device using uhci_hcd and address 3
usb 1-1: configuration #1 chosen from 1 choice
/usr/src/modules/spca5xx/drivers/usb/spca5xx.c: USB SPCA5XX camera
found. Type Vimicro Zc301P 0x301b
/usr/src/modules/spca5xx/drivers/usb/spca5xx.c: [spca5xx_probe:5480]
Camera type JPEG
/usr/src/modules/spca5xx/drivers/usb/spca5xx.c:
[spca50x_configure:3298] video_register_device succeeded
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x00
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x0F, 0x10
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x01
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x03, 0x12
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x12
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x08, 0x8D
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x00, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x02, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x91: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x95: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x96: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x02, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x91: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x95: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x96: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x03, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0xAA, 0x93
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x00, 0x94
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x91: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x03, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x02, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x91: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x95: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x96: 0x
/usr/src/modules/spca5xx/drivers/usb/zc3xx.h: [zcxx_probeSensor:176]
sensor answer1  0
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x00
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x00, 0x10
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x01
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x03, 0x12
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x12
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0xAA, 0x93
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x00, 0x94
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x01, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]
reg read: 0xC0, 0xA1, 0x01, 0x91: 0x
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x00, 0x92
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegWrite:131]
reg write: 0x40, 0xA0,0x02, 0x90
/usr/src/modules/spca5xx/drivers/usb/spcausb.h: [spca5xxRegRead:94]

Initial media controller implementation

2009-09-12 Thread Hans Verkuil
Rather than writing long mails on what a media controller is and what it can
do, I thought that I could just as well implement it.

So in 4 hours I implemented pretty much all of the media controller
functionality. The main missing features are the ability to register non-v4l
device nodes so that they can be enumerated and setting controls private to
a sub-device. For that I should first finish the control handling framework.

The datastructures and naming conventions needs to be cleaned up, and it
needs some tweaking, but I'd say this is pretty much the way I want it.

The code is available here:

http://linuxtv.org/hg/~hverkuil/v4l-dvb-mc/

It includes a v4l2-mc utility in v4l2-apps/util that has the
--show-topology option that enumerates all nodes and subdev. Currently any
registered subdevs and v4l device nodes are already automatically added.
Obviously, there are no links setup between them, that would require work
in the drivers.

Total diffstat:

 b/linux/include/media/v4l2-mc.h |   54 +
 b/v4l2-apps/util/v4l2-mc.cpp|  325 
 linux/drivers/media/video/v4l2-dev.c|   15 +
 linux/drivers/media/video/v4l2-device.c |  265 +-
 linux/include/linux/videodev2.h |   74 +++
 linux/include/media/v4l2-dev.h  |6
 linux/include/media/v4l2-device.h   |   23 +-
 linux/include/media/v4l2-subdev.h   |   11 -
 v4l2-apps/util/Makefile |2
 9 files changed, 762 insertions(+), 13 deletions(-)

Ignoring the new utility that's just 435 lines of core code.

Now try this with sysfs. Brrr.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Initial media controller implementation

2009-09-12 Thread Markus Rechberger
Hi,

On Sat, Sep 12, 2009 at 12:57 PM, Hans Verkuil hverk...@xs4all.nl wrote:
 Rather than writing long mails on what a media controller is and what it can
 do, I thought that I could just as well implement it.

 So in 4 hours I implemented pretty much all of the media controller
 functionality. The main missing features are the ability to register non-v4l
 device nodes so that they can be enumerated and setting controls private to
 a sub-device. For that I should first finish the control handling framework.

 The datastructures and naming conventions needs to be cleaned up, and it
 needs some tweaking, but I'd say this is pretty much the way I want it.

 The code is available here:

 http://linuxtv.org/hg/~hverkuil/v4l-dvb-mc/

 It includes a v4l2-mc utility in v4l2-apps/util that has the
 --show-topology option that enumerates all nodes and subdev. Currently any
 registered subdevs and v4l device nodes are already automatically added.
 Obviously, there are no links setup between them, that would require work
 in the drivers.

 Total diffstat:

  b/linux/include/media/v4l2-mc.h         |   54 +
  b/v4l2-apps/util/v4l2-mc.cpp            |  325 
 
  linux/drivers/media/video/v4l2-dev.c    |   15 +
  linux/drivers/media/video/v4l2-device.c |  265 +-
  linux/include/linux/videodev2.h         |   74 +++
  linux/include/media/v4l2-dev.h          |    6
  linux/include/media/v4l2-device.h       |   23 +-
  linux/include/media/v4l2-subdev.h       |   11 -
  v4l2-apps/util/Makefile                 |    2
  9 files changed, 762 insertions(+), 13 deletions(-)

 Ignoring the new utility that's just 435 lines of core code.

 Now try this with sysfs. Brrr.


please even more important when doing this push out a proper
documentation for it,
The s2api is a mess seen from the documentation people need to hack
existing code in order
to figure out how to use it it seems. v4l2/(incomplete)linuxdvb v3 API
are still the best references
to start with right now.

Markus
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Initial media controller implementation

2009-09-12 Thread Hans Verkuil
On Saturday 12 September 2009 13:05:14 Markus Rechberger wrote:
 Hi,
 
 On Sat, Sep 12, 2009 at 12:57 PM, Hans Verkuil hverk...@xs4all.nl wrote:
  Rather than writing long mails on what a media controller is and what it can
  do, I thought that I could just as well implement it.
 
  So in 4 hours I implemented pretty much all of the media controller
  functionality. The main missing features are the ability to register non-v4l
  device nodes so that they can be enumerated and setting controls private to
  a sub-device. For that I should first finish the control handling framework.
 
  The datastructures and naming conventions needs to be cleaned up, and it
  needs some tweaking, but I'd say this is pretty much the way I want it.
 
  The code is available here:
 
  http://linuxtv.org/hg/~hverkuil/v4l-dvb-mc/
 
  It includes a v4l2-mc utility in v4l2-apps/util that has the
  --show-topology option that enumerates all nodes and subdev. Currently any
  registered subdevs and v4l device nodes are already automatically added.
  Obviously, there are no links setup between them, that would require work
  in the drivers.
 
  Total diffstat:
 
   b/linux/include/media/v4l2-mc.h         |   54 +
   b/v4l2-apps/util/v4l2-mc.cpp            |  325 
  
   linux/drivers/media/video/v4l2-dev.c    |   15 +
   linux/drivers/media/video/v4l2-device.c |  265 +-
   linux/include/linux/videodev2.h         |   74 +++
   linux/include/media/v4l2-dev.h          |    6
   linux/include/media/v4l2-device.h       |   23 +-
   linux/include/media/v4l2-subdev.h       |   11 -
   v4l2-apps/util/Makefile                 |    2
   9 files changed, 762 insertions(+), 13 deletions(-)
 
  Ignoring the new utility that's just 435 lines of core code.
 
  Now try this with sysfs. Brrr.
 
 
 please even more important when doing this push out a proper
 documentation for it,
 The s2api is a mess seen from the documentation people need to hack
 existing code in order
 to figure out how to use it it seems. v4l2/(incomplete)linuxdvb v3 API
 are still the best references
 to start with right now.

It will obviously be documented extensively when/if this becomes official.
Right now it is an initial implementation people can play with.

Regards,

 Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Mauro Carvalho Chehab
Em Sat, 12 Sep 2009 00:21:48 +0200
Hans Verkuil hverk...@xs4all.nl escreveu:

 Hi all,
 
 I've started this as a new thread to prevent polluting the discussions of the
 media controller as a concept.
 
 First of all, I have no doubt that everything that you can do with an ioctl,
 you can also do with sysfs and vice versa. That's not the problem here.
 
 The problem is deciding which approach is the best.

True. Choosing the better approach is very important since, once merged, we'll
need to stick it for a very long time.

I saw your proposal of a ioctl-only implementation for the media control. It is
important to have a sysfs implementation also to compare. I can do it.

However, we are currently in the middle of a merge window, and this one will
require even more time than usual, since we have 2 series of patches for
soc_camera and for DaVinci/OMAP that depends on arm and omap architecture merge.

Also, there are some pending merges that requires some time to analyze, like
the ISDB-T/ISDB-S patches and API changes that were proposed for 2.6.32, that
requiring the analysis of both Japanese and Brazilian specs and do some
tests, and the tuner changes for better handling the i2c gates, and the V4L and
DVB specs that we can now merge upstream, as both got converted to DocBook XML
4.1.2 (the same version used upstream).

So, during the next two weeks, we'll have enough fun to handle, in order to get
our patches merged for 2.6.32. So, unfortunately, I'm afraid that we'll need to
give a break on those discussions until the end of the merge window, focusing
on merging the patches we have for 2.6.32.


Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [linux-dvb] Pinnacle 320e (em28xx/xc2028): scan finds just first channel

2009-09-12 Thread Devin Heitmueller
On Sat, Sep 12, 2009 at 6:15 AM, Miroslav Pragl - mailing lists
lists.subscri...@pragl.cz wrote:
 Hello,
 I've compiled and installed latest v4l-dvb and dvb-apps, extracted xceive
 firmware, so far so good. Distro is Fedora 11, x64 (2.6.30.5-43.fc11.x86_64)

 Unfortunately scan finds only the first channel:
snip

Hello Miroslav,

Are you absolutely sure you installed the latest code, including make
unload to unload the currently running modules?  I fixed this exact
regression back in June, so I would be extremely surprised if you are
really seeing this in the latest code.

I would suggest using the following commands, and then reboot:

unplug device
hg clone http://linuxtv.org/hg/v4l-dvb
cd v4l-dvb
make  make install  make unload
reboot
plug in device

Then see if it still happens.

Cheers,

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Devin Heitmueller
On Sat, Sep 12, 2009 at 9:31 AM, Mauro Carvalho Chehab
mche...@infradead.org wrote:
 True. Choosing the better approach is very important since, once merged, we'll
 need to stick it for a very long time.

 I saw your proposal of a ioctl-only implementation for the media control. It 
 is
 important to have a sysfs implementation also to compare. I can do it.

 However, we are currently in the middle of a merge window, and this one will
 require even more time than usual, since we have 2 series of patches for
 soc_camera and for DaVinci/OMAP that depends on arm and omap architecture 
 merge.

 Also, there are some pending merges that requires some time to analyze, like
 the ISDB-T/ISDB-S patches and API changes that were proposed for 2.6.32, that
 requiring the analysis of both Japanese and Brazilian specs and do some
 tests, and the tuner changes for better handling the i2c gates, and the V4L 
 and
 DVB specs that we can now merge upstream, as both got converted to DocBook XML
 4.1.2 (the same version used upstream).

 So, during the next two weeks, we'll have enough fun to handle, in order to 
 get
 our patches merged for 2.6.32. So, unfortunately, I'm afraid that we'll need 
 to
 give a break on those discussions until the end of the merge window, focusing
 on merging the patches we have for 2.6.32.


 Cheers,
 Mauro

Mauro,

I respectfully disagree.  The original version of this RFC has been
pending for almost a year now.  Hans has written a prototype
implementation.  We should strive to get this locked down by the LPC
conference.

I think we all know that you are busy, but this conversation needs to
continue even if you personally do not have the cycles to give it your
full attention.

There is finally some real momentum behind this initiative, and the
lack of this functionality is crippling usability for many, many
users.  Hi I a new user to tvtime.  I can see analog tv with tvtime,
but how do I make audio work?

Let's finally put this issue to rest.

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PULL] http://linuxtv.org/hg/~awalls/v4l-dvb

2009-09-12 Thread Mauro Carvalho Chehab
Em Mon, 07 Sep 2009 11:13:36 -0700
Brian Rogers br...@xyzw.org escreveu:

 Mauro Carvalho Chehab wrote:
  Em Sat, 5 Sep 2009 20:46:12 +0200
  Jean Delvare kh...@linux-fr.org escreveu:
 

  As far as I can see, the em28xx and saa7134 drivers have the exact same
  problem. Is there anyone working on this?
  
 
  I tested it here with an em28xx device and I got the trouble. I've 
  committed a
  patch fixing it with this driver, with a different strategy, using dynamic
  memory. I did a similar patch for saa7134, although I can't test it ATM. 
  Tests with
  saa7134 devices with i2c keyboards are welcome.

 
 Works fine with the MSI t...@nywhere Plus that prompted my version of the 
 patch.
 
 A couple comments. It looks like since the saa7134_dev is allocated with 
 kzalloc, you shouldn't have to zero out dev-info and dev-init_data.

Yes, that's true. However, as it were allocated on another routine, and we're
adding a callback pointer to be called for i2c IR handling, I opted to be a
little paranoid here, since a later IR redesign could insert some code
in-between.

 Secondly, you misspelled my name in your commit messages. :)

OK, I fixed your names at the commit messages on my -git. They'll be correct at
the time I send them upstream.

 Are you going to send this in for 2.6.31, or is it likely to wait until 
 2.6.31.1? I filed a bug to track the regression: 
 http://bugzilla.kernel.org/show_bug.cgi?id=14142

They should be backported to be added at 2.6.31 -stable, since there were some 
IR
struct changes that renamed the IR keycode tables. As the patches were applied 
after
those changes, they'll require backporting.



Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[2.6.30.y PATCH 1/1] V4L: em28xx: set up tda9887_conf in em28xx_card_setup()

2009-09-12 Thread Michael Krufky
V4L: em28xx: set up tda9887_conf in em28xx_card_setup()

From: Franklin Meng fmeng2...@yahoo.com

Added tda9887_conf set up into em28xx_card_setup()

Signed-off-by: Franklin Meng fmeng2...@yahoo.com
Signed-off-by: Douglas Schilling Landgraf dougsl...@redhat.com
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
Tested-by: Larry Finger larry.fin...@lwfinger.net
Signed-off-by: Michael Krufky mkru...@linuxtv.org
(cherry picked from commit ae3340cbf59ea362c2016eea762456cc0969fd9e)
---
 drivers/media/video/em28xx/em28xx-cards.c |3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-cards.c
b/drivers/media/video/em28xx/em28xx-cards.c
index 7c70738..168e892 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -1886,6 +1886,9 @@ void em28xx_card_setup(struct em28xx *dev)
if (em28xx_boards[dev-model].tuner_addr)
dev-tuner_addr = em28xx_boards[dev-model].tuner_addr;

+   if (em28xx_boards[dev-model].tda9887_conf)
+   dev-tda9887_conf = em28xx_boards[dev-model].tda9887_conf;
+
/* request some modules */
switch (dev-model) {
case EM2820_BOARD_HAUPPAUGE_WINTV_USB_2:
-- 
1.6.0.4
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Mauro Carvalho Chehab
Em Sat, 12 Sep 2009 09:41:58 -0400
Devin Heitmueller dheitmuel...@kernellabs.com escreveu:

 I respectfully disagree.

Are you suggesting that we should not submit any patches upstream during this
merge window in order to discuss this? Sorry, but this is not right with all 
the developers that did their homework and submitted changes for 2.6.32.

  The original version of this RFC has been
 pending for almost a year now. 

It was not pending since then. As there were all the framework changes needed,
we've agreed on doing the V4L framework changes, that were finally merged at 
2.6.30[1],
that were required, before proceeding with further discussions.

 Hans has written a prototype
 implementation.  We should strive to get this locked down by the LPC
 conference.

Why? Nothing stops discussing it there and better prepare a proposal, but,
considering all the noise we had after the DVB S2API last year, I don't think
we should ever repeat using a conference, where only some of us will be there
to approve a proposal. It is the right forum for discussing and better formulate
the issues, in order to prepare a proposal, but the decisions should happen at
the ML.

Hans took a year to prepare RFCv2, and we all know that he was hardly
working on implementing what was discussed during the first RFC proposal during
all those timeframe. This shows that this is a complex matter.

 I think we all know that you are busy, but this conversation needs to
 continue even if you personally do not have the cycles to give it your
 full attention.

It is not only me that has pending tasks, but other developers are also focused
on merging their things. For example, Mkrufky already pointed that he is
waiting for the merge of the first part of his series, since he needs to send a
complementary set of patches. I'm sure that there are other developers that
are still finishing some working for the merge or that may need to solve the
usual troubles that happens when some patches went upstream via other trees,
needing to be backported and tested.

 There is finally some real momentum behind this initiative, and the
 lack of this functionality is crippling usability for many, many
 users.  Hi I a new user to tvtime.  I can see analog tv with tvtime,
 but how do I make audio work?
 
 Let's finally put this issue to rest.

Yes, let's do it for 2.6.33, but it this discussion started too late for 2.6.32.

Cheers,
Mauro

[1] FYI, we had several regression fixes on 2.6.31 due to that - and there are
still some unsolved regressions related to them - basically i2c gate and radio
breakages yet requiring fixes. Some are documented at Kernel regression list
and at bugzilla, others were just reported at ML. As I said a countless number
of times, we need to focus fixing the regressions caused by those API changes
before doing another series of changes at API. So, if people are with spare
time, I suggest a task force to fix the remaining regressions mostly on saa7134.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/RFT 0/10] radio-mr800 patch series

2009-09-12 Thread David Ellingsworth
What follow is a series of patches to clean up the radio-mr800 driver. I 
do _not_ have access to this device so these patches need to be tested. 
These patches should apply to Mauro's git tree and against the 2.6.31 
release kernel. The patches in this series are as follows:


1. radio-mr800: implement proper locking
2. radio-mr800: simplify video_device allocation
3. radio-mr800: simplify error paths in usb probe callback
4. radio-mr800: remove an unnecessary local variable
5. radio-mr800: simplify access to amradio_device
6. radio-mr800: simplify locking in ioctl callbacks
7. radio-mr800: remove device-removed indicator
8. radio-mr800: turn radio on during first open and off during last close
9. radio-mr800: preserve radio-state during suspend/resume
10. radio-mr800: fix potential use after free

Each individual patch will follow in a separate email.

Regards,

David Ellingsworth
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/RFT 01/10] radio-mr800: implement proper locking

2009-09-12 Thread David Ellingsworth

From 1773df59dc8e63ca00a27f5235c293341fd07f36 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Fri, 11 Sep 2009 23:21:17 -0400
Subject: [PATCH 01/10] mr800: implement proper locking

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |  181 
++---

1 files changed, 106 insertions(+), 75 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 575bf9d..8e96c8a 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -168,11 +168,7 @@ static int amradio_set_mute(struct amradio_device 
*radio, char argument)

int retval;
int size;

-/* safety check */
-if (radio-removed)
-return -EIO;
-
-mutex_lock(radio-lock);
+BUG_ON(!mutex_is_locked(radio-lock));

radio-buffer[0] = 0x00;
radio-buffer[1] = 0x55;
@@ -186,15 +182,11 @@ static int amradio_set_mute(struct amradio_device 
*radio, char argument)

retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);

-if (retval  0 || size != BUFFER_LENGTH) {
-mutex_unlock(radio-lock);
+if (retval  0 || size != BUFFER_LENGTH)
return retval;
-}

radio-muted = argument;

-mutex_unlock(radio-lock);
-
return retval;
}

@@ -205,11 +197,7 @@ static int amradio_setfreq(struct amradio_device 
*radio, int freq)

int size;
unsigned short freq_send = 0x10 + (freq  3) / 25;

-/* safety check */
-if (radio-removed)
-return -EIO;
-
-mutex_lock(radio-lock);
+BUG_ON(!mutex_is_locked(radio-lock));

radio-buffer[0] = 0x00;
radio-buffer[1] = 0x55;
@@ -223,10 +211,8 @@ static int amradio_setfreq(struct amradio_device 
*radio, int freq)

retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);

-if (retval  0 || size != BUFFER_LENGTH) {
-mutex_unlock(radio-lock);
+if (retval  0 || size != BUFFER_LENGTH)
return retval;
-}

/* frequency is calculated from freq_send and placed in first 2 
bytes */

radio-buffer[0] = (freq_send  8)  0xff;
@@ -240,13 +226,6 @@ static int amradio_setfreq(struct amradio_device 
*radio, int freq)

retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);

-if (retval  0 || size != BUFFER_LENGTH) {
-mutex_unlock(radio-lock);
-return retval;
-}
-
-mutex_unlock(radio-lock);
-
return retval;
}

@@ -255,11 +234,7 @@ static int amradio_set_stereo(struct amradio_device 
*radio, char argument)

int retval;
int size;

-/* safety check */
-if (radio-removed)
-return -EIO;
-
-mutex_lock(radio-lock);
+BUG_ON(!mutex_is_locked(radio-lock));

radio-buffer[0] = 0x00;
radio-buffer[1] = 0x55;
@@ -275,14 +250,11 @@ static int amradio_set_stereo(struct 
amradio_device *radio, char argument)


if (retval  0 || size != BUFFER_LENGTH) {
radio-stereo = -1;
-mutex_unlock(radio-lock);
return retval;
}

radio-stereo = 1;

-mutex_unlock(radio-lock);
-
return retval;
}

@@ -325,12 +297,18 @@ static int vidioc_g_tuner(struct file *file, void 
*priv,

struct amradio_device *radio = video_get_drvdata(video_devdata(file));
int retval;

+mutex_lock(radio-lock);
+
/* safety check */
-if (radio-removed)
-return -EIO;
+if (radio-removed) {
+retval = -EIO;
+goto unlock;
+}

-if (v-index  0)
-return -EINVAL;
+if (v-index  0) {
+retval = -EINVAL;
+goto unlock;
+}

/* TODO: Add function which look is signal stereo or not
 * amradio_getstat(radio);
@@ -357,7 +335,10 @@ static int vidioc_g_tuner(struct file *file, void 
*priv,

v-audmode = V4L2_TUNER_MODE_MONO;
v-signal = 0x; /* Can't get the signal strength, sad.. */
v-afc = 0; /* Don't know what is this */
-return 0;
+
+unlock:
+mutex_unlock(radio-lock);
+return retval;
}

/* vidioc_s_tuner - set tuner attributes */
@@ -367,12 +348,18 @@ static int vidioc_s_tuner(struct file *file, void 
*priv,

struct amradio_device *radio = video_get_drvdata(video_devdata(file));
int retval;

+mutex_lock(radio-lock);
+
/* safety check */
-if (radio-removed)
-return -EIO;
+if (radio-removed) {
+retval = -EIO;
+goto unlock;
+}

-if (v-index  0)
-return -EINVAL;
+if (v-index  0) {
+retval = -EINVAL;
+goto unlock;
+}

/* mono/stereo selector */
switch (v-audmode) {
@@ -389,10 +376,12 @@ static int vidioc_s_tuner(struct file *file, void 
*priv,

set stereo failed\n);
break;
default:
-return -EINVAL;
+retval = -EINVAL;
 

[RFC/RFT 02/10] radio-mr800: simplify video_device allocation

2009-09-12 Thread David Ellingsworth

From 2839cd94e21123151c0fe6683991f5a3c88fa877 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Fri, 11 Sep 2009 23:59:22 -0400
Subject: [PATCH 02/10] mr800: simplify video_device allocation

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   53 
++--

1 files changed, 21 insertions(+), 32 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 8e96c8a..3129692 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -129,7 +129,7 @@ static int usb_amradio_resume(struct usb_interface 
*intf);

struct amradio_device {
/* reference to USB and video device */
struct usb_device *usbdev;
-struct video_device *videodev;
+struct video_device videodev;
struct v4l2_device v4l2_dev;

unsigned char *buffer;
@@ -272,7 +272,7 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)

mutex_unlock(radio-lock);

usb_set_intfdata(intf, NULL);
-video_unregister_device(radio-videodev);
+video_unregister_device(radio-videodev);
v4l2_device_disconnect(radio-v4l2_dev);
}

@@ -320,7 +320,7 @@ static int vidioc_g_tuner(struct file *file, void *priv,
 */
retval = amradio_set_stereo(radio, WANT_STEREO);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set stereo failed\n);

strcpy(v-name, FM);
@@ -366,13 +366,13 @@ static int vidioc_s_tuner(struct file *file, void 
*priv,

case V4L2_TUNER_MODE_MONO:
retval = amradio_set_stereo(radio, WANT_MONO);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set mono failed\n);
break;
case V4L2_TUNER_MODE_STEREO:
retval = amradio_set_stereo(radio, WANT_STEREO);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set stereo failed\n);
break;
default:
@@ -403,7 +403,7 @@ static int vidioc_s_frequency(struct file *file, 
void *priv,


retval = amradio_setfreq(radio, radio-curfreq);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set frequency failed\n);

unlock:
@@ -493,13 +493,13 @@ static int vidioc_s_ctrl(struct file *file, void 
*priv,

if (ctrl-value) {
retval = amradio_set_mute(radio, AMRADIO_STOP);
if (retval  0) {
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
amradio_stop failed\n);
}
} else {
retval = amradio_set_mute(radio, AMRADIO_START);
if (retval  0) {
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
amradio_start failed\n);
}
}
@@ -565,7 +565,7 @@ static int usb_amradio_open(struct file *file)

retval = amradio_set_mute(radio, AMRADIO_START);
if (retval  0) {
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
radio did not start up properly\n);
radio-users = 0;
goto unlock;
@@ -573,12 +573,12 @@ static int usb_amradio_open(struct file *file)

retval = amradio_set_stereo(radio, WANT_STEREO);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set stereo failed\n);

retval = amradio_setfreq(radio, radio-curfreq);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
set frequency failed\n);

unlock:
@@ -604,7 +604,7 @@ static int usb_amradio_close(struct file *file)
if (!radio-removed) {
retval = amradio_set_mute(radio, AMRADIO_STOP);
if (retval  0)
-amradio_dev_warn(radio-videodev-dev,
+amradio_dev_warn(radio-videodev.dev,
amradio_stop failed\n);
}

@@ -676,9 +676,6 @@ static void usb_amradio_video_device_release(struct 
video_device *videodev)

{
struct amradio_device *radio = video_get_drvdata(videodev);

-/* we call v4l to free radio-videodev */
-video_device_release(videodev);
-
v4l2_device_unregister(radio-v4l2_dev);

/* free rest memory */
@@ -718,20 +715,12 @@ static int usb_amradio_probe(struct usb_interface 
*intf,

return retval;
}

-radio-videodev = video_device_alloc();
-
-if (!radio-videodev) {
-dev_err(intf-dev, video_device_alloc failed\n);
-kfree(radio-buffer);
-kfree(radio);
-return -ENOMEM;
-}
-
-strlcpy(radio-videodev-name, v4l2_dev-name, 
sizeof(radio-videodev-name));

-radio-videodev-v4l2_dev = v4l2_dev;
-radio-videodev-fops 

[RFC/RFT 03/10] radio-mr800: simplify error paths in usb probe callback

2009-09-12 Thread David Ellingsworth

From 0cdbd79a6e87a8a2862a6c1309c8fdf83c80ba61 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:13:16 -0400
Subject: [PATCH 03/10] mr800: simplify error paths in usb probe callback

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   27 ---
1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 3129692..d01b96c 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -689,30 +689,29 @@ static int usb_amradio_probe(struct usb_interface 
*intf,

{
struct amradio_device *radio;
struct v4l2_device *v4l2_dev;
-int retval;
+int retval = 0;

radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);

if (!radio) {
dev_err(intf-dev, kmalloc for amradio_device failed\n);
-return -ENOMEM;
+retval = -ENOMEM;
+goto err;
}

radio-buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);

if (!radio-buffer) {
dev_err(intf-dev, kmalloc for radio-buffer failed\n);
-kfree(radio);
-return -ENOMEM;
+retval = -ENOMEM;
+goto err_nobuf;
}

v4l2_dev = radio-v4l2_dev;
retval = v4l2_device_register(intf-dev, v4l2_dev);
if (retval  0) {
dev_err(intf-dev, couldn't register v4l2_device\n);
-kfree(radio-buffer);
-kfree(radio);
-return retval;
+goto err_v4l2;
}

strlcpy(radio-videodev.name, v4l2_dev-name,
@@ -736,14 +735,20 @@ static int usb_amradio_probe(struct usb_interface 
*intf,

radio_nr);
if (retval  0) {
dev_err(intf-dev, could not register video device\n);
-v4l2_device_unregister(v4l2_dev);
-kfree(radio-buffer);
-kfree(radio);
-return -EIO;
+goto err_vdev;
}

usb_set_intfdata(intf, radio);
return 0;
+
+err_vdev:
+v4l2_device_unregister(v4l2_dev);
+err_v4l2:
+kfree(radio-buffer);
+err_nobuf:
+kfree(radio);
+err:
+return retval;
}

static int __init amradio_init(void)
--
1.6.3.3

From 0cdbd79a6e87a8a2862a6c1309c8fdf83c80ba61 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:13:16 -0400
Subject: [PATCH 03/10] mr800: simplify error paths in usb probe callback

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   27 ---
 1 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 3129692..d01b96c 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -689,30 +689,29 @@ static int usb_amradio_probe(struct usb_interface *intf,
 {
 	struct amradio_device *radio;
 	struct v4l2_device *v4l2_dev;
-	int retval;
+	int retval = 0;
 
 	radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);
 
 	if (!radio) {
 		dev_err(intf-dev, kmalloc for amradio_device failed\n);
-		return -ENOMEM;
+		retval = -ENOMEM;
+		goto err;
 	}
 
 	radio-buffer = kmalloc(BUFFER_LENGTH, GFP_KERNEL);
 
 	if (!radio-buffer) {
 		dev_err(intf-dev, kmalloc for radio-buffer failed\n);
-		kfree(radio);
-		return -ENOMEM;
+		retval = -ENOMEM;
+		goto err_nobuf;
 	}
 
 	v4l2_dev = radio-v4l2_dev;
 	retval = v4l2_device_register(intf-dev, v4l2_dev);
 	if (retval  0) {
 		dev_err(intf-dev, couldn't register v4l2_device\n);
-		kfree(radio-buffer);
-		kfree(radio);
-		return retval;
+		goto err_v4l2;
 	}
 
 	strlcpy(radio-videodev.name, v4l2_dev-name,
@@ -736,14 +735,20 @@ static int usb_amradio_probe(struct usb_interface *intf,
 	radio_nr);
 	if (retval  0) {
 		dev_err(intf-dev, could not register video device\n);
-		v4l2_device_unregister(v4l2_dev);
-		kfree(radio-buffer);
-		kfree(radio);
-		return -EIO;
+		goto err_vdev;
 	}
 
 	usb_set_intfdata(intf, radio);
 	return 0;
+
+err_vdev:
+	v4l2_device_unregister(v4l2_dev);
+err_v4l2:
+	kfree(radio-buffer);
+err_nobuf:
+	kfree(radio);
+err:
+	return retval;
 }
 
 static int __init amradio_init(void)
-- 
1.6.3.3



[RFC/RFT 04/10] radio-mr800: remove unnecessary local variable

2009-09-12 Thread David Ellingsworth

From f2fdb83ce649e9e69413ab533ec4a84d96850ed4 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:19:48 -0400
Subject: [PATCH 04/10] mr800: remove unnecessary local variable

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   10 --
1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index d01b96c..fb99c6b 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -688,7 +688,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
const struct usb_device_id *id)
{
struct amradio_device *radio;
-struct v4l2_device *v4l2_dev;
int retval = 0;

radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);
@@ -707,16 +706,15 @@ static int usb_amradio_probe(struct usb_interface 
*intf,

goto err_nobuf;
}

-v4l2_dev = radio-v4l2_dev;
-retval = v4l2_device_register(intf-dev, v4l2_dev);
+retval = v4l2_device_register(intf-dev, radio-v4l2_dev);
if (retval  0) {
dev_err(intf-dev, couldn't register v4l2_device\n);
goto err_v4l2;
}

-strlcpy(radio-videodev.name, v4l2_dev-name,
+strlcpy(radio-videodev.name, radio-v4l2_dev.name,
sizeof(radio-videodev.name));
-radio-videodev.v4l2_dev = v4l2_dev;
+radio-videodev.v4l2_dev = radio-v4l2_dev;
radio-videodev.fops = usb_amradio_fops;
radio-videodev.ioctl_ops = usb_amradio_ioctl_ops;
radio-videodev.release = usb_amradio_video_device_release;
@@ -742,7 +740,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
return 0;

err_vdev:
-v4l2_device_unregister(v4l2_dev);
+v4l2_device_unregister(radio-v4l2_dev);
err_v4l2:
kfree(radio-buffer);
err_nobuf:
--
1.6.3.3

From f2fdb83ce649e9e69413ab533ec4a84d96850ed4 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:19:48 -0400
Subject: [PATCH 04/10] mr800: remove unnecessary local variable

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   10 --
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index d01b96c..fb99c6b 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -688,7 +688,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
 const struct usb_device_id *id)
 {
 	struct amradio_device *radio;
-	struct v4l2_device *v4l2_dev;
 	int retval = 0;
 
 	radio = kzalloc(sizeof(struct amradio_device), GFP_KERNEL);
@@ -707,16 +706,15 @@ static int usb_amradio_probe(struct usb_interface *intf,
 		goto err_nobuf;
 	}
 
-	v4l2_dev = radio-v4l2_dev;
-	retval = v4l2_device_register(intf-dev, v4l2_dev);
+	retval = v4l2_device_register(intf-dev, radio-v4l2_dev);
 	if (retval  0) {
 		dev_err(intf-dev, couldn't register v4l2_device\n);
 		goto err_v4l2;
 	}
 
-	strlcpy(radio-videodev.name, v4l2_dev-name,
+	strlcpy(radio-videodev.name, radio-v4l2_dev.name,
 		sizeof(radio-videodev.name));
-	radio-videodev.v4l2_dev = v4l2_dev;
+	radio-videodev.v4l2_dev = radio-v4l2_dev;
 	radio-videodev.fops = usb_amradio_fops;
 	radio-videodev.ioctl_ops = usb_amradio_ioctl_ops;
 	radio-videodev.release = usb_amradio_video_device_release;
@@ -742,7 +740,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
 	return 0;
 
 err_vdev:
-	v4l2_device_unregister(v4l2_dev);
+	v4l2_device_unregister(radio-v4l2_dev);
 err_v4l2:
 	kfree(radio-buffer);
 err_nobuf:
-- 
1.6.3.3



[RFC/RFT 05/10] radio-mr800: simplify access to amradio_device

2009-09-12 Thread David Ellingsworth

From 762337020b7744f791fc02fff7eb983e3e4a2346 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:45:28 -0400
Subject: [PATCH 05/10] mr800: simplify access to amradio_device

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   23 +--
1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index fb99c6b..7305c96 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -141,6 +141,8 @@ struct amradio_device {
int muted;
};

+#define vdev_to_amradio(r) container_of(r, struct amradio_device, videodev)
+
/* USB Device ID List */
static struct usb_device_id usb_amradio_device_table[] = {
{USB_DEVICE_AND_INTERFACE_INFO(USB_AMRADIO_VENDOR, USB_AMRADIO_PRODUCT,
@@ -280,7 +282,7 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)

static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *v)
{
-struct amradio_device *radio = video_drvdata(file);
+struct amradio_device *radio = file-private_data;

strlcpy(v-driver, radio-mr800, sizeof(v-driver));
strlcpy(v-card, AverMedia MR 800 USB FM Radio, sizeof(v-card));
@@ -294,7 +296,7 @@ static int vidioc_querycap(struct file *file, void 
*priv,

static int vidioc_g_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval;

mutex_lock(radio-lock);
@@ -345,7 +347,7 @@ unlock:
static int vidioc_s_tuner(struct file *file, void *priv,
struct v4l2_tuner *v)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval;

mutex_lock(radio-lock);
@@ -388,7 +390,7 @@ unlock:
static int vidioc_s_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval;

mutex_lock(radio-lock);
@@ -415,7 +417,7 @@ unlock:
static int vidioc_g_frequency(struct file *file, void *priv,
struct v4l2_frequency *f)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval = 0;

mutex_lock(radio-lock);
@@ -450,7 +452,7 @@ static int vidioc_queryctrl(struct file *file, void 
*priv,

static int vidioc_g_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval = -EINVAL;

mutex_lock(radio-lock);
@@ -477,7 +479,7 @@ unlock:
static int vidioc_s_ctrl(struct file *file, void *priv,
struct v4l2_control *ctrl)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval = -EINVAL;

mutex_lock(radio-lock);
@@ -550,7 +552,7 @@ static int vidioc_s_input(struct file *filp, void 
*priv, unsigned int i)

/* open device - amradio_start() and amradio_setfreq() */
static int usb_amradio_open(struct file *file)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = vdev_to_amradio(video_devdata(file));
int retval = 0;

mutex_lock(radio-lock);
@@ -560,6 +562,7 @@ static int usb_amradio_open(struct file *file)
goto unlock;
}

+file-private_data = radio;
radio-users = 1;
radio-muted = 1;

@@ -589,7 +592,7 @@ unlock:
/*close device */
static int usb_amradio_close(struct file *file)
{
-struct amradio_device *radio = video_get_drvdata(video_devdata(file));
+struct amradio_device *radio = file-private_data;
int retval = 0;

mutex_lock(radio-lock);
@@ -674,7 +677,7 @@ static const struct v4l2_ioctl_ops 
usb_amradio_ioctl_ops = {


static void usb_amradio_video_device_release(struct video_device *videodev)
{
-struct amradio_device *radio = video_get_drvdata(videodev);
+struct amradio_device *radio = vdev_to_amradio(videodev);

v4l2_device_unregister(radio-v4l2_dev);

--
1.6.3.3

From 762337020b7744f791fc02fff7eb983e3e4a2346 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 00:45:28 -0400
Subject: [PATCH 05/10] mr800: simplify access to amradio_device

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   23 +--
 1 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index fb99c6b..7305c96 100644

[RFC/RFT 06/10] radio-mr800: simplify locking in ioctl callbacks

2009-09-12 Thread David Ellingsworth

From c012b1ac39a225e003b190a12ae942e1dd6ea09b Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 01:07:13 -0400
Subject: [PATCH 06/10] mr800: simplify locking in ioctl callbacks

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |  109 
++---

1 files changed, 30 insertions(+), 79 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 7305c96..71d15ba 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -299,18 +299,8 @@ static int vidioc_g_tuner(struct file *file, void 
*priv,

struct amradio_device *radio = file-private_data;
int retval;

-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}
-
-if (v-index  0) {
-retval = -EINVAL;
-goto unlock;
-}
+if (v-index  0)
+return -EINVAL;

/* TODO: Add function which look is signal stereo or not
 * amradio_getstat(radio);
@@ -338,8 +328,6 @@ static int vidioc_g_tuner(struct file *file, void *priv,
v-signal = 0x; /* Can't get the signal strength, sad.. */
v-afc = 0; /* Don't know what is this */

-unlock:
-mutex_unlock(radio-lock);
return retval;
}

@@ -348,20 +336,10 @@ static int vidioc_s_tuner(struct file *file, void 
*priv,

struct v4l2_tuner *v)
{
struct amradio_device *radio = file-private_data;
-int retval;
-
-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}
+int retval = -EINVAL;

-if (v-index  0) {
-retval = -EINVAL;
-goto unlock;
-}
+if (v-index  0)
+return -EINVAL;

/* mono/stereo selector */
switch (v-audmode) {
@@ -377,12 +355,8 @@ static int vidioc_s_tuner(struct file *file, void 
*priv,

amradio_dev_warn(radio-videodev.dev,
set stereo failed\n);
break;
-default:
-retval = -EINVAL;
}

-unlock:
-mutex_unlock(radio-lock);
return retval;
}

@@ -391,15 +365,7 @@ static int vidioc_s_frequency(struct file *file, 
void *priv,

struct v4l2_frequency *f)
{
struct amradio_device *radio = file-private_data;
-int retval;
-
-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}
+int retval = 0;

radio-curfreq = f-frequency;

@@ -408,8 +374,6 @@ static int vidioc_s_frequency(struct file *file, 
void *priv,

amradio_dev_warn(radio-videodev.dev,
set frequency failed\n);

-unlock:
-mutex_unlock(radio-lock);
return retval;
}

@@ -418,22 +382,11 @@ static int vidioc_g_frequency(struct file *file, 
void *priv,

struct v4l2_frequency *f)
{
struct amradio_device *radio = file-private_data;
-int retval = 0;
-
-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}

f-type = V4L2_TUNER_RADIO;
f-frequency = radio-curfreq;

-unlock:
-mutex_unlock(radio-lock);
-return retval;
+return 0;
}

/* vidioc_queryctrl - enumerate control items */
@@ -453,26 +406,14 @@ static int vidioc_g_ctrl(struct file *file, void 
*priv,

struct v4l2_control *ctrl)
{
struct amradio_device *radio = file-private_data;
-int retval = -EINVAL;
-
-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}

switch (ctrl-id) {
case V4L2_CID_AUDIO_MUTE:
ctrl-value = radio-muted;
-retval = 0;
-break;
+return 0;
}

-unlock:
-mutex_unlock(radio-lock);
-return retval;
+return -EINVAL;
}

/* vidioc_s_ctrl - set the value of a control */
@@ -482,14 +423,6 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
struct amradio_device *radio = file-private_data;
int retval = -EINVAL;

-mutex_lock(radio-lock);
-
-/* safety check */
-if (radio-removed) {
-retval = -EIO;
-goto unlock;
-}
-
switch (ctrl-id) {
case V4L2_CID_AUDIO_MUTE:
if (ctrl-value) {
@@ -508,8 +441,6 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
break;
}

-unlock:
-mutex_unlock(radio-lock);
return retval;
}

@@ -616,6 +547,26 @@ unlock:
return retval;
}

+static long usb_amradio_ioctl(struct file *file, unsigned int cmd,
+unsigned long arg)
+{
+struct amradio_device *radio = file-private_data;
+long retval = 0;
+
+mutex_lock(radio-lock);
+
+if (radio-removed) {
+retval = -EIO;
+goto unlock;
+}
+
+retval = video_ioctl2(file, cmd, arg);
+
+unlock:
+mutex_unlock(radio-lock);
+return retval;
+}
+
/* Suspend device - stop 

[RFC/RFT 07/10] radio-mr800: remove device removed indicator

2009-09-12 Thread David Ellingsworth

From a9b0a308892919514efc692f2a0e28b80ea304ac Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 01:22:57 -0400
Subject: [PATCH 07/10] mr800: remove device removed indicator

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   20 
1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 71d15ba..9fd2342 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -137,7 +137,6 @@ struct amradio_device {
int curfreq;
int stereo;
int users;
-int removed;
int muted;
};

@@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)

struct amradio_device *radio = usb_get_intfdata(intf);

mutex_lock(radio-lock);
-radio-removed = 1;
+radio-usbdev = NULL;
mutex_unlock(radio-lock);

usb_set_intfdata(intf, NULL);
@@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file)

mutex_lock(radio-lock);

-if (radio-removed) {
+if (!radio-usbdev) {
retval = -EIO;
goto unlock;
}
@@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file)

mutex_lock(radio-lock);

-if (radio-removed) {
+if (!radio-usbdev) {
retval = -EIO;
goto unlock;
}

radio-users = 0;

-if (!radio-removed) {
-retval = amradio_set_mute(radio, AMRADIO_STOP);
-if (retval  0)
-amradio_dev_warn(radio-videodev.dev,
-amradio_stop failed\n);
-}
+retval = amradio_set_mute(radio, AMRADIO_STOP);
+if (retval  0)
+amradio_dev_warn(radio-videodev.dev,
+amradio_stop failed\n);

unlock:
mutex_unlock(radio-lock);
@@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, 
unsigned int cmd,


mutex_lock(radio-lock);

-if (radio-removed) {
+if (!radio-usbdev) {
retval = -EIO;
goto unlock;
}
@@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
radio-videodev.ioctl_ops = usb_amradio_ioctl_ops;
radio-videodev.release = usb_amradio_video_device_release;

-radio-removed = 0;
radio-users = 0;
radio-usbdev = interface_to_usbdev(intf);
radio-curfreq = 95.16 * FREQ_MUL;
--
1.6.3.3

From a9b0a308892919514efc692f2a0e28b80ea304ac Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 01:22:57 -0400
Subject: [PATCH 07/10] mr800: remove device removed indicator

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   20 
 1 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 71d15ba..9fd2342 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -137,7 +137,6 @@ struct amradio_device {
 	int curfreq;
 	int stereo;
 	int users;
-	int removed;
 	int muted;
 };
 
@@ -270,7 +269,7 @@ static void usb_amradio_disconnect(struct usb_interface *intf)
 	struct amradio_device *radio = usb_get_intfdata(intf);
 
 	mutex_lock(radio-lock);
-	radio-removed = 1;
+	radio-usbdev = NULL;
 	mutex_unlock(radio-lock);
 
 	usb_set_intfdata(intf, NULL);
@@ -488,7 +487,7 @@ static int usb_amradio_open(struct file *file)
 
 	mutex_lock(radio-lock);
 
-	if (radio-removed) {
+	if (!radio-usbdev) {
 		retval = -EIO;
 		goto unlock;
 	}
@@ -528,19 +527,17 @@ static int usb_amradio_close(struct file *file)
 
 	mutex_lock(radio-lock);
 
-	if (radio-removed) {
+	if (!radio-usbdev) {
 		retval = -EIO;
 		goto unlock;
 	}
 
 	radio-users = 0;
 
-	if (!radio-removed) {
-		retval = amradio_set_mute(radio, AMRADIO_STOP);
-		if (retval  0)
-			amradio_dev_warn(radio-videodev.dev,
-amradio_stop failed\n);
-	}
+	retval = amradio_set_mute(radio, AMRADIO_STOP);
+	if (retval  0)
+		amradio_dev_warn(radio-videodev.dev,
+			amradio_stop failed\n);
 
 unlock:
 	mutex_unlock(radio-lock);
@@ -555,7 +552,7 @@ static long usb_amradio_ioctl(struct file *file, unsigned int cmd,
 
 	mutex_lock(radio-lock);
 
-	if (radio-removed) {
+	if (!radio-usbdev) {
 		retval = -EIO;
 		goto unlock;
 	}
@@ -673,7 +670,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
 	radio-videodev.ioctl_ops = usb_amradio_ioctl_ops;
 	radio-videodev.release = usb_amradio_video_device_release;
 
-	radio-removed = 0;
 	radio-users = 0;
 	radio-usbdev = interface_to_usbdev(intf);
 	radio-curfreq = 95.16 * FREQ_MUL;
-- 
1.6.3.3



[RFC/RFT 08/10] radio-mr800: turn radio on during first open and off during last close

2009-09-12 Thread David Ellingsworth

From 46c7d395e4ed2df431b21b6c07fb02a075a15e43 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 01:57:36 -0400
Subject: [PATCH 08/10] mr800: turn radio on during first open and off 
during last close


Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   31 +--
1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..11db6ea 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -493,15 +493,14 @@ static int usb_amradio_open(struct file *file)
}

file-private_data = radio;
-radio-users = 1;
-radio-muted = 1;

-retval = amradio_set_mute(radio, AMRADIO_START);
-if (retval  0) {
-amradio_dev_warn(radio-videodev.dev,
-radio did not start up properly\n);
-radio-users = 0;
-goto unlock;
+if (radio-users == 0) {
+retval = amradio_set_mute(radio, AMRADIO_START);
+if (retval  0) {
+amradio_dev_warn(radio-videodev.dev,
+radio did not start up properly\n);
+goto unlock;
+}
}

retval = amradio_set_stereo(radio, WANT_STEREO);
@@ -514,6 +513,8 @@ static int usb_amradio_open(struct file *file)
amradio_dev_warn(radio-videodev.dev,
set frequency failed\n);

+radio-users++;
+
unlock:
mutex_unlock(radio-lock);
return retval;
@@ -526,18 +527,19 @@ static int usb_amradio_close(struct file *file)
int retval = 0;

mutex_lock(radio-lock);
+radio-users--;

if (!radio-usbdev) {
retval = -EIO;
goto unlock;
}

-radio-users = 0;
-
-retval = amradio_set_mute(radio, AMRADIO_STOP);
-if (retval  0)
-amradio_dev_warn(radio-videodev.dev,
-amradio_stop failed\n);
+if (radio-users == 0  !radio-muted) {
+retval = amradio_set_mute(radio, AMRADIO_STOP);
+if (retval  0)
+amradio_dev_warn(radio-videodev.dev,
+amradio_stop failed\n);
+}

unlock:
mutex_unlock(radio-lock);
@@ -674,6 +676,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
radio-usbdev = interface_to_usbdev(intf);
radio-curfreq = 95.16 * FREQ_MUL;
radio-stereo = -1;
+radio-muted = 1;

mutex_init(radio-lock);

--
1.6.3.3

From 46c7d395e4ed2df431b21b6c07fb02a075a15e43 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 01:57:36 -0400
Subject: [PATCH 08/10] mr800: turn radio on during first open and off during last close

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   31 +--
 1 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 9fd2342..11db6ea 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -493,15 +493,14 @@ static int usb_amradio_open(struct file *file)
 	}
 
 	file-private_data = radio;
-	radio-users = 1;
-	radio-muted = 1;
 
-	retval = amradio_set_mute(radio, AMRADIO_START);
-	if (retval  0) {
-		amradio_dev_warn(radio-videodev.dev,
-			radio did not start up properly\n);
-		radio-users = 0;
-		goto unlock;
+	if (radio-users == 0) {
+		retval = amradio_set_mute(radio, AMRADIO_START);
+		if (retval  0) {
+			amradio_dev_warn(radio-videodev.dev,
+radio did not start up properly\n);
+			goto unlock;
+		}
 	}
 
 	retval = amradio_set_stereo(radio, WANT_STEREO);
@@ -514,6 +513,8 @@ static int usb_amradio_open(struct file *file)
 		amradio_dev_warn(radio-videodev.dev,
 			set frequency failed\n);
 
+	radio-users++;
+
 unlock:
 	mutex_unlock(radio-lock);
 	return retval;
@@ -526,18 +527,19 @@ static int usb_amradio_close(struct file *file)
 	int retval = 0;
 
 	mutex_lock(radio-lock);
+	radio-users--;
 
 	if (!radio-usbdev) {
 		retval = -EIO;
 		goto unlock;
 	}
 
-	radio-users = 0;
-
-	retval = amradio_set_mute(radio, AMRADIO_STOP);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			amradio_stop failed\n);
+	if (radio-users == 0  !radio-muted) {
+		retval = amradio_set_mute(radio, AMRADIO_STOP);
+		if (retval  0)
+			amradio_dev_warn(radio-videodev.dev,
+amradio_stop failed\n);
+	}
 
 unlock:
 	mutex_unlock(radio-lock);
@@ -674,6 +676,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
 	radio-usbdev = interface_to_usbdev(intf);
 	radio-curfreq = 95.16 * FREQ_MUL;
 	radio-stereo = -1;
+	radio-muted = 1;
 
 	mutex_init(radio-lock);
 
-- 
1.6.3.3



[RFC/RFT 09/10] radio-mr800: preserve radio state during suspend/resume

2009-09-12 Thread David Ellingsworth

From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 02:05:57 -0400
Subject: [PATCH 09/10] mr800: preserve radio state during suspend/resume

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |   17 +++--
1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 11db6ea..10bed62 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -574,9 +574,12 @@ static int usb_amradio_suspend(struct usb_interface 
*intf, pm_message_t message)


mutex_lock(radio-lock);

-retval = amradio_set_mute(radio, AMRADIO_STOP);
-if (retval  0)
-dev_warn(intf-dev, amradio_stop failed\n);
+if (!radio-muted) {
+retval = amradio_set_mute(radio, AMRADIO_STOP);
+if (retval  0)
+dev_warn(intf-dev, amradio_stop failed\n);
+radio-muted = 0;
+}

dev_info(intf-dev, going into suspend..\n);

@@ -592,9 +595,11 @@ static int usb_amradio_resume(struct usb_interface 
*intf)


mutex_lock(radio-lock);

-retval = amradio_set_mute(radio, AMRADIO_START);
-if (retval  0)
-dev_warn(intf-dev, amradio_start failed\n);
+if (!radio-muted) {
+retval = amradio_set_mute(radio, AMRADIO_START);
+if (retval  0)
+dev_warn(intf-dev, amradio_start failed\n);
+}

dev_info(intf-dev, coming out of suspend..\n);

--
1.6.3.3

From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 02:05:57 -0400
Subject: [PATCH 09/10] mr800: preserve radio state during suspend/resume

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 11db6ea..10bed62 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -574,9 +574,12 @@ static int usb_amradio_suspend(struct usb_interface *intf, pm_message_t message)
 
 	mutex_lock(radio-lock);
 
-	retval = amradio_set_mute(radio, AMRADIO_STOP);
-	if (retval  0)
-		dev_warn(intf-dev, amradio_stop failed\n);
+	if (!radio-muted) {
+		retval = amradio_set_mute(radio, AMRADIO_STOP);
+		if (retval  0)
+			dev_warn(intf-dev, amradio_stop failed\n);
+		radio-muted = 0;
+	}
 
 	dev_info(intf-dev, going into suspend..\n);
 
@@ -592,9 +595,11 @@ static int usb_amradio_resume(struct usb_interface *intf)
 
 	mutex_lock(radio-lock);
 
-	retval = amradio_set_mute(radio, AMRADIO_START);
-	if (retval  0)
-		dev_warn(intf-dev, amradio_start failed\n);
+	if (!radio-muted) {
+		retval = amradio_set_mute(radio, AMRADIO_START);
+		if (retval  0)
+			dev_warn(intf-dev, amradio_start failed\n);
+	}
 
 	dev_info(intf-dev, coming out of suspend..\n);
 
-- 
1.6.3.3



[RFC/RFT 10/10] radio-mr800: fix potential use after free

2009-09-12 Thread David Ellingsworth

From 987d22363c7a55a5e48a2746a61a6d805fef8661 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 02:35:22 -0400
Subject: [PATCH 10/10] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 10bed62..806523c 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From 987d22363c7a55a5e48a2746a61a6d805fef8661 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 02:35:22 -0400
Subject: [PATCH 10/10] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 10bed62..806523c 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct usb_interface *intf)
 
 	usb_set_intfdata(intf, NULL);
 	video_unregister_device(radio-videodev);
-	v4l2_device_disconnect(radio-v4l2_dev);
 }
 
 /* vidioc_querycap - query device capabilities */
-- 
1.6.3.3



Re: image quality of Labtec Webcam 2200

2009-09-12 Thread leandro Costantino
Nice, i will take a look.
Anyway, be aware, that the conversion error, is something expected
on pac7311, in fact, Hans have commented that on the libv4lconvert.
..
if (result) {
/* Pixart webcam's seem to regulary generate corrupt frames, which
   are best thrown away to avoid flashes in the video stream. Tell
   the upper layer this is an intermediate fault and it should try
   again with a new buffer by setting errno to EAGAIN */
if (src_pix_fmt == V4L2_PIX_FMT_PJPG ||
data-flags  V4LCONVERT_IS_SN9C20X) {
  V4LCONVERT_ERR(decompressing JPEG: %s,
tinyjpeg_get_errorstring(data-jdec));
  errno = EAGAIN;
  return -1;

That's the result of the EAGAIN.

About, the half brightness picture, did that happens when autogain is off?
Best Regards
On Sat, Sep 12, 2009 at 2:16 AM, Németh Márton nm...@freemail.hu wrote:
 Hello,

 thank you for looking at this topic.

 leandro Costantino wrote:
  Hi ,
  i tested it with 2.6.31-rc9  libvl 0.6.1 + svv  and cannot reproduce.
 
  301147.626826] gspca: probing 093a:2626
  [301147.641578] gspca: probe ok
  [301147.641607] gspca: probing 093a:2626
  [301147.641770] gspca: probing 093a:2626
  [301147.641829] usbcore: registered new interface driver pac7311
  [301147.641835] pac7311: registered

 I have the same dmesg output. My Labtec Webcam 2200 has the following labels
 on the cable:

 M/N: V-UCE52
 P/N: 860-73
 PID: CE73902

 Maybe there is more than one revision of the Labtec Webcam 2200 and I have
 one with a different hardware/firmware inside?

  Could you try testing with svv.c app?

 I used a bit modified svv.c to create the measurement result. The
 modifications are to create the output HTML report and save the raw
 and the BMP images. The display is not correct because I changed
 the format from V4L2_PIX_FMT_RGB24 to V4L2_PIX_FMT_BGR24 to easily
 save the result to BMP. The source code quality is not the best,
 I am sorry about that, but I can still attach my source code which I
 modified a little bit since my last report.

  pd: quality is not the best, but works ok. Seem that the format is not
  the proper or expected pjpeg on your streaming.

 Do you think about USB transfer problem?

 Regards,

        Márton Németh

  2009/9/11 Németh Márton nm...@freemail.hu:
  Márton Németh wrote:
  Hi,
 
  I have a Labtec Webcam 2200 and I have problems with the image quality
  with Linux 2.6.31 + libv4l 0.6.1. I made some experiments and stored
  each captured image as raw data and when libv4l was able to convert
  then I also stored the result as bmp.
 
  You can find my results at 
  http://v4l-test.sourceforge.net/results/test-20090911/index.html
  There are three types of problems:
   a) Sometimes the picture contains a 8x8 pixel error, like in image #9
      
  http://v4l-test.sourceforge.net/results/test-20090911/index.html#img9
   b) Sometimes the brightness of the half picture is changed, like in
      images #7, #36 and #37
      
  http://v4l-test.sourceforge.net/results/test-20090911/index.html#img7
      
  http://v4l-test.sourceforge.net/results/test-20090911/index.html#img00036
      
  http://v4l-test.sourceforge.net/results/test-20090911/index.html#img00037
   c) Sometimes the libv4l cannot convert the raw image and the errno
      is set to EAGAIN (11), for example image #1, #2 and #3
 
  Do you know how can I fix these problems?
  I investigated the c) point a little bit. When I get a negative return 
  value
  from the v4lconvert_convert() function then I print out the error 
  message what the
  v4lconvert_get_error_message() function returns. With the result log file
  I executed a grep v4l-convert |sort |uniq command. All the error 
  messages are
  coming from the tinyjpeg.c (Small jpeg decoder library):
 
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (65) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (66) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (67) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (68) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (69) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (70) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (71) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (72) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (73) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (75) in huffman unit
  v4l-convert: error decompressing JPEG: error: more then 63 AC components 
  (76) in huffman unit
  v4l-convert: error decompressing JPEG: Pixart JPEG error: 

Re: [linux-dvb] Leadtek WinFast DTV Dongle Gold Remote y04g0051 issues

2009-09-12 Thread Antti Palosaari

On 09/11/2009 07:30 PM, Matthew Skinner, PC Mus wrote:

I have the Leadtek WinFast DTV Dongle Gold which uses the af9015 chip and
the y04g0051 remote, after a lot of reading I now have the remote partially
working as only half of the keys are sending codes to irw

I read this thread and noticed that the exact keys which work are the ones
listed with reported codes.



http://www.linuxtv.org/pipermail/linux-dvb/2008-July/027058.html



The keys not mentioned in that thread are the ones not working, so I guess
the extra codes need to be reported to someone to be added into a new build?



Can I help in providing these codes and some testing.


You could send missing button codes to me and I will add those to the 
driver. There is debug switch which shows remote events, it is debug=2.


remove driver from memory
# rmmod dvb-usb-af9015

# load driver with needed debug
modprobe dvb-usb-af9015 debug=2

# look codes from log
tail -f /var/log/messages

I am not sure if debugs are enabled with your system build, but if not 
you will need to install and compile current v4l-dvb master.


Antti
--
http://palosaari.fi/
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: LinuxTV firmware blocks all wireless connections / traffic

2009-09-12 Thread CityK
Aleksandr V. Piskunov wrote:
 I'm getting closer to pinpointing the real problem and so far
 everything points to AMD SB700 chipset driver. Google says it has quite
 some hardware bugs and several workarounds in linux drivers...

If your googling didn't turn them up already, here's some more threads:

http://www.mail-archive.com/search?q=SB700+l=linux-media%40vger.kernel.org
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Mauro Carvalho Chehab
Em Sat, 12 Sep 2009 17:12:35 +0200
Hans Verkuil hverk...@xs4all.nl escreveu:

  Why? Nothing stops discussing it there and better prepare a proposal, but,
  considering all the noise we had after the DVB S2API last year, I don't 
  think
  we should ever repeat using a conference, where only some of us will be 
  there
  to approve a proposal. It is the right forum for discussing and better 
  formulate
  the issues, in order to prepare a proposal, but the decisions should happen 
  at
  the ML.
 
 In that particular case you would have had a lot of noise no matter what you
 did :-)

True.

 The final decisions will indeed be taken here, but the conference is an
 excellent place to talk face-to-face and to see how well the current proposal
 will fit actual media hardware.
 
 I don't have complete access or knowledge of all the current and upcoming
 media boards, but there are several TI and Nokia engineers present who can
 help with that. Also interesting is to see how and if the framework can be
 extended to dvb.

As I've said at #irc, it would be really great if you could find some ways for
remote people to participate, maybe setting an audio conference channel. I
think we should try to discuss with LPC runners if we can find some ways for it.

I would love to discuss this there with you, but this year's budget and
logistics didn't allow. For those that will also be in Japan for JLC, we can
compliment there with some useful face-to-face discussions.
 
  Hans took a year to prepare RFCv2, and we all know that he was hardly
  working on implementing what was discussed during the first RFC proposal 
  during
  all those timeframe. This shows that this is a complex matter.
 
 Not entirely true, I worked on the necessary building blocks for such a media
 controller in the past year. There is a reason why it only took me 400-odd
 lines to get the basic mc support in...

Yes, I know. having the drivers using the framework is for sure the first step.
Yet, unfortunately, this means that we'll still need to do lots of work with
the webcam and dvb drivers for them to use the i2c kernel support and the
proper media core. As some webcams has audio input streaming over USB, it is
important to extend media controller features also to them.

  Yes, let's do it for 2.6.33, but it this discussion started too late for 
  2.6.32.
 
 I don't think anyone advocated getting anything merged for 2.6.32. Certainly
 not me. I'm not even sure whether 2.6.33 is feasible: before we merge anything
 I'd really like to see it implemented in e.g. omap3, uvcvideo and ivtv at the
 least. The proof of the pudding is in the eating, and since this is meant to
 cover a wide range of media boards we should have some idea if theory and
 practice actually match.
 
 Personally I think that the fact that I got an initial version implemented so
 quickly is very promising.
 
 I'm currently trying to get ivtv media-controller-aware. It's probably the
 most complex driver when it comes to topology that I have access to, so that
 would be a good test case.

The most complex hardware for PC I'm aware is the cx25821. Unfortunately, the
driver is currently in bad shape, in terms of CodingStyle (including the
removal of large blocks of code that are repeated several times along the
driver), needing lots of changes in order to get merged.

For those interested, the code is at:
http://linuxtv.org/hg/~mchehab/cx25821/

I'll likely do some work on it during this merge window for its inclusion
upstream (probably at drivers/staging - since I doubt we'll have enough time to
clean it up right now).

It has several blocks that can be used for video in and video out. The current
driver has support for 8 simultaneous video inputs and 4 simultaneous video
output. I'm not sure, but I won't doubt that you can exchange inputs and
outputs or even group them. So, this is a good candidate for some media
controller tests. I'll try to do it via sysfs, running some tests and post the
results.

Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: problem building v4l2-spec from docbook source

2009-09-12 Thread Mauro Carvalho Chehab
Em Wed, 09 Sep 2009 00:07:05 -0400
CityK ci...@rogers.com escreveu:

 We've got too many entry points/links to things -- which lends itself to
 becoming a maintenance nightmare  (not blaming anyone, just pointing out
 the obvious).  For example:  although the updated info was applied here:
 http://www.linuxtv.org/docs.php, we have other avenues such as
 http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/  (as linked
 to by, for example,  from here
 :http://www.linuxtv.org/wiki/index.php/Development:_Video4Linux_APIs)
 that do not reflect those changes, and hence we have inconsistent info
 across the board. 

In fact, docs.php currently points to the downloads page. Also, this is updated
daily via script. I intend to run the same proccess also for the new DocBook
DVB API spec. Anyway, i agree that we should have a consistent place for
storing the docs.

 
 Same goes with mailing lists and #irc channels -- we've got too many of
 them! ... /trails off mumbling about this and thatmumble mumble
 mumble grumble
 --
 To unsubscribe from this list: send the line unsubscribe linux-media in
 the body of a message to majord...@vger.kernel.org
 More majordomo info at  http://vger.kernel.org/majordomo-info.html




Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Arm changes upstream

2009-09-12 Thread Mauro Carvalho Chehab
Hi Guennadi and Murali,

I'm working on cleaning up our pending -arm patches for their upstream
inclusion.

As a first step, I ran a diff between our linux-next tree and -hg and I found
a number of changes that should, be applied at our tree, for it to reflect what
we have currently at linux-next.

This probably means that we'll need to change versions.txt for it to reflect
that the drivers will compile only with 2.6.31 (or 2.6.32 or upper).

As, even if the changes are wrong, we'll need to add a fix at linux-next, I'll
merge it at -hg right now. Yet, could you please double check if everything is
ok upstream, or if some patches are needed there, in order to fix git bisect?

Also, could you please provide the proper versions.txt patches?

Cheers,
Mauro

diff -upr oldtree/arch/arm/mach-pxa/pcm990-baseboard.c 
/home/v4l/tokernel/wrk/linux-next/arch/arm/mach-pxa/pcm990-baseboard.c
--- oldtree/arch/arm/mach-pxa/pcm990-baseboard.c2009-09-12 
13:15:41.0 -0300
+++ /home/v4l/tokernel/wrk/linux-next/arch/arm/mach-pxa/pcm990-baseboard.c  
2009-09-12 13:01:16.0 -0300
@@ -427,56 +427,25 @@ static void pcm990_camera_free_bus(struc
gpio_bus_switch = -EINVAL;
 }
 
+static struct soc_camera_link iclink = {
+   .bus_id = 0, /* Must match with the camera ID above */
+   .query_bus_param = pcm990_camera_query_bus_param,
+   .set_bus_param = pcm990_camera_set_bus_param,
+   .free_bus = pcm990_camera_free_bus,
+};
+
 /* Board I2C devices. */
 static struct i2c_board_info __initdata pcm990_i2c_devices[] = {
{
/* Must initialize before the camera(s) */
I2C_BOARD_INFO(pca9536, 0x41),
.platform_data = pca9536_data,
-   },
-};
-
-static struct i2c_board_info pcm990_camera_i2c[] = {
-   {
+   }, {
I2C_BOARD_INFO(mt9v022, 0x48),
+   .platform_data = iclink, /* With extender */
}, {
I2C_BOARD_INFO(mt9m001, 0x5d),
-   },
-};
-
-static struct soc_camera_link iclink[] = {
-   {
-   .bus_id = 0, /* Must match with the camera ID */
-   .board_info = pcm990_camera_i2c[0],
-   .i2c_adapter_id = 0,
-   .query_bus_param= pcm990_camera_query_bus_param,
-   .set_bus_param  = pcm990_camera_set_bus_param,
-   .free_bus   = pcm990_camera_free_bus,
-   .module_name= mt9v022,
-   }, {
-   .bus_id = 0, /* Must match with the camera ID */
-   .board_info = pcm990_camera_i2c[1],
-   .i2c_adapter_id = 0,
-   .query_bus_param= pcm990_camera_query_bus_param,
-   .set_bus_param  = pcm990_camera_set_bus_param,
-   .free_bus   = pcm990_camera_free_bus,
-   .module_name= mt9m001,
-   },
-};
-
-static struct platform_device pcm990_camera[] = {
-   {
-   .name   = soc-camera-pdrv,
-   .id = 0,
-   .dev= {
-   .platform_data = iclink[0],
-   },
-   }, {
-   .name   = soc-camera-pdrv,
-   .id = 1,
-   .dev= {
-   .platform_data = iclink[1],
-   },
+   .platform_data = iclink, /* With extender */
},
 };
 #endif /* CONFIG_VIDEO_PXA27x ||CONFIG_VIDEO_PXA27x_MODULE */
@@ -532,9 +501,6 @@ void __init pcm990_baseboard_init(void)
pxa_set_camera_info(pcm990_pxacamera_platform_data);
 
i2c_register_board_info(0, ARRAY_AND_SIZE(pcm990_i2c_devices));
-
-   platform_device_register(pcm990_camera[0]);
-   platform_device_register(pcm990_camera[1]);
 #endif
 
printk(KERN_INFO PCM-990 Evaluation baseboard initialized\n);
diff -upr oldtree/arch/sh/boards/board-ap325rxa.c 
/home/v4l/tokernel/wrk/linux-next/arch/sh/boards/board-ap325rxa.c
--- oldtree/arch/sh/boards/board-ap325rxa.c 2009-09-12 13:15:41.0 
-0300
+++ /home/v4l/tokernel/wrk/linux-next/arch/sh/boards/board-ap325rxa.c   
2009-09-12 13:02:53.0 -0300
@@ -581,7 +581,7 @@ static int __init ap325rxa_devices_setup
return platform_add_devices(ap325rxa_devices,
ARRAY_SIZE(ap325rxa_devices));
 }
-device_initcall(ap325rxa_devices_setup);
+arch_initcall(ap325rxa_devices_setup);
 
 /* Return the board specific boot mode pin configuration */
 static int ap325rxa_mode_pins(void)
diff -upr oldtree/arch/sh/boards/mach-migor/setup.c 
/home/v4l/tokernel/wrk/linux-next/arch/sh/boards/mach-migor/setup.c
--- oldtree/arch/sh/boards/mach-migor/setup.c   2009-09-12 13:15:41.0 
-0300
+++ /home/v4l/tokernel/wrk/linux-next/arch/sh/boards/mach-migor/setup.c 
2009-09-12 13:01:19.0 -0300
@@ -608,7 +608,7 @@ static int __init migor_devices_setup(vo
 
return 

media controller ivtv example

2009-09-12 Thread Hans Verkuil
Hi all,

I've added support to v4l2-mc in my tree to produce .dot code for graphviz.
See this pdf for what it looks like: http://www.xs4all.nl/~hverkuil/ivtv.pdf

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[cron job] v4l-dvb daily build 2.6.22 and up: ERRORS, 2.6.16-2.6.21: ERRORS

2009-09-12 Thread Hans Verkuil
This message is generated daily by a cron job that builds v4l-dvb for
the kernels and architectures in the list below.

Results of the daily build of v4l-dvb:

date:Sat Sep 12 19:00:05 CEST 2009
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   12715:2a59e7f77e6f
gcc version: gcc (GCC) 4.3.1
hardware:x86_64
host os: 2.6.26

linux-2.6.22.19-armv5: WARNINGS
linux-2.6.23.12-armv5: ERRORS
linux-2.6.24.7-armv5: ERRORS
linux-2.6.25.11-armv5: ERRORS
linux-2.6.26-armv5: ERRORS
linux-2.6.27-armv5: ERRORS
linux-2.6.28-armv5: ERRORS
linux-2.6.29.1-armv5: ERRORS
linux-2.6.30-armv5: ERRORS
linux-2.6.31-armv5: OK
linux-2.6.27-armv5-ixp: ERRORS
linux-2.6.28-armv5-ixp: ERRORS
linux-2.6.29.1-armv5-ixp: ERRORS
linux-2.6.30-armv5-ixp: ERRORS
linux-2.6.31-armv5-ixp: OK
linux-2.6.28-armv5-omap2: ERRORS
linux-2.6.29.1-armv5-omap2: ERRORS
linux-2.6.30-armv5-omap2: ERRORS
linux-2.6.31-armv5-omap2: OK
linux-2.6.22.19-i686: WARNINGS
linux-2.6.23.12-i686: ERRORS
linux-2.6.24.7-i686: ERRORS
linux-2.6.25.11-i686: ERRORS
linux-2.6.26-i686: ERRORS
linux-2.6.27-i686: ERRORS
linux-2.6.28-i686: ERRORS
linux-2.6.29.1-i686: ERRORS
linux-2.6.30-i686: ERRORS
linux-2.6.31-i686: WARNINGS
linux-2.6.23.12-m32r: OK
linux-2.6.24.7-m32r: OK
linux-2.6.25.11-m32r: OK
linux-2.6.26-m32r: OK
linux-2.6.27-m32r: OK
linux-2.6.28-m32r: OK
linux-2.6.29.1-m32r: OK
linux-2.6.30-m32r: OK
linux-2.6.31-m32r: OK
linux-2.6.30-mips: ERRORS
linux-2.6.31-mips: OK
linux-2.6.27-powerpc64: ERRORS
linux-2.6.28-powerpc64: ERRORS
linux-2.6.29.1-powerpc64: ERRORS
linux-2.6.30-powerpc64: ERRORS
linux-2.6.31-powerpc64: WARNINGS
linux-2.6.22.19-x86_64: WARNINGS
linux-2.6.23.12-x86_64: ERRORS
linux-2.6.24.7-x86_64: ERRORS
linux-2.6.25.11-x86_64: ERRORS
linux-2.6.26-x86_64: ERRORS
linux-2.6.27-x86_64: ERRORS
linux-2.6.28-x86_64: ERRORS
linux-2.6.29.1-x86_64: ERRORS
linux-2.6.30-x86_64: ERRORS
linux-2.6.31-x86_64: WARNINGS
sparse (linux-2.6.31): OK
linux-2.6.16.61-i686: ERRORS
linux-2.6.17.14-i686: ERRORS
linux-2.6.18.8-i686: WARNINGS
linux-2.6.19.5-i686: WARNINGS
linux-2.6.20.21-i686: WARNINGS
linux-2.6.21.7-i686: WARNINGS
linux-2.6.16.61-x86_64: ERRORS
linux-2.6.17.14-x86_64: ERRORS
linux-2.6.18.8-x86_64: WARNINGS
linux-2.6.19.5-x86_64: WARNINGS
linux-2.6.20.21-x86_64: WARNINGS
linux-2.6.21.7-x86_64: WARNINGS

Detailed results are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.log

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Saturday.tar.bz2

The V4L2 specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/v4l2.html

The DVB API specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/dvbapi.pdf

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: image quality of Labtec Webcam 2200

2009-09-12 Thread Németh Márton
leandro Costantino wrote:
 Nice, i will take a look.
 Anyway, be aware, that the conversion error, is something expected
 on pac7311, in fact, Hans have commented that on the libv4lconvert.
 ..
 if (result) {
 /* Pixart webcam's seem to regulary generate corrupt frames, which
are best thrown away to avoid flashes in the video stream. Tell
the upper layer this is an intermediate fault and it should try
again with a new buffer by setting errno to EAGAIN */
 if (src_pix_fmt == V4L2_PIX_FMT_PJPG ||
 data-flags  V4LCONVERT_IS_SN9C20X) {
   V4LCONVERT_ERR(decompressing JPEG: %s,
 tinyjpeg_get_errorstring(data-jdec));
   errno = EAGAIN;
   return -1;
 
 That's the result of the EAGAIN.

The corrupted data coming from the device would be one reason. An other reason
could be the limitation of the libv4l 0.6.1 that it cannot understand the raw 
data
coming from the webcam. Maybe the raw data does not fulfill the JPEG 
specification
but still could have some meaning -- which we don't understand at the moment. 
The
different types of error messages mean for me that at least some of them could 
be
solved (i.e. unknown huffman code).

 About, the half brightness picture, did that happens when autogain is off?

Yes, I tried to switch the Auto Gain control off before starting a 
measurement.
The half brightness pictures appears time to time.

Regards,

Márton Németh

 Best Regards
 On Sat, Sep 12, 2009 at 2:16 AM, Németh Márton nm...@freemail.hu wrote:
 Hello,

 thank you for looking at this topic.

 leandro Costantino wrote:
 Hi ,
 i tested it with 2.6.31-rc9  libvl 0.6.1 + svv  and cannot reproduce.

 301147.626826] gspca: probing 093a:2626
 [301147.641578] gspca: probe ok
 [301147.641607] gspca: probing 093a:2626
 [301147.641770] gspca: probing 093a:2626
 [301147.641829] usbcore: registered new interface driver pac7311
 [301147.641835] pac7311: registered
 I have the same dmesg output. My Labtec Webcam 2200 has the following labels
 on the cable:

 M/N: V-UCE52
 P/N: 860-73
 PID: CE73902

 Maybe there is more than one revision of the Labtec Webcam 2200 and I have
 one with a different hardware/firmware inside?

 Could you try testing with svv.c app?
 I used a bit modified svv.c to create the measurement result. The
 modifications are to create the output HTML report and save the raw
 and the BMP images. The display is not correct because I changed
 the format from V4L2_PIX_FMT_RGB24 to V4L2_PIX_FMT_BGR24 to easily
 save the result to BMP. The source code quality is not the best,
 I am sorry about that, but I can still attach my source code which I
 modified a little bit since my last report.

 pd: quality is not the best, but works ok. Seem that the format is not
 the proper or expected pjpeg on your streaming.
 Do you think about USB transfer problem?

 Regards,

Márton Németh

 2009/9/11 Németh Márton nm...@freemail.hu:
 Márton Németh wrote:
 Hi,

 I have a Labtec Webcam 2200 and I have problems with the image quality
 with Linux 2.6.31 + libv4l 0.6.1. I made some experiments and stored
 each captured image as raw data and when libv4l was able to convert
 then I also stored the result as bmp.

 You can find my results at 
 http://v4l-test.sourceforge.net/results/test-20090911/index.html
 There are three types of problems:
  a) Sometimes the picture contains a 8x8 pixel error, like in image #9
 
 http://v4l-test.sourceforge.net/results/test-20090911/index.html#img9
  b) Sometimes the brightness of the half picture is changed, like in
 images #7, #36 and #37
 
 http://v4l-test.sourceforge.net/results/test-20090911/index.html#img7
 
 http://v4l-test.sourceforge.net/results/test-20090911/index.html#img00036
 
 http://v4l-test.sourceforge.net/results/test-20090911/index.html#img00037
  c) Sometimes the libv4l cannot convert the raw image and the errno
 is set to EAGAIN (11), for example image #1, #2 and #3

 Do you know how can I fix these problems?
 I investigated the c) point a little bit. When I get a negative return 
 value
 from the v4lconvert_convert() function then I print out the error 
 message what the
 v4lconvert_get_error_message() function returns. With the result log file
 I executed a grep v4l-convert |sort |uniq command. All the error 
 messages are
 coming from the tinyjpeg.c (Small jpeg decoder library):

 v4l-convert: error decompressing JPEG: error: more then 63 AC components 
 (65) in huffman unit
 v4l-convert: error decompressing JPEG: error: more then 63 AC components 
 (66) in huffman unit
 v4l-convert: error decompressing JPEG: error: more then 63 AC components 
 (67) in huffman unit
 v4l-convert: error decompressing JPEG: error: more then 63 AC components 
 (68) in huffman unit
 v4l-convert: error decompressing JPEG: error: more then 63 AC components 
 (69) in huffman unit
 v4l-convert: error decompressing JPEG: error: more then 

Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Andy Walls
On Sat, 2009-09-12 at 12:54 -0300, Mauro Carvalho Chehab wrote:
 Em Sat, 12 Sep 2009 17:12:35 +0200
 Hans Verkuil hverk...@xs4all.nl escreveu:

  I'm currently trying to get ivtv media-controller-aware. It's probably the
  most complex driver when it comes to topology that I have access to, so that
  would be a good test case.
 
 The most complex hardware for PC I'm aware is the cx25821. Unfortunately, the
 driver is currently in bad shape, in terms of CodingStyle (including the
 removal of large blocks of code that are repeated several times along the
 driver), needing lots of changes in order to get merged.
 
 For those interested, the code is at:
   http://linuxtv.org/hg/~mchehab/cx25821/
 
 I'll likely do some work on it during this merge window for its inclusion
 upstream (probably at drivers/staging - since I doubt we'll have enough time 
 to
 clean it up right now).
 
 It has several blocks that can be used for video in and video out. The current
 driver has support for 8 simultaneous video inputs and 4 simultaneous video
 output. I'm not sure, but I won't doubt that you can exchange inputs and
 outputs or even group them. So, this is a good candidate for some media
 controller tests. I'll try to do it via sysfs, running some tests and post the
 results.


I read the available specs for that chip when I saw the source code
appear in a repo of yours several months ago.  The public data sheet is
here.

http://www.conexant.com/servlets/DownloadServlet/PBR-201499-004.pdf?docid=1501revid=4

The chip looks like it is a good fit for surveillance applications.

The block diagram indicates it is essentially a Video (10x CCIR656) and
Audio (5x I2S) router, with a pile of GPIOS (48), 3 I2C busses, and
support for inbound and outbound DMA channels.  The chip also has built
in scalers and motion detection.  Managing the chip itself doesn't look
too complicated, but once intergrated with other devices like
compression CODECs, a CX25853 devices, or general purpose
microcontrollers, I imagine it could get complex to manage.

The reference design brief is here:

http://www.conexant.com/servlets/DownloadServlet/RED-202183-001.pdf?docid=2184revid=1


I agree with the coding style problems of the current driver.

Regards,
Andy

 Cheers,
 Mauro


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Driver for webcams based on GL860 chip.

2009-09-12 Thread lorin

Hi !


I would like to add the support for GL860 based webcams within the
GSPCA framework.

A patch (116KB) for that can be found at :
http://launchpadlibrarian.net/31182405/patchu_gl860g.diff

This is not a final version, some improvement in the auto detection
of sensor will be done. Before that I'm waiting for comments about
what should changed in this patch in order to be accepted.

Basically there is four managed sensors so that this patch add a new
directory in the gspca one, it contains the main part of the driver
and the four sub-drivers.




Here are some remarks:

- in gl860/gl860.h, there are complex macros. Please, use functions
  instead.

Done



- in gl860/gl860.c

. don't change the returned values of the virtual functions as:
static s32  sd_init(struct gspca_dev *gspca_dev);
  (should be int and not s32)
. more generally, it is a bad idea to have s32 variables.

I changed the returned value to int instead of s32.
There is still s32 for the control parameters.



. why are the module parameters read only? (see below)

Properties changed to 644 instead of 444.
I discarded all parameters but sensor and AC power frequency.



. some initialization are unuseful as:
static char sensor[7] = ;

Removed with some initialisation to zero for static variables.



. why is the video control table not static? (if some controls are not
  available for some webcams, just set gspca_dev-ctl_dis)
It's a kind of trade-off. Control characteristics are hold in the  
sensor specific files but because of const the control table is  
still in the main

file. I can surely improve that.



. in the function gl860_guess_sensor, there is
if (product_id == 0xf191)
sd-vsettings.sensor = ID_MI1320;
  This information could be in the device_table, and also, in the
declaration of this table, '.driver_info = 0' is not useful.

Driver_info removed. I need the sensor ID in functions which not benefit from
the device table so that it is useful in the sd structure.



. in the function sd_config, there is no need to set values to 0 as:
sd-vsettings.mirrorMask = 0;
. in the same function,
gspca_dev-alt   = 3 + 1;
  is not useful (the value will be reset at streaming start).

Removed


. in the function sd_pkt_scan, the line
switch (*(s16 *)data) {
  may not work either with BE or LE machines.

I add a comment about the fact that only 0x0202 is checked.
May a if instead of the case could be used as I don't think any other
values will be tested.



. in the function sd_mod_init, why are the static module parameters
  moved to the variable vsettings?
. about this same variable, it should be better to set the device
  settings from the module parameters at connect time instead of at
  module load time. This permits to have different webcam types active
  at the same time...

Right! Old stuff no more needed. Changed.



- in the other .c files
. the use of static variables prevents to have more than one active
  webcam.

Changed. Also, the byte arrays whose one byte is a control value are no more
static.



. there are values = 0x80 in 'char' tables. These ones should be 's8'
  or 'u8' ('char' may be unsigned).

Changed to u8.


. using strings to handle binary values is less readable than simple
  hexadecimal values.

There are still there. Because these binary values are not human
understandable, I prefer the strings as they are more compact.

The improved patch is there :
http://launchpadlibrarian.net/31723472/patchu_gl860g.diff


Regards,
Olivier Lorin


This message was sent using IMP, the Internet Messaging Program.


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/RFT 08/10] radio-mr800: turn radio on during first open and off during last close

2009-09-12 Thread David Ellingsworth
On Sat, Sep 12, 2009 at 10:50 AM, David Ellingsworth
da...@identd.dyndns.org wrote:
 From 46c7d395e4ed2df431b21b6c07fb02a075a15e43 Mon Sep 17 00:00:00 2001
 From: David Ellingsworth da...@identd.dyndns.org
 Date: Sat, 12 Sep 2009 01:57:36 -0400
 Subject: [PATCH 08/10] mr800: turn radio on during first open and off during
 last close

 Signed-off-by: David Ellingsworth da...@identd.dyndns.org
 ---
 drivers/media/radio/radio-mr800.c |   31 +--
 1 files changed, 17 insertions(+), 14 deletions(-)

 diff --git a/drivers/media/radio/radio-mr800.c
 b/drivers/media/radio/radio-mr800.c
 index 9fd2342..11db6ea 100644
 --- a/drivers/media/radio/radio-mr800.c
 +++ b/drivers/media/radio/radio-mr800.c
 @@ -493,15 +493,14 @@ static int usb_amradio_open(struct file *file)
    }

    file-private_data = radio;
 -    radio-users = 1;
 -    radio-muted = 1;

 -    retval = amradio_set_mute(radio, AMRADIO_START);
 -    if (retval  0) {
 -        amradio_dev_warn(radio-videodev.dev,
 -            radio did not start up properly\n);
 -        radio-users = 0;
 -        goto unlock;
 +    if (radio-users == 0) {
 +        retval = amradio_set_mute(radio, AMRADIO_START);
 +        if (retval  0) {
 +            amradio_dev_warn(radio-videodev.dev,
 +                radio did not start up properly\n);
 +            goto unlock;
 +        }
    }

    retval = amradio_set_stereo(radio, WANT_STEREO);
 @@ -514,6 +513,8 @@ static int usb_amradio_open(struct file *file)
        amradio_dev_warn(radio-videodev.dev,
            set frequency failed\n);

 +    radio-users++;
 +
 unlock:
    mutex_unlock(radio-lock);
    return retval;
 @@ -526,18 +527,19 @@ static int usb_amradio_close(struct file *file)
    int retval = 0;

    mutex_lock(radio-lock);
 +    radio-users--;

    if (!radio-usbdev) {
        retval = -EIO;
        goto unlock;
    }

 -    radio-users = 0;
 -
 -    retval = amradio_set_mute(radio, AMRADIO_STOP);
 -    if (retval  0)
 -        amradio_dev_warn(radio-videodev.dev,
 -            amradio_stop failed\n);
 +    if (radio-users == 0  !radio-muted) {
 +        retval = amradio_set_mute(radio, AMRADIO_STOP);
 +        if (retval  0)
 +            amradio_dev_warn(radio-videodev.dev,
 +                amradio_stop failed\n);
 +    }

 unlock:
    mutex_unlock(radio-lock);
 @@ -674,6 +676,7 @@ static int usb_amradio_probe(struct usb_interface *intf,
    radio-usbdev = interface_to_usbdev(intf);
    radio-curfreq = 95.16 * FREQ_MUL;
    radio-stereo = -1;
 +    radio-muted = 1;

    mutex_init(radio-lock);

 --
 1.6.3.3



I just went back over Alexey Klimov's last patch series and I think
I'm going to rework this patch. I agree with the concept he presented
in his last patch whereby the radio should not be turned on/off during
open close, nor should the device's frequency or stereo be set.

Regards,

David Ellingsworth
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [RFC/RFT 09/10] radio-mr800: preserve radio state during suspend/resume

2009-09-12 Thread David Ellingsworth
On Sat, Sep 12, 2009 at 10:50 AM, David Ellingsworth
da...@identd.dyndns.org wrote:
 From 31243088bd32d5568f06f2044f8ff782641e16b5 Mon Sep 17 00:00:00 2001
 From: David Ellingsworth da...@identd.dyndns.org
 Date: Sat, 12 Sep 2009 02:05:57 -0400
 Subject: [PATCH 09/10] mr800: preserve radio state during suspend/resume

 Signed-off-by: David Ellingsworth da...@identd.dyndns.org
 ---
 drivers/media/radio/radio-mr800.c |   17 +++--
 1 files changed, 11 insertions(+), 6 deletions(-)

 diff --git a/drivers/media/radio/radio-mr800.c
 b/drivers/media/radio/radio-mr800.c
 index 11db6ea..10bed62 100644
 --- a/drivers/media/radio/radio-mr800.c
 +++ b/drivers/media/radio/radio-mr800.c
 @@ -574,9 +574,12 @@ static int usb_amradio_suspend(struct usb_interface
 *intf, pm_message_t message)

    mutex_lock(radio-lock);

 -    retval = amradio_set_mute(radio, AMRADIO_STOP);
 -    if (retval  0)
 -        dev_warn(intf-dev, amradio_stop failed\n);
 +    if (!radio-muted) {
 +        retval = amradio_set_mute(radio, AMRADIO_STOP);
 +        if (retval  0)
 +            dev_warn(intf-dev, amradio_stop failed\n);
 +        radio-muted = 0;
 +    }

    dev_info(intf-dev, going into suspend..\n);

 @@ -592,9 +595,11 @@ static int usb_amradio_resume(struct usb_interface
 *intf)

    mutex_lock(radio-lock);

 -    retval = amradio_set_mute(radio, AMRADIO_START);
 -    if (retval  0)
 -        dev_warn(intf-dev, amradio_start failed\n);
 +    if (!radio-muted) {
 +        retval = amradio_set_mute(radio, AMRADIO_START);
 +        if (retval  0)
 +            dev_warn(intf-dev, amradio_start failed\n);
 +    }

    dev_info(intf-dev, coming out of suspend..\n);

 --
 1.6.3.3



I'm going to rework this patch as well. I think the driver needs to do
more than just turn the radio back on. It should also restore the set
frequency and stereo mode.

Regards,

David Ellingsworth
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Problems with Pinnacle 310i (saa7134) and recent kernels

2009-09-12 Thread Avl Jawrowski
hermann pitton hermann-pitton at arcor.de writes:

  However it works still only with Kaffeine and w_scan.
  dvbscan (last mercurial) give:
 
 Off hand I can't tell, but try with scan.
 I did not use dvbscan since years and can't tell the status.

Even scan works perfectly (I didn't know it).
I think it's an mplayer problem, I'll write about it in the mplayer mailing 
list.

 Cheers,
 Hermann

You've been very helpful!
Thank you very much,
Avl

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PULL] http://linuxtv.org/hg/~anttip/af9015/

2009-09-12 Thread Antti Palosaari

Hei Mauro,

Please pull from http://linuxtv.org/hg/~anttip/af9015/
for the following:

get_dvb_firmware: add af9015 firmware
af9015: [1/2] fix USB TS configuration
af9015: [2/2] fix USB TS configuration
af9015: improve usb control message function slightly
af9015: fix typo in register compare

regards
Antti
--
http://palosaari.fi/

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Media controller: sysfs vs ioctl

2009-09-12 Thread Mauro Carvalho Chehab
Em Sat, 12 Sep 2009 14:48:23 -0400
Andy Walls awa...@radix.net escreveu:

 On Sat, 2009-09-12 at 12:54 -0300, Mauro Carvalho Chehab wrote:
  Em Sat, 12 Sep 2009 17:12:35 +0200
  Hans Verkuil hverk...@xs4all.nl escreveu:
 
   I'm currently trying to get ivtv media-controller-aware. It's probably the
   most complex driver when it comes to topology that I have access to, so 
   that
   would be a good test case.
  
  The most complex hardware for PC I'm aware is the cx25821. Unfortunately, 
  the
  driver is currently in bad shape, in terms of CodingStyle (including the
  removal of large blocks of code that are repeated several times along the
  driver), needing lots of changes in order to get merged.
  
  For those interested, the code is at:
  http://linuxtv.org/hg/~mchehab/cx25821/
  
  I'll likely do some work on it during this merge window for its inclusion
  upstream (probably at drivers/staging - since I doubt we'll have enough 
  time to
  clean it up right now).
  
  It has several blocks that can be used for video in and video out. The 
  current
  driver has support for 8 simultaneous video inputs and 4 simultaneous video
  output. I'm not sure, but I won't doubt that you can exchange inputs and
  outputs or even group them. So, this is a good candidate for some media
  controller tests. I'll try to do it via sysfs, running some tests and post 
  the
  results.
 
 
 I read the available specs for that chip when I saw the source code
 appear in a repo of yours several months ago.  The public data sheet is
 here.
 
 http://www.conexant.com/servlets/DownloadServlet/PBR-201499-004.pdf?docid=1501revid=4
 
 The chip looks like it is a good fit for surveillance applications.
 
 The block diagram indicates it is essentially a Video (10x CCIR656) and
 Audio (5x I2S) router, with a pile of GPIOS (48), 3 I2C busses, and
 support for inbound and outbound DMA channels.  The chip also has built
 in scalers and motion detection.  Managing the chip itself doesn't look
 too complicated, but once intergrated with other devices like
 compression CODECs, a CX25853 devices, or general purpose
 microcontrollers, I imagine it could get complex to manage.
 
 The reference design brief is here:
 
 http://www.conexant.com/servlets/DownloadServlet/RED-202183-001.pdf?docid=2184revid=1

Yes, this board is very powerful, and very complex designs are possible with it.

 I agree with the coding style problems of the current driver.

Yes. It will take some time until cleaning it up and letting it done for being
at drivers/media.

Cheers,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


cx88: 2 channels on each of 2 cards

2009-09-12 Thread Adam Swift

Hi all,

I have 2 LeadTek WinFast TV2000 XP Expert analog capture cards. I'm  
attempting to get 4 channels of video in, using both the S-video and  
component inputs (not the tuners) of each cards. I understand that  
this was possible with the bt878 which this chip is an evolution of.


However, it doesn't work.

1 channel on each card gives no signal on the second card- i.e. the  
one initialised second. This is from tests with  and ZoneAlarm (the  
application I'm trying to use the cards with).


2 channels on one card kinda works, but not correctly. Sometimes one  
channel will display vertical split-screen of both feeds, with a  
little noise at the top, bottom, and in between. Sometimes each  
channel will display correctly, but will appear to vibrate up and  
down, and the channels seem to alternate between which one updates. I  
can provide screenshots of both these behaviours if it will help.


I've tried this with the following kernels:
2.6.29-larch
2.6.17-10mdv

If someone can point me in the right direction I may be able to do any  
patches required myself, but I need a starting point.


Thanks in advance,
Adam Swift


relevant parts of lspci -vv:

02:0b.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video  
and Audio Decoder (rev 05)

Subsystem: LeadTek Research Inc. Unknown device 6611
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-  
Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort-  
TAbort- MAbort- SERR- PERR-

Latency: 32 (5000ns min, 13750ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 19
Region 0: Memory at ec00 (32-bit, non-prefetchable) [size=16M]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

02:0d.0 Multimedia video controller: Conexant CX23880/1/2/3 PCI Video  
and Audio Decoder (rev 05)

Subsystem: LeadTek Research Inc. Unknown device 6611
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr-  
Stepping- SERR- FastB2B-
	Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort-  
TAbort- MAbort- SERR- PERR-

Latency: 32 (5000ns min, 13750ns max), Cache Line Size: 32 bytes
Interrupt: pin A routed to IRQ 20
Region 0: Memory at eb00 (32-bit, non-prefetchable) [size=16M]
Capabilities: [44] Vital Product Data
Capabilities: [4c] Power Management version 2
Flags: PMEClk- DSI+ D1- D2- AuxCurrent=0mA 
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 PME-Enable- DSel=0 DScale=0 PME-

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/RFT 0/14] radio-mr800 patch series

2009-09-12 Thread David Ellingsworth

What follow is a series of patches to clean up the radio-mr800 driver. I
do _not_ have access to this device so these patches need to be tested.
These patches should apply to Mauro's git tree and against the 2.6.31
release kernel. The patches in this series are as follows:

01. radio-mr800: implement proper locking
02. radio-mr800: simplify video_device allocation
03. radio-mr800: simplify error paths in usb probe callback
04. radio-mr800: remove an unnecessary local variable
05. radio-mr800: simplify access to amradio_device
06. radio-mr800: simplify locking in ioctl callbacks
07. radio-mr800: remove device-removed indicator
08. radio-mr800: fix potential use after free
09. radio-mr800: remove device initialization from open/close
10. radio-mr800: ensure the radio is initialized to a consistent state
11. radio-mr800: fix behavior of set_radio function
12. radio-mr800: preserve radio state during suspend/resume
13. radio-mr800: simplify device warnings
14. radio-mr800: set radio frequency only upon success

The first 7 in this series are the same as those submitted in my last 
series and will not be resent. The remaining 7 patches in this series 
will be sent separately for review.


Regards,

David Ellingsworth
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/RFT 09/14] radio-mr800: remove device initialization from open/close

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From 5d01d49c78e2788dca8981af7369c799b650c706 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:28:45 -0400
Subject: [PATCH 09/14] mr800: remove device initialization from open/close

Device initialization should happen on an as needed basis.
This change allows the device to continue operating even
when there are no applications using it. This should allow
simple command based applications to turn the device on and
off without a persistent process.

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   35 ++-
 1 files changed, 2 insertions(+), 33 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 87b58e3..df020e8 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -136,7 +136,6 @@ struct amradio_device {
 	struct mutex lock;	/* buffer locking */
 	int curfreq;
 	int stereo;
-	int users;
 	int muted;
 };
 
@@ -492,26 +491,6 @@ static int usb_amradio_open(struct file *file)
 	}
 
 	file-private_data = radio;
-	radio-users = 1;
-	radio-muted = 1;
-
-	retval = amradio_set_mute(radio, AMRADIO_START);
-	if (retval  0) {
-		amradio_dev_warn(radio-videodev.dev,
-			radio did not start up properly\n);
-		radio-users = 0;
-		goto unlock;
-	}
-
-	retval = amradio_set_stereo(radio, WANT_STEREO);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			set stereo failed\n);
-
-	retval = amradio_setfreq(radio, radio-curfreq);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			set frequency failed\n);
 
 unlock:
 	mutex_unlock(radio-lock);
@@ -526,19 +505,9 @@ static int usb_amradio_close(struct file *file)
 
 	mutex_lock(radio-lock);
 
-	if (!radio-usbdev) {
+	if (!radio-usbdev)
 		retval = -EIO;
-		goto unlock;
-	}
-
-	radio-users = 0;
 
-	retval = amradio_set_mute(radio, AMRADIO_STOP);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			amradio_stop failed\n);
-
-unlock:
 	mutex_unlock(radio-lock);
 	return retval;
 }
@@ -669,10 +638,10 @@ static int usb_amradio_probe(struct usb_interface *intf,
 	radio-videodev.ioctl_ops = usb_amradio_ioctl_ops;
 	radio-videodev.release = usb_amradio_video_device_release;
 
-	radio-users = 0;
 	radio-usbdev = interface_to_usbdev(intf);
 	radio-curfreq = 95.16 * FREQ_MUL;
 	radio-stereo = -1;
+	radio-muted = 1;
 
 	mutex_init(radio-lock);
 
-- 
1.6.3.3



[RFC/RFT 10/14] radio-mr800: ensure the radio is initialized to a consistent state

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From 8b5f17aeea6cf394bedd6f9029a57b8f5815 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 21:59:07 -0400
Subject: [PATCH 10/14] mr800: ensure the radio is initialized to a
 consistent state

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   34 --
 1 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index df020e8..dbf0dbb 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -85,6 +85,9 @@ MODULE_LICENSE(GPL);
 #define amradio_dev_warn(dev, fmt, arg...)\
 		dev_warn(dev, MR800_DRIVER_NAME  -  fmt, ##arg)
 
+#define amradio_dev_err(dev, fmt, arg...) \
+		dev_err(dev, MR800_DRIVER_NAME  -  fmt, ##arg)
+
 /* Probably USB_TIMEOUT should be modified in module parameter */
 #define BUFFER_LENGTH 8
 #define USB_TIMEOUT 500
@@ -137,6 +140,7 @@ struct amradio_device {
 	int curfreq;
 	int stereo;
 	int muted;
+	int initialized;
 };
 
 #define vdev_to_amradio(r) container_of(r, struct amradio_device, videodev)
@@ -477,6 +481,31 @@ static int vidioc_s_input(struct file *filp, void *priv, unsigned int i)
 	return 0;
 }
 
+static int usb_amradio_init(struct amradio_device *radio)
+{
+	int retval;
+
+	retval = amradio_set_mute(radio, AMRADIO_STOP);
+	if (retval  0) {
+		amradio_dev_warn(radio-videodev.dev, amradio_stop failed\n);
+		goto out_err;
+	}
+
+	retval = amradio_set_stereo(radio, WANT_STEREO);
+	if (retval  0) {
+		amradio_dev_warn(radio-videodev.dev, set stereo failed\n);
+		goto out_err;
+	}
+
+	radio-initialized = 1;
+	goto out;
+
+out_err:
+	amradio_dev_err(radio-videodev.dev, initialization failed\n);
+out:
+	return retval;
+}
+
 /* open device - amradio_start() and amradio_setfreq() */
 static int usb_amradio_open(struct file *file)
 {
@@ -492,6 +521,9 @@ static int usb_amradio_open(struct file *file)
 
 	file-private_data = radio;
 
+	if (unlikely(!radio-initialized))
+		retval = usb_amradio_init(radio);
+
 unlock:
 	mutex_unlock(radio-lock);
 	return retval;
@@ -640,8 +672,6 @@ static int usb_amradio_probe(struct usb_interface *intf,
 
 	radio-usbdev = interface_to_usbdev(intf);
 	radio-curfreq = 95.16 * FREQ_MUL;
-	radio-stereo = -1;
-	radio-muted = 1;
 
 	mutex_init(radio-lock);
 
-- 
1.6.3.3



[RFC/RFT 12/14] radio-mr800: preserve radio state during suspend/resume

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From c8c27c663db7294c660a3bac659742c915ce91a9 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 22:01:49 -0400
Subject: [PATCH 12/14] mr800: preserve radio state during suspend/resume

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   33 -
 1 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 8fc413d..ed734bb 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -573,9 +573,12 @@ static int usb_amradio_suspend(struct usb_interface *intf, pm_message_t message)
 
 	mutex_lock(radio-lock);
 
-	retval = amradio_set_mute(radio, AMRADIO_STOP);
-	if (retval  0)
-		dev_warn(intf-dev, amradio_stop failed\n);
+	if (!radio-muted  radio-initialized) {
+		retval = amradio_set_mute(radio, AMRADIO_STOP);
+		if (retval  0)
+			dev_warn(intf-dev, amradio_stop failed\n);
+		radio-muted = 0;
+	}
 
 	dev_info(intf-dev, going into suspend..\n);
 
@@ -591,10 +594,30 @@ static int usb_amradio_resume(struct usb_interface *intf)
 
 	mutex_lock(radio-lock);
 
-	retval = amradio_set_mute(radio, AMRADIO_START);
+	if (unlikely(!radio-initialized))
+		goto unlock;
+
+	if (radio-stereo)
+		retval = amradio_set_stereo(radio, WANT_STEREO);
+	else
+		retval = amradio_set_stereo(radio, WANT_MONO);
+
 	if (retval  0)
-		dev_warn(intf-dev, amradio_start failed\n);
+		amradio_dev_warn(radio-videodev.dev, set stereo failed\n);
 
+	retval = amradio_setfreq(radio, radio-curfreq);
+	if (retval  0)
+		amradio_dev_warn(radio-videodev.dev,
+			set frequency failed\n);
+
+	if (!radio-muted) {
+		retval = amradio_set_mute(radio, AMRADIO_START);
+		if (retval  0)
+			dev_warn(radio-videodev.dev,
+amradio_start failed\n);
+	}
+
+unlock:
 	dev_info(intf-dev, coming out of suspend..\n);
 
 	mutex_unlock(radio-lock);
-- 
1.6.3.3



Re: [RFC/RFT 0/10] radio-mr800 patch series

2009-09-12 Thread David Ellingsworth

David Ellingsworth wrote:
What follow is a series of patches to clean up the radio-mr800 driver. 
I do _not_ have access to this device so these patches need to be 
tested. These patches should apply to Mauro's git tree and against the 
2.6.31 release kernel. The patches in this series are as follows:


1. radio-mr800: implement proper locking
2. radio-mr800: simplify video_device allocation
3. radio-mr800: simplify error paths in usb probe callback
4. radio-mr800: remove an unnecessary local variable
5. radio-mr800: simplify access to amradio_device
6. radio-mr800: simplify locking in ioctl callbacks
7. radio-mr800: remove device-removed indicator
8. radio-mr800: turn radio on during first open and off during last close
9. radio-mr800: preserve radio-state during suspend/resume
10. radio-mr800: fix potential use after free

Each individual patch will follow in a separate email.

Regards,

David Ellingsworth
This series has been superseded by my new 14 patch series. The first 7 
patches of this series remain a part of the new series.


Regards,

David Ellingsworth
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[RFC/RFT 11/14] radio-mr800: fix behavior of set_stereo function

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From ea0c11ec6706fbd0777b0147da8a8a827a537699 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 22:00:29 -0400
Subject: [PATCH 11/14] mr800: fix behavior of set_stereo function

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |9 +
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index dbf0dbb..8fc413d 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -252,12 +252,13 @@ static int amradio_set_stereo(struct amradio_device *radio, char argument)
 	retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
 		(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);
 
-	if (retval  0 || size != BUFFER_LENGTH) {
-		radio-stereo = -1;
+	if (retval  0 || size != BUFFER_LENGTH)
 		return retval;
-	}
 
-	radio-stereo = 1;
+	if (argument == WANT_STEREO)
+		radio-stereo = 1;
+	else
+		radio-stereo = 0;
 
 	return retval;
 }
-- 
1.6.3.3



[RFC/RFT 13/14] radio-mr800: simplify device warnings

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From af0aeff199bfba73db6cfcf540936c4c9279aad1 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 22:03:16 -0400
Subject: [PATCH 13/14] mr800: simplify device warnings

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |   78 
 1 files changed, 26 insertions(+), 52 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index ed734bb..4d955aa 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -186,8 +186,10 @@ static int amradio_set_mute(struct amradio_device *radio, char argument)
 	retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
 		(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);
 
-	if (retval  0 || size != BUFFER_LENGTH)
+	if (retval  0 || size != BUFFER_LENGTH) {
+		amradio_dev_warn(radio-videodev.dev, set mute failed\n);
 		return retval;
+	}
 
 	radio-muted = argument;
 
@@ -216,7 +218,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
 		(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);
 
 	if (retval  0 || size != BUFFER_LENGTH)
-		return retval;
+		goto out_err;
 
 	/* frequency is calculated from freq_send and placed in first 2 bytes */
 	radio-buffer[0] = (freq_send  8)  0xff;
@@ -230,6 +232,14 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
 	retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
 		(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);
 
+	if (retval  0 || size != BUFFER_LENGTH)
+		goto out_err;
+
+	goto out;
+
+out_err:
+	amradio_dev_warn(radio-videodev.dev, set frequency failed\n);
+out:
 	return retval;
 }
 
@@ -252,8 +262,10 @@ static int amradio_set_stereo(struct amradio_device *radio, char argument)
 	retval = usb_bulk_msg(radio-usbdev, usb_sndintpipe(radio-usbdev, 2),
 		(void *) (radio-buffer), BUFFER_LENGTH, size, USB_TIMEOUT);
 
-	if (retval  0 || size != BUFFER_LENGTH)
+	if (retval  0 || size != BUFFER_LENGTH) {
+		amradio_dev_warn(radio-videodev.dev, set stereo failed\n);
 		return retval;
+	}
 
 	if (argument == WANT_STEREO)
 		radio-stereo = 1;
@@ -313,9 +325,6 @@ static int vidioc_g_tuner(struct file *file, void *priv,
  * amradio_set_stereo shouldn't be here
  */
 	retval = amradio_set_stereo(radio, WANT_STEREO);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			set stereo failed\n);
 
 	strcpy(v-name, FM);
 	v-type = V4L2_TUNER_RADIO;
@@ -347,15 +356,9 @@ static int vidioc_s_tuner(struct file *file, void *priv,
 	switch (v-audmode) {
 	case V4L2_TUNER_MODE_MONO:
 		retval = amradio_set_stereo(radio, WANT_MONO);
-		if (retval  0)
-			amradio_dev_warn(radio-videodev.dev,
-set mono failed\n);
 		break;
 	case V4L2_TUNER_MODE_STEREO:
 		retval = amradio_set_stereo(radio, WANT_STEREO);
-		if (retval  0)
-			amradio_dev_warn(radio-videodev.dev,
-set stereo failed\n);
 		break;
 	}
 
@@ -372,9 +375,6 @@ static int vidioc_s_frequency(struct file *file, void *priv,
 	radio-curfreq = f-frequency;
 
 	retval = amradio_setfreq(radio, radio-curfreq);
-	if (retval  0)
-		amradio_dev_warn(radio-videodev.dev,
-			set frequency failed\n);
 
 	return retval;
 }
@@ -427,19 +427,11 @@ static int vidioc_s_ctrl(struct file *file, void *priv,
 
 	switch (ctrl-id) {
 	case V4L2_CID_AUDIO_MUTE:
-		if (ctrl-value) {
+		if (ctrl-value)
 			retval = amradio_set_mute(radio, AMRADIO_STOP);
-			if (retval  0) {
-amradio_dev_warn(radio-videodev.dev,
-	amradio_stop failed\n);
-			}
-		} else {
+		else
 			retval = amradio_set_mute(radio, AMRADIO_START);
-			if (retval  0) {
-amradio_dev_warn(radio-videodev.dev,
-	amradio_start failed\n);
-			}
-		}
+
 		break;
 	}
 
@@ -487,16 +479,12 @@ static int usb_amradio_init(struct amradio_device *radio)
 	int retval;
 
 	retval = amradio_set_mute(radio, AMRADIO_STOP);
-	if (retval  0) {
-		amradio_dev_warn(radio-videodev.dev, amradio_stop failed\n);
+	if (retval)
 		goto out_err;
-	}
 
 	retval = amradio_set_stereo(radio, WANT_STEREO);
-	if (retval  0) {
-		

[RFC/RFT 08/14] radio-mr800: fix potential use after free

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct usb_interface *intf)
 
 	usb_set_intfdata(intf, NULL);
 	video_unregister_device(radio-videodev);
-	v4l2_device_disconnect(radio-v4l2_dev);
 }
 
 /* vidioc_querycap - query device capabilities */
-- 
1.6.3.3



[RFC/RFT 14/14] radio-mr800: set radio frequency only upon success

2009-09-12 Thread David Ellingsworth

From 8c441616f67011244cb15bc1a3dda6fd8706ecd2 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 16:04:44 -0400
Subject: [PATCH 08/14] mr800: fix potential use after free

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
drivers/media/radio/radio-mr800.c |1 -
1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c 
b/drivers/media/radio/radio-mr800.c

index 9fd2342..87b58e3 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -274,7 +274,6 @@ static void usb_amradio_disconnect(struct 
usb_interface *intf)


usb_set_intfdata(intf, NULL);
video_unregister_device(radio-videodev);
-v4l2_device_disconnect(radio-v4l2_dev);
}

/* vidioc_querycap - query device capabilities */
--
1.6.3.3

From 1c62f52da6114756d16644f8401f1903a50ae455 Mon Sep 17 00:00:00 2001
From: David Ellingsworth da...@identd.dyndns.org
Date: Sat, 12 Sep 2009 22:03:56 -0400
Subject: [PATCH 14/14] mr800: set radio frequency only upon success

Signed-off-by: David Ellingsworth da...@identd.dyndns.org
---
 drivers/media/radio/radio-mr800.c |8 ++--
 1 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/media/radio/radio-mr800.c b/drivers/media/radio/radio-mr800.c
index 4d955aa..f609fdf 100644
--- a/drivers/media/radio/radio-mr800.c
+++ b/drivers/media/radio/radio-mr800.c
@@ -235,6 +235,7 @@ static int amradio_setfreq(struct amradio_device *radio, int freq)
 	if (retval  0 || size != BUFFER_LENGTH)
 		goto out_err;
 
+	radio-curfreq = freq;
 	goto out;
 
 out_err:
@@ -370,13 +371,8 @@ static int vidioc_s_frequency(struct file *file, void *priv,
 struct v4l2_frequency *f)
 {
 	struct amradio_device *radio = file-private_data;
-	int retval = 0;
-
-	radio-curfreq = f-frequency;
 
-	retval = amradio_setfreq(radio, radio-curfreq);
-
-	return retval;
+	return amradio_setfreq(radio, f-frequency);
 }
 
 /* vidioc_g_frequency - get tuner radio frequency */
-- 
1.6.3.3



Re: cx88: 2 channels on each of 2 cards

2009-09-12 Thread hermann pitton

Am Sonntag, den 13.09.2009, 11:46 +1000 schrieb Adam Swift:
 Hi all,
 
 I have 2 LeadTek WinFast TV2000 XP Expert analog capture cards. I'm  
 attempting to get 4 channels of video in, using both the S-video and  
 component inputs (not the tuners) of each cards. I understand that  
 this was possible with the bt878 which this chip is an evolution of.
 
 However, it doesn't work.
 
 1 channel on each card gives no signal on the second card- i.e. the  
 one initialised second. This is from tests with  and ZoneAlarm (the  
 application I'm trying to use the cards with).
 
 2 channels on one card kinda works, but not correctly. Sometimes one  
 channel will display vertical split-screen of both feeds, with a  
 little noise at the top, bottom, and in between. Sometimes each  
 channel will display correctly, but will appear to vibrate up and  
 down, and the channels seem to alternate between which one updates. I  
 can provide screenshots of both these behaviours if it will help.
 
 I've tried this with the following kernels:
 2.6.29-larch
 2.6.17-10mdv
 
 If someone can point me in the right direction I may be able to do any  
 patches required myself, but I need a starting point.
 
 Thanks in advance,
 Adam Swift
 

Adam,

starting point here is, that neither of the now older chips like bt878,
saa713x or cx88xx can do two external inputs at the same time on one
chip at once. 

At least saa713x and cx88xx boards can do DVB and analog at once for
external inputs, if not depending on a single hybrid tuner for both,
also DVB and analog TV from tuners.

Else, they totally depend on software switching between those external
inputs.

In short, to have those inputs at once, you need at least two those
chips per board and PCI hardware able to deal with them.

Cheers,
Hermann





--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Problems with Pinnacle 310i (saa7134) and recent kernels

2009-09-12 Thread hermann pitton
Hi,

Am Samstag, den 12.09.2009, 21:39 + schrieb Avl Jawrowski:
 hermann pitton hermann-pitton at arcor.de writes:
 
   However it works still only with Kaffeine and w_scan.
   dvbscan (last mercurial) give:
  
  Off hand I can't tell, but try with scan.
  I did not use dvbscan since years and can't tell the status.
 
 Even scan works perfectly (I didn't know it).
 I think it's an mplayer problem, I'll write about it in the mplayer mailing 
 list.
 
  Cheers,
  Hermann
 
 You've been very helpful!
 Thank you very much,
 Avl
 

I'm sorry that we have some mess on some of such devices, but currently
really nobody can help much further.

Mike and Hauppauge don't have any schematics for LNA and external
antenna voltage switching for now, he assured it to me personally and we
must live with the back hacks for now and try to further work through
it.

However, mplayer should work as well, but my last checkout is a little
out dated.

It will go to Nico anyway, he is usually at the list here.

If you can tell me on what you are, I might be able to confirm or not.

The only other issue I'm aware of is that radio is broken since guessed
8 weeks on my tuners, only realized when testing on enabling external
active antenna voltage for DVB-T on a/some 310i.

Might be anything, hm, hopefully I should not have caused it ;)

Cheers,
Hermann




--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: (Saa7134) Re: ADS-Tech Instant TV PCI, no remote support, giving up.

2009-09-12 Thread hermann pitton

Am Samstag, den 12.09.2009, 10:14 +0200 schrieb Morvan Le Meut: 
 Since i don't know where to look, i finally decided to use a basic 
 incorrect keymap :
  /* ADS Tech Instant TV PCI Remote */
 static struct ir_scancode ir_codes_adstech_pci[] = {
 /* too many repeating codes : incorrect gpio ?. */

 { 0x1f, KEY_MUTE },
 { 0x1d, KEY_SEARCH },
 { 0x17, KEY_EPG },/* Guide */
 { 0x0f, KEY_UP },
 { 0x6, KEY_DOWN },
 { 0x16, KEY_LEFT },
 { 0x1e, KEY_RIGHT },
 { 0x0e, KEY_SELECT },/* Enter */
 { 0x1a, KEY_INFO },
 { 0x12, KEY_EXIT },
 { 0x19, KEY_PREVIOUS },
 { 0x11, KEY_NEXT },
 { 0x18, KEY_REWIND },
 { 0x10, KEY_FORWARD },
 { 0x4, KEY_PLAYPAUSE },
 { 0x07, KEY_STOP },
 { 0x1b, KEY_RECORD },
 { 0x13, KEY_TUNER },/* Live */
 { 0x0a, KEY_A },
 { 0x03, KEY_PROG1 },/* 1 */
 { 0x01, KEY_PROG2 },/* 2 */
 { 0x0, KEY_VIDEO },
 { 0x0b, KEY_CHANNELUP },
 { 0x08, KEY_CHANNELDOWN },
 { 0x15, KEY_VOLUMEUP },
 { 0x1c, KEY_VOLUMEDOWN },
 };
 
 struct ir_scancode_table ir_codes_adstech_pci_table = {
 .scan = ir_codes_adstech_pci,
 .size = ARRAY_SIZE(ir_codes_adstech_pci),
 };
 EXPORT_SYMBOL_GPL(ir_codes_adstech_pci_table);
 
 No numbers in favor of arrows and ch+/- Vol+/- . Well 246 will be arrows 
 and  5 select, 7 and 8 are undefined, 9 become vol-, 1 epg and 3 is tuner.
 If someone, one day, wants to find that missig bit, i'll be happy to 
 help. ( Strange anyway : it's as if there was a 0x7f mask even when i 
 specify a 0xff one )
 Feel free to write a patch.
 
 Morvan Le Meut a écrit :
  um .. help, please ?
  how can i make the driver read 1011011 instead of 011011 when i press 
  Power instead of record on the remote ?
 
  thanks
 

Morvan,

I still have a huge mail backlash and are not in details what you may
have tried already, but if you have a missing/unknown gpio on such a
remote, you start to test for that one with mask_keycode = 0x0 in
saa7134-input.c and if it is then found, you do add it to that mask.

If that doesn't help, it might be something special.

Cheers,
Hermann






--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Initial media controller implementation

2009-09-12 Thread hermann pitton

Am Samstag, den 12.09.2009, 13:13 +0200 schrieb Hans Verkuil:
 On Saturday 12 September 2009 13:05:14 Markus Rechberger wrote:
  Hi,
  
  On Sat, Sep 12, 2009 at 12:57 PM, Hans Verkuil hverk...@xs4all.nl wrote:
   Rather than writing long mails on what a media controller is and what it 
   can
   do, I thought that I could just as well implement it.
  
   So in 4 hours I implemented pretty much all of the media controller
   functionality. The main missing features are the ability to register 
   non-v4l
   device nodes so that they can be enumerated and setting controls private 
   to
   a sub-device. For that I should first finish the control handling 
   framework.
  
   The datastructures and naming conventions needs to be cleaned up, and it
   needs some tweaking, but I'd say this is pretty much the way I want it.
  
   The code is available here:
  
   http://linuxtv.org/hg/~hverkuil/v4l-dvb-mc/
  
   It includes a v4l2-mc utility in v4l2-apps/util that has the
   --show-topology option that enumerates all nodes and subdev. Currently any
   registered subdevs and v4l device nodes are already automatically added.
   Obviously, there are no links setup between them, that would require work
   in the drivers.
  
   Total diffstat:
  
b/linux/include/media/v4l2-mc.h |   54 +
b/v4l2-apps/util/v4l2-mc.cpp|  325 
   
linux/drivers/media/video/v4l2-dev.c|   15 +
linux/drivers/media/video/v4l2-device.c |  265 +-
linux/include/linux/videodev2.h |   74 +++
linux/include/media/v4l2-dev.h  |6
linux/include/media/v4l2-device.h   |   23 +-
linux/include/media/v4l2-subdev.h   |   11 -
v4l2-apps/util/Makefile |2
9 files changed, 762 insertions(+), 13 deletions(-)
  
   Ignoring the new utility that's just 435 lines of core code.
  
   Now try this with sysfs. Brrr.
  
  
  please even more important when doing this push out a proper
  documentation for it,
  The s2api is a mess seen from the documentation people need to hack
  existing code in order
  to figure out how to use it it seems. v4l2/(incomplete)linuxdvb v3 API
  are still the best references
  to start with right now.
 
 It will obviously be documented extensively when/if this becomes official.
 Right now it is an initial implementation people can play with.
 
 Regards,
 
  Hans

Hi,

going through mail backlash I arrived at least here for now.

What to say?

One of our previous best hackers, who decided meanwhile to distribute
exclusive hardware also on GNU/Linux, providing the driver only as
closed source, if the possessor/buyer/idiot is clearly identified by his
hardware and then gets it exclusively ...

Makes suggestions for better documentation ???

My Nero OEM version is now also to be claimed not to be functional
anymore after one year. Three years were guarantied once. Who cares? I
do. 

I'll bail out of that zoo very soon, if such is going further on.

Cheers,
Hermann






--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html