Format of /dev/video0 data for HVR-4000 frame grabber

2010-11-09 Thread Michael PARKER
All,

I'm attempting to capture a single frame from the /dev/video0 output of my 
HVR-4000 card's analogue tuner as a JPEG.

Whilst several resources exist for capturing the output of a card with h/w MPEG 
compression, I'm unable to determine the format of the /dev/video0 data for a 
frame grabber such as the HVR-4000.

Can anyone suggest a means by which I can capture a single frame from a frame 
grabber card? Can I just use dd if=/dev/video0 of=image.jpg bs=64K or similar 
or do I have to access the card via the V4L2 drivers?

Many thanks in advance,

Mike



--
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: Format of /dev/video0 data for HVR-4000 frame grabber

2010-11-09 Thread Daniel Glöckner
On Tue, Nov 09, 2010 at 09:43:29AM +0100, Michael PARKER wrote:
 I'm attempting to capture a single frame from the /dev/video0 output of
 my HVR-4000 card's analogue tuner as a JPEG.
 
 Whilst several resources exist for capturing the output of a card with
 h/w MPEG compression, I'm unable to determine the format of the
 /dev/video0 data for a frame grabber such as the HVR-4000.

According to the sourcecode the cx88 chip can do 8 bit grayscale,
15/16/24/32 bit RGB/BGR, and two variants of 4:2:2 YCbCr.
 
 Can anyone suggest a means by which I can capture a single frame from a
 frame grabber card? Can I just use dd if=/dev/video0 of=image.jpg bs=64K
 or similar or do I have to access the card via the V4L2 drivers?

Yes, dd should work but you need to use a blocksize that can hold a
complete frame and count=1 if you want a single frame. JPEG, as
mentioned above, is not possible with this board.

The resolution and data format can be selected with V4L2 ioctls.

  Daniel
--
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: Format of /dev/video0 data for HVR-4000 frame grabber

2010-11-09 Thread Michael PARKER
Daniel,

Many thanks for your mail. Please excuse the naivety of my questions - I'm a 
h/w guy and a nube to the s/w world.

 -Original Message-
 From: Daniel Glöckner [mailto:daniel...@gmx.net]
 Sent: 09 November 2010 09:10
 To: Michael PARKER
 Cc: linux-media@vger.kernel.org
 Subject: Re: Format of /dev/video0 data for HVR-4000 frame grabber
 
 On Tue, Nov 09, 2010 at 09:43:29AM +0100, Michael PARKER wrote:
  I'm attempting to capture a single frame from the /dev/video0 output of
  my HVR-4000 card's analogue tuner as a JPEG.
 
  Whilst several resources exist for capturing the output of a card with
  h/w MPEG compression, I'm unable to determine the format of the
  /dev/video0 data for a frame grabber such as the HVR-4000.
 
 According to the sourcecode the cx88 chip can do 8 bit grayscale,
 15/16/24/32 bit RGB/BGR, and two variants of 4:2:2 YCbCr.

Do you know which of these is the default format or how to determine the format 
I'm seeing coming out of /dev/video0? 

Do you have a suggestion for how data captured from /dev/video0 can be 
converted into a recognisable image format (JPEG, GIF, PNG etc.)?

I'm keen, if possible, to grab the single frame image using just command line 
tools and without recourse to ioctls, compiled code etc.

  Can anyone suggest a means by which I can capture a single frame from a
  frame grabber card? Can I just use dd if=/dev/video0 of=image.jpg bs=64K
  or similar or do I have to access the card via the V4L2 drivers?
 
 Yes, dd should work but you need to use a blocksize that can hold a
 complete frame and count=1 if you want a single frame. JPEG, as
 mentioned above, is not possible with this board.

Presumably blocksize is just x * y * depth? Do you happen to know the default 
x/y for the cx88 output? 

I assume that x/y can be set via ioctls but, as stated earlier, I'm keen to 
avoid writing/compiling code if I can. 

Do I need to make any allowance for any form of header within the blocksize?

Also, how do I synchronise dd to the beginning of a new frame (and thus avoid 
capturing sections of two frames)?

Thanks again,

Mike
--
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: [PATCH 0/6] rc-core: ir-core to rc-core conversion

2010-11-09 Thread David Härdeman
On Tue, 02 Nov 2010 21:17:38 +0100, David Härdeman da...@hardeman.nu
wrote:
 This is my current patch queue, the main change is to make struct rc_dev
 the primary interface for rc drivers and to abstract away the fact that
 there's an input device lurking in there somewhere.

Mauro,

you have neither commented on the patches nor committed them. At the same
time you've created a for_v2.6.38 branch where you've already committed
other IR related patches. Could you please provide some feedback on what
the plan is?

-- 
David Härdeman
--
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: [PATCH 0/6] rc-core: ir-core to rc-core conversion

2010-11-09 Thread Mauro Carvalho Chehab
Hi David,

Em 09-11-2010 08:27, David Härdeman escreveu:
 On Tue, 02 Nov 2010 21:17:38 +0100, David Härdeman da...@hardeman.nu
 wrote:
 This is my current patch queue, the main change is to make struct rc_dev
 the primary interface for rc drivers and to abstract away the fact that
 there's an input device lurking in there somewhere.
 
 Mauro,
 
 you have neither commented on the patches nor committed them. At the same
 time you've created a for_v2.6.38 branch where you've already committed
 other IR related patches. Could you please provide some feedback on what
 the plan is?

I've returned from LPC at Sunday. In the last two weeks, I received
about 140+ patches at patchwork, plus 8 pull requests, plus tons of emails that
I received at the last week. So, I have lots of backlog to handle.

My intention is to handle the pending stuff during this week.

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: [V4L][SAA7134] fix tda9887 detection on cold and eeprom read corruption on warm Medion 7134

2010-11-09 Thread Mauro Carvalho Chehab
Em 25-10-2010 15:59, Maciej Szmigiero escreveu:
 [V4L][SAA7134] fix tda9887 detection on cold and eeprom read corruption on 
 warm Medion 7134
 
 When Medion 7134 analog+DVB-T card is cold (after powerup) the tda9887 analog 
 demodulator
 won't show on i2c bus.
 This results in no signal on analog TV. After loading driver for second time
 eeprom (required for tuner autodetection) read is corrupted, but tda9987 is 
 detected
 properly and analog TV works when tuner model is forced.
 
 Fix tda9887 problem by moving its detect code after tuner setup which unhides 
 it.
 The eeprom read issue is fixed by opening i2c gate in DVB-T demodulator.
 
 Tested on Medion 7134 and also tested for reference on Typhoon Cardbus Hybrid
 (which also uses saa7134 driver).
 
 Signed-off-by: Maciej Szmigiero m...@o2.pl
 
 --- a/drivers/media/video/saa7134/saa7134-cards.c 2010-08-02 
 00:11:14.0 +0200
 +++ b/drivers/media/video/saa7134/saa7134-cards.c 2010-10-25 
 19:19:08.0 +0200
 @@ -7249,12 +7249,37 @@
   break;
   case SAA7134_BOARD_MD7134:
   {
 - u8 subaddr;
 + u8 subaddr, dmdregval;
   u8 data[3];
   int ret, tuner_t;
 + struct i2c_msg i2cgatemsg_r[] = { {.addr = 0x08, .flags = 0,
 + .buf = subaddr, .len = 1},
 + {.addr = 0x08,
 + .flags = I2C_M_RD,
 + .buf = dmdregval, .len = 1} };
 + struct i2c_msg i2cgatemsg_w[] = { {.addr = 0x08, .flags = 0,
 + .buf = data, .len = 2} };
   struct i2c_msg msg[] = {{.addr=0x50, .flags=0, .buf=subaddr, 
 .len = 1},
   {.addr=0x50, .flags=I2C_M_RD, 
 .buf=data, .len = 3}};
  
 + /* open i2c gate in DVB-T demod */
 + /* so eeprom read won't be corrupted */
 + subaddr = 0x7;
 + ret = i2c_transfer(dev-i2c_adap, i2cgatemsg_r, 2);
 + if ((ret == 2)  (dmdregval  0x2)) {
 + printk(KERN_NOTICE %s DVB-T demod i2c gate was left
 +  closed\n, dev-name);
 + printk(KERN_NOTICE %s previous informational
 +  EEPROM read might have been
 +  corrupted\n, dev-name);

hmm... I don't think we need those debug messages on normal cases. Also, we 
want the log
shown as:
saa7134: foo
and not as:
saa7134 foo

 +
 + data[0] = 0x7;
 + data[1] = (dmdregval  ~0x2);
 + if (i2c_transfer(dev-i2c_adap, i2cgatemsg_w, 1) != 1)
 + printk(KERN_ERR early i2c gate
 +  open failure\n);

Gah. A message like that should really specify the dev-name, and the board.

 + }
 +
   subaddr= 0x14;
   tuner_t = 0;
  
 @@ -7522,10 +7547,6 @@
   v4l2_i2c_new_subdev(dev-v4l2_dev,
   dev-i2c_adap, tuner, tuner,
   dev-radio_addr, NULL);
 - if (has_demod)
 - v4l2_i2c_new_subdev(dev-v4l2_dev,
 - dev-i2c_adap, tuner, tuner,
 - 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
   if (dev-tuner_addr == ADDR_UNSET) {
   enum v4l2_i2c_tuner_type type =
   has_demod ? ADDRS_TV_WITH_DEMOD : ADDRS_TV;
 @@ -7542,6 +7563,15 @@
  
   saa7134_tuner_setup(dev);
  
 + /* some cards (Medion 7134 for example) needs tuner to be setup */
 + /* before tda9887 shows itself on i2c bus */
 + if ((TUNER_ABSENT != dev-tuner_type)
 +  (dev-tda9887_conf  TDA9887_PRESENT)) {
 + v4l2_i2c_new_subdev(dev-v4l2_dev,
 + dev-i2c_adap, tuner, tuner,
 + 0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 + }
 +
   switch (dev-board) {
   case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM:
   case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:

The order change for the demod probe will likely break support for other boards.
If the problem is specific to Medion 7134, what you should do, instead, is to
change the order just for MD7134 (so, inside the switch(dev-board)).

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: em28xx: Terratec Grabby no sound

2010-11-09 Thread Mauro Carvalho Chehab
Em 26-10-2010 10:58, Florian Klink escreveu:
 Hi,
 
 The sound comes from alsa device. Several em28xx types provide
 standard USB audio. So,
 snd-usb-audio handles it. That's why you need
 alsa:adevice=hw.2,0:forceaudio at mplayer.
 
 ... but thats my problem.
 sound doesn't appear inside mplayer, even with the command line options set 
 to use the external alsa device. However, arecord -D hw:2,0 -r 32000 -c 2 
 -f S16_LE | aplay - plays the sound, but only before mplayer tried to access 
 the sound card

Have you tried my patch?

If you're using alsa:adevice=hw.2,0:forceaudio at mplayer, you should not be 
running arecord/aplay. You need
to use one solution or the other.
 
 When trying to play sound with arecord again after mplayer tried to access 
 it, I have to re-plug the card to get it playing sound over arecord again, 
 video only seems to not break it. There is no error message or something in 
 arecord when it's not playing anything, just silence and the same command 
 line output.
 
 Is there maybe anything with the sample format S16_LE or something that 
 confuses mplayer/the driver/whatever?
 
 Strange problem...
 
 mplayer output (mplayer -v -tv 
 driver=v4l2:input=0:device=/dev/video1:alsa:adevice=hw.2,0:forceaudio tv://):
 http://pastebin.com/yTV300iG
 
 Florian
 -- 
 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: [GIT PATCHES FOR 2.6.37] Various gspca patches

2010-11-09 Thread Mauro Carvalho Chehab
Em 27-10-2010 10:35, Hans de Goede escreveu:
 Hi Mauro,
 
 Please pull from:
 http://linuxtv.org/hg/~hgoede/ibmcam3
 
 Starting at the commit titled:
 gspca: submit interrupt urbs *after* isoc urbs
 
 This pull consists of the following commits:
 gspca: submit interrupt urbs *after* isoc urbs
 gspca: only set gspca-int_urb if submitting it succeeds
 gspca-stv06xx: support bandwidth changing
 gspca_xirlink_cit: various usb bandwidth allocation improvements / fixes
 gspca_xirlink_cit: Frames have a 4 byte footer
 gspca_xirlink_cit: Add support camera button
 gspca_ov519: generate release button event on stream stop if needed
 
 Note that since the hg v4l-dvb tree is a bit out of data, pulling from
 my hg tree won't apply cleanly though. So to make things easier for you
 I'm in the process of switching over to git. This mail will be followed
 by the 7 patches from this pull request in git format-patch format, rebased
 on top of the master branch of your git tree:
 git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-next.git
 
 The reason I'm not sending a git pull request is because I don't
 have a git tree, and I could not find documentation for creating
 a git tree @ git.linuxtv.org. Can you help me with this?
 
 Also this wiki page:
 http://linuxtv.org/wiki/index.php/Maintaining_Git_trees
 Points to the obsolete: git://linuxtv.org/v4l-dvb.git
 Repository, please update it.
 
 Thanks  Regards,
 
 Hans
 --
 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

All patches but one applied fine. I had to do one trivial merge conflict fix.

This one, however, has a more complex conflict, so I prefer if you could fix
and re-send. Feel free to resend via email, if you were not able to create your
git tree yet.

Thanks,
Mauro.


From: Hans de Goede  hdego...@redhat.com
Commiter: Hans de Goede hdego...@redhat.com
Date: Tue Oct 26 14:43:35 2010 +0200
Subject: gspca-stv06xx: support bandwidth changing

stv06xx devices have only one altsetting, but the actual used
bandwidth can be programmed through a register. We were already
setting this register lower then the max packetsize of the altsetting
indicates. This patch makes the gspca-stv06xx update the usb descriptor
for the alt setting to reflect the actual packetsize in use, so that
the usb subsystem uses the correct information for scheduling usb transfers.

This patch also tries to fallback to lower speeds in case a ENOSPC error
is received when submitting urbs, but currently this is only supported
with stv06xx cams with the pb0100 sensor, as this is the only one for
which we know how to change the framerate.

This patch is based on an initial incomplete patch by
Lee Jones lee.jo...@canonical.com

Priority: normal

Signed-off-by: Lee Jones lee.jo...@canonical.com
Signed-off-by: Hans de Goede hdego...@redhat.com
---

diff -upNr oldtree/drivers/media/video/gspca/stv06xx/stv06xx.c 
linux/drivers/media/video/gspca/stv06xx/stv06xx.c
--- oldtree/drivers/media/video/gspca/stv06xx/stv06xx.c 2010-11-09 
12:41:28.0 -0200
+++ linux/drivers/media/video/gspca/stv06xx/stv06xx.c   2010-11-09 
12:41:24.0 -0200
@@ -263,7 +263,21 @@ static int stv06xx_init(struct gspca_dev
 static int stv06xx_start(struct gspca_dev *gspca_dev)
 {
struct sd *sd = (struct sd *) gspca_dev;
-   int err;
+   struct usb_host_interface *alt;
+   struct usb_interface *intf;
+   int err, packet_size;
+
+   intf = usb_ifnum_to_if(sd-gspca_dev.dev, sd-gspca_dev.iface);
+   alt = usb_altnum_to_altsetting(intf, sd-gspca_dev.alt);
+   if (!alt) {
+   PDEBUG(D_ERR, Couldn't get altsetting);
+   return -EIO;
+   }
+
+   packet_size = le16_to_cpu(alt-endpoint[0].desc.wMaxPacketSize);
+   err = stv06xx_write_bridge(sd, STV_ISO_SIZE_L, packet_size);
+   if (err  0)
+   return err;
 
/* Prepare the sensor for start */
err = sd-sensor-start(sd);
@@ -282,6 +296,43 @@ out:
return (err  0) ? err : 0;
 }
 
+static int stv06xx_isoc_init(struct gspca_dev *gspca_dev)
+{
+   struct usb_host_interface *alt;
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   /* Start isoc bandwidth negotiation at max isoc bandwidth */
+   alt = gspca_dev-dev-config-intf_cache[0]-altsetting[1];
+   alt-endpoint[0].desc.wMaxPacketSize =
+   cpu_to_le16(sd-sensor-max_packet_size[gspca_dev-curr_mode]);
+
+   return 0;
+}
+
+static int stv06xx_isoc_nego(struct gspca_dev *gspca_dev)
+{
+   int ret, packet_size, min_packet_size;
+   struct usb_host_interface *alt;
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   alt = gspca_dev-dev-config-intf_cache[0]-altsetting[1];
+   packet_size = le16_to_cpu(alt-endpoint[0].desc.wMaxPacketSize);
+   min_packet_size = sd-sensor-min_packet_size[gspca_dev-curr_mode];
+   if 

RE: Format of /dev/video0 data for HVR-4000 frame grabber

2010-11-09 Thread Andy Walls
On Tue, 2010-11-09 at 10:34 +0100, Michael PARKER wrote:
 Daniel,
 
 Many thanks for your mail. Please excuse the naivety of my questions -
 I'm a h/w guy and a nube to the s/w world.


 Do you know which of these is the default format or how to determine
 the format I'm seeing coming out of /dev/video0? 

$ v4l2-ctl -d /dev/video0 --list-formats
$ v4l2-ctl -d /dev/video0 --get-fmt-video
$ v4l2-ctl --help

 Do you have a suggestion for how data captured from /dev/video0 can be
 converted into a recognisable image format (JPEG, GIF, PNG etc.)?
 
 I'm keen, if possible, to grab the single frame image using just
 command line tools and without recourse to ioctls, compiled code etc.

v4l2-ctl can set up the device.  As you and Daniel mentioned, dd can
read off a frame given the proper parameters.


 Also, how do I synchronise dd to the beginning of a new frame (and
 thus avoid capturing sections of two frames)?

When dd open()s the device and does a read() it should start a capture.
When dd close()s the device and exits, it should stop the capture.  I'm
fairly certain stopping and restarting a capture should resynchronize
things, but I'm not sure.  The overhead of stopping and starting a
capture may cause you some noticeable delays, but again, I'm not sure.

I think the answer is to write some code and use the Streaming I/O
ioctl()s interface to get frame based data. I know you were hoping to
avoid that.

Regards,
Andy

 Thanks again,
 
 Mike


--
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


[PATCH 0/2] Use modaliases to load I2C modules

2010-11-09 Thread Laurent Pinchart
Hi everybody,

Here are the last two patches that complete the removal of the module_name
argument from the v4l2_i2c_new_subdev* functions. All the other patches have
already been merged in 2.6.37-rc1, and the goal was to merge one last patch
after the end of the merge window to avoid conflicts.

Unfortunately a few new drivers started using the v4l2_i2c_new_subdev*
functions (s5p-fimc and via-camera) and part of one previous patch got
reverted during a merge conflict resolution. I've thus included a patch that
fixes those drivers.

I will post a pull request against Mauro's linux-next tree as soon as the bad
cafe-ccic merge conflict resolution gets there.

Laurent Pinchart (2):
  v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev* (2)
  v4l: Remove module_name argument to the v4l2_i2c_new_subdev*
functions

 drivers/media/radio/radio-si4713.c|2 +-
 drivers/media/video/au0828/au0828-cards.c |4 ++--
 drivers/media/video/bt8xx/bttv-cards.c|   22 +++---
 drivers/media/video/cafe_ccic.c   |3 +--
 drivers/media/video/cx18/cx18-i2c.c   |8 
 drivers/media/video/cx231xx/cx231xx-cards.c   |4 ++--
 drivers/media/video/cx23885/cx23885-cards.c   |2 +-
 drivers/media/video/cx23885/cx23885-video.c   |4 ++--
 drivers/media/video/cx88/cx88-cards.c |9 -
 drivers/media/video/cx88/cx88-video.c |7 +++
 drivers/media/video/davinci/vpfe_capture.c|1 -
 drivers/media/video/davinci/vpif_capture.c|1 -
 drivers/media/video/davinci/vpif_display.c|2 +-
 drivers/media/video/em28xx/em28xx-cards.c |   18 +-
 drivers/media/video/fsl-viu.c |2 +-
 drivers/media/video/ivtv/ivtv-i2c.c   |   22 +-
 drivers/media/video/mxb.c |   12 ++--
 drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 ++
 drivers/media/video/s5p-fimc/fimc-capture.c   |2 +-
 drivers/media/video/saa7134/saa7134-cards.c   |8 
 drivers/media/video/saa7134/saa7134-core.c|4 ++--
 drivers/media/video/sh_vou.c  |2 +-
 drivers/media/video/soc_camera.c  |2 +-
 drivers/media/video/usbvision/usbvision-i2c.c |6 +++---
 drivers/media/video/v4l2-common.c |   15 +--
 drivers/media/video/via-camera.c  |2 +-
 drivers/media/video/vino.c|4 ++--
 drivers/media/video/zoran/zoran_card.c|5 ++---
 drivers/staging/go7007/go7007-driver.c|2 +-
 drivers/staging/tm6000/tm6000-cards.c |4 ++--
 include/media/v4l2-common.h   |   16 ++--
 31 files changed, 90 insertions(+), 111 deletions(-)

-- 
Regards,

Laurent Pinchart

--
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


[PATCH 1/2] v4l: Remove hardcoded module names passed to v4l2_i2c_new_subdev* (2)

2010-11-09 Thread Laurent Pinchart
With the v4l2_i2c_new_subdev* functions now supporting loading modules
based on modaliases, replace the hardcoded module name passed to those
functions by NULL in the cafe-ccic, via-camera and s5p-fimc drivers.

All corresponding I2C modules have been checked, and all of them include
a module aliases table with names corresponding to what the drivers
modified here use.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/media/video/cafe_ccic.c |3 +--
 drivers/media/video/s5p-fimc/fimc-capture.c |2 +-
 drivers/media/video/via-camera.c|2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index 5ae2cec..68b6dce 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -2064,8 +2064,7 @@ static int cafe_pci_probe(struct pci_dev *pdev,
 
cam-sensor_addr = 0x42;
cam-sensor = v4l2_i2c_new_subdev_cfg(cam-v4l2_dev, cam-i2c_adapter,
-   ov7670, ov7670, 0, sensor_cfg, cam-sensor_addr,
-   NULL);
+   NULL, ov7670, 0, sensor_cfg, cam-sensor_addr, NULL);
if (cam-sensor == NULL) {
ret = -ENODEV;
goto out_smbus;
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c 
b/drivers/media/video/s5p-fimc/fimc-capture.c
index e8f13d3..26f7ad2 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -44,7 +44,7 @@ static struct v4l2_subdev *fimc_subdev_register(struct 
fimc_dev *fimc,
return ERR_PTR(-ENOMEM);
 
sd = v4l2_i2c_new_subdev_board(vid_cap-v4l2_dev, i2c_adap,
-  MODULE_NAME, isp_info-board_info, NULL);
+  NULL, isp_info-board_info, NULL);
if (!sd) {
v4l2_err(vid_cap-v4l2_dev, failed to acquire subdev\n);
return NULL;
diff --git a/drivers/media/video/via-camera.c b/drivers/media/video/via-camera.c
index 02a21bc..01bcdb4 100644
--- a/drivers/media/video/via-camera.c
+++ b/drivers/media/video/via-camera.c
@@ -1360,7 +1360,7 @@ static __devinit int viacam_probe(struct platform_device 
*pdev)
 */
sensor_adapter = viafb_find_i2c_adapter(VIA_PORT_31);
cam-sensor = v4l2_i2c_new_subdev(cam-v4l2_dev, sensor_adapter,
-   ov7670, ov7670, 0x42  1, NULL);
+   NULL, ov7670, 0x42  1, NULL);
if (cam-sensor == NULL) {
dev_err(pdev-dev, Unable to find the sensor!\n);
ret = -ENODEV;
-- 
1.7.2.2

--
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


[PATCH 2/2] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions

2010-11-09 Thread Laurent Pinchart
The argument isn't used anymore by the functions, remote it.

Signed-off-by: Laurent Pinchart laurent.pinch...@ideasonboard.com
---
 drivers/media/radio/radio-si4713.c|2 +-
 drivers/media/video/au0828/au0828-cards.c |4 ++--
 drivers/media/video/bt8xx/bttv-cards.c|   22 +++---
 drivers/media/video/cafe_ccic.c   |2 +-
 drivers/media/video/cx18/cx18-i2c.c   |8 
 drivers/media/video/cx231xx/cx231xx-cards.c   |4 ++--
 drivers/media/video/cx23885/cx23885-cards.c   |2 +-
 drivers/media/video/cx23885/cx23885-video.c   |4 ++--
 drivers/media/video/cx88/cx88-cards.c |9 -
 drivers/media/video/cx88/cx88-video.c |7 +++
 drivers/media/video/davinci/vpfe_capture.c|1 -
 drivers/media/video/davinci/vpif_capture.c|1 -
 drivers/media/video/davinci/vpif_display.c|2 +-
 drivers/media/video/em28xx/em28xx-cards.c |   18 +-
 drivers/media/video/fsl-viu.c |2 +-
 drivers/media/video/ivtv/ivtv-i2c.c   |   22 +-
 drivers/media/video/mxb.c |   12 ++--
 drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 ++
 drivers/media/video/s5p-fimc/fimc-capture.c   |2 +-
 drivers/media/video/saa7134/saa7134-cards.c   |8 
 drivers/media/video/saa7134/saa7134-core.c|4 ++--
 drivers/media/video/sh_vou.c  |2 +-
 drivers/media/video/soc_camera.c  |2 +-
 drivers/media/video/usbvision/usbvision-i2c.c |6 +++---
 drivers/media/video/v4l2-common.c |   15 +--
 drivers/media/video/via-camera.c  |2 +-
 drivers/media/video/vino.c|4 ++--
 drivers/media/video/zoran/zoran_card.c|5 ++---
 drivers/staging/go7007/go7007-driver.c|2 +-
 drivers/staging/tm6000/tm6000-cards.c |4 ++--
 include/media/v4l2-common.h   |   16 ++--
 31 files changed, 90 insertions(+), 110 deletions(-)

diff --git a/drivers/media/radio/radio-si4713.c 
b/drivers/media/radio/radio-si4713.c
index 6a43578..03829e6 100644
--- a/drivers/media/radio/radio-si4713.c
+++ b/drivers/media/radio/radio-si4713.c
@@ -291,7 +291,7 @@ static int radio_si4713_pdriver_probe(struct 
platform_device *pdev)
goto unregister_v4l2_dev;
}
 
-   sd = v4l2_i2c_new_subdev_board(rsdev-v4l2_dev, adapter, NULL,
+   sd = v4l2_i2c_new_subdev_board(rsdev-v4l2_dev, adapter,
pdata-subdev_board_info, NULL);
if (!sd) {
dev_err(pdev-dev, Cannot get v4l2 subdevice\n);
diff --git a/drivers/media/video/au0828/au0828-cards.c 
b/drivers/media/video/au0828/au0828-cards.c
index 0453816..01be89f 100644
--- a/drivers/media/video/au0828/au0828-cards.c
+++ b/drivers/media/video/au0828/au0828-cards.c
@@ -212,7 +212,7 @@ void au0828_card_setup(struct au0828_dev *dev)
   be abstracted out if we ever need to support a different
   demod) */
sd = v4l2_i2c_new_subdev(dev-v4l2_dev, dev-i2c_adap,
-   NULL, au8522, 0x8e  1, NULL);
+   au8522, 0x8e  1, NULL);
if (sd == NULL)
printk(KERN_ERR analog subdev registration failed\n);
}
@@ -221,7 +221,7 @@ void au0828_card_setup(struct au0828_dev *dev)
if (dev-board.tuner_type != TUNER_ABSENT) {
/* Load the tuner module, which does the attach */
sd = v4l2_i2c_new_subdev(dev-v4l2_dev, dev-i2c_adap,
-   NULL, tuner, dev-board.tuner_addr, NULL);
+   tuner, dev-board.tuner_addr, NULL);
if (sd == NULL)
printk(KERN_ERR tuner subdev registration fail\n);
 
diff --git a/drivers/media/video/bt8xx/bttv-cards.c 
b/drivers/media/video/bt8xx/bttv-cards.c
index 87d8b00..49efcf6 100644
--- a/drivers/media/video/bt8xx/bttv-cards.c
+++ b/drivers/media/video/bt8xx/bttv-cards.c
@@ -3529,7 +3529,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
struct v4l2_subdev *sd;
 
sd = v4l2_i2c_new_subdev(btv-c.v4l2_dev,
-   btv-c.i2c_adap, NULL, saa6588, 0, addrs);
+   btv-c.i2c_adap, saa6588, 0, addrs);
btv-has_saa6588 = (sd != NULL);
}
 
@@ -3554,7 +3554,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
};
 
btv-sd_msp34xx = v4l2_i2c_new_subdev(btv-c.v4l2_dev,
-   btv-c.i2c_adap, NULL, msp3400, 0, addrs);
+   btv-c.i2c_adap, msp3400, 0, addrs);
if (btv-sd_msp34xx)
return;
goto no_audio;
@@ -3568,7 +3568,7 @@ void __devinit bttv_init_card2(struct bttv *btv)
};
 

Re: [PATCH 2/2] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions

2010-11-09 Thread Antonio Ospite
On Tue,  9 Nov 2010 16:30:28 +0100
Laurent Pinchart laurent.pinch...@ideasonboard.com wrote:

 The argument isn't used anymore by the functions, remote it.

s/remote/remove/

Regards,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

A: Because it messes up the order in which people normally read text.
   See http://en.wikipedia.org/wiki/Posting_style
Q: Why is top-posting such a bad thing?


pgpVuK3JLfxEk.pgp
Description: PGP signature


Re: [PATCH 2/2] v4l: Remove module_name argument to the v4l2_i2c_new_subdev* functions

2010-11-09 Thread Laurent Pinchart
Hi Antonio,

On Tuesday 09 November 2010 16:33:25 Antonio Ospite wrote:
 On Tue,  9 Nov 2010 16:30:28 +0100
 
 Laurent Pinchart laurent.pinch...@ideasonboard.com wrote:
  The argument isn't used anymore by the functions, remote it.
 
 s/remote/remove/

Oops :-)

Thanks, I'll fix that when sending the pull request.

-- 
Regards,

Laurent Pinchart
--
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: Format of /dev/video0 data for HVR-4000 frame grabber

2010-11-09 Thread Michael PARKER
Andy,

Thanks - I'm looking over the source code for the V4L2 sample capture 
application (http://v4l2spec.bytesex.org/v4l2spec/capture.c) for inspiration.

I'm still more than a little unclear how I go about transforming my captured 
frame into an image file. 

Can you point me in the direction of a utility/methodology that I can use to 
transform RGB/BGR/YCbCr/greyscale into JPEG/PNG/GIF or similar?

Cheers,

Mike

 -Original Message-
 From: Andy Walls [mailto:awa...@md.metrocast.net]
 Sent: 09 November 2010 12:29
 To: Michael PARKER
 Cc: Daniel Glöckner; linux-media@vger.kernel.org
 Subject: RE: Format of /dev/video0 data for HVR-4000 frame grabber
 
 On Tue, 2010-11-09 at 10:34 +0100, Michael PARKER wrote:
  Daniel,
 
  Many thanks for your mail. Please excuse the naivety of my questions -
  I'm a h/w guy and a nube to the s/w world.
 
 
  Do you know which of these is the default format or how to determine
  the format I'm seeing coming out of /dev/video0?
 
 $ v4l2-ctl -d /dev/video0 --list-formats
 $ v4l2-ctl -d /dev/video0 --get-fmt-video
 $ v4l2-ctl --help
 
  Do you have a suggestion for how data captured from /dev/video0 can be
  converted into a recognisable image format (JPEG, GIF, PNG etc.)?
 
  I'm keen, if possible, to grab the single frame image using just
  command line tools and without recourse to ioctls, compiled code etc.
 
 v4l2-ctl can set up the device.  As you and Daniel mentioned, dd can
 read off a frame given the proper parameters.
 
 
  Also, how do I synchronise dd to the beginning of a new frame (and
  thus avoid capturing sections of two frames)?
 
 When dd open()s the device and does a read() it should start a capture.
 When dd close()s the device and exits, it should stop the capture.  I'm
 fairly certain stopping and restarting a capture should resynchronize
 things, but I'm not sure.  The overhead of stopping and starting a
 capture may cause you some noticeable delays, but again, I'm not sure.
 
 I think the answer is to write some code and use the Streaming I/O
 ioctl()s interface to get frame based data. I know you were hoping to
 avoid that.
 
 Regards,
 Andy
 
  Thanks again,
 
  Mike
 

N�r��yb�X��ǧv�^�)޺{.n�+{���bj)w*jg����ݢj/���z�ޖ��2�ޙ�)ߡ�a�����G���h��j:+v���w��٥

Trying to get unlisted Terratec Cinergy to work

2010-11-09 Thread Mark van Reijn
Hi everyone,

I have been trying to get my Terratec Cinergy HT USB PVR tuner to
work (on DVB-T). This is a hybrid analog/dvb-t tuner with a hardware
MPEG encoder.
Inserting the device does not cause any driver to respond and load.
The USB ID is 0ccd:006b. The PID is not listed in dvb-usb-ids.h.

After quite a bit of research I have a lot of information on the
device. I also opened it up to check the actual chip versions (took me
back to slackware 3 and graphics cards).
The various components are:
* Cypress CY7C68013A FX2 USB controller
* Intel CE6353 demodulator (should be the same as Zarlink ZL10353)
* XCeive XC3028 tuner
(* Conexant CX25843 a/v decoder)
(* Conexant CX23416 MPEG encoder)

The last two should not be really necessary from what I have learned.

From what I can see, all components are supported in one way or
another. There are several drivers that mention the combination of
FX2, ZL10353 and XC2028/XC3028, cxusb seems to be closest. A
copy-paste from existing code might do the trick.

One thing stands in my way: I have never written C code in my life. I
can read the code and more or less understand what the purpose is, but
to combine stuff into a working driver requires real skills :-)

I have the correct xceive and conexant firmwares, a windows driver
with INF file, etc. at my disposal.
Can anyone help me assemble a driver for my device?
TIA,

Mark
--
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: [V4L][SAA7134] fix tda9887 detection on cold and eeprom read corruption on warm Medion 7134

2010-11-09 Thread Maciej Szmigiero
W dniu 09.11.2010 11:53, Mauro Carvalho Chehab pisze:
 Em 25-10-2010 15:59, Maciej Szmigiero escreveu:
 +printk(KERN_NOTICE %s DVB-T demod i2c gate was left
 + closed\n, dev-name);
 +printk(KERN_NOTICE %s previous informational
 + EEPROM read might have been
 + corrupted\n, dev-name);
 
 hmm... I don't think we need those debug messages on normal cases. 

I added this message because when the gate was left closed the eeprom content 
(printed out unconditionally in saa7134_i2c_eeprom) looks garbled in dmesg,
so it's better to inform user that he (or she) shouldn't be worried about this.
The eeprom dump is called from saa7134_i2c_register, before card-specific code 
has opportunity to run.

  saa7134_tuner_setup(dev);
  
 +/* some cards (Medion 7134 for example) needs tuner to be setup */
 +/* before tda9887 shows itself on i2c bus */
 +if ((TUNER_ABSENT != dev-tuner_type)
 + (dev-tda9887_conf  TDA9887_PRESENT)) {
 +v4l2_i2c_new_subdev(dev-v4l2_dev,
 +dev-i2c_adap, tuner, tuner,
 +0, v4l2_i2c_tuner_addrs(ADDRS_DEMOD));
 +}
 +
  switch (dev-board) {
  case SAA7134_BOARD_BEHOLD_COLUMBUS_TVFM:
  case SAA7134_BOARD_AVERMEDIA_CARDBUS_501:
 
 The order change for the demod probe will likely break support for other 
 boards.
 If the problem is specific to Medion 7134, what you should do, instead, is to
 change the order just for MD7134 (so, inside the switch(dev-board)).

It was done in that order (tuner first then tda9887) for a long time before it 
was changed.
For example ( 
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=drivers/media/video/saa7134/saa7134-core.c;hb=7a766f9ddd74b50d6069f054a3004ece0439f5c1
 ) it used to look like that:
 942 /* load i2c helpers */
 943 if (TUNER_ABSENT != dev-tuner_type)
 944 request_module(tuner);
 945 if (dev-tda9887_conf)
 946 request_module(tda9887);
 947 if (card_is_empress(dev)) {
 948 request_module(saa6752hs);
 949 request_module_depend(saa7134-empress,need_empress);
 950 }

But then the code for tda9887 was integrated into tuner module and later split 
out again, this time reversing the detection order (by accident I suppose).
 
 Cheers,
 Mauro.
 

Best regards,
Maciej Szmigiero
--
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: [PATCH 6/6] davinci vpbe: Build infrastructure for VPBE driver

2010-11-09 Thread Sergei Shtylyov

Hello.

Manjunath Hadli wrote:


From: Muralidharan Karicheri m-kariche...@ti.com



This patch adds the build infra-structure for Davinci
VPBE dislay driver.



Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com

[...]


diff --git a/drivers/media/video/davinci/Kconfig 
b/drivers/media/video/davinci/Kconfig
index 6b19540..dab32d5 100644
--- a/drivers/media/video/davinci/Kconfig
+++ b/drivers/media/video/davinci/Kconfig
@@ -91,3 +91,25 @@ config VIDEO_ISIF
 
 	   To compile this driver as a module, choose M here: the

   module will be called vpfe.
+
+config VIDEO_DM644X_VPBE
+tristate DM644X VPBE HW module
+select VIDEO_VPSS_SYSTEM
+   select VIDEOBUF_DMA_CONTIG
+help


   Please use tabs for indentation uniformly.

WBR, Sergei

--
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: [PATCH 6/6] davinci vpbe: Build infrastructure for VPBE driver

2010-11-09 Thread Hadli, Manjunath
On Tue, Nov 09, 2010 at 20:21:50, Sergei Shtylyov wrote:
 Hello.
 
 Manjunath Hadli wrote:
 
  From: Muralidharan Karicheri m-kariche...@ti.com
 
  This patch adds the build infra-structure for Davinci VPBE dislay 
  driver.
 
  Signed-off-by: Muralidharan Karicheri m-kariche...@ti.com
  Signed-off-by: Manjunath Hadli manjunath.ha...@ti.com
 [...]
 
  diff --git a/drivers/media/video/davinci/Kconfig 
  b/drivers/media/video/davinci/Kconfig
  index 6b19540..dab32d5 100644
  --- a/drivers/media/video/davinci/Kconfig
  +++ b/drivers/media/video/davinci/Kconfig
  @@ -91,3 +91,25 @@ config VIDEO_ISIF
   
 To compile this driver as a module, choose M here: the
 module will be called vpfe.
  +
  +config VIDEO_DM644X_VPBE
  +tristate DM644X VPBE HW module
  +select VIDEO_VPSS_SYSTEM
  +   select VIDEOBUF_DMA_CONTIG
  +help
 
 Please use tabs for indentation uniformly.
 
 WBR, Sergei
 
 

Sure. Thank you for the review.
-Manju

--
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: [git:v4l-dvb/for_v2.6.38] [media] tm6000: bugfix set tv standards

2010-11-09 Thread Stefan Ringel

 Am 09.11.2010 13:20, schrieb Mauro Carvalho Chehab:

This is an automatic generated email to let you know that the following patch 
were queued at the
http://git.linuxtv.org/media_tree.git tree:

Subject: [media] tm6000: bugfix set tv standards
Author:  Stefan Ringelstefan.rin...@arcor.de
Date:Wed Oct 27 16:48:05 2010 -0300

bugfix set tv standards

Signed-off-by: Stefan Ringelstefan.rin...@arcor.de
Signed-off-by: Mauro Carvalho Chehabmche...@redhat.com

  drivers/staging/tm6000/tm6000-video.c |1 +
  1 files changed, 1 insertions(+), 0 deletions(-)

---

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=8eb5e30293e2460a37feaaa94abc7c6ede6cc29d

diff --git a/drivers/staging/tm6000/tm6000-video.c 
b/drivers/staging/tm6000/tm6000-video.c
index 9ec8279..c5690b2 100644
--- a/drivers/staging/tm6000/tm6000-video.c
+++ b/drivers/staging/tm6000/tm6000-video.c
@@ -1032,6 +1032,7 @@ static int vidioc_s_std (struct file *file, void *priv, 
v4l2_std_id *norm)
struct tm6000_fh   *fh=priv;
struct tm6000_core *dev = fh-dev;

+   dev-norm = *norm;
rc = tm6000_init_analog_mode(dev);

fh-width  = dev-width;

Why not in 2.6.37-rc2 ?
--
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://www.kernellabs.com/hg/~dheitmueller/v4l-dvb-950q-final

2010-11-09 Thread Mauro Carvalho Chehab
Em 02-11-2010 16:47, Devin Heitmueller escreveu:
 On Sat, Oct 9, 2010 at 2:40 PM, Devin Heitmueller
 dheitmuel...@kernellabs.com wrote:
 Hello,

 Please pull from the following for some basic fixes related to
 applications such as tvtime hanging when no video is present, as well
 as some quality improvements for analog.

 http://www.kernellabs.com/hg/~dheitmueller/v4l-dvb-950q-final

 Please let me know if there are any questions/problems.

I'm still importing your patches, but, at the very first one, you
forgot to send your Signed-off-by:

Generating hg_15168_djh_merge_vbi_changes.patch
WARNING: please, no space before tabs
#39: FILE: drivers/media/video/au0828/au0828.h:155:
+^Istruct au0828_buffer^I*vbi_buf;$

ERROR: Missing Signed-off-by: line(s)

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: [PULL] http://www.kernellabs.com/hg/~dheitmueller/v4l-dvb-950q-final

2010-11-09 Thread Devin Heitmueller
On Tue, Nov 9, 2010 at 11:03 AM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Em 02-11-2010 16:47, Devin Heitmueller escreveu:
 On Sat, Oct 9, 2010 at 2:40 PM, Devin Heitmueller
 dheitmuel...@kernellabs.com wrote:
 Hello,

 Please pull from the following for some basic fixes related to
 applications such as tvtime hanging when no video is present, as well
 as some quality improvements for analog.

 http://www.kernellabs.com/hg/~dheitmueller/v4l-dvb-950q-final

 Please let me know if there are any questions/problems.

 I'm still importing your patches, but, at the very first one, you
 forgot to send your Signed-off-by:

 Generating hg_15168_djh_merge_vbi_changes.patch
 WARNING: please, no space before tabs
 #39: FILE: drivers/media/video/au0828/au0828.h:155:
 +^Istruct au0828_buffer    ^I*vbi_buf;$

 ERROR: Missing Signed-off-by: line(s)

 Cheers,
 Mauro


djh - merge vbi changes was just a rebase against the latest code.
The very first patch in the series is one earlier (047a8c9fa9d5).

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


[PATCH v2] tm6000: add revision check

2010-11-09 Thread stefan . ringel
From: Stefan Ringel stefan.rin...@arcor.de

adding chip revision check


Signed-off-by: Stefan Ringel stefan.rin...@arcor.de
---
 drivers/staging/tm6000/tm6000-cards.c |7 ---
 drivers/staging/tm6000/tm6000-core.c  |   27 ---
 2 files changed, 20 insertions(+), 14 deletions(-)

diff --git a/drivers/staging/tm6000/tm6000-cards.c 
b/drivers/staging/tm6000/tm6000-cards.c
index 664e603..1c9374a 100644
--- a/drivers/staging/tm6000/tm6000-cards.c
+++ b/drivers/staging/tm6000/tm6000-cards.c
@@ -521,13 +521,6 @@ int tm6000_cards_setup(struct tm6000_core *dev)
printk(KERN_ERR Error %i doing tuner reset\n, 
rc);
return rc;
}
-   msleep(10);
-
-   if (!i) {
-   rc = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 
0, 0);
-   if (rc = 0)
-   printk(KERN_DEBUG board=0x%08x\n, rc);
-   }
}
} else {
printk(KERN_ERR Tuner reset is not configured\n);
diff --git a/drivers/staging/tm6000/tm6000-core.c 
b/drivers/staging/tm6000/tm6000-core.c
index df3f187..121dc46 100644
--- a/drivers/staging/tm6000/tm6000-core.c
+++ b/drivers/staging/tm6000/tm6000-core.c
@@ -542,6 +542,26 @@ int tm6000_init(struct tm6000_core *dev)
int board, rc = 0, i, size;
struct reg_init *tab;
 
+   /* Check board revision */
+   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
+   if (board = 0) {
+   switch (board  0xff) {
+   case 0xf3:
+   printk(KERN_INFO Found tm6000\n);
+   if (dev-dev_type != TM6000)
+   dev-dev_type = TM6000;
+   break;
+   case 0xf4:
+   printk(KERN_INFO Found tm6010\n);
+   if (dev-dev_type != TM6010)
+   dev-dev_type = TM6010;
+   break;
+   default:
+   printk(KERN_INFO Unknown board version = 0x%08x\n, 
board);
+   }
+   } else
+   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
+
if (dev-dev_type == TM6010) {
tab = tm6010_init_tab;
size = ARRAY_SIZE(tm6010_init_tab);
@@ -563,13 +583,6 @@ int tm6000_init(struct tm6000_core *dev)
 
msleep(5); /* Just to be conservative */
 
-   /* Check board version - maybe 10Moons specific */
-   board = tm6000_get_reg32(dev, REQ_40_GET_VERSION, 0, 0);
-   if (board = 0)
-   printk(KERN_INFO Board version = 0x%08x\n, board);
-   else
-   printk(KERN_ERR Error %i while retrieving board version\n, 
board);
-
rc = tm6000_cards_setup(dev);
 
return rc;
-- 
1.7.2.2

--
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: [PATCH 0/5] Re: REGRESSION: Re: [GIT] kconfig rc fixes

2010-11-09 Thread Mauro Carvalho Chehab
Hi Arnaud,

Em 06-11-2010 19:30, Arnaud Lacombe escreveu:
 Hi,
 
 This should do the job.
 
 A.
 
 Arnaud Lacombe (5):
   kconfig: add an option to determine a menu's visibility
   kconfig: regen parser
   Revert i2c: Fix Kconfig dependencies
   media/video: convert Kconfig to use the menu's `visible' keyword
   i2c/algos: convert Kconfig to use the menu's `visible' keyword
 
  drivers/i2c/Kconfig  |3 +-
  drivers/i2c/algos/Kconfig|   14 +-
  drivers/media/video/Kconfig  |2 +-
  scripts/kconfig/expr.h   |1 +
  scripts/kconfig/lkc.h|1 +
  scripts/kconfig/menu.c   |   11 +
  scripts/kconfig/zconf.gperf  |1 +
  scripts/kconfig/zconf.hash.c_shipped |  122 
  scripts/kconfig/zconf.tab.c_shipped  |  570 +
  scripts/kconfig/zconf.y  |   21 +-
  10 files changed, 393 insertions(+), 353 deletions(-)

Patches look OK to my eyes. One more patch is needed, in order to fix build
warnings when customise is enabled for tuners and/or for DVB frontends.
I'm enclosing the fix.

For this patch series:
Acked-by: Mauro Carvalho Chehab mche...@redhat.com

Michal,

Would you apply those fixes to your tree, or do you prefer if I send them via
my tree?

Thanks,
Mauro

---


commit f53404d53c026548e03444f7ed33e8027716425d
Author: Mauro Carvalho Chehab mche...@redhat.com
Date:   Tue Nov 9 15:29:05 2010 -0200

[media] Fix Kconfig errors due to two visible menus

Use the new visible Kconfig keyword to avoid producing error for two menus
that are visible only if Tuner/frontend customise options are enabled.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

diff --git a/drivers/media/common/tuners/Kconfig 
b/drivers/media/common/tuners/Kconfig
index 2385e6c..78b0895 100644
--- a/drivers/media/common/tuners/Kconfig
+++ b/drivers/media/common/tuners/Kconfig
@@ -31,7 +31,7 @@ config MEDIA_TUNER
select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE
 
-menuconfig MEDIA_TUNER_CUSTOMISE
+config MEDIA_TUNER_CUSTOMISE
bool Customize analog and hybrid tuner modules to build
depends on MEDIA_TUNER
default y if EMBEDDED
@@ -44,7 +44,8 @@ menuconfig MEDIA_TUNER_CUSTOMISE
 
  If unsure say N.
 
-if MEDIA_TUNER_CUSTOMISE
+menu Customize TV tuners
+   visible if MEDIA_TUNER_CUSTOMISE
 
 config MEDIA_TUNER_SIMPLE
tristate Simple tuner support
@@ -185,5 +186,4 @@ config MEDIA_TUNER_TDA18218
default m if MEDIA_TUNER_CUSTOMISE
help
  NXP TDA18218 silicon tuner driver.
-
-endif # MEDIA_TUNER_CUSTOMISE
+endmenu
diff --git a/drivers/media/dvb/frontends/Kconfig 
b/drivers/media/dvb/frontends/Kconfig
index e9062b0..96b2701 100644
--- a/drivers/media/dvb/frontends/Kconfig
+++ b/drivers/media/dvb/frontends/Kconfig
@@ -12,9 +12,8 @@ config DVB_FE_CUSTOMISE
 
  If unsure say N.
 
-if DVB_FE_CUSTOMISE
-
 menu Customise DVB Frontends
+   visible if DVB_FE_CUSTOMISE
 
 comment Multistandard (satellite) frontends
depends on DVB_CORE
@@ -619,5 +618,3 @@ config DVB_DUMMY_FE
tristate Dummy frontend driver
default n
 endmenu
-
-endif
--
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: WARNINGS

2010-11-09 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:Tue Nov  9 19:00:19 CET 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15167:abd3aac6644e
git master:   3e6dce76d99b328716b43929b9195adfee1de00c
git media-master: a348e9110ddb5d494e060d989b35dd1f35359d58
gcc version:  i686-linux-gcc (GCC) 4.5.1
host hardware:x86_64
host os:  2.6.32.5

linux-git-armv5: WARNINGS
linux-git-armv5-davinci: WARNINGS
linux-git-armv5-ixp: WARNINGS
linux-git-armv5-omap2: WARNINGS
linux-git-i686: WARNINGS
linux-git-m32r: WARNINGS
linux-git-mips: WARNINGS
linux-git-powerpc64: WARNINGS
linux-git-x86_64: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

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

The V4L-DVB specification from this daily build is here:

http://www.xs4all.nl/~hverkuil/spec/media.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: Hauppauge WinTV HVR-1400 (XC3028L) firmware loading problem

2010-11-09 Thread Alina Friedrichsen
Hi,

beginning with kernel 2.6.34.? the HVR-1400 stops working completely.
If I run the scan utility, only the fist tuning works and after that it fails 
always. On the next run of the utility it says Device or resource busy. 
Watching TV with vlc works never.

This bug persist up to the current developer kernel 2.6.37-rc1-git7.

Any ideas? Maybe it's a PCIe/ExpressCard related problem? Some more
popular USB sticks use the same chipset.

Regards,
Alina

 Original-Nachricht 
 Datum: Wed, 17 Mar 2010 02:14:43 +0100
 Von: Alina Friedrichsen x-al...@gmx.net
 An: linux-media@vger.kernel.org
 Betreff: Hauppauge WinTV HVR-1400 firmware loading problem

 My kernel is 2.6.33.
 When I want to watch DVB-T with VLC, loading the firmwares stops after
 the following and don't see any pictures:
 
 cx23885 :03:00.0: firmware: requesting xc3028L-v36.fw
 xc2028 3-0064: Loading 81 firmware images from xc3028L-v36.fw, type:
 xc2028 firmware, ver 3.6
 xc2028 3-0064: Loading firmware for type=BASE F8MHZ (3), id
 .
 xc2028 3-0064: Loading firmware for type=D2633 DTV7 (90), id
 .
 
 And hangs forever. Any retries has the same effect.
 
 But if I start scan /usr/share/dvb/dvb-t/de-Berlin the tuning fails
 two times, then all firmwares load correctly and scanning works.
 
 xc2028 3-0064: Loading firmware for type=BASE F8MHZ (3), id
 .
 xc2028 3-0064: Loading firmware for type=D2633 DTV7 (90), id
 .
 xc2028 3-0064: Loading firmware for type=BASE F8MHZ (3), id
 .
 xc2028 3-0064: Loading firmware for type=D2633 DTV7 (90), id
 .
 xc2028 3-0064: Loading firmware for type=D2633 DTV78 (110), id
 .
 xc2028 3-0064: Loading SCODE for type=DTV78 DTV8 DIBCOM52 SCODE
 HAS_IF_5200 (61000300), id .
 
 After that all other firmware loadings works fine and I can watch TV.
 
 Any idea whats goes wrong? Is this a problem of the driver, or is my
 express card broken? I unfortunately has no other card to test.
 
 Thanks!
 Alina
 
 
 
--
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: Hauppauge WinTV HVR-1400 (XC3028L) firmware loading problem

2010-11-09 Thread fabio tirapelle
 

 Hi,
 
 beginning with kernel 2.6.34.? the HVR-1400 stops working  completely.
 If I run the scan utility, only the fist tuning works and after  that it 
 fails 
always. On the next run of the utility it says Device or resource  busy. 
Watching TV with vlc works never.

I think that all the WinTV-HVR will be effected by theese problems. See thread 
Wintv-HVR-1120 woes

 
 This bug persist up to the  current developer kernel 2.6.37-rc1-git7.
 
 Any ideas? Maybe it's a  PCIe/ExpressCard related problem? Some more
 popular USB sticks use the same  chipset.
 
 Regards,
 Alina
 
  Original-Nachricht  
  Datum: Wed, 17 Mar 2010 02:14:43 +0100
  Von: Alina  Friedrichsen x-al...@gmx.net
  An: linux-media@vger.kernel.org
   Betreff: Hauppauge WinTV HVR-1400 firmware loading problem
 
  My  kernel is 2.6.33.
  When I want to watch DVB-T with VLC, loading the  firmwares stops after
  the following and don't see any pictures:
  
  cx23885 :03:00.0: firmware: requesting xc3028L-v36.fw
   xc2028 3-0064: Loading 81 firmware images from xc3028L-v36.fw, type:
   xc2028 firmware, ver 3.6
  xc2028 3-0064: Loading firmware for type=BASE  F8MHZ (3), id
  .
  xc2028 3-0064: Loading firmware  for type=D2633 DTV7 (90), id
  .
  
  And  hangs forever. Any retries has the same effect.
  
  But if I start  scan /usr/share/dvb/dvb-t/de-Berlin the tuning fails
  two times, then  all firmwares load correctly and scanning works.
  
  xc2028 3-0064:  Loading firmware for type=BASE F8MHZ (3), id
  .
   xc2028 3-0064: Loading firmware for type=D2633 DTV7 (90), id
   .
  xc2028 3-0064: Loading firmware for type=BASE F8MHZ  (3), id
  .
  xc2028 3-0064: Loading firmware for  type=D2633 DTV7 (90), id
  .
  xc2028 3-0064:  Loading firmware for type=D2633 DTV78 (110), id
   .
  xc2028 3-0064: Loading SCODE for type=DTV78 DTV8  DIBCOM52 SCODE
  HAS_IF_5200 (61000300), id .
  
  After that all other firmware loadings works fine and I can watch  TV.
  
  Any idea whats goes wrong? Is this a problem of the driver,  or is my
  express card broken? I unfortunately has no other card to  test.
  
  Thanks!
  Alina
  
  
  
 --
 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


[PATCH] nuvoton-cir: improve buffer parsing responsiveness

2010-11-09 Thread Jarod Wilson
Rather than waiting for trigger bits, the formula for which was slightly
messy, and apparently, not actually 100% complete for some remotes, just
call ir_raw_event_handle whenever we finish parsing a chunk of data from
the rx fifo, similar to mceusb, as well as whenever we see an 'end of
signal data' 0x80 packet.

Signed-off-by: Jarod Wilson ja...@redhat.com
---

Note: this patch should really go into 2.6.37, imo, as non-mce remotes
frequently don't behave without it.

 drivers/media/IR/nuvoton-cir.c |   10 --
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
index 301be53..acc729c 100644
--- a/drivers/media/IR/nuvoton-cir.c
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -603,6 +603,8 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
count = nvt-pkts;
nvt_dbg_verbose(Processing buffer of len %d, count);
 
+   init_ir_raw_event(rawir);
+
for (i = 0; i  count; i++) {
nvt-pkts--;
sample = nvt-buf[i];
@@ -643,11 +645,15 @@ static void nvt_process_rx_ir_data(struct nvt_dev *nvt)
 * indicates end of IR signal, but new data incoming. In both
 * cases, it means we're ready to call ir_raw_event_handle
 */
-   if (sample == BUF_PULSE_BIT || ((sample != BUF_LEN_MASK) 
-   (sample  BUF_REPEAT_MASK) == BUF_REPEAT_BYTE))
+   if ((sample == BUF_PULSE_BIT)  nvt-pkts) {
+   nvt_dbg(Calling ir_raw_event_handle (signal end)\n);
ir_raw_event_handle(nvt-rdev);
+   }
}
 
+   nvt_dbg(Calling ir_raw_event_handle (buffer empty)\n);
+   ir_raw_event_handle(nvt-rdev);
+
if (nvt-pkts) {
nvt_dbg(Odd, pkts should be 0 now... (its %u), nvt-pkts);
nvt-pkts = 0;
-- 
1.7.1

-- 
Jarod Wilson
ja...@redhat.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


[PATCH 0/3 v2] mceusb: buffer parsing and keymap cleanups

2010-11-09 Thread Jarod Wilson
This v2 series is actually one patch light from v1, as the Conexant device
support patch has already been merged into the for_v2.6.38 tree, but adds
another patch not in v1 which simply cleans up the mce keytable a bit and
adds a missing mapping for one of my mce remotes.

The core good done by this patchset is to fix the reporting of trailing
spaces, which makes lirc decode work again, and some necessary buffer
parsing fixes specific to the first-gen device. v2 of the trailing space
fix implements multiple suggestions from David Härdeman that greatly
simplify the buffer parsing state machine.

Jarod Wilson (3):
mceusb: fix up reporting of trailing space
mceusb: buffer parsing fixups for 1st-gen device
IR: add tv power scancode to rc6 mce keymap

-- 
Jarod Wilson
ja...@redhat.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


[PATCH 1/3 v2] mceusb: fix up reporting of trailing space

2010-11-09 Thread Jarod Wilson
We were storing a bunch of spaces at the end of each signal, rather than
a single long space. The in-kernel decoders were actually okay with
this, but lirc isn't. As suggested by David Härdeman, switch to storing
samples using ir_raw_event_store_with_filter, which auto-merges the
consecutive space samples for us. This also allows us to bypass having
to store rawir samples in our device struct, further simplifying the
buffer parsing state machine. Both in-kernel decoders and lirc are happy
again with this change.

Also included in this patch is proper parsing of 0x9f 0x01 commands, the
removal of some magic number usage and some printk spew fixups.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/mceusb.c |   45 +
 1 files changed, 13 insertions(+), 32 deletions(-)

diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index e453c6b..1811098 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -74,6 +74,7 @@
 #define MCE_PACKET_LENGTH_MASK 0x1f /* Packet length mask */
 
 /* Sub-commands, which follow MCE_COMMAND_HEADER or MCE_HW_CMD_HEADER */
+#define MCE_CMD_SIG_END0x01/* End of signal */
 #define MCE_CMD_PING   0x03/* Ping device */
 #define MCE_CMD_UNKNOWN0x04/* Unknown */
 #define MCE_CMD_UNKNOWN2   0x05/* Unknown */
@@ -422,6 +423,7 @@ static int mceusb_cmdsize(u8 cmd, u8 subcmd)
case MCE_CMD_G_RXSENSOR:
datasize = 2;
break;
+   case MCE_CMD_SIG_END:
case MCE_CMD_S_TXMASK:
case MCE_CMD_S_RXSENSOR:
datasize = 1;
@@ -502,6 +504,9 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
break;
case MCE_COMMAND_HEADER:
switch (subcmd) {
+   case MCE_CMD_SIG_END:
+   dev_info(dev, End of signal\n);
+   break;
case MCE_CMD_PING:
dev_info(dev, Ping\n);
break;
@@ -539,7 +544,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
if (len == 2)
dev_info(dev, Get receive sensor\n);
else
-   dev_info(dev, Received pulse count is %d\n,
+   dev_info(dev, Remaining pulse count is %d\n,
 ((data1  8) | data2));
break;
case MCE_RSP_CMD_INVALID:
@@ -763,7 +768,7 @@ static int mceusb_set_tx_carrier(void *priv, u32 carrier)
 
if (carrier == 0) {
ir-carrier = carrier;
-   cmdbuf[2] = 0x01;
+   cmdbuf[2] = MCE_CMD_SIG_END;
cmdbuf[3] = MCE_IRDATA_TRAILER;
dev_dbg(ir-dev, %s: disabling carrier 
modulation\n, __func__);
@@ -816,25 +821,11 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, 
int buf_len)
rawir.duration = (ir-buf_in[i]  MCE_PULSE_MASK)
 * MCE_TIME_UNIT * 1000;
 
-   if ((ir-buf_in[i]  MCE_PULSE_MASK) == 0x7f) {
-   if (ir-rawir.pulse == rawir.pulse) {
-   ir-rawir.duration += rawir.duration;
-   } else {
-   ir-rawir.duration = rawir.duration;
-   ir-rawir.pulse = rawir.pulse;
-   }
-   if (ir-rem)
-   break;
-   }
-   rawir.duration += ir-rawir.duration;
-   ir-rawir.duration = 0;
-   ir-rawir.pulse = rawir.pulse;
-
dev_dbg(ir-dev, Storing %s with duration %d\n,
rawir.pulse ? pulse : space,
rawir.duration);
 
-   ir_raw_event_store(ir-idev, rawir);
+   ir_raw_event_store_with_filter(ir-idev, rawir);
break;
case CMD_DATA:
ir-rem--;
@@ -851,16 +842,8 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, 
int buf_len)
}
ir-rem = (ir-cmd  MCE_PACKET_LENGTH_MASK);
mceusb_dev_printdata(ir, ir-buf_in, i, ir-rem + 1, 
false);
-   if (ir-rem) {
+   if (ir-rem)
ir-parser_state = PARSE_IRDATA;
-   break;
-   }
-   /*
-* a package with 

[PATCH 2/3 v2] mceusb: buffer parsing fixups for 1st-gen device

2010-11-09 Thread Jarod Wilson
If we pass in an offset, we shouldn't skip 2 bytes. And the first-gen
hardware generates a constant stream of interrupts, always with two
header bytes, and if there's been no IR, with nothing else. Bail from
ir processing without calling ir_handle_raw_event when we get such a
buffer delivered to us.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/mceusb.c |6 +-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/media/IR/mceusb.c b/drivers/media/IR/mceusb.c
index 1811098..ed151c8 100644
--- a/drivers/media/IR/mceusb.c
+++ b/drivers/media/IR/mceusb.c
@@ -446,7 +446,7 @@ static void mceusb_dev_printdata(struct mceusb_dev *ir, 
char *buf,
return;
 
/* skip meaningless 0xb1 0x60 header bytes on orig receiver */
-   if (ir-flags.microsoft_gen1  !out)
+   if (ir-flags.microsoft_gen1  !out  !offset)
skip = 2;
 
if (len = skip)
@@ -807,6 +807,10 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, 
int buf_len)
if (ir-flags.microsoft_gen1)
i = 2;
 
+   /* if there's no data, just return now */
+   if (buf_len = i)
+   return;
+
for (; i  buf_len; i++) {
switch (ir-parser_state) {
case SUBCMD:
-- 
1.7.1


-- 
Jarod Wilson
ja...@redhat.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


[PATCH 3/3 v2] IR: add tv power scancode to rc6 mce keymap

2010-11-09 Thread Jarod Wilson
And clean up some stray spaces.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/keymaps/rc-rc6-mce.c |   21 +++--
 1 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/drivers/media/IR/keymaps/rc-rc6-mce.c 
b/drivers/media/IR/keymaps/rc-rc6-mce.c
index 1b7adab..6da955d 100644
--- a/drivers/media/IR/keymaps/rc-rc6-mce.c
+++ b/drivers/media/IR/keymaps/rc-rc6-mce.c
@@ -26,8 +26,8 @@ static struct ir_scancode rc6_mce[] = {
 
{ 0x800f040a, KEY_DELETE },
{ 0x800f040b, KEY_ENTER },
-   { 0x800f040c, KEY_POWER },
-   { 0x800f040d, KEY_PROG1 },  /* Windows MCE button */
+   { 0x800f040c, KEY_POWER },  /* PC Power */
+   { 0x800f040d, KEY_PROG1 },  /* Windows MCE button */
{ 0x800f040e, KEY_MUTE },
{ 0x800f040f, KEY_INFO },
 
@@ -56,31 +56,32 @@ static struct ir_scancode rc6_mce[] = {
{ 0x800f0422, KEY_OK },
{ 0x800f0423, KEY_EXIT },
{ 0x800f0424, KEY_DVD },
-   { 0x800f0425, KEY_TUNER },  /* LiveTV */
-   { 0x800f0426, KEY_EPG },/* Guide */
-   { 0x800f0427, KEY_ZOOM },   /* Aspect */
+   { 0x800f0425, KEY_TUNER },  /* LiveTV */
+   { 0x800f0426, KEY_EPG },/* Guide */
+   { 0x800f0427, KEY_ZOOM },   /* Aspect */
 
{ 0x800f043a, KEY_BRIGHTNESSUP },
 
{ 0x800f0446, KEY_TV },
-   { 0x800f0447, KEY_AUDIO },  /* My Music */
-   { 0x800f0448, KEY_PVR },/* RecordedTV */
+   { 0x800f0447, KEY_AUDIO },  /* My Music */
+   { 0x800f0448, KEY_PVR },/* RecordedTV */
{ 0x800f0449, KEY_CAMERA },
{ 0x800f044a, KEY_VIDEO },
{ 0x800f044c, KEY_LANGUAGE },
{ 0x800f044d, KEY_TITLE },
-   { 0x800f044e, KEY_PRINT },  /* Print - HP OEM version of remote */
+   { 0x800f044e, KEY_PRINT },  /* Print - HP OEM version of remote */
 
{ 0x800f0450, KEY_RADIO },
 
-   { 0x800f045a, KEY_SUBTITLE },   /* Caption/Teletext */
+   { 0x800f045a, KEY_SUBTITLE },   /* Caption/Teletext */
{ 0x800f045b, KEY_RED },
{ 0x800f045c, KEY_GREEN },
{ 0x800f045d, KEY_YELLOW },
{ 0x800f045e, KEY_BLUE },
 
+   { 0x800f0465, KEY_POWER2 }, /* TV Power */
{ 0x800f046e, KEY_PLAYPAUSE },
-   { 0x800f046f, KEY_MEDIA },  /* Start media application (NEW) */
+   { 0x800f046f, KEY_MEDIA },  /* Start media application (NEW) */
 
{ 0x800f0480, KEY_BRIGHTNESSDOWN },
{ 0x800f0481, KEY_PLAYPAUSE },
-- 
1.7.1


-- 
Jarod Wilson
ja...@redhat.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: Webcam driver not working: drivers/media/video/gspca/ov519.c device 05a9:4519

2010-11-09 Thread Anca Emanuel
Short update: Jean-Francois Moine is cooking something.
http://moinejf.free.fr/gspca-2.11.3.tar.gz
My camera works now.
--
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


[PATCH 1/4] [media] rename drivers/media/IR to drives/media/rc

2010-11-09 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

 rename drivers/media/{IR = rc}/Kconfig (99%)
 rename drivers/media/{IR = rc}/Makefile (100%)
 rename drivers/media/{IR = rc}/ene_ir.c (100%)
 rename drivers/media/{IR = rc}/ene_ir.h (100%)
 rename drivers/media/{IR = rc}/imon.c (100%)
 rename drivers/media/{IR = rc}/ir-core-priv.h (100%)
 rename drivers/media/{IR = rc}/ir-functions.c (100%)
 rename drivers/media/{IR = rc}/ir-jvc-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-keytable.c (100%)
 rename drivers/media/{IR = rc}/ir-lirc-codec.c (100%)
 rename drivers/media/{IR = rc}/ir-nec-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-raw-event.c (100%)
 rename drivers/media/{IR = rc}/ir-rc5-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-rc5-sz-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-rc6-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-sony-decoder.c (100%)
 rename drivers/media/{IR = rc}/ir-sysfs.c (100%)
 rename drivers/media/{IR = rc}/keymaps/Kconfig (100%)
 rename drivers/media/{IR = rc}/keymaps/Makefile (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-adstech-dvb-t-pci.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-alink-dtu-m.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-anysee.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-apac-viewcomp.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-asus-pc39.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-ati-tv-wonder-hd-600.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-a16d.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-cardbus.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-dvbt.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-m135a.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-m733a-rm-k6.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia-rm-ks.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avermedia.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-avertv-303.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-azurewave-ad-tu700.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-behold-columbus.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-behold.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-budget-ci-old.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-cinergy-1400.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-cinergy.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-dib0700-nec.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-dib0700-rc5.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-digitalnow-tinytwin.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-digittrade.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-dm1105-nec.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-dntv-live-dvb-t.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-dntv-live-dvbt-pro.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-em-terratec.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-encore-enltv-fm53.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-encore-enltv.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-encore-enltv2.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-evga-indtube.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-eztv.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-flydvb.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-flyvideo.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-fusionhdtv-mce.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-gadmei-rm008z.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-genius-tvgo-a11mce.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-gotview7135.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-hauppauge-new.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-imon-mce.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-imon-pad.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-iodata-bctv7e.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-kaiomy.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-kworld-315u.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-kworld-plus-tv-analog.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-leadtek-y04g0051.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-lirc.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-lme2510.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-manli.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-msi-digivox-ii.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-msi-digivox-iii.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-msi-tvanywhere-plus.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-msi-tvanywhere.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-nebula.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-nec-terratec-cinergy-xs.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-norwood.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-npgtech.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-pctv-sedna.c (100%)
 rename drivers/media/{IR = rc}/keymaps/rc-pinnacle-color.c (100%)
 rename 

[PATCH 2/4] [media] Rename rc-core files from ir- to rc-

2010-11-09 Thread Mauro Carvalho Chehab
As protocol decoders are specific to InfraRed, keep their names as-is.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

 rename drivers/media/rc/{ir-core-priv.h = rc-core-priv.h} (100%)
 rename drivers/media/rc/{ir-keytable.c = rc-main.c} (99%)
 rename drivers/media/rc/{ir-raw-event.c = rc-raw.c} (99%)
 rename drivers/media/rc/{ir-sysfs.c = rc-sysfs.c} (99%)

diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index 38873cf..479a8f4 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -1,9 +1,9 @@
 ir-common-objs  := ir-functions.o
-ir-core-objs   := ir-keytable.o ir-sysfs.o ir-raw-event.o rc-map.o
+rc-core-objs   := rc-main.o rc-sysfs.o rc-raw.o rc-map.o
 
 obj-y += keymaps/
 
-obj-$(CONFIG_IR_CORE) += ir-core.o
+obj-$(CONFIG_IR_CORE) += rc-core.o
 obj-$(CONFIG_IR_LEGACY) += ir-common.o
 obj-$(CONFIG_LIRC) += lirc_dev.o
 obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o
diff --git a/drivers/media/rc/ir-functions.c b/drivers/media/rc/ir-functions.c
index ec021c9..14397d0 100644
--- a/drivers/media/rc/ir-functions.c
+++ b/drivers/media/rc/ir-functions.c
@@ -24,7 +24,7 @@
 #include linux/string.h
 #include linux/jiffies.h
 #include media/ir-common.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 /* -- 
*/
 
diff --git a/drivers/media/rc/ir-jvc-decoder.c 
b/drivers/media/rc/ir-jvc-decoder.c
index 63dca6e..d83a5f6 100644
--- a/drivers/media/rc/ir-jvc-decoder.c
+++ b/drivers/media/rc/ir-jvc-decoder.c
@@ -13,7 +13,7 @@
  */
 
 #include linux/bitrev.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define JVC_NBITS  16  /* dev(8) + func(8) */
 #define JVC_UNIT   525000  /* ns */
diff --git a/drivers/media/rc/ir-lirc-codec.c b/drivers/media/rc/ir-lirc-codec.c
index 1d9c6b0..aed69ed 100644
--- a/drivers/media/rc/ir-lirc-codec.c
+++ b/drivers/media/rc/ir-lirc-codec.c
@@ -17,7 +17,7 @@
 #include media/lirc.h
 #include media/lirc_dev.h
 #include media/ir-core.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define LIRCBUF_SIZE 256
 
diff --git a/drivers/media/rc/ir-nec-decoder.c 
b/drivers/media/rc/ir-nec-decoder.c
index 70993f7..cad4e99 100644
--- a/drivers/media/rc/ir-nec-decoder.c
+++ b/drivers/media/rc/ir-nec-decoder.c
@@ -13,7 +13,7 @@
  */
 
 #include linux/bitrev.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define NEC_NBITS  32
 #define NEC_UNIT   562500  /* ns */
diff --git a/drivers/media/rc/ir-rc5-decoder.c 
b/drivers/media/rc/ir-rc5-decoder.c
index 572ed4c..c07f6e0 100644
--- a/drivers/media/rc/ir-rc5-decoder.c
+++ b/drivers/media/rc/ir-rc5-decoder.c
@@ -20,7 +20,7 @@
  * the first two bits are start bits, and a third one is a filing bit
  */
 
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define RC5_NBITS  14
 #define RC5X_NBITS 20
diff --git a/drivers/media/rc/ir-rc5-sz-decoder.c 
b/drivers/media/rc/ir-rc5-sz-decoder.c
index 7c41350..0c3b6eb 100644
--- a/drivers/media/rc/ir-rc5-sz-decoder.c
+++ b/drivers/media/rc/ir-rc5-sz-decoder.c
@@ -20,7 +20,7 @@
  * the first two bits are start bits, and a third one is a filing bit
  */
 
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define RC5_SZ_NBITS   15
 #define RC5_UNIT   88 /* ns */
diff --git a/drivers/media/rc/ir-rc6-decoder.c 
b/drivers/media/rc/ir-rc6-decoder.c
index d25da91..48e82be 100644
--- a/drivers/media/rc/ir-rc6-decoder.c
+++ b/drivers/media/rc/ir-rc6-decoder.c
@@ -12,7 +12,7 @@
  * GNU General Public License for more details.
  */
 
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 /*
  * This decoder currently supports:
diff --git a/drivers/media/rc/ir-sony-decoder.c 
b/drivers/media/rc/ir-sony-decoder.c
index 2d15730..0a5cadb 100644
--- a/drivers/media/rc/ir-sony-decoder.c
+++ b/drivers/media/rc/ir-sony-decoder.c
@@ -13,7 +13,7 @@
  */
 
 #include linux/bitrev.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 #define SONY_UNIT  60 /* ns */
 #define SONY_HEADER_PULSE  (4 * SONY_UNIT)
diff --git a/drivers/media/rc/ir-core-priv.h b/drivers/media/rc/rc-core-priv.h
similarity index 100%
rename from drivers/media/rc/ir-core-priv.h
rename to drivers/media/rc/rc-core-priv.h
diff --git a/drivers/media/rc/ir-keytable.c b/drivers/media/rc/rc-main.c
similarity index 99%
rename from drivers/media/rc/ir-keytable.c
rename to drivers/media/rc/rc-main.c
index d0c3c0e..af7119f 100644
--- a/drivers/media/rc/ir-keytable.c
+++ b/drivers/media/rc/rc-main.c
@@ -15,7 +15,7 @@
 
 #include linux/input.h
 #include linux/slab.h
-#include ir-core-priv.h
+#include rc-core-priv.h
 
 /* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */
 #define IR_TAB_MIN_SIZE256
diff --git a/drivers/media/rc/ir-raw-event.c b/drivers/media/rc/rc-raw.c
similarity index 99%
rename from drivers/media/rc/ir-raw-event.c
rename to drivers/media/rc/rc-raw.c
index a06a07e..d6c556e 

[PATCH 3/4] [media] rc-core: Merge rc-sysfs.c into rc-main.c

2010-11-09 Thread Mauro Carvalho Chehab
Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

 delete mode 100644 drivers/media/rc/rc-sysfs.c

diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index 479a8f4..5a1112c 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -1,5 +1,5 @@
 ir-common-objs  := ir-functions.o
-rc-core-objs   := rc-main.o rc-sysfs.o rc-raw.o rc-map.o
+rc-core-objs   := rc-main.o rc-raw.o rc-map.o
 
 obj-y += keymaps/
 
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index af7119f..3942673 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -1,6 +1,6 @@
-/* ir-keytable.c - handle IR scancode-keycode tables
+/* rc-core.c - handle IR scancode-keycode tables
  *
- * Copyright (C) 2009 by Mauro Carvalho Chehab mche...@redhat.com
+ * Copyright (C) 2009-2010 by Mauro Carvalho Chehab mche...@redhat.com
  *
  * This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -15,8 +15,14 @@
 
 #include linux/input.h
 #include linux/slab.h
+#include linux/device.h
 #include rc-core-priv.h
 
+#define IRRCV_NUM_DEVICES  256
+
+/* bit array to represent IR sysfs device number */
+static unsigned long ir_core_dev_number;
+
 /* Sizes are in bytes, 256 bytes allows for 32 entries on x64 */
 #define IR_TAB_MIN_SIZE256
 #define IR_TAB_MAX_SIZE8192
@@ -625,6 +631,345 @@ void ir_input_unregister(struct input_dev *input_dev)
 }
 EXPORT_SYMBOL_GPL(ir_input_unregister);
 
+/* class for /sys/class/rc */
+static char *ir_devnode(struct device *dev, mode_t *mode)
+{
+   return kasprintf(GFP_KERNEL, rc/%s, dev_name(dev));
+}
+
+static struct class ir_input_class = {
+   .name   = rc,
+   .devnode= ir_devnode,
+};
+
+static struct {
+   u64 type;
+   char*name;
+} proto_names[] = {
+   { IR_TYPE_UNKNOWN,  unknown   },
+   { IR_TYPE_RC5,  rc-5  },
+   { IR_TYPE_NEC,  nec   },
+   { IR_TYPE_RC6,  rc-6  },
+   { IR_TYPE_JVC,  jvc   },
+   { IR_TYPE_SONY, sony  },
+   { IR_TYPE_RC5_SZ,   rc-5-sz   },
+   { IR_TYPE_LIRC, lirc  },
+};
+
+#define PROTO_NONE none
+
+/**
+ * show_protocols() - shows the current IR protocol(s)
+ * @d: the device descriptor
+ * @mattr: the device attribute struct (unused)
+ * @buf:   a pointer to the output buffer
+ *
+ * This routine is a callback routine for input read the IR protocol type(s).
+ * it is trigged by reading /sys/class/rc/rc?/protocols.
+ * It returns the protocol names of supported protocols.
+ * Enabled protocols are printed in brackets.
+ */
+static ssize_t show_protocols(struct device *d,
+ struct device_attribute *mattr, char *buf)
+{
+   struct ir_input_dev *ir_dev = dev_get_drvdata(d);
+   u64 allowed, enabled;
+   char *tmp = buf;
+   int i;
+
+   /* Device is being removed */
+   if (!ir_dev)
+   return -EINVAL;
+
+   if (ir_dev-props  ir_dev-props-driver_type == RC_DRIVER_SCANCODE) {
+   enabled = ir_dev-rc_tab.ir_type;
+   allowed = ir_dev-props-allowed_protos;
+   } else if (ir_dev-raw) {
+   enabled = ir_dev-raw-enabled_protocols;
+   allowed = ir_raw_get_allowed_protocols();
+   } else
+   return sprintf(tmp, [builtin]\n);
+
+   IR_dprintk(1, allowed - 0x%llx, enabled - 0x%llx\n,
+  (long long)allowed,
+  (long long)enabled);
+
+   for (i = 0; i  ARRAY_SIZE(proto_names); i++) {
+   if (allowed  enabled  proto_names[i].type)
+   tmp += sprintf(tmp, [%s] , proto_names[i].name);
+   else if (allowed  proto_names[i].type)
+   tmp += sprintf(tmp, %s , proto_names[i].name);
+   }
+
+   if (tmp != buf)
+   tmp--;
+   *tmp = '\n';
+   return tmp + 1 - buf;
+}
+
+/**
+ * store_protocols() - changes the current IR protocol(s)
+ * @d: the device descriptor
+ * @mattr: the device attribute struct (unused)
+ * @buf:   a pointer to the input buffer
+ * @len:   length of the input buffer
+ *
+ * This routine is a callback routine for changing the IR protocol type.
+ * It is trigged by writing to /sys/class/rc/rc?/protocols.
+ * Writing +proto will add a protocol to the list of enabled protocols.
+ * Writing -proto will remove a protocol from the list of enabled protocols.
+ * Writing proto will enable only proto.
+ * Writing none will disable all protocols.
+ * Returns -EINVAL if an invalid protocol combination or unknown protocol name
+ * is used, otherwise @len.
+ */
+static ssize_t store_protocols(struct device *d,
+  struct device_attribute *mattr,
+  const char *data,
+   

[PATCH 4/4] [media] rc-core: merge rc-map.c into rc-main.c

2010-11-09 Thread Mauro Carvalho Chehab
With this change, all rc-core functions are into just one file, except
for the rc-raw specific functions.

Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com

 delete mode 100644 drivers/media/rc/rc-map.c

diff --git a/drivers/media/rc/Makefile b/drivers/media/rc/Makefile
index 5a1112c..1eb24e6 100644
--- a/drivers/media/rc/Makefile
+++ b/drivers/media/rc/Makefile
@@ -1,5 +1,5 @@
 ir-common-objs  := ir-functions.o
-rc-core-objs   := rc-main.o rc-raw.o rc-map.o
+rc-core-objs   := rc-main.o rc-raw.o
 
 obj-y += keymaps/
 
diff --git a/drivers/media/rc/rc-main.c b/drivers/media/rc/rc-main.c
index 3942673..73813b8 100644
--- a/drivers/media/rc/rc-main.c
+++ b/drivers/media/rc/rc-main.c
@@ -12,7 +12,9 @@
  *  GNU General Public License for more details.
  */
 
-
+#include media/ir-core.h
+#include linux/spinlock.h
+#include linux/delay.h
 #include linux/input.h
 #include linux/slab.h
 #include linux/device.h
@@ -30,6 +32,96 @@ static unsigned long ir_core_dev_number;
 /* FIXME: IR_KEYPRESS_TIMEOUT should be protocol specific */
 #define IR_KEYPRESS_TIMEOUT 250
 
+/* Used to handle IR raw handler extensions */
+static LIST_HEAD(rc_map_list);
+static DEFINE_SPINLOCK(rc_map_lock);
+
+static struct rc_keymap *seek_rc_map(const char *name)
+{
+   struct rc_keymap *map = NULL;
+
+   spin_lock(rc_map_lock);
+   list_for_each_entry(map, rc_map_list, list) {
+   if (!strcmp(name, map-map.name)) {
+   spin_unlock(rc_map_lock);
+   return map;
+   }
+   }
+   spin_unlock(rc_map_lock);
+
+   return NULL;
+}
+
+struct ir_scancode_table *get_rc_map(const char *name)
+{
+
+   struct rc_keymap *map;
+
+   map = seek_rc_map(name);
+#ifdef MODULE
+   if (!map) {
+   int rc = request_module(name);
+   if (rc  0) {
+   printk(KERN_ERR Couldn't load IR keymap %s\n, name);
+   return NULL;
+   }
+   msleep(20); /* Give some time for IR to register */
+
+   map = seek_rc_map(name);
+   }
+#endif
+   if (!map) {
+   printk(KERN_ERR IR keymap %s not found\n, name);
+   return NULL;
+   }
+
+   printk(KERN_INFO Registered IR keymap %s\n, map-map.name);
+
+   return map-map;
+}
+EXPORT_SYMBOL_GPL(get_rc_map);
+
+int ir_register_map(struct rc_keymap *map)
+{
+   spin_lock(rc_map_lock);
+   list_add_tail(map-list, rc_map_list);
+   spin_unlock(rc_map_lock);
+   return 0;
+}
+EXPORT_SYMBOL_GPL(ir_register_map);
+
+void ir_unregister_map(struct rc_keymap *map)
+{
+   spin_lock(rc_map_lock);
+   list_del(map-list);
+   spin_unlock(rc_map_lock);
+}
+EXPORT_SYMBOL_GPL(ir_unregister_map);
+
+
+static struct ir_scancode empty[] = {
+   { 0x2a, KEY_COFFEE },
+};
+
+static struct rc_keymap empty_map = {
+   .map = {
+   .scan= empty,
+   .size= ARRAY_SIZE(empty),
+   .ir_type = IR_TYPE_UNKNOWN, /* Legacy IR type */
+   .name= RC_MAP_EMPTY,
+   }
+};
+
+int ir_rcmap_init(void)
+{
+   return ir_register_map(empty_map);
+}
+
+void ir_rcmap_cleanup(void)
+{
+   ir_unregister_map(empty_map);
+}
+
 /**
  * ir_resize_table() - resizes a scancode table if necessary
  * @rc_tab:the ir_scancode_table to resize
diff --git a/drivers/media/rc/rc-map.c b/drivers/media/rc/rc-map.c
deleted file mode 100644
index 689143f..000
--- a/drivers/media/rc/rc-map.c
+++ /dev/null
@@ -1,107 +0,0 @@
-/* ir-raw-event.c - handle IR Pulse/Space event
- *
- * Copyright (C) 2010 by Mauro Carvalho Chehab mche...@redhat.com
- *
- * This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation version 2 of the License.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- */
-
-#include media/ir-core.h
-#include linux/spinlock.h
-#include linux/delay.h
-
-/* Used to handle IR raw handler extensions */
-static LIST_HEAD(rc_map_list);
-static DEFINE_SPINLOCK(rc_map_lock);
-
-static struct rc_keymap *seek_rc_map(const char *name)
-{
-   struct rc_keymap *map = NULL;
-
-   spin_lock(rc_map_lock);
-   list_for_each_entry(map, rc_map_list, list) {
-   if (!strcmp(name, map-map.name)) {
-   spin_unlock(rc_map_lock);
-   return map;
-   }
-   }
-   spin_unlock(rc_map_lock);
-
-   return NULL;
-}
-
-struct ir_scancode_table *get_rc_map(const char *name)
-{
-
-   struct rc_keymap *map;
-
-   map = seek_rc_map(name);
-#ifdef MODULE
-   if (!map) {
-   int rc = request_module(name);
-   if 

[PATCH 0/4] Rename rc-core files

2010-11-09 Thread Mauro Carvalho Chehab
This patch series basically rename rc-core files.

I took David Härdeman's idea to merge rc-sysfs, rc-map and rc-keycode
into one file, and to rename ir-raw-event as rc-raw, in order to make
easier to merge his two remaining patches.

Yet, patch 5/6 from his series breaks, due to the upstream changes
made on ir-keytable.c.

I didn't made a cleanup at include/media/ir-core.h yet, but there are some
functions now that can be static, and the file, itself, should also be
renamed to rc-core.h.

PS.: The files were generated with git option -M, in order to be easier
for review, as the diff file will just show the actual differences after
the renames.

Mauro Carvalho Chehab (4):
  [media] rename drivers/media/IR to drives/media/rc
  [media] Rename rc-core files from ir- to rc-
  [media] rc-core: Merge rc-sysfs.c into rc-main.c
  [media] rc-core: merge rc-map.c into rc-main.c

 drivers/media/IR/ir-keytable.c |  633 
 drivers/media/IR/ir-sysfs.c|  362 ---
 drivers/media/IR/rc-map.c  |  107 --
 drivers/media/Kconfig  |2 +-
 drivers/media/Makefile |2 +-
 drivers/media/{IR = rc}/Kconfig   |2 +-
 drivers/media/{IR = rc}/Makefile  |4 +-
 drivers/media/{IR = rc}/ene_ir.c  |0
 drivers/media/{IR = rc}/ene_ir.h  |0
 drivers/media/{IR = rc}/imon.c|0
 drivers/media/{IR = rc}/ir-functions.c|2 +-
 drivers/media/{IR = rc}/ir-jvc-decoder.c  |2 +-
 drivers/media/{IR = rc}/ir-lirc-codec.c   |2 +-
 drivers/media/{IR = rc}/ir-nec-decoder.c  |2 +-
 drivers/media/{IR = rc}/ir-rc5-decoder.c  |2 +-
 drivers/media/{IR = rc}/ir-rc5-sz-decoder.c   |2 +-
 drivers/media/{IR = rc}/ir-rc6-decoder.c  |2 +-
 drivers/media/{IR = rc}/ir-sony-decoder.c |2 +-
 drivers/media/{IR = rc}/keymaps/Kconfig   |0
 drivers/media/{IR = rc}/keymaps/Makefile  |0
 .../{IR = rc}/keymaps/rc-adstech-dvb-t-pci.c  |0
 drivers/media/{IR = rc}/keymaps/rc-alink-dtu-m.c  |0
 drivers/media/{IR = rc}/keymaps/rc-anysee.c   |0
 .../media/{IR = rc}/keymaps/rc-apac-viewcomp.c|0
 drivers/media/{IR = rc}/keymaps/rc-asus-pc39.c|0
 .../{IR = rc}/keymaps/rc-ati-tv-wonder-hd-600.c   |0
 .../media/{IR = rc}/keymaps/rc-avermedia-a16d.c   |0
 .../{IR = rc}/keymaps/rc-avermedia-cardbus.c  |0
 .../media/{IR = rc}/keymaps/rc-avermedia-dvbt.c   |0
 .../media/{IR = rc}/keymaps/rc-avermedia-m135a.c  |0
 .../{IR = rc}/keymaps/rc-avermedia-m733a-rm-k6.c  |0
 .../media/{IR = rc}/keymaps/rc-avermedia-rm-ks.c  |0
 drivers/media/{IR = rc}/keymaps/rc-avermedia.c|0
 drivers/media/{IR = rc}/keymaps/rc-avertv-303.c   |0
 .../{IR = rc}/keymaps/rc-azurewave-ad-tu700.c |0
 .../media/{IR = rc}/keymaps/rc-behold-columbus.c  |0
 drivers/media/{IR = rc}/keymaps/rc-behold.c   |0
 .../media/{IR = rc}/keymaps/rc-budget-ci-old.c|0
 drivers/media/{IR = rc}/keymaps/rc-cinergy-1400.c |0
 drivers/media/{IR = rc}/keymaps/rc-cinergy.c  |0
 drivers/media/{IR = rc}/keymaps/rc-dib0700-nec.c  |0
 drivers/media/{IR = rc}/keymaps/rc-dib0700-rc5.c  |0
 .../{IR = rc}/keymaps/rc-digitalnow-tinytwin.c|0
 drivers/media/{IR = rc}/keymaps/rc-digittrade.c   |0
 drivers/media/{IR = rc}/keymaps/rc-dm1105-nec.c   |0
 .../media/{IR = rc}/keymaps/rc-dntv-live-dvb-t.c  |0
 .../{IR = rc}/keymaps/rc-dntv-live-dvbt-pro.c |0
 drivers/media/{IR = rc}/keymaps/rc-em-terratec.c  |0
 .../{IR = rc}/keymaps/rc-encore-enltv-fm53.c  |0
 drivers/media/{IR = rc}/keymaps/rc-encore-enltv.c |0
 .../media/{IR = rc}/keymaps/rc-encore-enltv2.c|0
 drivers/media/{IR = rc}/keymaps/rc-evga-indtube.c |0
 drivers/media/{IR = rc}/keymaps/rc-eztv.c |0
 drivers/media/{IR = rc}/keymaps/rc-flydvb.c   |0
 drivers/media/{IR = rc}/keymaps/rc-flyvideo.c |0
 .../media/{IR = rc}/keymaps/rc-fusionhdtv-mce.c   |0
 .../media/{IR = rc}/keymaps/rc-gadmei-rm008z.c|0
 .../{IR = rc}/keymaps/rc-genius-tvgo-a11mce.c |0
 drivers/media/{IR = rc}/keymaps/rc-gotview7135.c  |0
 .../media/{IR = rc}/keymaps/rc-hauppauge-new.c|0
 drivers/media/{IR = rc}/keymaps/rc-imon-mce.c |0
 drivers/media/{IR = rc}/keymaps/rc-imon-pad.c |0
 .../media/{IR = rc}/keymaps/rc-iodata-bctv7e.c|0
 drivers/media/{IR = rc}/keymaps/rc-kaiomy.c   |0
 drivers/media/{IR = rc}/keymaps/rc-kworld-315u.c  |0
 .../{IR = rc}/keymaps/rc-kworld-plus-tv-analog.c  |0
 .../media/{IR = rc}/keymaps/rc-leadtek-y04g0051.c |0
 drivers/media/{IR = rc}/keymaps/rc-lirc.c |0
 drivers/media/{IR = rc}/keymaps/rc-lme2510.c  |0
 drivers/media/{IR = rc}/keymaps/rc-manli.c  

Re: [PATCH 0/6] rc-core: ir-core to rc-core conversion

2010-11-09 Thread Jarod Wilson
On Tue, Nov 9, 2010 at 8:50 PM, Mauro Carvalho Chehab
mche...@infradead.org wrote:
...
 Sorry for giving you a late feedback about those patches. I was busy the last 
 two
 weeks, due to my trip to US for KS/LPC.

 I've applied patches 1 to 3 (in fact, I got the patches from the previous 
 version -
 unfortunately, patchwork do a very bad job when someone sends a new series 
 that superseeds
 the previous patches).

 I didn't like patch 4 for some reasons: instead of just doing rename, it is a
 all-in-one patch, doing several things at the same time. It is hard to 
 analyse it by
 just looking at the diffs, as it is not a pure rename patch. Also, it doesn't 
 rename
 /drivers/media/IR into something else.

 Btw, the patch is currently broken:

Hm, the series applied cleanly against 2.6.37-rc1 a bit ago:

http://git.kernel.org/?p=linux/kernel/git/jarod/linux-2.6-ir.git;a=shortlog;h=refs/heads/staging

-- 
Jarod Wilson
ja...@wilsonet.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: [PATCH 6/7] ir-core: make struct rc_dev the primary interface

2010-11-09 Thread Mauro Carvalho Chehab
Em 29-10-2010 17:08, David Härdeman escreveu:
 This patch merges the ir_input_dev and ir_dev_props structs into a single
 struct called rc_dev. The drivers and various functions in rc-core used
 by the drivers are also changed to use rc_dev as the primary interface
 when dealing with rc-core.
 
 This means that the input_dev is abstracted away from the drivers which
 is necessary if we ever want to support multiple input devs per rc device.
 
 The new API is similar to what the input subsystem uses, i.e:
 rc_device_alloc()
 rc_device_free()
 rc_device_register()
 rc_device_unregister()
 


David,

 + struct rc_dev *rdev;
...
 + struct rc_dev   *dev;   /* pointer to the 
 parent rc_dev */

 + struct rc_dev  *rc;


A quick comment: try to call this struct with the same name on all places,
avoiding to call it as just dev. It makes harder to understand the code,
especially on complex devices that have several types of dev's. The better
is to always call it as rc_dev.

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: [PATCH 0/6] rc-core: ir-core to rc-core conversion

2010-11-09 Thread Mauro Carvalho Chehab
Em 10-11-2010 01:25, Jarod Wilson escreveu:
 On Tue, Nov 9, 2010 at 8:50 PM, Mauro Carvalho Chehab
 mche...@infradead.org wrote:
 ...
 Sorry for giving you a late feedback about those patches. I was busy the 
 last two
 weeks, due to my trip to US for KS/LPC.

 I've applied patches 1 to 3 (in fact, I got the patches from the previous 
 version -
 unfortunately, patchwork do a very bad job when someone sends a new series 
 that superseeds
 the previous patches).

 I didn't like patch 4 for some reasons: instead of just doing rename, it is a
 all-in-one patch, doing several things at the same time. It is hard to 
 analyse it by
 just looking at the diffs, as it is not a pure rename patch. Also, it 
 doesn't rename
 /drivers/media/IR into something else.

 Btw, the patch is currently broken:
 
 Hm, the series applied cleanly against 2.6.37-rc1 a bit ago:
 
 http://git.kernel.org/?p=linux/kernel/git/jarod/linux-2.6-ir.git;a=shortlog;h=refs/heads/staging

Probably, some other RC patch broke it. It doesn't apply cleanly 
against staging/for_v2.6.38.

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