Re: [GIT PATCHES FOR 2.6.36] gspca for_2.6.36

2010-10-15 Thread Antonio Ospite
On Sun, 10 Oct 2010 13:24:47 +0200
Jean-Francois Moine moin...@free.fr wrote:

 The following changes since commit
 d65728875a85ac7c8b7d6eb8d51425bacc188980:
 
   V4L/DVB: v4l: radio: si470x: fix unneeded free_irq() call (2010-09-30 
 07:35:12 -0300)
 
 are available in the git repository at:
   git://linuxtv.org/jfrancois/gspca.git for_2.6.36
 
 Jean-François Moine (1):
   gspca - main: Fix a regression with the PS3 Eye webcam
 

Hi, this is not in 2.6.36-rc8, any chance we can make it for 2.6.36?

Thanks,
   Antonio

  drivers/media/video/gspca/gspca.c |4 ++--
  1 files changed, 2 insertions(+), 2 deletions(-)

 -- 
 Ken ar c'hentañ   | ** Breizh ha Linux atav! **
 Jef   |   http://moinejf.free.fr/
 --
 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
 

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


pgpz9ZBF3yqXo.pgp
Description: PGP signature


Skystar USB 2 Driver

2010-10-15 Thread Ali Güller
Hi,

I have just participated in this mail group. I wonder if there is a driver for 
Technisat Skystar USB 2 . Thank you.


--
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: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken

2010-10-15 Thread Hans Verkuil
On Thursday, October 14, 2010 22:06:29 valdis.kletni...@vt.edu wrote:
 On Wed, 13 Oct 2010 17:13:25 PDT, a...@linux-foundation.org said:
  The mm-of-the-moment snapshot 2010-10-13-17-13 has been uploaded to
  
 http://userweb.kernel.org/~akpm/mmotm/
 
 This broke my webcam.  I bisected it down to this commit, and things
 work again after reverting the 2 code lines of change.
 
 commit 9e4d79a98ebd857ec729f5fa8f432f35def4d0da
 Author: Hans Verkuil hverk...@xs4all.nl
 Date:   Sun Sep 26 08:16:56 2010 -0300
 
 V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked
 
 Until now all fops except release and (unlocked_)ioctl returned an error
 after the device node was unregistered. Extend this as well to the ioctl
 fops. There is nothing useful that an application can do here and it
 complicates the driver code unnecessarily.
 
 Signed-off-by: Hans Verkuil hverk...@xs4all.nl
 Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
 
 
 diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
 index d4a3532..f069c61 100644
 --- a/drivers/media/video/v4l2-dev.c
 +++ b/drivers/media/video/v4l2-dev.c
 @@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned int 
 cmd, 
 struct video_device *vdev = video_devdata(filp);
 int ret;
  
 -   /* Allow ioctl to continue even if the device was unregistered.
 -  Things like dequeueing buffers might still be useful. */
 +   if (!vdev-fops-ioctl)
 +   return -ENOTTY;
 if (vdev-fops-unlocked_ioctl) {
 ret = vdev-fops-unlocked_ioctl(filp, cmd, arg);
 } else if (vdev-fops-ioctl) {
 
 I suspect this doesn't do what's intended if a driver is using 
 -unlocked_ioctl
 rather than -ioctl, and it should be reverted - it only saves at most one
 if statement.
 
 

I'm not sure what is going on here. It looks like this patch is mangled in your
tree since the same patch in the v4l-dvb repository looks like this:

diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
 
index 32575a6..26d39c4 100644   
 
--- a/drivers/media/video/v4l2-dev.c
 
+++ b/drivers/media/video/v4l2-dev.c
 
@@ -222,8 +222,8 @@ static int v4l2_ioctl(struct inode *inode, struct file 
*filp,

 
if (!vdev-fops-ioctl) 
 
return -ENOTTY; 
 
-   /* Allow ioctl to continue even if the device was unregistered. 
 
-  Things like dequeueing buffers might still be useful. */
+   if (!video_is_registered(vdev))
+   return -ENODEV;
return vdev-fops-ioctl(filp, cmd, arg);
 }
 
@@ -234,8 +234,8 @@ static long v4l2_unlocked_ioctl(struct file *filp,
 
if (!vdev-fops-unlocked_ioctl)
return -ENOTTY;
-   /* Allow ioctl to continue even if the device was unregistered.
-  Things like dequeueing buffers might still be useful. */
+   if (!video_is_registered(vdev))
+   return -ENODEV;
return vdev-fops-unlocked_ioctl(filp, cmd, arg);
 }

In your diff there is a mismatch between ioctl and unlocked_ioctl which no doubt
is causing all the problems for you.

Regards,

Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
--
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: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken

2010-10-15 Thread Andrew Morton
On Fri, 15 Oct 2010 10:45:45 +0200 Hans Verkuil hverk...@xs4all.nl wrote:

 On Thursday, October 14, 2010 22:06:29 valdis.kletni...@vt.edu wrote:
  On Wed, 13 Oct 2010 17:13:25 PDT, a...@linux-foundation.org said:
   The mm-of-the-moment snapshot 2010-10-13-17-13 has been uploaded to
   
  http://userweb.kernel.org/~akpm/mmotm/
  
  This broke my webcam.  I bisected it down to this commit, and things
  work again after reverting the 2 code lines of change.
  
  commit 9e4d79a98ebd857ec729f5fa8f432f35def4d0da
  Author: Hans Verkuil hverk...@xs4all.nl
  Date:   Sun Sep 26 08:16:56 2010 -0300
  
  V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked
  
  Until now all fops except release and (unlocked_)ioctl returned an error
  after the device node was unregistered. Extend this as well to the ioctl
  fops. There is nothing useful that an application can do here and it
  complicates the driver code unnecessarily.
  
  Signed-off-by: Hans Verkuil hverk...@xs4all.nl
  Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
  
  
  diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
  index d4a3532..f069c61 100644
  --- a/drivers/media/video/v4l2-dev.c
  +++ b/drivers/media/video/v4l2-dev.c
  @@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned int 
  cmd, 
  struct video_device *vdev = video_devdata(filp);
  int ret;
   
  -   /* Allow ioctl to continue even if the device was unregistered.
  -  Things like dequeueing buffers might still be useful. */
  +   if (!vdev-fops-ioctl)
  +   return -ENOTTY;
  if (vdev-fops-unlocked_ioctl) {
  ret = vdev-fops-unlocked_ioctl(filp, cmd, arg);
  } else if (vdev-fops-ioctl) {
  
  I suspect this doesn't do what's intended if a driver is using 
  -unlocked_ioctl
  rather than -ioctl, and it should be reverted - it only saves at most one
  if statement.
  
  
 
 I'm not sure what is going on here. It looks like this patch is mangled in 
 your
 tree since the same patch in the v4l-dvb repository looks like this:
 
 diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c  

 index 32575a6..26d39c4 100644 

 --- a/drivers/media/video/v4l2-dev.c  

 +++ b/drivers/media/video/v4l2-dev.c  

 @@ -222,8 +222,8 @@ static int v4l2_ioctl(struct inode *inode, struct file 
 *filp,
   

 if (!vdev-fops-ioctl)   

 return -ENOTTY;   

 -   /* Allow ioctl to continue even if the device was unregistered.   

 -  Things like dequeueing buffers might still be useful. */
 +   if (!video_is_registered(vdev))
 +   return -ENODEV;
 return vdev-fops-ioctl(filp, cmd, arg);
  }
  
 @@ -234,8 +234,8 @@ static long v4l2_unlocked_ioctl(struct file *filp,
  
 if (!vdev-fops-unlocked_ioctl)
 return -ENOTTY;
 -   /* Allow ioctl to continue even if the device was unregistered.
 -  Things like dequeueing buffers might still be useful. */
 +   if (!video_is_registered(vdev))
 +   return -ENODEV;
 return vdev-fops-unlocked_ioctl(filp, cmd, arg);
  }
 
 In your diff there is a mismatch between ioctl and unlocked_ioctl which no 
 doubt
 is causing all the problems for you.

The patch which Valdis quoted is what is in linux-next.  I'm not
at which stage the mangling happened?
--
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: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken

2010-10-15 Thread Hans Verkuil
On Friday, October 15, 2010 11:05:26 Andrew Morton wrote:
 On Fri, 15 Oct 2010 10:45:45 +0200 Hans Verkuil hverk...@xs4all.nl wrote:
 
  On Thursday, October 14, 2010 22:06:29 valdis.kletni...@vt.edu wrote:
   On Wed, 13 Oct 2010 17:13:25 PDT, a...@linux-foundation.org said:
The mm-of-the-moment snapshot 2010-10-13-17-13 has been uploaded to

   http://userweb.kernel.org/~akpm/mmotm/
   
   This broke my webcam.  I bisected it down to this commit, and things
   work again after reverting the 2 code lines of change.
   
   commit 9e4d79a98ebd857ec729f5fa8f432f35def4d0da
   Author: Hans Verkuil hverk...@xs4all.nl
   Date:   Sun Sep 26 08:16:56 2010 -0300
   
   V4L/DVB: v4l2-dev: after a disconnect any ioctl call will be blocked
   
   Until now all fops except release and (unlocked_)ioctl returned an 
   error
   after the device node was unregistered. Extend this as well to the 
   ioctl
   fops. There is nothing useful that an application can do here and it
   complicates the driver code unnecessarily.
   
   Signed-off-by: Hans Verkuil hverk...@xs4all.nl
   Signed-off-by: Mauro Carvalho Chehab mche...@redhat.com
   
   
   diff --git a/drivers/media/video/v4l2-dev.c 
   b/drivers/media/video/v4l2-dev.c
   index d4a3532..f069c61 100644
   --- a/drivers/media/video/v4l2-dev.c
   +++ b/drivers/media/video/v4l2-dev.c
   @@ -221,8 +221,8 @@ static long v4l2_ioctl(struct file *filp, unsigned 
   int cmd, 
   struct video_device *vdev = video_devdata(filp);
   int ret;

   -   /* Allow ioctl to continue even if the device was unregistered.
   -  Things like dequeueing buffers might still be useful. */
   +   if (!vdev-fops-ioctl)
   +   return -ENOTTY;
   if (vdev-fops-unlocked_ioctl) {
   ret = vdev-fops-unlocked_ioctl(filp, cmd, arg);
   } else if (vdev-fops-ioctl) {
   
   I suspect this doesn't do what's intended if a driver is using 
   -unlocked_ioctl
   rather than -ioctl, and it should be reverted - it only saves at most one
   if statement.
   
   
  
  I'm not sure what is going on here. It looks like this patch is mangled in 
  your
  tree since the same patch in the v4l-dvb repository looks like this:
  
  diff --git a/drivers/media/video/v4l2-dev.c 
  b/drivers/media/video/v4l2-dev.c
   
  index 32575a6..26d39c4 100644   
   
  --- a/drivers/media/video/v4l2-dev.c
   
  +++ b/drivers/media/video/v4l2-dev.c
   
  @@ -222,8 +222,8 @@ static int v4l2_ioctl(struct inode *inode, struct file 
  *filp,
  
   
  if (!vdev-fops-ioctl) 
   
  return -ENOTTY; 
   
  -   /* Allow ioctl to continue even if the device was unregistered. 
   
  -  Things like dequeueing buffers might still be useful. */
  +   if (!video_is_registered(vdev))
  +   return -ENODEV;
  return vdev-fops-ioctl(filp, cmd, arg);
   }
   
  @@ -234,8 +234,8 @@ static long v4l2_unlocked_ioctl(struct file *filp,
   
  if (!vdev-fops-unlocked_ioctl)
  return -ENOTTY;
  -   /* Allow ioctl to continue even if the device was unregistered.
  -  Things like dequeueing buffers might still be useful. */
  +   if (!video_is_registered(vdev))
  +   return -ENODEV;
  return vdev-fops-unlocked_ioctl(filp, cmd, arg);
   }
  
  In your diff there is a mismatch between ioctl and unlocked_ioctl which no 
  doubt
  is causing all the problems for you.
 
 The patch which Valdis quoted is what is in linux-next.  I'm not
 at which stage the mangling happened?
 

OK, I see what happened. My original patch:

http://git.linuxtv.org/media_tree.git?a=commitdiff;h=30de1fa062e42a74c54e94c8977d7dcef9a5049f;hp=f39385558f50f0b5b2bc9b47c187b81a8188fb10

clashed with Arnd Bergmann's patch:

http://git.kernel.org/?p=linux/kernel/git/next/linux-next.git;a=commit;h=86a5ef7d777cdd61dfe82379d559dbea069aea3d

Someone tried to resolve the conflict but made a mistake.

The result is this:

static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
struct video_device *vdev = video_devdata(filp);
int ret;

if 

RE: Skystar USB 2 Driver

2010-10-15 Thread Ali Güller
Hi,
Thank you for your reply

Here is my device
http://www.linuxtv.org/wiki/index.php/TechniSat_SkyStar_USB_2

TechniSat SkyStar USB 2
From LinuxTVWiki
Jump to: navigation, search
Overview
Output of lsusb -v: 

Bus 002 Device 004: ID 13d0:2282 TechniSat DVB-S Skystar USB 2
Device Descriptor:
  bLength18
  bDescriptorType 1
  bcdUSB   2.00
  bDeviceClass  255 Vendor Specific Class
  bDeviceSubClass 0
  bDeviceProtocol 0
  bMaxPacketSize064
  idVendor   0x13d0 TechniSat
  idProduct  0x2282 DVB-S Skystar USB 2
  bcdDevice1.01
  iManufacturer   0
  iProduct0
  iSerial 0
  bNumConfigurations  1
  Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength   81
bNumInterfaces  1
bConfigurationValue 1
iConfiguration  0
bmAttributes 0xc0
  Self Powered
MaxPower  222mA
Interface Descriptor:
  bLength 9
  bDescriptorType 4
  bInterfaceNumber0
  bAlternateSetting   0
  bNumEndpoints   9
  bInterfaceClass   255 Vendor Specific Class
  bInterfaceSubClass  0
  bInterfaceProtocol  0
  iInterface  0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x81  EP 1 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82  EP 2 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03  EP 3 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84  EP 4 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x8d  EP 13 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x0d  EP 13 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x8e  EP 14 IN
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x0e  EP 14 OUT
bmAttributes2
  Transfer TypeBulk
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0200  1x 512 bytes
bInterval   0
  Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x8f  EP 15 IN
bmAttributes3
  Transfer TypeInterrupt
  Synch Type   None
  Usage Type   Data
wMaxPacketSize 0x0004  1x 4 bytes
bInterval   1
cannot read device status, Broken pipe (32)



-Original Message-
From: linux-media-ow...@vger.kernel.org 
[mailto:linux-media-ow...@vger.kernel.org] On Behalf Of Patrick Boettcher
Sent: Friday, October 15, 2010 11:15 AM
To: Ali Güller
Cc: 'tvbox'; 

Re: mmotm 2010-10-13 - GSPCA SPCA561 webcam driver broken

2010-10-15 Thread Mauro Carvalho Chehab
Em 15-10-2010 07:02, Hans Verkuil escreveu:
 On Friday, October 15, 2010 11:05:26 Andrew Morton wrote:
 On Fri, 15 Oct 2010 10:45:45 +0200 Hans Verkuil hverk...@xs4all.nl wrote:

 On Thursday, October 14, 2010 22:06:29 valdis.kletni...@vt.edu wrote:
 On Wed, 13 Oct 2010 17:13:25 PDT, a...@linux-foundation.org said:
 The mm-of-the-moment snapshot 2010-10-13-17-13 has been uploaded to
 
 Mauro, is this something for you to fix?

I have a patch fixing this conflict already:

http://git.linuxtv.org/mchehab/sbtvd.git?a=commit;h=88164fbe701a0a16e9044b74443dddb6188b54cc

The patch is currently on a separate tree, that I'm using to test some 
experimental
drivers for Brazilian Digital TV system (SBTVD). I'm planning to merge this 
patch, among
with other patches I received for .37 during this weekend.

The problem were due to a conflict between a BKL patch and your patch.

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


OMAP 3530 ISP driver segfaults

2010-10-15 Thread Bastian Hecht
Hello ISP driver developers,

after the lastest pull of branch 'devel' of
git://gitorious.org/maemo-multimedia/omap3isp-rx51 I get a segfault
when I register my ISP_device.
The segfault happens in isp.c in line
 isp-iommu = iommu_get(isp);

I noticed that with the new kernel the module iommu is loaded
automatically after booting while it wasn't in before my pull (my old
pull is about 3 days old).
Tell me what kind of further info you need. Btw, I run an Igepv2.

Thank you,

 Bastian



Here is the dmesg output since init:

[   62.589965] Freeing init memory: 128K
[   71.526092] omap-iommu omap-iommu.0: isp registered
[  106.695953] net eth0: SMSC911x/921x identified at 0xe0808000, IRQ: 336
[  148.803588] Linux media interface: v0.10
[  149.751892] Linux video capture interface: v2.00
[  155.912719] address of isp_platform_data in boardconfig: bf058074
[  155.919219] address of isp_platform_data bf058074
[  155.932434] omap3isp omap3isp: Revision 2.0 found
[  155.940673] Unable to handle kernel NULL pointer dereference at
virtual address 0004
[  155.948852] pgd = dedb8000
[  155.951599] [0004] *pgd=9fffa031, *pte=, *ppte=
[  155.957977] Internal error: Oops: 17 [#1]
[  155.962036] last sysfs file: /sys/module/iommu/initstate
[  155.967407] Modules linked in: board_bastix(+) omap3_isp
v4l2_common videodev media iovmm iommu
[  155.976257] CPU: 0Not tainted  (2.6.35+ #4)
[  155.980834] PC is at iommu_get+0x70/0x108 [iommu]
[  155.985595] LR is at clk_enable+0x38/0x4c
[  155.989654] pc : [bf000bf8]lr : [c0037920]psr: 2013
[  155.989654] sp : deeefe68  ip :   fp : 
[  156.001220] r10: decf8014  r9 : c03d3760  r8 : 
[  156.006500] r7 : 07ff  r6 : dfe6be18  r5 : c03d3758  r4 : dfe6be00
[  156.013092] r3 :   r2 :   r1 : c03d8b64  r0 : dfe6be00
[  156.019683] Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  156.026855] Control: 10c5387d  Table: 9edb8019  DAC: 0015
[  156.032653] Process insmod (pid: 1877, stack limit = 0xd2f0)
[  156.038726] Stack: (0xdeeefe68 to 0xdeef)
[  156.043121] fe60:   decf8000 c03d3758 000f
bf0333dc  0001
[  156.051391] fe80:   dee13ba8  c03d3768
c03d3760 c03d3760 
[  156.059631] fea0: bf045314 c0028fc4   
c019bd50 c019bd3c c019af30
[  156.067901] fec0: c019bdec c03d3760 c019b064  
c019a548 dfc04b08 dfcf2774
[  156.076141] fee0: c03d3794 c03d3760 c03f7770 c019b118 0001
c03d3760 c03d3768 c019a3b8
[  156.084411] ff00: c03d3760 c0198ff0 deeeff40 c03d3768 c03d3768
  c015e050
[  156.092651] ff20: c03d3758 c03d3758 0010 01c0 00014154
c0028fc4 d000 00013008
[  156.100921] ff40:  c019c15c  bf05b000 
 00014154 c0028330
[  156.109161] ff60: bf0580c4  00013008 00014154 c0028fc4
bf0580c4  00013008
[  156.117431] ff80: 00014154 c006c948 00013018 00014154 00013008
4000e93c 0002 0003
[  156.125701] ffa0: 0080 c0028e40 4000e93c 0002 00013018
00014154 00013008 0001
[  156.133941] ffc0: 4000e93c 0002 0003 0080 be989a2b
 00013008 
[  156.142211] ffe0: 00013018 be9897ac 90d8 400fa194 2010
00013018 c00c 330c
[  156.150543] [bf000bf8] (iommu_get+0x70/0x108 [iommu]) from
[bf0333dc] (isp_probe+0x2e8/0xbe4 [omap3_isp])
[  156.160583] [bf0333dc] (isp_probe+0x2e8/0xbe4 [omap3_isp]) from
[c019bd50] (platform_drv_probe+0x14/0x18)
[  156.170623] [c019bd50] (platform_drv_probe+0x14/0x18) from
[c019af30] (driver_probe_device+0xa8/0x158)
[  156.180358] [c019af30] (driver_probe_device+0xa8/0x158) from
[c019a548] (bus_for_each_drv+0x48/0x80)
[  156.189941] [c019a548] (bus_for_each_drv+0x48/0x80) from
[c019b118] (device_attach+0x50/0x68)
[  156.198913] [c019b118] (device_attach+0x50/0x68) from
[c019a3b8] (bus_probe_device+0x24/0x40)
[  156.207855] [c019a3b8] (bus_probe_device+0x24/0x40) from
[c0198ff0] (device_add+0x308/0x46c)
[  156.216735] [c0198ff0] (device_add+0x308/0x46c) from [c019c15c]
(platform_device_add+0x104/0x160)
[  156.226043] [c019c15c] (platform_device_add+0x104/0x160) from
[c0028330] (do_one_initcall+0x58/0x1b4)
[  156.235717] [c0028330] (do_one_initcall+0x58/0x1b4) from
[c006c948] (sys_init_module+0x90/0x1a4)
[  156.244964] [c006c948] (sys_init_module+0x90/0x1a4) from
[c0028e40] (ret_fast_syscall+0x0/0x30)




My board specific code:

//  IGEP CAM BUS NUM
#define BASTIX_CAM_I2C_BUS_NUM  2

static int __init cam_init(void)
{
return 0;
}

static struct mt9t001_platform_data bastix_mt9p031_platform_data = {
.clk_pol= 0,
};


static struct i2c_board_info bastix_camera_i2c_devices[] = {
{
I2C_BOARD_INFO(MT9P031_NAME, MT9P031_I2C_ADDR),
.platform_data = bastix_mt9p031_platform_data,
},
};

static struct v4l2_subdev_i2c_board_info bastix_camera_mt9p031[] = {
{
   

Re: OMAP 3530 ISP driver segfaults

2010-10-15 Thread Laurent Pinchart
Hi Bastian,

On Friday 15 October 2010 13:59:24 Bastian Hecht wrote:
 Hello ISP driver developers,
 
 after the lastest pull of branch 'devel' of
 git://gitorious.org/maemo-multimedia/omap3isp-rx51 I get a segfault
 when I register my ISP_device.
 The segfault happens in isp.c in line
  isp-iommu = iommu_get(isp);
 
 I noticed that with the new kernel the module iommu is loaded
 automatically after booting while it wasn't in before my pull (my old
 pull is about 3 days old).
 Tell me what kind of further info you need. Btw, I run an Igepv2.

Can you make sure that both the omap-iommu and iommu2 modules are loaded 
before omap3-isp.ko ?

-- 
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: Re: [PULL] http://kernellabs.com/hg/~stoth/saa7164-v4l

2010-10-15 Thread Steven Toth
Sorry, SOB

On Thu, Oct 14, 2010 at 12:36 PM, Mauro Carvalho Chehab
mche...@redhat.com wrote:
 Hi Steven,

 I'm still missing your SOB for the three patches from Gavin.

 Please reply to this thread publicly with your SOB, and I'll add both SOB's 
 on my tree.

 Thanks,
 Mauro

Sorry, a mix of travel and time away from email.

For all three patches by Gavin:

Signed-off-by: Steven Toth st...@kernellabs.com

Regards,

- Steve

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


Re: Skystar USB 2 Driver

2010-10-15 Thread Antti Palosaari

Hei Ali,

On 10/15/2010 11:10 AM, Ali Güller wrote:

I have just participated in this mail group. I wonder if there is a driver for 
Technisat Skystar USB 2 . Thank you.


There is also commonly available Cinergy S2 USB HD (USB DVB-S2). I 
tested it recently and it was rather working with s2-liplianin tree. 
Support is not added to the main Kernel for some reason, looks like 
Liplianin is delaying it for some reason. He didn't even answer mail 
when I asked reason for delay :-(


http://mercurial.intuxication.org/hg/s2-liplianin-351/rev/97ae743b2035


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


[PULL] hdpvr changes for 2.6.37

2010-10-15 Thread Janne Grunau
Hi Mauro,

please pull 

git://git.jannau.net/linux hdpvr-v2.6.37

for following hdpvr changes.

thanks,
Janne

Alan Young (4):
  V4L/DVB: hdpvr: remove unnecessary sleep in hdpvr_config_call
  V4L/DVB: hdpvr: remove unecessary sleep in buffer drain loop
  V4L/DVB: hdpvr: print firmware date
  V4L/DVB: hdpvr: decrease URB timeout to 90ms

James M McLaren (1):
  V4L/DVB: hdpvr: Add missing URB_NO_TRANSFER_DMA_MAP flag

Janne Grunau (4):
  V4L/DVB: hdpvr: add two known to work firmware versions
  V4L/DVB: hdpvr: use AC3 as default audio codec for SPDIF
  V4L/DVB: hdpvr: fix audio input setting for pre AC3 firmwares
  V4L/DVB: hdpvr: add usb product id 0x4903

 drivers/media/video/hdpvr/hdpvr-control.c |5 +---
 drivers/media/video/hdpvr/hdpvr-core.c|   36 +++-
 drivers/media/video/hdpvr/hdpvr-video.c   |5 +--
 drivers/media/video/hdpvr/hdpvr.h |7 -
 4 files changed, 32 insertions(+), 21 deletions(-)
--
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


no DVB-T with AVerMedia M115S

2010-10-15 Thread Daniel Päßler
 Hi,

i own a mini-PCI card builtin in a Sony Vaio VGN-AR71ZU Notebook.
After searching the web it looks like this is a AVerMedia M115S (maybe
the S stands for Sony?), which is somehow different to an ordinary M115.
Is there any chance to get DVB-T working with this card? It seems, that
the tuner is the problem, but i don't know how to find out the type of
the tuner.


lspci -vvvnn gives this:

08:04.0 Multimedia controller [0480]: Philips Semiconductors
SAA7131/SAA7133/SAA7135 Video Broadcast Decoder [1131:7133] (rev d1)
Subsystem: Avermedia Technologies Inc Device [1461:e836]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort-
TAbort- MAbort- SERR- PERR- INTx-
Latency: 64
Interrupt: pin A routed to IRQ 22
Region 0: Memory at fc006800 (32-bit, non-prefetchable) [size=2K]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: saa7134
Kernel modules: saa7134


and dmesg with the actual checkout of v4l gives this:

saa7130/34: v4l2 driver version 0.2.16 loaded
saa7133[0]: found at :08:04.0, rev: 209, irq: 22, latency: 64, mmio:
0xfc006800
saa7133[0]: subsystem: 1461:e836, board: UNKNOWN/GENERIC
[card=0,autodetected]
saa7133[0]: board init: gpio is eff
saa7133[0]/core: hwinit1
saa7133[0]: i2c xfer:  a0 00 
saa7133[0]: i2c xfer:  a1 =61 =14 =36 =e8 =00 =00 =00 =00 =00 =00 =00
=00 =00 =00 =00 =00 =ff =ff =ff =ff =ff =20 =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =01 =40 =01 =02 =02 =01 =01 =03 =08 =ff =00 =00 =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=65 =00 =ff =c2 =00 =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =0d =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff 
saa7133[0]: i2c eeprom 00: 61 14 36 e8 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 00 ff ff ff ff
saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 40: ff 65 00 ff c2 00 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom a0: 0d ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c xfer:  01 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  03 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  05 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  07 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  09 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  11 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  13 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  15 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  17 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  19 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  21 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  23 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  25 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  27 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  29 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  31 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  33 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  35 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  37 ERROR: NO_DEVICE

[PATCH] IR/nuvoton: address all checkpatch.pl issues

2010-10-15 Thread Jarod Wilson
On Fri, Oct 15, 2010 at 12:39:57AM -0300, Mauro Carvalho Chehab wrote:
 Em 12-10-2010 10:50, Jarod Wilson escreveu:
  Jarod Wilson (8):
IR: add driver for Nuvoton w836x7hg integrated CIR
 
 There's a number of checkpatch issues on this patch. Please send me later a 
 patch 
 addressing them. The 80-cols warnings seem bogus to me.
 You should notice that a few printk's have the \n missing. Not sure if you 
 forgot, or
 if you should be using KERN_CONT for some printk's.

D'oh. I forgot to checkpatch it entirely. The following should take care
of it all.

From cb24961b294a6fd13f4297fd2da634e379a8a9a8 Mon Sep 17 00:00:00 2001
From: Jarod Wilson ja...@redhat.com
Date: Fri, 15 Oct 2010 10:07:37 -0400
Subject: [PATCH] IR/nuvoton: address all checkpatch.pl issues

The driver was missing KERN_ facilities on a number of printks. The
register dump functions have been updated to use KERN_INFO, so that the
register dump gets logged in syslog (they only run on driver load, and
only when debug is enabled). The buffer dump routine now uses
KERN_DEBUG, as that spew will happen quite frequently (several times
every IR signal), and shouldn't need to be logged.

Also split up the small handful of lines that were just over 80
characaters, and fixed the ioctl.h include.

Signed-off-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/nuvoton-cir.c |  112 +---
 drivers/media/IR/nuvoton-cir.h |2 +-
 2 files changed, 60 insertions(+), 54 deletions(-)

diff --git a/drivers/media/IR/nuvoton-cir.c b/drivers/media/IR/nuvoton-cir.c
index fdb280e..2f0f780 100644
--- a/drivers/media/IR/nuvoton-cir.c
+++ b/drivers/media/IR/nuvoton-cir.c
@@ -126,40 +126,43 @@ static u8 nvt_cir_wake_reg_read(struct nvt_dev *nvt, u8 
offset)
return val;
 }
 
+#define pr_reg(text, ...) \
+   printk(KERN_INFO KBUILD_MODNAME :  text, ## __VA_ARGS__)
+
 /* dump current cir register contents */
 static void cir_dump_regs(struct nvt_dev *nvt)
 {
nvt_efm_enable(nvt);
nvt_select_logical_dev(nvt, LOGICAL_DEV_CIR);
 
-   printk(%s: Dump CIR logical device registers:\n, NVT_DRIVER_NAME);
-   printk( * CR CIR ACTIVE :   0x%x\n,
+   pr_reg(%s: Dump CIR logical device registers:\n, NVT_DRIVER_NAME);
+   pr_reg( * CR CIR ACTIVE :   0x%x\n,
   nvt_cr_read(nvt, CR_LOGICAL_DEV_EN));
-   printk( * CR CIR BASE ADDR: 0x%x\n,
+   pr_reg( * CR CIR BASE ADDR: 0x%x\n,
   (nvt_cr_read(nvt, CR_CIR_BASE_ADDR_HI)  8) |
nvt_cr_read(nvt, CR_CIR_BASE_ADDR_LO));
-   printk( * CR CIR IRQ NUM:   0x%x\n,
+   pr_reg( * CR CIR IRQ NUM:   0x%x\n,
   nvt_cr_read(nvt, CR_CIR_IRQ_RSRC));
 
nvt_efm_disable(nvt);
 
-   printk(%s: Dump CIR registers:\n, NVT_DRIVER_NAME);
-   printk( * IRCON: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRCON));
-   printk( * IRSTS: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRSTS));
-   printk( * IREN:  0x%x\n, nvt_cir_reg_read(nvt, CIR_IREN));
-   printk( * RXFCONT:   0x%x\n, nvt_cir_reg_read(nvt, CIR_RXFCONT));
-   printk( * CP:0x%x\n, nvt_cir_reg_read(nvt, CIR_CP));
-   printk( * CC:0x%x\n, nvt_cir_reg_read(nvt, CIR_CC));
-   printk( * SLCH:  0x%x\n, nvt_cir_reg_read(nvt, CIR_SLCH));
-   printk( * SLCL:  0x%x\n, nvt_cir_reg_read(nvt, CIR_SLCL));
-   printk( * FIFOCON:   0x%x\n, nvt_cir_reg_read(nvt, CIR_FIFOCON));
-   printk( * IRFIFOSTS: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRFIFOSTS));
-   printk( * SRXFIFO:   0x%x\n, nvt_cir_reg_read(nvt, CIR_SRXFIFO));
-   printk( * TXFCONT:   0x%x\n, nvt_cir_reg_read(nvt, CIR_TXFCONT));
-   printk( * STXFIFO:   0x%x\n, nvt_cir_reg_read(nvt, CIR_STXFIFO));
-   printk( * FCCH:  0x%x\n, nvt_cir_reg_read(nvt, CIR_FCCH));
-   printk( * FCCL:  0x%x\n, nvt_cir_reg_read(nvt, CIR_FCCL));
-   printk( * IRFSM: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRFSM));
+   pr_reg(%s: Dump CIR registers:\n, NVT_DRIVER_NAME);
+   pr_reg( * IRCON: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRCON));
+   pr_reg( * IRSTS: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRSTS));
+   pr_reg( * IREN:  0x%x\n, nvt_cir_reg_read(nvt, CIR_IREN));
+   pr_reg( * RXFCONT:   0x%x\n, nvt_cir_reg_read(nvt, CIR_RXFCONT));
+   pr_reg( * CP:0x%x\n, nvt_cir_reg_read(nvt, CIR_CP));
+   pr_reg( * CC:0x%x\n, nvt_cir_reg_read(nvt, CIR_CC));
+   pr_reg( * SLCH:  0x%x\n, nvt_cir_reg_read(nvt, CIR_SLCH));
+   pr_reg( * SLCL:  0x%x\n, nvt_cir_reg_read(nvt, CIR_SLCL));
+   pr_reg( * FIFOCON:   0x%x\n, nvt_cir_reg_read(nvt, CIR_FIFOCON));
+   pr_reg( * IRFIFOSTS: 0x%x\n, nvt_cir_reg_read(nvt, CIR_IRFIFOSTS));
+   pr_reg( * SRXFIFO:   0x%x\n, nvt_cir_reg_read(nvt, CIR_SRXFIFO));
+   pr_reg( * TXFCONT:   0x%x\n, nvt_cir_reg_read(nvt, CIR_TXFCONT));
+   pr_reg( * STXFIFO:   0x%x\n, nvt_cir_reg_read(nvt, CIR_STXFIFO));
+   pr_reg( * FCCH:  0x%x\n, 

no DVB-T with AVerMedia M115S

2010-10-15 Thread Daniel
 Hi,

i own a mini-PCI card builtin in a Sony Vaio VGN-AR71ZU Notebook.
After searching the web it looks like this is a AVerMedia M115S (maybe
the S stands for Sony?), which is somehow different to an ordinary M115.
Is there any chance to get DVB-T working with this card? It seems, that
the tuner is the problem, but i don't know how to find out the type of
the tuner.


lspci -vvvnn gives this:

08:04.0 Multimedia controller [0480]: Philips Semiconductors
SAA7131/SAA7133/SAA7135 Video Broadcast Decoder [1131:7133] (rev d1)
Subsystem: Avermedia Technologies Inc Device [1461:e836]
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
Stepping- SERR- FastB2B- DisINTx-
Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium TAbort-
TAbort- MAbort- SERR- PERR- INTx-
Latency: 64
Interrupt: pin A routed to IRQ 22
Region 0: Memory at fc006800 (32-bit, non-prefetchable) [size=2K]
Capabilities: [40] Power Management version 2
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA
PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Kernel driver in use: saa7134
Kernel modules: saa7134


and dmesg with the actual checkout of v4l gives this:

saa7130/34: v4l2 driver version 0.2.16 loaded
saa7133[0]: found at :08:04.0, rev: 209, irq: 22, latency: 64, mmio:
0xfc006800
saa7133[0]: subsystem: 1461:e836, board: UNKNOWN/GENERIC
[card=0,autodetected]
saa7133[0]: board init: gpio is eff
saa7133[0]/core: hwinit1
saa7133[0]: i2c xfer:  a0 00 
saa7133[0]: i2c xfer:  a1 =61 =14 =36 =e8 =00 =00 =00 =00 =00 =00 =00
=00 =00 =00 =00 =00 =ff =ff =ff =ff =ff =20 =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =01 =40 =01 =02 =02 =01 =01 =03 =08 =ff =00 =00 =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=65 =00 =ff =c2 =00 =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =0d =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff
=ff =ff =ff =ff =ff =ff =ff =ff =ff =ff =ff 
saa7133[0]: i2c eeprom 00: 61 14 36 e8 00 00 00 00 00 00 00 00 00 00 00 00
saa7133[0]: i2c eeprom 10: ff ff ff ff ff 20 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 20: 01 40 01 02 02 01 01 03 08 ff 00 00 ff ff ff ff
saa7133[0]: i2c eeprom 30: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 40: ff 65 00 ff c2 00 ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 50: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 60: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 70: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom 90: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom a0: 0d ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom b0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom c0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom d0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c eeprom f0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
saa7133[0]: i2c xfer:  01 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  03 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  05 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  07 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  09 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  0f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  11 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  13 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  15 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  17 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  19 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  1f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  21 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  23 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  25 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  27 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  29 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2b ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2d ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  2f ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  31 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  33 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  35 ERROR: NO_DEVICE
saa7133[0]: i2c xfer:  37 ERROR: NO_DEVICE

[PATCH 3/7] IR: extend an sort the MCE keymap

2010-10-15 Thread Maxim Levitsky
Add new keys, found on:

Toshiba Qosmio F50-10q.
Toshiba Qosmio X300
Toshiba A500-141

Also sort the keytable by scancode number as that makes sense
and alows easily to add new keycodes.

Thanks to:
Sami R maeses...@gmail.com
Alexander Skiba ghostlyr...@gmail.com
Jordi Pelegrin pelegrin.jo...@gmail.com

For reports and testing.

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
---
 drivers/media/IR/keymaps/rc-rc6-mce.c |   88 +
 1 files changed, 45 insertions(+), 43 deletions(-)

diff --git a/drivers/media/IR/keymaps/rc-rc6-mce.c 
b/drivers/media/IR/keymaps/rc-rc6-mce.c
index 39557ad..1b7adab 100644
--- a/drivers/media/IR/keymaps/rc-rc6-mce.c
+++ b/drivers/media/IR/keymaps/rc-rc6-mce.c
@@ -12,76 +12,78 @@
 #include media/rc-map.h
 
 static struct ir_scancode rc6_mce[] = {
-   { 0x800f0415, KEY_REWIND },
-   { 0x800f0414, KEY_FASTFORWARD },
-   { 0x800f041b, KEY_PREVIOUS },
-   { 0x800f041a, KEY_NEXT },
 
+   { 0x800f0400, KEY_NUMERIC_0 },
+   { 0x800f0401, KEY_NUMERIC_1 },
+   { 0x800f0402, KEY_NUMERIC_2 },
+   { 0x800f0403, KEY_NUMERIC_3 },
+   { 0x800f0404, KEY_NUMERIC_4 },
+   { 0x800f0405, KEY_NUMERIC_5 },
+   { 0x800f0406, KEY_NUMERIC_6 },
+   { 0x800f0407, KEY_NUMERIC_7 },
+   { 0x800f0408, KEY_NUMERIC_8 },
+   { 0x800f0409, KEY_NUMERIC_9 },
+
+   { 0x800f040a, KEY_DELETE },
+   { 0x800f040b, KEY_ENTER },
+   { 0x800f040c, KEY_POWER },
+   { 0x800f040d, KEY_PROG1 },  /* Windows MCE button */
+   { 0x800f040e, KEY_MUTE },
+   { 0x800f040f, KEY_INFO },
+
+   { 0x800f0410, KEY_VOLUMEUP },
+   { 0x800f0411, KEY_VOLUMEDOWN },
+   { 0x800f0412, KEY_CHANNELUP },
+   { 0x800f0413, KEY_CHANNELDOWN },
+
+   { 0x800f0414, KEY_FASTFORWARD },
+   { 0x800f0415, KEY_REWIND },
{ 0x800f0416, KEY_PLAY },
+   { 0x800f0417, KEY_RECORD },
{ 0x800f0418, KEY_PAUSE },
{ 0x800f046e, KEY_PLAYPAUSE },
{ 0x800f0419, KEY_STOP },
-   { 0x800f0417, KEY_RECORD },
+   { 0x800f041a, KEY_NEXT },
+   { 0x800f041b, KEY_PREVIOUS },
+   { 0x800f041c, KEY_NUMERIC_POUND },
+   { 0x800f041d, KEY_NUMERIC_STAR },
 
{ 0x800f041e, KEY_UP },
{ 0x800f041f, KEY_DOWN },
{ 0x800f0420, KEY_LEFT },
{ 0x800f0421, KEY_RIGHT },
 
-   { 0x800f040b, KEY_ENTER },
{ 0x800f0422, KEY_OK },
{ 0x800f0423, KEY_EXIT },
-   { 0x800f040a, KEY_DELETE },
+   { 0x800f0424, KEY_DVD },
+   { 0x800f0425, KEY_TUNER },  /* LiveTV */
+   { 0x800f0426, KEY_EPG },/* Guide */
+   { 0x800f0427, KEY_ZOOM },   /* Aspect */
 
-   { 0x800f040e, KEY_MUTE },
-   { 0x800f0410, KEY_VOLUMEUP },
-   { 0x800f0411, KEY_VOLUMEDOWN },
-   { 0x800f0412, KEY_CHANNELUP },
-   { 0x800f0413, KEY_CHANNELDOWN },
{ 0x800f043a, KEY_BRIGHTNESSUP },
-   { 0x800f0480, KEY_BRIGHTNESSDOWN },
-
-   { 0x800f0401, KEY_NUMERIC_1 },
-   { 0x800f0402, KEY_NUMERIC_2 },
-   { 0x800f0403, KEY_NUMERIC_3 },
-   { 0x800f0404, KEY_NUMERIC_4 },
-   { 0x800f0405, KEY_NUMERIC_5 },
-   { 0x800f0406, KEY_NUMERIC_6 },
-   { 0x800f0407, KEY_NUMERIC_7 },
-   { 0x800f0408, KEY_NUMERIC_8 },
-   { 0x800f0409, KEY_NUMERIC_9 },
-   { 0x800f0400, KEY_NUMERIC_0 },
-
-   { 0x800f041d, KEY_NUMERIC_STAR },
-   { 0x800f041c, KEY_NUMERIC_POUND },
 
{ 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 },
-   { 0x800f0424, KEY_DVD },
-   { 0x800f0425, KEY_TUNER }, /* LiveTV */
-   { 0x800f0450, KEY_RADIO },
-
{ 0x800f044c, KEY_LANGUAGE },
-   { 0x800f0427, KEY_ZOOM }, /* Aspect */
+   { 0x800f044d, KEY_TITLE },
+   { 0x800f044e, KEY_PRINT },  /* Print - HP OEM version of remote */
 
+   { 0x800f0450, KEY_RADIO },
+
+   { 0x800f045a, KEY_SUBTITLE },   /* Caption/Teletext */
{ 0x800f045b, KEY_RED },
{ 0x800f045c, KEY_GREEN },
{ 0x800f045d, KEY_YELLOW },
{ 0x800f045e, KEY_BLUE },
 
-   { 0x800f040f, KEY_INFO },
-   { 0x800f0426, KEY_EPG }, /* Guide */
-   { 0x800f045a, KEY_SUBTITLE }, /* Caption/Teletext */
-   { 0x800f044d, KEY_TITLE },
-
-   { 0x800f044e, KEY_PRINT }, /* Print - HP OEM version of remote */
-
-   { 0x800f040c, KEY_POWER },
-   { 0x800f040d, KEY_PROG1 }, /* Windows MCE button */
+   { 0x800f046e, KEY_PLAYPAUSE },
+   { 0x800f046f, KEY_MEDIA },  /* Start media application (NEW) */
 
+   { 0x800f0480, KEY_BRIGHTNESSDOWN },
+   { 0x800f0481, KEY_PLAYPAUSE },
 };
 
 static struct rc_keymap rc6_mce_map = {
-- 
1.7.1

--
To unsubscribe from 

[PATCH 7/7] IR: ene_ir: don't upload all settings on each TX packet.

2010-10-15 Thread Maxim Levitsky
This is just unnessesary, and now more logical

Also lot of refactoring

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
---
 drivers/media/IR/ene_ir.c |  474 +++-
 drivers/media/IR/ene_ir.h |6 +-
 2 files changed, 251 insertions(+), 229 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 1962652..685db83 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -43,7 +43,7 @@
 #include ene_ir.h
 
 static int sample_period;
-static bool learning_mode;
+static bool learning_mode_force;
 static int debug;
 static bool txsim;
 
@@ -190,6 +190,145 @@ static int ene_hw_detect(struct ene_device *dev)
return 0;
 }
 
+/* Read properities of hw sample buffer */
+static void ene_rx_setup_hw_buffer(struct ene_device *dev)
+{
+   u16 tmp;
+
+   ene_rx_read_hw_pointer(dev);
+   dev-r_pointer = dev-w_pointer;
+
+   if (!dev-hw_extra_buffer) {
+   dev-buffer_len = ENE_FW_PACKET_SIZE * 2;
+   return;
+   }
+
+   tmp = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER);
+   tmp |= ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER+1)  8;
+   dev-extra_buf1_address = tmp;
+
+   dev-extra_buf1_len = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 2);
+
+   tmp = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 3);
+   tmp |= ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 4)  8;
+   dev-extra_buf2_address = tmp;
+
+   dev-extra_buf2_len = ene_read_reg(dev, ENE_FW_SAMPLE_BUFFER + 5);
+
+   dev-buffer_len = dev-extra_buf1_len + dev-extra_buf2_len + 8;
+
+   ene_notice(Hardware uses 2 extended buffers:);
+   ene_notice(  0x%04x - len : %d, dev-extra_buf1_address,
+   dev-extra_buf1_len);
+   ene_notice(  0x%04x - len : %d, dev-extra_buf2_address,
+   dev-extra_buf2_len);
+
+   ene_notice(Total buffer len = %d, dev-buffer_len);
+
+   if (dev-buffer_len  64 || dev-buffer_len  16)
+   goto error;
+
+   if (dev-extra_buf1_address  0xFBFC ||
+   dev-extra_buf1_address  0xEC00)
+   goto error;
+
+   if (dev-extra_buf2_address  0xFBFC ||
+   dev-extra_buf2_address  0xEC00)
+   goto error;
+
+   if (dev-r_pointer  dev-buffer_len)
+   goto error;
+
+   ene_set_reg_mask(dev, ENE_FW1, ENE_FW1_EXTRA_BUF_HND);
+   return;
+error:
+   ene_warn(Error validating extra buffers, device probably won't work);
+   dev-hw_extra_buffer = false;
+   ene_clear_reg_mask(dev, ENE_FW1, ENE_FW1_EXTRA_BUF_HND);
+}
+
+
+/* Restore the pointers to extra buffers - to make module reload work*/
+static void ene_rx_restore_hw_buffer(struct ene_device *dev)
+{
+   if (!dev-hw_extra_buffer)
+   return;
+
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 0,
+   dev-extra_buf1_address  0xFF);
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 1,
+   dev-extra_buf1_address  8);
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 2, dev-extra_buf1_len);
+
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 3,
+   dev-extra_buf2_address  0xFF);
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 4,
+   dev-extra_buf2_address  8);
+   ene_write_reg(dev, ENE_FW_SAMPLE_BUFFER + 5,
+   dev-extra_buf2_len);
+   ene_clear_reg_mask(dev, ENE_FW1, ENE_FW1_EXTRA_BUF_HND);
+}
+
+/* Read hardware write pointer */
+static void ene_rx_read_hw_pointer(struct ene_device *dev)
+{
+   if (dev-hw_extra_buffer)
+   dev-w_pointer = ene_read_reg(dev, ENE_FW_RX_POINTER);
+   else
+   dev-w_pointer = ene_read_reg(dev, ENE_FW2)
+ENE_FW2_BUF_WPTR ? 0 : ENE_FW_PACKET_SIZE;
+
+   dbg_verbose(RB: HW write pointer: %02x, driver read pointer: %02x,
+   dev-w_pointer, dev-r_pointer);
+}
+
+/* Gets address of next sample from HW ring buffer */
+static int ene_rx_get_sample_reg(struct ene_device *dev)
+{
+   int r_pointer;
+
+   if (dev-r_pointer == dev-w_pointer) {
+   dbg_verbose(RB: hit end, try update w_pointer);
+   ene_rx_read_hw_pointer(dev);
+   }
+
+   if (dev-r_pointer == dev-w_pointer) {
+   dbg_verbose(RB: end of data at %d, dev-r_pointer);
+   return 0;
+   }
+
+   dbg_verbose(RB: reading at offset %d, dev-r_pointer);
+   r_pointer = dev-r_pointer;
+
+   dev-r_pointer++;
+   if (dev-r_pointer == dev-buffer_len)
+   dev-r_pointer = 0;
+
+   dbg_verbose(RB: next read will be from offset %d, dev-r_pointer);
+
+   if (r_pointer  8) {
+   dbg_verbose(RB: read at main buffer at %d, r_pointer);
+   return ENE_FW_SAMPLE_BUFFER + r_pointer;
+   }
+

[PATCH 1/7] IR: plug races in IR raw thread.

2010-10-15 Thread Maxim Levitsky
Unfortunelly (my fault) the kernel thread that now handles IR processing
has classical races in regard to wakeup and stop.
This patch hopefully closes them all.
Tested with module reload running in a loop, while receiver is blasted
with IR data for 10 minutes.

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
Acked-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/ir-core-priv.h |2 ++
 drivers/media/IR/ir-raw-event.c |   34 +-
 2 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index a85a8c7..761e7f4 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -17,6 +17,7 @@
 #define _IR_RAW_EVENT
 
 #include linux/slab.h
+#include linux/spinlock.h
 #include media/ir-core.h
 
 struct ir_raw_handler {
@@ -33,6 +34,7 @@ struct ir_raw_handler {
 struct ir_raw_event_ctrl {
struct list_headlist;   /* to keep track of raw 
clients */
struct task_struct  *thread;
+   spinlock_t  lock;
struct kfifokfifo;  /* fifo for the 
pulse/space durations */
ktime_t last_event; /* when last event 
occurred */
enum raw_event_type last_type;  /* last event type */
diff --git a/drivers/media/IR/ir-raw-event.c b/drivers/media/IR/ir-raw-event.c
index 8e0e1b1..119b567 100644
--- a/drivers/media/IR/ir-raw-event.c
+++ b/drivers/media/IR/ir-raw-event.c
@@ -39,22 +39,34 @@ static int ir_raw_event_thread(void *data)
struct ir_raw_event ev;
struct ir_raw_handler *handler;
struct ir_raw_event_ctrl *raw = (struct ir_raw_event_ctrl *)data;
+   int retval;
 
while (!kthread_should_stop()) {
-   try_to_freeze();
 
-   mutex_lock(ir_raw_handler_lock);
+   spin_lock_irq(raw-lock);
+   retval = kfifo_out(raw-kfifo, ev, sizeof(ev));
+
+   if (!retval) {
+   set_current_state(TASK_INTERRUPTIBLE);
 
-   while (kfifo_out(raw-kfifo, ev, sizeof(ev)) == sizeof(ev)) {
-   list_for_each_entry(handler, ir_raw_handler_list, list)
-   handler-decode(raw-input_dev, ev);
-   raw-prev_ev = ev;
+   if (kthread_should_stop())
+   set_current_state(TASK_RUNNING);
+
+   spin_unlock_irq(raw-lock);
+   schedule();
+   continue;
}
 
-   mutex_unlock(ir_raw_handler_lock);
+   spin_unlock_irq(raw-lock);
 
-   set_current_state(TASK_INTERRUPTIBLE);
-   schedule();
+
+   BUG_ON(retval != sizeof(ev));
+
+   mutex_lock(ir_raw_handler_lock);
+   list_for_each_entry(handler, ir_raw_handler_list, list)
+   handler-decode(raw-input_dev, ev);
+   raw-prev_ev = ev;
+   mutex_unlock(ir_raw_handler_lock);
}
 
return 0;
@@ -232,11 +244,14 @@ EXPORT_SYMBOL_GPL(ir_raw_event_set_idle);
 void ir_raw_event_handle(struct input_dev *input_dev)
 {
struct ir_input_dev *ir = input_get_drvdata(input_dev);
+   unsigned long flags;
 
if (!ir-raw)
return;
 
+   spin_lock_irqsave(ir-raw-lock, flags);
wake_up_process(ir-raw-thread);
+   spin_unlock_irqrestore(ir-raw-lock, flags);
 }
 EXPORT_SYMBOL_GPL(ir_raw_event_handle);
 
@@ -275,6 +290,7 @@ int ir_raw_event_register(struct input_dev *input_dev)
return rc;
}
 
+   spin_lock_init(ir-raw-lock);
ir-raw-thread = kthread_run(ir_raw_event_thread, ir-raw,
rc%u,  (unsigned int)ir-devno);
 
-- 
1.7.1

--
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 6/7] IR: ene_ir: add support for carrier reports

2010-10-15 Thread Maxim Levitsky
Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
---
 drivers/media/IR/ene_ir.c |   37 +
 1 files changed, 29 insertions(+), 8 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 8639621..1962652 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -193,10 +193,11 @@ static int ene_hw_detect(struct ene_device *dev)
 /* Sense current received carrier */
 void ene_rx_sense_carrier(struct ene_device *dev)
 {
+   DEFINE_IR_RAW_EVENT(ev);
+
+   int carrier, duty_cycle;
int period = ene_read_reg(dev, ENE_CIRCAR_PRD);
int hperiod = ene_read_reg(dev, ENE_CIRCAR_HPRD);
-   int carrier, duty_cycle;
-
 
if (!(period  ENE_CIRCAR_PRD_VALID))
return;
@@ -209,13 +210,16 @@ void ene_rx_sense_carrier(struct ene_device *dev)
dbg(RX: hardware carrier period = %02x, period);
dbg(RX: hardware carrier pulse period = %02x, hperiod);
 
-
carrier = 200 / period;
duty_cycle = (hperiod * 100) / period;
dbg(RX: sensed carrier = %d Hz, duty cycle %d%%,
-   carrier, duty_cycle);
-
-   /* TODO: Send carrier  duty cycle to IR layer */
+   carrier, duty_cycle);
+   if (dev-carrier_detect_enabled) {
+   ev.carrier_report = true;
+   ev.carrier = carrier;
+   ev.duty_cycle = duty_cycle;
+   ir_raw_event_store(dev-idev, ev);
+   }
 }
 
 /* this enables/disables the CIR RX engine */
@@ -724,7 +728,7 @@ static irqreturn_t ene_isr(int irq, void *data)
 
dbg_verbose(RX interrupt);
 
-   if (dev-carrier_detect_enabled || debug)
+   if (dev-hw_learning_and_tx_capable)
ene_rx_sense_carrier(dev);
 
/* On hardware that don't support extra buffer we need to trust
@@ -897,6 +901,23 @@ static int ene_set_learning_mode(void *data, int enable)
return 0;
 }
 
+static int ene_set_carrier_report(void *data, int enable)
+{
+   struct ene_device *dev = (struct ene_device *)data;
+   unsigned long flags;
+
+   if (enable == dev-carrier_detect_enabled)
+   return 0;
+
+   spin_lock_irqsave(dev-hw_lock, flags);
+   dev-carrier_detect_enabled = enable;
+   ene_rx_disable(dev);
+   ene_rx_setup(dev);
+   ene_rx_enable(dev);
+   spin_unlock_irqrestore(dev-hw_lock, flags);
+   return 0;
+}
+
 /* outside interface: enable or disable idle mode */
 static void ene_rx_set_idle(void *data, bool idle)
 {
@@ -1029,7 +1050,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const 
struct pnp_device_id *id)
ir_props-s_tx_mask = ene_set_tx_mask;
ir_props-s_tx_carrier = ene_set_tx_carrier;
ir_props-s_tx_duty_cycle = ene_set_tx_duty_cycle;
-   /* ir_props-s_carrier_report = ene_set_carrier_report; */
+   ir_props-s_carrier_report = ene_set_carrier_report;
}
 
ene_setup_hw_buffer(dev);
-- 
1.7.1

--
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/8 V6] Many fixes for in-kernel decoding and for the ENE driver

2010-10-15 Thread Mauro Carvalho Chehab
Em 15-10-2010 12:07, Maxim Levitsky escreveu:
 Hi,
 
 This is mostly a resend of my patches, although
 I fixed few bugs in the ENE code.
 This exact patchset was tested against ENE devices with all
 features tested.

I've applied most of the patches from your original series.

The pending ones are:

Sep, 6 2010: [7/8] IR: extend ir_raw_event and do refactoring   
lmml_159431_7_8_ir_extend_ir_raw_event_and_do_refactoring.patch
Maxim Levitsky maximlevit...@gmail.com
Sep, 6 2010: [8/8] IR: ene_ir: add support for carrier reports  
lmml_159451_8_8_ir_ene_ir_add_support_for_carrier_reports.patch
Maxim Levitsky maximlevit...@gmail.com

So, this series as-is will probably not apply anymore.

Could you please rebase it against staging/v2.6.37? 

I'll mark the two above as superseed and wait for your update.

Thanks,
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: [RFC] Resource reservation for frontend - Was: Re: xc5000 and switch RF input

2010-10-15 Thread Antti Palosaari

On 10/14/2010 11:41 AM, Devin Heitmueller wrote:

On Thu, Oct 14, 2010 at 4:33 AM, Antti Palosaaricr...@iki.fi  wrote:

I haven't examined this yet enough, but for the background information I can
say I have one device which needs this. There is tuner behind demodulator,
but instead of normal I2C-gate switch, it is rather much likely repeater.
All tuner commands are send to the demod which then writes those to the
tuner.

DD = demod I2C addr
TT = tuner I2C addr
Bn = payload data

traditional I2C send to the tuner:
TT  B0 B1 B2 ...

demod as repeater send to the tuner:
DD  TT B0 B1 B2 ...


You can accomplish this by having the demod create an i2c adapter
instance, which generates i2c commands to the bridge.  Then when
instantiating the tuner subdev, pass a pointer to the demod's i2c
adapter instead of the i2c adapter provided by the bridge.

No changes required to the core framework.


Thank you Devin. I didn't realized that earlier. It worked just fine.

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


[PATCH 5/7] IR: extend ir_raw_event and do refactoring

2010-10-15 Thread Maxim Levitsky
Add new event types for timeout  carrier report
Move timeout handling from ir_raw_event_store_with_filter to
ir-lirc-codec, where it is really needed.
Now lirc bridge ensures proper gap handling.
Extend lirc bridge for carrier  timeout reports

Note: all new ir_raw_event variables now should be initialized
like that: DEFINE_IR_RAW_EVENT(ev);

To clean an existing event, use init_ir_raw_event(ev);

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
Acked-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/ene_ir.c  |4 +-
 drivers/media/IR/ir-core-priv.h|   13 -
 drivers/media/IR/ir-jvc-decoder.c  |5 +-
 drivers/media/IR/ir-lirc-codec.c   |  128 +---
 drivers/media/IR/ir-nec-decoder.c  |5 +-
 drivers/media/IR/ir-raw-event.c|   45 +
 drivers/media/IR/ir-rc5-decoder.c  |5 +-
 drivers/media/IR/ir-rc6-decoder.c  |5 +-
 drivers/media/IR/ir-sony-decoder.c |5 +-
 drivers/media/IR/mceusb.c  |3 +-
 drivers/media/IR/streamzap.c   |8 ++-
 include/media/ir-core.h|   40 ++--
 12 files changed, 176 insertions(+), 90 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 9f9afe7..8639621 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -697,7 +697,7 @@ static irqreturn_t ene_isr(int irq, void *data)
unsigned long flags;
irqreturn_t retval = IRQ_NONE;
struct ene_device *dev = (struct ene_device *)data;
-   struct ir_raw_event ev;
+   DEFINE_IR_RAW_EVENT(ev);
 
spin_lock_irqsave(dev-hw_lock, flags);
 
@@ -898,7 +898,7 @@ static int ene_set_learning_mode(void *data, int enable)
 }
 
 /* outside interface: enable or disable idle mode */
-static void ene_rx_set_idle(void *data, int idle)
+static void ene_rx_set_idle(void *data, bool idle)
 {
struct ene_device *dev = (struct ene_device *)data;
 
diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index 5d7e08f..2559e72 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -82,6 +82,12 @@ struct ir_raw_event_ctrl {
struct ir_input_dev *ir_dev;
struct lirc_driver *drv;
int carrier_low;
+
+   ktime_t gap_start;
+   u64 gap_duration;
+   bool gap;
+   bool send_timeout_reports;
+
} lirc;
 };
 
@@ -109,9 +115,14 @@ static inline void decrease_duration(struct ir_raw_event 
*ev, unsigned duration)
ev-duration -= duration;
 }
 
+/* Returns true if event is normal pulse/space event */
+static inline bool is_timing_event(struct ir_raw_event ev)
+{
+   return !ev.carrier_report  !ev.reset;
+}
+
 #define TO_US(duration)DIV_ROUND_CLOSEST((duration), 
1000)
 #define TO_STR(is_pulse)   ((is_pulse) ? pulse : space)
-#define IS_RESET(ev)   (ev.duration == 0)
 /*
  * Routines from ir-sysfs.c - Meant to be called only internally inside
  * ir-core
diff --git a/drivers/media/IR/ir-jvc-decoder.c 
b/drivers/media/IR/ir-jvc-decoder.c
index 77a89c4..63dca6e 100644
--- a/drivers/media/IR/ir-jvc-decoder.c
+++ b/drivers/media/IR/ir-jvc-decoder.c
@@ -50,8 +50,9 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct 
ir_raw_event ev)
if (!(ir_dev-raw-enabled_protocols  IR_TYPE_JVC))
return 0;
 
-   if (IS_RESET(ev)) {
-   data-state = STATE_INACTIVE;
+   if (!is_timing_event(ev)) {
+   if (ev.reset)
+   data-state = STATE_INACTIVE;
return 0;
}
 
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index e63f757..9317be8 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -32,6 +32,7 @@
 static int ir_lirc_decode(struct input_dev *input_dev, struct ir_raw_event ev)
 {
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
+   struct lirc_codec *lirc = ir_dev-raw-lirc;
int sample;
 
if (!(ir_dev-raw-enabled_protocols  IR_TYPE_LIRC))
@@ -40,21 +41,57 @@ static int ir_lirc_decode(struct input_dev *input_dev, 
struct ir_raw_event ev)
if (!ir_dev-raw-lirc.drv || !ir_dev-raw-lirc.drv-rbuf)
return -EINVAL;
 
-   if (IS_RESET(ev))
+   /* Packet start */
+   if (ev.reset)
return 0;
 
-   IR_dprintk(2, LIRC data transfer started (%uus %s)\n,
-  TO_US(ev.duration), TO_STR(ev.pulse));
+   /* Carrier reports */
+   if (ev.carrier_report) {
+   sample = LIRC_FREQUENCY(ev.carrier);
+
+   /* Packet end */
+   } else if (ev.timeout) {
+
+   if (lirc-gap)
+   return 0;
+
+   lirc-gap_start = ktime_get();
+   lirc-gap = true;
+   lirc-gap_duration = ev.duration;
+
+   if 

[PATCH 0/8 V7] Many fixes for in-kernel decoding and for the ENE driver

2010-10-15 Thread Maxim Levitsky
Hi,

This is a rebased version against the media_tree staging/v2.6.37

Best regards,
Maxim Levitsky

--
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/5] IR: ene_ir: few bugfixes

2010-10-15 Thread Maxim Levitsky
This is a result of last round of debug with
Sami R maeses...@gmail.com.

Thank you Sami very much!

The biggest bug I fixed is that,
I was clobbering the CIRCFG register after it is setup
That wasn't a good idea really

And some small refactoring, etc.

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
---
 drivers/media/IR/ene_ir.c |   43 ---
 1 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index dc32509..8639621 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -156,11 +156,12 @@ static int ene_hw_detect(struct ene_device *dev)
 
ene_notice(Firmware regs: %02x %02x, fw_reg1, fw_reg2);
 
-   dev-hw_use_gpio_0a = fw_reg2  ENE_FW2_GP0A;
-   dev-hw_learning_and_tx_capable = fw_reg2  ENE_FW2_LEARNING;
-   dev-hw_extra_buffer = fw_reg1  ENE_FW1_HAS_EXTRA_BUF;
-   dev-hw_fan_input = dev-hw_learning_and_tx_capable 
-   (fw_reg2  ENE_FW2_FAN_INPUT);
+   dev-hw_use_gpio_0a = !!(fw_reg2  ENE_FW2_GP0A);
+   dev-hw_learning_and_tx_capable = !!(fw_reg2  ENE_FW2_LEARNING);
+   dev-hw_extra_buffer = !!(fw_reg1  ENE_FW1_HAS_EXTRA_BUF);
+
+   if (dev-hw_learning_and_tx_capable)
+   dev-hw_fan_input = !!(fw_reg2  ENE_FW2_FAN_INPUT);
 
ene_notice(Hardware features:);
 
@@ -255,6 +256,8 @@ static void ene_rx_setup(struct ene_device *dev)
dev-carrier_detect_enabled;
int sample_period_adjust = 0;
 
+   /* This selects RLC input and clears CFG2 settings */
+   ene_write_reg(dev, ENE_CIRCFG2, 0x00);
 
/* set sample period*/
if (sample_period == ENE_DEFAULT_SAMPLE_PERIOD)
@@ -268,7 +271,9 @@ static void ene_rx_setup(struct ene_device *dev)
if (dev-hw_revision  ENE_HW_C)
goto select_timeout;
 
-   if (learning_mode  dev-hw_learning_and_tx_capable) {
+   if (learning_mode) {
+
+   WARN_ON(!dev-hw_learning_and_tx_capable);
 
/* Enable the opposite of the normal input
That means that if GPIO40 is normally used, use GPIO0A
@@ -282,6 +287,7 @@ static void ene_rx_setup(struct ene_device *dev)
ene_set_reg_mask(dev, ENE_CIRCFG, ENE_CIRCFG_CARR_DEMOD);
 
/* Enable carrier detection */
+   ene_write_reg(dev, ENE_CIRCAR_PULS, 0x63);
ene_set_clear_reg_mask(dev, ENE_CIRCFG2, 
ENE_CIRCFG2_CARR_DETECT,
dev-carrier_detect_enabled || debug);
} else {
@@ -343,19 +349,9 @@ static void ene_rx_enable(struct ene_device *dev)
ene_write_reg(dev, ENE_IRQ, reg_value);
}
 
-   if (dev-hw_revision = ENE_HW_C)
-   ene_write_reg(dev, ENE_CIRCAR_PULS, 0x63);
-
-   /* Enable the inputs */
-   ene_write_reg(dev, ENE_CIRCFG2, 0x00);
-
-   if (dev-rx_fan_input_inuse) {
-   ene_enable_cir_engine(dev, false);
-   ene_enable_fan_input(dev, true);
-   } else {
-   ene_enable_cir_engine(dev, true);
-   ene_enable_fan_input(dev, false);
-   }
+   /* Enable inputs */
+   ene_enable_fan_input(dev, dev-rx_fan_input_inuse);
+   ene_enable_cir_engine(dev, !dev-rx_fan_input_inuse);
 
/* ack any pending irqs - just in case */
ene_irq_status(dev);
@@ -793,12 +789,10 @@ static void ene_setup_settings(struct ene_device *dev)
dev-tx_period = 32;
dev-tx_duty_cycle = 50; /*%*/
dev-transmitter_mask = 0x03;
-
-   dev-learning_enabled =
-   (learning_mode  dev-hw_learning_and_tx_capable);
+   dev-learning_enabled = learning_mode;
 
/* Set reasonable default timeout */
-   dev-props-timeout = MS_TO_NS(15000);
+   dev-props-timeout = MS_TO_NS(15);
 }
 
 /* outside interface: called on first open*/
@@ -1015,6 +1009,9 @@ static int ene_probe(struct pnp_dev *pnp_dev, const 
struct pnp_device_id *id)
ene_warn(Simulation of TX activated);
}
 
+   if (!dev-hw_learning_and_tx_capable)
+   learning_mode = false;
+
ir_props-driver_type = RC_DRIVER_IR_RAW;
ir_props-allowed_protos = IR_TYPE_ALL;
ir_props-priv = dev;
-- 
1.7.1

--
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] Move V4L2 locking into the core framework

2010-10-15 Thread David Ellingsworth
Hans,

I noticed a couple more issues with this series. In your changes to
radio-mr800, you removed the lock from usb_amradio_suspend and
usb_amradio_resume without implementing resume/suspend support in the
v4l2 core. Without resume/suspend support in the v4l2 core, the
locking within usb_amradio_suspend and usb_amradio_resume must remain
to prevent races between other open/close/ioctl/read/mmap/etc and the
resume/suspend cycle. Please revert the changes you made to these two
functions.

Regards,

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


Re: [GIT PATCHES FOR 2.6.37] Move V4L2 locking into the core framework

2010-10-15 Thread David Ellingsworth
On Mon, Oct 11, 2010 at 2:05 PM, David Ellingsworth
da...@identd.dyndns.org wrote:
 On Mon, Oct 11, 2010 at 11:40 AM, Hans Verkuil hverk...@xs4all.nl wrote:
 On Sunday, October 10, 2010 19:33:48 David Ellingsworth wrote:
 Hans,

 On Sun, Sep 26, 2010 at 8:25 AM, Hans Verkuil hverk...@xs4all.nl wrote:
  Hi Mauro,
 
  These are the locking patches. It's based on my previous test tree, but 
  with
  more testing with em28xx and radio-mr800 and some small tweaks relating to
  disconnect handling and video_is_registered().
 
  I also removed the unused get_unmapped_area file op and I am now blocking
  any further (unlocked_)ioctl calls after the device node is unregistered.
  The only things an application can do legally after a disconnect is 
  unmap()
  and close().
 
  This patch series also contains a small em28xx fix that I found while 
  testing
  the em28xx BKL removal patch.
 
  Regards,
 
         Hans
 
  The following changes since commit 
  dace3857de7a16b83ae7d4e13c94de8e4b267d2a:
   Hans Verkuil (1):
         V4L/DVB: tvaudio: remove obsolete tda8425 initialization
 
  are available in the git repository at:
 
   ssh://linuxtv.org/git/hverkuil/v4l-dvb.git bkl
 
  Hans Verkuil (10):
       v4l2-dev: after a disconnect any ioctl call will be blocked.
       v4l2-dev: remove get_unmapped_area
       v4l2: add core serialization lock.
       videobuf: prepare to make locking optional in videobuf
       videobuf: add ext_lock argument to the queue init functions
       videobuf: add queue argument to videobuf_waiton()
       vivi: remove BKL.
       em28xx: remove BKL.
       em28xx: the default std was not passed on to the subdevs
       radio-mr800: remove BKL

 Did you even test these patches?

 Yes, I did test. And it works for me. But you are correct in that it 
 shouldn't
 work since the struct will indeed be freed. I'll fix this and post a patch.

 I'm not sure why it works fine when I test it.

 There is a problem as well with unlocking before unregistering the device in
 that it leaves a race condition where another app can open the device again
 before it is registered. I have to think about that some more.

 Actually, no this problem did not exist. The previous version of the
 driver cleared the USB device member to indicate that the device had
 been disconnected. During open, if the USB device member was null, it
 aborted with -EIO. If there's a race there now, it's only because you
 introduced it.

 One thing I noticed while looking at this driver is that there's a
 call to usb_autopm_put_interface in usb_amradio_close. I'm not sure if
 it's a problem or not, but is it valid to call that after the device
 has been disconnected? I only ask, because it wasn't called in
 previous versions if the driver was disconnected before all handles to
 the device were closed. If it's incorrect to call it within this
 context, then this introduces another bug as well. It seems logical
 that for every get there should be a put, but I don't know in this
 case.

Just came across this in power-management.txt kernel documentation:

343 Drivers need not be concerned about balancing changes to the usage
344 counter; the USB core will undo any remaining gets when a driver
345 is unbound from its interface.  As a corollary, drivers must not call
346 any of the usb_autopm_* functions after their diconnect() routine has
347 returned.

According to this documentation, the usb_autopm_put_interface call in
usb_amradio_close should not occur if the device has been
disconnected. The code you removed, used to prevent this special case.

Regards,

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


Re: [GIT PATCHES FOR 2.6.37] Move V4L2 locking into the core framework

2010-10-15 Thread Hans Verkuil
On Friday, October 15, 2010 18:49:47 David Ellingsworth wrote:
 On Mon, Oct 11, 2010 at 2:05 PM, David Ellingsworth
 da...@identd.dyndns.org wrote:
  On Mon, Oct 11, 2010 at 11:40 AM, Hans Verkuil hverk...@xs4all.nl wrote:
  On Sunday, October 10, 2010 19:33:48 David Ellingsworth wrote:
  Hans,
 
  On Sun, Sep 26, 2010 at 8:25 AM, Hans Verkuil hverk...@xs4all.nl wrote:
   Hi Mauro,
  
   These are the locking patches. It's based on my previous test tree, but 
   with
   more testing with em28xx and radio-mr800 and some small tweaks relating 
   to
   disconnect handling and video_is_registered().
  
   I also removed the unused get_unmapped_area file op and I am now 
   blocking
   any further (unlocked_)ioctl calls after the device node is 
   unregistered.
   The only things an application can do legally after a disconnect is 
   unmap()
   and close().
  
   This patch series also contains a small em28xx fix that I found while 
   testing
   the em28xx BKL removal patch.
  
   Regards,
  
  Hans
  
   The following changes since commit 
   dace3857de7a16b83ae7d4e13c94de8e4b267d2a:
Hans Verkuil (1):
  V4L/DVB: tvaudio: remove obsolete tda8425 initialization
  
   are available in the git repository at:
  
ssh://linuxtv.org/git/hverkuil/v4l-dvb.git bkl
  
   Hans Verkuil (10):
v4l2-dev: after a disconnect any ioctl call will be blocked.
v4l2-dev: remove get_unmapped_area
v4l2: add core serialization lock.
videobuf: prepare to make locking optional in videobuf
videobuf: add ext_lock argument to the queue init functions
videobuf: add queue argument to videobuf_waiton()
vivi: remove BKL.
em28xx: remove BKL.
em28xx: the default std was not passed on to the subdevs
radio-mr800: remove BKL
 
  Did you even test these patches?
 
  Yes, I did test. And it works for me. But you are correct in that it 
  shouldn't
  work since the struct will indeed be freed. I'll fix this and post a patch.
 
  I'm not sure why it works fine when I test it.
 
  There is a problem as well with unlocking before unregistering the device 
  in
  that it leaves a race condition where another app can open the device again
  before it is registered. I have to think about that some more.
 
  Actually, no this problem did not exist. The previous version of the
  driver cleared the USB device member to indicate that the device had
  been disconnected. During open, if the USB device member was null, it
  aborted with -EIO. If there's a race there now, it's only because you
  introduced it.
 
  One thing I noticed while looking at this driver is that there's a
  call to usb_autopm_put_interface in usb_amradio_close. I'm not sure if
  it's a problem or not, but is it valid to call that after the device
  has been disconnected? I only ask, because it wasn't called in
  previous versions if the driver was disconnected before all handles to
  the device were closed. If it's incorrect to call it within this
  context, then this introduces another bug as well. It seems logical
  that for every get there should be a put, but I don't know in this
  case.
 
 Just came across this in power-management.txt kernel documentation:
 
 343   Drivers need not be concerned about balancing changes to the usage
 344   counter; the USB core will undo any remaining gets when a driver
 345   is unbound from its interface.  As a corollary, drivers must not call
 346   any of the usb_autopm_* functions after their diconnect() routine has
 347   returned.
 
 According to this documentation, the usb_autopm_put_interface call in
 usb_amradio_close should not occur if the device has been
 disconnected. The code you removed, used to prevent this special case.
 
 Regards,
 
 David Ellingsworth

I'll post a patch fixing these issues this weekend.

Regards,

  Hans

-- 
Hans Verkuil - video4linux developer - sponsored by TANDBERG, part of Cisco
--
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/7] IR: make sure we register the input device when it is safe to do so.

2010-10-15 Thread Maxim Levitsky
As soon as input device is registered, it might be accessed (and it is)
This can trigger a hardware interrupt that can access
not yet initialized ir-raw, (by sending a sample)

This can be reproduced by holding down a remote button and reloading the module.
And this always crashes the systems where hardware decides to send an interrupt
right at the moment it is enabled.

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
Acked-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/ir-core-priv.h |1 +
 drivers/media/IR/ir-keytable.c  |2 ++
 drivers/media/IR/ir-sysfs.c |   27 +--
 3 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index 761e7f4..5d7e08f 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -116,6 +116,7 @@ static inline void decrease_duration(struct ir_raw_event 
*ev, unsigned duration)
  * Routines from ir-sysfs.c - Meant to be called only internally inside
  * ir-core
  */
+int ir_register_input(struct input_dev *input_dev);
 
 int ir_register_class(struct input_dev *input_dev);
 void ir_unregister_class(struct input_dev *input_dev);
diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index a3f0af3..1997812 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -505,6 +505,8 @@ int __ir_input_register(struct input_dev *input_dev,
goto out_event;
}
 
+   rc = ir_register_input(input_dev);
+
IR_dprintk(1, Registered input device on %s for %s remote%s.\n,
   driver_name, rc_tab-name,
   (ir_dev-props  ir_dev-props-driver_type == 
RC_DRIVER_IR_RAW) ?
diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c
index 46d4246..ada2ec6 100644
--- a/drivers/media/IR/ir-sysfs.c
+++ b/drivers/media/IR/ir-sysfs.c
@@ -256,8 +256,6 @@ static struct device_type rc_dev_type = {
  */
 int ir_register_class(struct input_dev *input_dev)
 {
-   int rc;
-   const char *path;
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
int devno = find_first_zero_bit(ir_core_dev_number,
IRRCV_NUM_DEVICES);
@@ -266,17 +264,28 @@ int ir_register_class(struct input_dev *input_dev)
return devno;
 
ir_dev-dev.type = rc_dev_type;
+   ir_dev-devno = devno;
 
ir_dev-dev.class = ir_input_class;
ir_dev-dev.parent = input_dev-dev.parent;
+   input_dev-dev.parent = ir_dev-dev;
dev_set_name(ir_dev-dev, rc%d, devno);
dev_set_drvdata(ir_dev-dev, ir_dev);
-   rc = device_register(ir_dev-dev);
-   if (rc)
-   return rc;
+   return  device_register(ir_dev-dev);
+};
+
+/**
+ * ir_register_input - registers ir input device with input subsystem
+ * @input_dev: the struct input_dev descriptor of the device
+ */
+
+int ir_register_input(struct input_dev *input_dev)
+{
+   struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
+   int rc;
+   const char *path;
 
 
-   input_dev-dev.parent = ir_dev-dev;
rc = input_register_device(input_dev);
if (rc  0) {
device_del(ir_dev-dev);
@@ -292,11 +301,9 @@ int ir_register_class(struct input_dev *input_dev)
path ? path : N/A);
kfree(path);
 
-   ir_dev-devno = devno;
-   set_bit(devno, ir_core_dev_number);
-
+   set_bit(ir_dev-devno, ir_core_dev_number);
return 0;
-};
+}
 
 /**
  * ir_unregister_class() - removes the sysfs for sysfs for
-- 
1.7.1

--
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/5] IR: extend ir_raw_event and do refactoring

2010-10-15 Thread Maxim Levitsky
Add new event types for timeout  carrier report
Move timeout handling from ir_raw_event_store_with_filter to
ir-lirc-codec, where it is really needed.
Now lirc bridge ensures proper gap handling.
Extend lirc bridge for carrier  timeout reports

Note: all new ir_raw_event variables now should be initialized
like that: DEFINE_IR_RAW_EVENT(ev);

To clean an existing event, use init_ir_raw_event(ev);

Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
Acked-by: Jarod Wilson ja...@redhat.com
---
 drivers/media/IR/ene_ir.c  |4 +-
 drivers/media/IR/ir-core-priv.h|   13 -
 drivers/media/IR/ir-jvc-decoder.c  |5 +-
 drivers/media/IR/ir-lirc-codec.c   |  128 +---
 drivers/media/IR/ir-nec-decoder.c  |5 +-
 drivers/media/IR/ir-raw-event.c|   45 +
 drivers/media/IR/ir-rc5-decoder.c  |5 +-
 drivers/media/IR/ir-rc6-decoder.c  |5 +-
 drivers/media/IR/ir-sony-decoder.c |5 +-
 drivers/media/IR/mceusb.c  |3 +-
 drivers/media/IR/streamzap.c   |8 ++-
 include/media/ir-core.h|   40 ++--
 12 files changed, 176 insertions(+), 90 deletions(-)

diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
index 7880d9c..dc32509 100644
--- a/drivers/media/IR/ene_ir.c
+++ b/drivers/media/IR/ene_ir.c
@@ -701,7 +701,7 @@ static irqreturn_t ene_isr(int irq, void *data)
unsigned long flags;
irqreturn_t retval = IRQ_NONE;
struct ene_device *dev = (struct ene_device *)data;
-   struct ir_raw_event ev;
+   DEFINE_IR_RAW_EVENT(ev);
 
spin_lock_irqsave(dev-hw_lock, flags);
 
@@ -904,7 +904,7 @@ static int ene_set_learning_mode(void *data, int enable)
 }
 
 /* outside interface: enable or disable idle mode */
-static void ene_rx_set_idle(void *data, int idle)
+static void ene_rx_set_idle(void *data, bool idle)
 {
struct ene_device *dev = (struct ene_device *)data;
 
diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
index 5d7e08f..2559e72 100644
--- a/drivers/media/IR/ir-core-priv.h
+++ b/drivers/media/IR/ir-core-priv.h
@@ -82,6 +82,12 @@ struct ir_raw_event_ctrl {
struct ir_input_dev *ir_dev;
struct lirc_driver *drv;
int carrier_low;
+
+   ktime_t gap_start;
+   u64 gap_duration;
+   bool gap;
+   bool send_timeout_reports;
+
} lirc;
 };
 
@@ -109,9 +115,14 @@ static inline void decrease_duration(struct ir_raw_event 
*ev, unsigned duration)
ev-duration -= duration;
 }
 
+/* Returns true if event is normal pulse/space event */
+static inline bool is_timing_event(struct ir_raw_event ev)
+{
+   return !ev.carrier_report  !ev.reset;
+}
+
 #define TO_US(duration)DIV_ROUND_CLOSEST((duration), 
1000)
 #define TO_STR(is_pulse)   ((is_pulse) ? pulse : space)
-#define IS_RESET(ev)   (ev.duration == 0)
 /*
  * Routines from ir-sysfs.c - Meant to be called only internally inside
  * ir-core
diff --git a/drivers/media/IR/ir-jvc-decoder.c 
b/drivers/media/IR/ir-jvc-decoder.c
index 77a89c4..63dca6e 100644
--- a/drivers/media/IR/ir-jvc-decoder.c
+++ b/drivers/media/IR/ir-jvc-decoder.c
@@ -50,8 +50,9 @@ static int ir_jvc_decode(struct input_dev *input_dev, struct 
ir_raw_event ev)
if (!(ir_dev-raw-enabled_protocols  IR_TYPE_JVC))
return 0;
 
-   if (IS_RESET(ev)) {
-   data-state = STATE_INACTIVE;
+   if (!is_timing_event(ev)) {
+   if (ev.reset)
+   data-state = STATE_INACTIVE;
return 0;
}
 
diff --git a/drivers/media/IR/ir-lirc-codec.c b/drivers/media/IR/ir-lirc-codec.c
index e63f757..9317be8 100644
--- a/drivers/media/IR/ir-lirc-codec.c
+++ b/drivers/media/IR/ir-lirc-codec.c
@@ -32,6 +32,7 @@
 static int ir_lirc_decode(struct input_dev *input_dev, struct ir_raw_event ev)
 {
struct ir_input_dev *ir_dev = input_get_drvdata(input_dev);
+   struct lirc_codec *lirc = ir_dev-raw-lirc;
int sample;
 
if (!(ir_dev-raw-enabled_protocols  IR_TYPE_LIRC))
@@ -40,21 +41,57 @@ static int ir_lirc_decode(struct input_dev *input_dev, 
struct ir_raw_event ev)
if (!ir_dev-raw-lirc.drv || !ir_dev-raw-lirc.drv-rbuf)
return -EINVAL;
 
-   if (IS_RESET(ev))
+   /* Packet start */
+   if (ev.reset)
return 0;
 
-   IR_dprintk(2, LIRC data transfer started (%uus %s)\n,
-  TO_US(ev.duration), TO_STR(ev.pulse));
+   /* Carrier reports */
+   if (ev.carrier_report) {
+   sample = LIRC_FREQUENCY(ev.carrier);
+
+   /* Packet end */
+   } else if (ev.timeout) {
+
+   if (lirc-gap)
+   return 0;
+
+   lirc-gap_start = ktime_get();
+   lirc-gap = true;
+   lirc-gap_duration = ev.duration;
+
+   if 

[cron job] v4l-dvb daily build 2.6.26 and up: ERRORS

2010-10-15 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:Fri Oct 15 19:00:16 CEST 2010
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   15164:1da5fed5c8b2
git master:   3e6dce76d99b328716b43929b9195adfee1de00c
git media-master: 7c0f36fc484c5693a145e9d795fcc700f42b5231
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
linux-2.6.32.6-armv5: WARNINGS
linux-2.6.33-armv5: WARNINGS
linux-2.6.34-armv5: WARNINGS
linux-2.6.35.3-armv5: WARNINGS
linux-2.6.32.6-armv5-davinci: ERRORS
linux-2.6.33-armv5-davinci: ERRORS
linux-2.6.34-armv5-davinci: ERRORS
linux-2.6.35.3-armv5-davinci: ERRORS
linux-2.6.32.6-armv5-ixp: ERRORS
linux-2.6.33-armv5-ixp: ERRORS
linux-2.6.34-armv5-ixp: ERRORS
linux-2.6.35.3-armv5-ixp: ERRORS
linux-2.6.32.6-armv5-omap2: ERRORS
linux-2.6.33-armv5-omap2: ERRORS
linux-2.6.34-armv5-omap2: ERRORS
linux-2.6.35.3-armv5-omap2: ERRORS
linux-2.6.26.8-i686: WARNINGS
linux-2.6.27.44-i686: WARNINGS
linux-2.6.28.10-i686: WARNINGS
linux-2.6.29.1-i686: WARNINGS
linux-2.6.30.10-i686: WARNINGS
linux-2.6.31.12-i686: WARNINGS
linux-2.6.32.6-i686: WARNINGS
linux-2.6.33-i686: WARNINGS
linux-2.6.34-i686: WARNINGS
linux-2.6.35.3-i686: WARNINGS
linux-2.6.32.6-m32r: WARNINGS
linux-2.6.33-m32r: WARNINGS
linux-2.6.34-m32r: WARNINGS
linux-2.6.35.3-m32r: WARNINGS
linux-2.6.32.6-mips: WARNINGS
linux-2.6.33-mips: WARNINGS
linux-2.6.34-mips: WARNINGS
linux-2.6.35.3-mips: WARNINGS
linux-2.6.32.6-powerpc64: WARNINGS
linux-2.6.33-powerpc64: WARNINGS
linux-2.6.34-powerpc64: WARNINGS
linux-2.6.35.3-powerpc64: WARNINGS
linux-2.6.26.8-x86_64: WARNINGS
linux-2.6.27.44-x86_64: WARNINGS
linux-2.6.28.10-x86_64: WARNINGS
linux-2.6.29.1-x86_64: WARNINGS
linux-2.6.30.10-x86_64: WARNINGS
linux-2.6.31.12-x86_64: WARNINGS
linux-2.6.32.6-x86_64: WARNINGS
linux-2.6.33-x86_64: WARNINGS
linux-2.6.34-x86_64: WARNINGS
linux-2.6.35.3-x86_64: WARNINGS
spec-git: OK
sparse: ERRORS

Detailed results are available here:

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

Full logs are available here:

http://www.xs4all.nl/~hverkuil/logs/Friday.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: [PATCH 1/5] IR: extend and sort the MCE keymap

2010-10-15 Thread Jarod Wilson
On Fri, Oct 15, 2010 at 06:06:35PM +0200, Maxim Levitsky wrote:
 Add new keys, found on:
 
 Toshiba Qosmio F50-10q.
 Toshiba Qosmio X300
 Toshiba A500-141
 
 Also sort the keytable by scancode number as that makes sense
 and alows easily to add new keycodes.
 
 Thanks to:
 Sami R maeses...@gmail.com
 Alexander Skiba ghostlyr...@gmail.com
 Jordi Pelegrin pelegrin.jo...@gmail.com
 
 For reports and testing.
 
 Signed-off-by: Maxim Levitsky maximlevit...@gmail.com

Acked-by: Jarod Wilson ja...@redhat.com

-- 
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: [PATCH 3/5] IR: ene_ir: few bugfixes

2010-10-15 Thread Jarod Wilson
On Fri, Oct 15, 2010 at 06:06:37PM +0200, Maxim Levitsky wrote:
 This is a result of last round of debug with
 Sami R maeses...@gmail.com.
 
 Thank you Sami very much!
 
 The biggest bug I fixed is that,
 I was clobbering the CIRCFG register after it is setup
 That wasn't a good idea really
 
 And some small refactoring, etc.
 
 Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
 ---
  drivers/media/IR/ene_ir.c |   43 ---
  1 files changed, 20 insertions(+), 23 deletions(-)
 
 diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
 index dc32509..8639621 100644
 --- a/drivers/media/IR/ene_ir.c
 +++ b/drivers/media/IR/ene_ir.c
...
 @@ -282,6 +287,7 @@ static void ene_rx_setup(struct ene_device *dev)
   ene_set_reg_mask(dev, ENE_CIRCFG, ENE_CIRCFG_CARR_DEMOD);
  
   /* Enable carrier detection */
 + ene_write_reg(dev, ENE_CIRCAR_PULS, 0x63);

Looks sane, though I'd prefer to see symbolic bit names or some such thing
here instead of 0x63. Not something to hold up the patch though.

Acked-by: Jarod Wilson ja...@redhat.com

-- 
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: [PATCH 3/5] IR: ene_ir: few bugfixes

2010-10-15 Thread Maxim Levitsky
On Fri, 2010-10-15 at 16:02 -0400, Jarod Wilson wrote:
 On Fri, Oct 15, 2010 at 06:06:37PM +0200, Maxim Levitsky wrote:
  This is a result of last round of debug with
  Sami R maeses...@gmail.com.
  
  Thank you Sami very much!
  
  The biggest bug I fixed is that,
  I was clobbering the CIRCFG register after it is setup
  That wasn't a good idea really
  
  And some small refactoring, etc.
  
  Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
  ---
   drivers/media/IR/ene_ir.c |   43 
  ---
   1 files changed, 20 insertions(+), 23 deletions(-)
  
  diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
  index dc32509..8639621 100644
  --- a/drivers/media/IR/ene_ir.c
  +++ b/drivers/media/IR/ene_ir.c
 ...
  @@ -282,6 +287,7 @@ static void ene_rx_setup(struct ene_device *dev)
  ene_set_reg_mask(dev, ENE_CIRCFG, ENE_CIRCFG_CARR_DEMOD);
   
  /* Enable carrier detection */
  +   ene_write_reg(dev, ENE_CIRCAR_PULS, 0x63);
 
 Looks sane, though I'd prefer to see symbolic bit names or some such thing
 here instead of 0x63. Not something to hold up the patch though.
 
 Acked-by: Jarod Wilson ja...@redhat.com
 
63 isn't a bitfileld, but rather two numbers.
3 is number of carrier pulses to skip, and 6 is number of carrier pulses
to average.

I have a note about that in header.

Best regards,
Maxim Levitsky

--
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 3/5] IR: ene_ir: few bugfixes

2010-10-15 Thread Jarod Wilson
On Fri, Oct 15, 2010 at 10:24:55PM +0200, Maxim Levitsky wrote:
 On Fri, 2010-10-15 at 16:02 -0400, Jarod Wilson wrote:
  On Fri, Oct 15, 2010 at 06:06:37PM +0200, Maxim Levitsky wrote:
   This is a result of last round of debug with
   Sami R maeses...@gmail.com.
   
   Thank you Sami very much!
   
   The biggest bug I fixed is that,
   I was clobbering the CIRCFG register after it is setup
   That wasn't a good idea really
   
   And some small refactoring, etc.
   
   Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
   ---
drivers/media/IR/ene_ir.c |   43 
   ---
1 files changed, 20 insertions(+), 23 deletions(-)
   
   diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
   index dc32509..8639621 100644
   --- a/drivers/media/IR/ene_ir.c
   +++ b/drivers/media/IR/ene_ir.c
  ...
   @@ -282,6 +287,7 @@ static void ene_rx_setup(struct ene_device *dev)
 ene_set_reg_mask(dev, ENE_CIRCFG, ENE_CIRCFG_CARR_DEMOD);

 /* Enable carrier detection */
   + ene_write_reg(dev, ENE_CIRCAR_PULS, 0x63);
  
  Looks sane, though I'd prefer to see symbolic bit names or some such thing
  here instead of 0x63. Not something to hold up the patch though.
  
  Acked-by: Jarod Wilson ja...@redhat.com
  
 63 isn't a bitfileld, but rather two numbers.
 3 is number of carrier pulses to skip, and 6 is number of carrier pulses
 to average.
 
 I have a note about that in header.

Ah, so you do. Apologies then. Personally, I'd probably document that next
to the 0x63 as well, just so readers who neglect to go find the register
define and discover the comment there don't think the same as me. ;)

-- 
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: [PATCH] dabusb: remove the BKL

2010-10-15 Thread Mauro Carvalho Chehab
Em 04-10-2010 16:32, Arnd Bergmann escreveu:
 The dabusb device driver is sufficiently serialized using
 its own mutex, no need for the big kernel lock here
 in addition.
 
 Signed-off-by: Arnd Bergmann a...@arndb.de
 Cc: Mauro Carvalho Chehab mche...@infradead.org
 ---
 
 Hi Mauro,
 
 I just realized that the dabusb driver is not actually a v4l driver,
 when I did more test builds with allyesconfig and CONFIG_BKL disabled.
 
 I've added this patch to my bkl/config queue for now, but if you want to carry
 it in your tree, I'll drop it from mine.

Sorry for not handling it sooner... I have a large number of patches in my 
queue...
I don't have any patch for dabusb on my tree, so, I'm OK if you sent it via your
tree. So,

Acked-by: Mauro Carvalho Chehab mche...@redhat.com

---

PS.: I tried to contact the authors a few weeks ago to double check about this 
driver.
I suspect that it were added for some prototype, based on its help message, and 
the
links I found about that. So, it could be a good idea to simply move it to 
staging
and let it die, as maybe nobody has an actual hardware for it... 
Well, I got no answer about that so far.

 
 diff --git a/drivers/media/video/dabusb.c b/drivers/media/video/dabusb.c
 index 5b176bd..f3e25e9 100644
 --- a/drivers/media/video/dabusb.c
 +++ b/drivers/media/video/dabusb.c
 @@ -32,7 +32,6 @@
  #include linux/list.h
  #include linux/vmalloc.h
  #include linux/slab.h
 -#include linux/smp_lock.h
  #include linux/init.h
  #include asm/uaccess.h
  #include asm/atomic.h
 @@ -621,7 +620,6 @@ static int dabusb_open (struct inode *inode, struct file 
 *file)
   if (devnum  DABUSB_MINOR || devnum = (DABUSB_MINOR + NRDABUSB))
   return -EIO;
  
 - lock_kernel();
   s = dabusb[devnum - DABUSB_MINOR];
  
   dbg(dabusb_open);
 @@ -630,21 +628,17 @@ static int dabusb_open (struct inode *inode, struct 
 file *file)
   while (!s-usbdev || s-opened) {
   mutex_unlock(s-mutex);
  
 - if (file-f_flags  O_NONBLOCK) {
 + if (file-f_flags  O_NONBLOCK)
   return -EBUSY;
 - }
   msleep_interruptible(500);
  
 - if (signal_pending (current)) {
 - unlock_kernel();
 + if (signal_pending (current))
   return -EAGAIN;
 - }
   mutex_lock(s-mutex);
   }
   if (usb_set_interface (s-usbdev, _DABUSB_IF, 1)  0) {
   mutex_unlock(s-mutex);
   dev_err(s-usbdev-dev, set_interface failed\n);
 - unlock_kernel();
   return -EINVAL;
   }
   s-opened = 1;
 @@ -654,7 +648,6 @@ static int dabusb_open (struct inode *inode, struct file 
 *file)
   file-private_data = s;
  
   r = nonseekable_open(inode, file);
 - unlock_kernel();
   return r;
  }
  
 @@ -689,17 +682,13 @@ static long dabusb_ioctl (struct file *file, unsigned 
 int cmd, unsigned long arg
  
   dbg(dabusb_ioctl);
  
 - lock_kernel();
 - if (s-remove_pending) {
 - unlock_kernel();
 + if (s-remove_pending)
   return -EIO;
 - }
  
   mutex_lock(s-mutex);
  
   if (!s-usbdev) {
   mutex_unlock(s-mutex);
 - unlock_kernel();
   return -EIO;
   }
  
 @@ -735,7 +724,6 @@ static long dabusb_ioctl (struct file *file, unsigned int 
 cmd, unsigned long arg
   break;
   }
   mutex_unlock(s-mutex);
 - unlock_kernel();
   return ret;
  }
  

--
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] Terratec Cinergy Hybrid T USB XS FR

2010-10-15 Thread Mauro Carvalho Chehab
Em 04-10-2010 16:32, Catimimi escreveu:
  New gpio definitions.
 XC3028_FE_ZARLINK456 was not loaded.
 
 Signed-off-by: Michel Garniercatim...@libertysurf.fr
 
 ---
 
 diff -Nru 
 v4l-dvb-1da5fed5c8b2-orig/linux/drivers/media/video/em28xx/em28xx-cards.c 
 v4l-dvb-1da5fed5c8b2-new/linux/drivers/media/video/em28xx/em28xx-cards.c
 --- v4l-dvb-1da5fed5c8b2-orig/linux/drivers/media/video/em28xx/em28xx-cards.c 
2010-09-19 07:23:09.0 +0200
 +++ v4l-dvb-1da5fed5c8b2-new/linux/drivers/media/video/em28xx/em28xx-cards.c  
   2010-10-04 19:05:11.0 +0200
 @@ -200,6 +200,18 @@
  {-1,-1,-1,-1},
  };
 
 +static struct em28xx_reg_seq terratec_cinergy_USB_XS_analog[] = {
 +{EM28XX_R08_GPIO,0x6d,~EM_GPIO_4,10},
 +{EM2880_R04_GPO,0x00,0xff,10},
 +{ -1,-1,-1,-1},
 +};
 +
 +static struct em28xx_reg_seq terratec_cinergy_USB_XS_digital[] = {
 +{EM28XX_R08_GPIO,0x6e,~EM_GPIO_4,10},
 +{EM2880_R04_GPO,0x08,0xff,10},
 +{ -1,-1,-1,-1},
 +};
 +
  /* eb1a:2868 Reddo DVB-C USB TV Box
 GPIO4 - CU1216L NIM
 Other GPIOs seems to be don't care. */
 @@ -824,22 +836,22 @@
  .tuner_gpio   = default_tuner_gpio,
  .decoder  = EM28XX_TVP5150,
  .has_dvb  = 1,
 -.dvb_gpio = default_digital,
 +.dvb_gpio = terratec_cinergy_USB_XS_digital,
  .input= { {
  .type = EM28XX_VMUX_TELEVISION,
  .vmux = TVP5150_COMPOSITE0,
  .amux = EM28XX_AMUX_VIDEO,
 -.gpio = default_analog,
 +.gpio = terratec_cinergy_USB_XS_analog,
  }, {
  .type = EM28XX_VMUX_COMPOSITE1,
  .vmux = TVP5150_COMPOSITE1,
  .amux = EM28XX_AMUX_LINE_IN,
 -.gpio = default_analog,
 +.gpio = terratec_cinergy_USB_XS_analog,
  }, {
  .type = EM28XX_VMUX_SVIDEO,
  .vmux = TVP5150_SVIDEO,
  .amux = EM28XX_AMUX_LINE_IN,
 -.gpio = default_analog,
 +.gpio = terratec_cinergy_USB_XS_analog,
  } },
  },
  [EM2880_BOARD_HAUPPAUGE_WINTV_HVR_900] = {
 @@ -2259,6 +2271,7 @@
  ctl-demod = XC3028_FE_ZARLINK456;
  break;
  case EM2880_BOARD_TERRATEC_HYBRID_XS:
 +case EM2880_BOARD_TERRATEC_HYBRID_XS_FR:

Hmm... do you have a different device, right? Please, don't change the entries
of the original Hybrid XS, or it will cause a regression for the others. 
Instead,
create another entry describing your board.

Also, please use tabs for indent. A tab in Linux have 8 spaces, and not four.

  case EM2881_BOARD_PINNACLE_HYBRID_PRO:
  ctl-demod = XC3028_FE_ZARLINK456;
  break;
 
 -- 
 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: [PATCH] Compro videmate T750f for 2.6.35.7

2010-10-15 Thread Mauro Carvalho Chehab
Your patch looks correct for me, with a few issues:

Em 02-10-2010 02:53, Davor Emard escreveu:
 HI
 
 This is my update for compro videomate t750f v19 for kernel 2.6.35.7
 which has separated IR remote in a file.
 
 There seem to be different types of this card which I don't know
 how to distinguish. This patch works for my card but may not work
 for other types.
 
 Best regards, Davor

You forgot to add your Signed-off-by: This is a requirement for us to merge it 
;)
See Documentation/SubmittingPatches.

 
 --- linux-2.6.35.7/drivers/media/video/saa7134/saa7134-input.c.orig   
 2010-09-29 03:09:08.0 +0200
 +++ linux-2.6.35.7/drivers/media/video/saa7134/saa7134-input.c
 2010-10-02 05:45:01.467990234 +0200
 @@ -816,6 +816,11 @@ int saa7134_input_init1(struct saa7134_d
   mask_keycode = 0x003f00;
   mask_keydown = 0x04;
   break;
 + case SAA7134_BOARD_VIDEOMATE_T750:
 + ir_codes = RC_MAP_VIDEOMATE_T750;
 + mask_keycode = 0x003f00;
 + mask_keyup   = 0x04;
 + break;
   case SAA7134_BOARD_LEADTEK_WINFAST_DTV1000S:
   ir_codes = RC_MAP_WINFAST;
   mask_keycode = 0x5f00;
 --- linux-2.6.35.7/drivers/media/video/saa7134/saa7134-cards.c.orig   
 2010-09-29 03:09:08.0 +0200
 +++ linux-2.6.35.7/drivers/media/video/saa7134/saa7134-cards.c
 2010-10-02 05:43:50.639315788 +0200
 @@ -4915,12 +4915,14 @@ struct saa7134_board saa7134_boards[] =
   },
   [SAA7134_BOARD_VIDEOMATE_T750] = {
   /* John Newbigin j...@it.swin.edu.au */
 + /* Emard 2010-05-10 v18 davorem...@gmail.com */
   .name   = Compro VideoMate T750,
   .audio_clock= 0x00187de7,
   .tuner_type = TUNER_XC2028,
   .radio_type = UNSET,
 - .tuner_addr = ADDR_UNSET,
 + .tuner_addr = 0x61,
   .radio_addr = ADDR_UNSET,
 + .mpeg   = SAA7134_MPEG_DVB,
   .inputs = {{
   .name   = name_tv,
   .vmux   = 3,
 @@ -6722,6 +6724,11 @@ static int saa7134_xc2028_callback(struc
   msleep(10);
   saa7134_set_gpio(dev, 18, 1);
   break;
 + case SAA7134_BOARD_VIDEOMATE_T750:
 + saa7134_set_gpio(dev, 20, 0);
 + msleep(10);
 + saa7134_set_gpio(dev, 20, 1);
 + break;
   }
   return 0;
   }
 @@ -7142,6 +7149,11 @@ int saa7134_board_init1(struct saa7134_d
   saa7134_set_gpio(dev, 1, 1);
   dev-has_remote = SAA7134_REMOTE_GPIO;
   break;
 + case SAA7134_BOARD_VIDEOMATE_T750:
 + dev-has_remote = SAA7134_REMOTE_GPIO;
 + saa_andorl(SAA7134_GPIO_GPMODE0  2,   0x8000, 0x8000);
 + saa_andorl(SAA7134_GPIO_GPSTATUS0  2, 0x8000, 0x8000);
 + break;
   }
   return 0;
  }
 --- linux-2.6.35.7/drivers/media/video/saa7134/saa7134-dvb.c.orig 
 2010-09-29 03:09:08.0 +0200
 +++ linux-2.6.35.7/drivers/media/video/saa7134/saa7134-dvb.c  2010-10-02 
 05:43:50.639315788 +0200
 @@ -54,6 +54,7 @@
  #include tda8290.h
  
  #include zl10353.h
 +#include qt1010.h
  
  #include zl10036.h
  #include zl10039.h
 @@ -885,6 +886,17 @@ static struct zl10353_config behold_x7_c
   .disable_i2c_gate_ctrl = 1,
  };
  
 +static struct zl10353_config videomate_t750_zl10353_config = {
 + .demod_address  = 0x0f,
 + .no_tuner = 1,
 + .parallel_ts = 1,
 +};
 +
 +static struct qt1010_config videomate_t750_qt1010_config = {
 + .i2c_address = 0x62
 +};
 +
 +
  /* ==
   * tda10086 based DVB-S cards, helper functions
   */
 @@ -1564,6 +1576,21 @@ static int dvb_init(struct saa7134_dev *
   __func__);
  
   break;
 + case SAA7134_BOARD_VIDEOMATE_T750:
 + printk(Compro VideoMate T750 DVB setup\n);

Please remove the printk. we don't need it on production ;)

 + fe0-dvb.frontend = dvb_attach(zl10353_attach,
 + videomate_t750_zl10353_config,
 + dev-i2c_adap);
 + if (fe0-dvb.frontend != NULL) {
 + // if there is a gate function then the i2c bus 
 breaks.!

comments should use /**/ instead of //

 + fe0-dvb.frontend-ops.i2c_gate_ctrl = 0;
 + if (dvb_attach(qt1010_attach,
 + fe0-dvb.frontend,
 + dev-i2c_adap,
 + videomate_t750_qt1010_config) == NULL)
 + wprintk(error attaching QT1010\n);
 + }
 + break;
   case 

Re: [PATCH 0/8 V7] Many fixes for in-kernel decoding and for the ENE driver

2010-10-15 Thread Mauro Carvalho Chehab
Em 15-10-2010 13:06, Maxim Levitsky escreveu:
 Hi,
 
 This is a rebased version against the media_tree staging/v2.6.37

Hmm patch 0 for a series of 8 patches...
two patches 2 (seem identical)...
and it ends with patch 4/5...
something got deadly wrong with your numbering schema here...

Well, if the patches look good to me, I'll apply what I have.

 
 Best regards,
   Maxim Levitsky
 
 --
 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: [PATCH 2/5] IR: extend ir_raw_event and do refactoring

2010-10-15 Thread Mauro Carvalho Chehab
Em 15-10-2010 13:06, Maxim Levitsky escreveu:
 Add new event types for timeout  carrier report
 Move timeout handling from ir_raw_event_store_with_filter to
 ir-lirc-codec, where it is really needed.
 Now lirc bridge ensures proper gap handling.
 Extend lirc bridge for carrier  timeout reports
 
 Note: all new ir_raw_event variables now should be initialized
 like that: DEFINE_IR_RAW_EVENT(ev);
 
 To clean an existing event, use init_ir_raw_event(ev);
 
 Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
 Acked-by: Jarod Wilson ja...@redhat.com


Applying patch 
patches/lmml_257371_2_5_ir_extend_ir_raw_event_and_do_refactoring.patch
patching file drivers/media/IR/ene_ir.c
patching file drivers/media/IR/ir-core-priv.h
Hunk #1 succeeded at 88 (offset 6 lines).
Hunk #2 succeeded at 121 (offset 6 lines).
patching file drivers/media/IR/ir-jvc-decoder.c
patching file drivers/media/IR/ir-lirc-codec.c
Hunk #3 FAILED at 139.
Hunk #4 FAILED at 167.
Hunk #7 succeeded at 330 (offset 3 lines).
2 out of 7 hunks FAILED -- rejects in file drivers/media/IR/ir-lirc-codec.c
patching file drivers/media/IR/ir-nec-decoder.c
patching file drivers/media/IR/ir-raw-event.c
patching file drivers/media/IR/ir-rc5-decoder.c
patching file drivers/media/IR/ir-rc6-decoder.c
patching file drivers/media/IR/ir-sony-decoder.c
patching file drivers/media/IR/mceusb.c
patching file drivers/media/IR/streamzap.c
Hunk #1 FAILED at 170.
Hunk #2 FAILED at 215.
Hunk #3 FAILED at 233.
Hunk #4 succeeded at 373 (offset -139 lines).
3 out of 4 hunks FAILED -- rejects in file drivers/media/IR/streamzap.c
patching file include/media/ir-core.h
Hunk #3 succeeded at 165 (offset 1 line).
Patch patches/lmml_257371_2_5_ir_extend_ir_raw_event_and_do_refactoring.patch 
does not apply (enforce with -f)
Patch didn't apply. Aborting

Too much fails for me... -EABORTING...

I won't apply this patch... there are two copies of it, and it has several 
broken hunks.


Please fix.

 ---
  drivers/media/IR/ene_ir.c  |4 +-
  drivers/media/IR/ir-core-priv.h|   13 -
  drivers/media/IR/ir-jvc-decoder.c  |5 +-
  drivers/media/IR/ir-lirc-codec.c   |  128 
 +---
  drivers/media/IR/ir-nec-decoder.c  |5 +-
  drivers/media/IR/ir-raw-event.c|   45 +
  drivers/media/IR/ir-rc5-decoder.c  |5 +-
  drivers/media/IR/ir-rc6-decoder.c  |5 +-
  drivers/media/IR/ir-sony-decoder.c |5 +-
  drivers/media/IR/mceusb.c  |3 +-
  drivers/media/IR/streamzap.c   |8 ++-
  include/media/ir-core.h|   40 ++--
  12 files changed, 176 insertions(+), 90 deletions(-)
 
 diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
 index 7880d9c..dc32509 100644
 --- a/drivers/media/IR/ene_ir.c
 +++ b/drivers/media/IR/ene_ir.c
 @@ -701,7 +701,7 @@ static irqreturn_t ene_isr(int irq, void *data)
   unsigned long flags;
   irqreturn_t retval = IRQ_NONE;
   struct ene_device *dev = (struct ene_device *)data;
 - struct ir_raw_event ev;
 + DEFINE_IR_RAW_EVENT(ev);
  
   spin_lock_irqsave(dev-hw_lock, flags);
  
 @@ -904,7 +904,7 @@ static int ene_set_learning_mode(void *data, int enable)
  }
  
  /* outside interface: enable or disable idle mode */
 -static void ene_rx_set_idle(void *data, int idle)
 +static void ene_rx_set_idle(void *data, bool idle)
  {
   struct ene_device *dev = (struct ene_device *)data;
  
 diff --git a/drivers/media/IR/ir-core-priv.h b/drivers/media/IR/ir-core-priv.h
 index 5d7e08f..2559e72 100644
 --- a/drivers/media/IR/ir-core-priv.h
 +++ b/drivers/media/IR/ir-core-priv.h
 @@ -82,6 +82,12 @@ struct ir_raw_event_ctrl {
   struct ir_input_dev *ir_dev;
   struct lirc_driver *drv;
   int carrier_low;
 +
 + ktime_t gap_start;
 + u64 gap_duration;
 + bool gap;
 + bool send_timeout_reports;
 +
   } lirc;
  };
  
 @@ -109,9 +115,14 @@ static inline void decrease_duration(struct ir_raw_event 
 *ev, unsigned duration)
   ev-duration -= duration;
  }
  
 +/* Returns true if event is normal pulse/space event */
 +static inline bool is_timing_event(struct ir_raw_event ev)
 +{
 + return !ev.carrier_report  !ev.reset;
 +}
 +
  #define TO_US(duration)  DIV_ROUND_CLOSEST((duration), 
 1000)
  #define TO_STR(is_pulse) ((is_pulse) ? pulse : space)
 -#define IS_RESET(ev) (ev.duration == 0)
  /*
   * Routines from ir-sysfs.c - Meant to be called only internally inside
   * ir-core
 diff --git a/drivers/media/IR/ir-jvc-decoder.c 
 b/drivers/media/IR/ir-jvc-decoder.c
 index 77a89c4..63dca6e 100644
 --- a/drivers/media/IR/ir-jvc-decoder.c
 +++ b/drivers/media/IR/ir-jvc-decoder.c
 @@ -50,8 +50,9 @@ static int ir_jvc_decode(struct input_dev *input_dev, 
 struct ir_raw_event ev)
   if (!(ir_dev-raw-enabled_protocols  IR_TYPE_JVC))
   return 0;
  
 - if (IS_RESET(ev)) {
 - 

Re: [PATCH 4/5] IR: ene_ir: add support for carrier reports

2010-10-15 Thread Mauro Carvalho Chehab
Em 15-10-2010 13:06, Maxim Levitsky escreveu:
 Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
 ---
  drivers/media/IR/ene_ir.c |   37 +
  1 files changed, 29 insertions(+), 8 deletions(-)
 
 diff --git a/drivers/media/IR/ene_ir.c b/drivers/media/IR/ene_ir.c
 index 8639621..1962652 100644
 --- a/drivers/media/IR/ene_ir.c
 +++ b/drivers/media/IR/ene_ir.c
 @@ -193,10 +193,11 @@ static int ene_hw_detect(struct ene_device *dev)
  /* Sense current received carrier */
  void ene_rx_sense_carrier(struct ene_device *dev)
  {
 + DEFINE_IR_RAW_EVENT(ev);
 +

Hmm... shouldn't it be in the patch that adds DEFINE_IR_RAW_EVENT(ev) ?

This way, it will likely break git bisect.

Anyway, as patch 2/5 weren't applied, I can't apply this one either.

the other 2 patches were applied.

 + int carrier, duty_cycle;
   int period = ene_read_reg(dev, ENE_CIRCAR_PRD);
   int hperiod = ene_read_reg(dev, ENE_CIRCAR_HPRD);
 - int carrier, duty_cycle;
 -
  
   if (!(period  ENE_CIRCAR_PRD_VALID))
   return;
 @@ -209,13 +210,16 @@ void ene_rx_sense_carrier(struct ene_device *dev)
   dbg(RX: hardware carrier period = %02x, period);
   dbg(RX: hardware carrier pulse period = %02x, hperiod);
  
 -
   carrier = 200 / period;
   duty_cycle = (hperiod * 100) / period;
   dbg(RX: sensed carrier = %d Hz, duty cycle %d%%,
 - carrier, duty_cycle);
 -
 - /* TODO: Send carrier  duty cycle to IR layer */
 + carrier, duty_cycle);
 + if (dev-carrier_detect_enabled) {
 + ev.carrier_report = true;
 + ev.carrier = carrier;
 + ev.duty_cycle = duty_cycle;
 + ir_raw_event_store(dev-idev, ev);
 + }
  }
  
  /* this enables/disables the CIR RX engine */
 @@ -724,7 +728,7 @@ static irqreturn_t ene_isr(int irq, void *data)
  
   dbg_verbose(RX interrupt);
  
 - if (dev-carrier_detect_enabled || debug)
 + if (dev-hw_learning_and_tx_capable)
   ene_rx_sense_carrier(dev);
  
   /* On hardware that don't support extra buffer we need to trust
 @@ -897,6 +901,23 @@ static int ene_set_learning_mode(void *data, int enable)
   return 0;
  }
  
 +static int ene_set_carrier_report(void *data, int enable)
 +{
 + struct ene_device *dev = (struct ene_device *)data;
 + unsigned long flags;
 +
 + if (enable == dev-carrier_detect_enabled)
 + return 0;
 +
 + spin_lock_irqsave(dev-hw_lock, flags);
 + dev-carrier_detect_enabled = enable;
 + ene_rx_disable(dev);
 + ene_rx_setup(dev);
 + ene_rx_enable(dev);
 + spin_unlock_irqrestore(dev-hw_lock, flags);
 + return 0;
 +}
 +
  /* outside interface: enable or disable idle mode */
  static void ene_rx_set_idle(void *data, bool idle)
  {
 @@ -1029,7 +1050,7 @@ static int ene_probe(struct pnp_dev *pnp_dev, const 
 struct pnp_device_id *id)
   ir_props-s_tx_mask = ene_set_tx_mask;
   ir_props-s_tx_carrier = ene_set_tx_carrier;
   ir_props-s_tx_duty_cycle = ene_set_tx_duty_cycle;
 - /* ir_props-s_carrier_report = ene_set_carrier_report; */
 + ir_props-s_carrier_report = ene_set_carrier_report;
   }
  
   ene_setup_hw_buffer(dev);

--
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 2/5] IR: extend ir_raw_event and do refactoring

2010-10-15 Thread Maxim Levitsky
On Sat, 2010-10-16 at 00:29 -0300, Mauro Carvalho Chehab wrote:
 Em 15-10-2010 13:06, Maxim Levitsky escreveu:
  Add new event types for timeout  carrier report
  Move timeout handling from ir_raw_event_store_with_filter to
  ir-lirc-codec, where it is really needed.
  Now lirc bridge ensures proper gap handling.
  Extend lirc bridge for carrier  timeout reports
  
  Note: all new ir_raw_event variables now should be initialized
  like that: DEFINE_IR_RAW_EVENT(ev);
  
  To clean an existing event, use init_ir_raw_event(ev);
  
  Signed-off-by: Maxim Levitsky maximlevit...@gmail.com
  Acked-by: Jarod Wilson ja...@redhat.com
 
 
 Applying patch 
 patches/lmml_257371_2_5_ir_extend_ir_raw_event_and_do_refactoring.patch
 patching file drivers/media/IR/ene_ir.c
 patching file drivers/media/IR/ir-core-priv.h
 Hunk #1 succeeded at 88 (offset 6 lines).
 Hunk #2 succeeded at 121 (offset 6 lines).
 patching file drivers/media/IR/ir-jvc-decoder.c
 patching file drivers/media/IR/ir-lirc-codec.c
 Hunk #3 FAILED at 139.
 Hunk #4 FAILED at 167.
 Hunk #7 succeeded at 330 (offset 3 lines).
 2 out of 7 hunks FAILED -- rejects in file drivers/media/IR/ir-lirc-codec.c
 patching file drivers/media/IR/ir-nec-decoder.c
 patching file drivers/media/IR/ir-raw-event.c
 patching file drivers/media/IR/ir-rc5-decoder.c
 patching file drivers/media/IR/ir-rc6-decoder.c
 patching file drivers/media/IR/ir-sony-decoder.c
 patching file drivers/media/IR/mceusb.c
 patching file drivers/media/IR/streamzap.c
 Hunk #1 FAILED at 170.
 Hunk #2 FAILED at 215.
 Hunk #3 FAILED at 233.
 Hunk #4 succeeded at 373 (offset -139 lines).
 3 out of 4 hunks FAILED -- rejects in file drivers/media/IR/streamzap.c
 patching file include/media/ir-core.h
 Hunk #3 succeeded at 165 (offset 1 line).
 Patch patches/lmml_257371_2_5_ir_extend_ir_raw_event_and_do_refactoring.patch 
 does not apply (enforce with -f)
 Patch didn't apply. Aborting
 
 Too much fails for me... -EABORTING...
 
 I won't apply this patch... there are two copies of it, and it has several 
 broken hunks.
 
 
 Please fix.

Not surprising as v4l tree got many changes and that patch touches many
places.

Will redo that really against the media_tree :-)
Sorry!

Best regards,
Maxim Levitsky



--
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 3/3] ov7670: Support customization of clock speed

2010-10-15 Thread Mauro Carvalho Chehab
Em 08-10-2010 18:04, Daniel Drake escreveu:
 For accurate frame rate limiting, we need to know the speed of the external
 clock wired into the ov7670 chip.
 
 Add a module parameter so that the user can specify this information.
 And add DMI detection for appropriate clock speeds on the OLPC XO-1 and
 XO-1.5 laptops. If specified, the module parameter wins over whatever we
 might have set through the DMI table.
 
 Based on earlier work by Jonathan Corbet.

There's just one small checkpatch error:

ERROR: do not initialise statics to 0 or NULL
#51: FILE: drivers/media/video/ov7670.c:40:
+static bool clock_speed_from_param = false;

Instead of fixing the warning, I would just try to avoid the extra static
symbol, by simply not initializing clock_speed.

Btw, what happens if a machine have two ov7670 sensors, maybe connected
to two different bridges, at different clock speeds? The better would be have
the clock_speed parameter on a per-device struct, instead of using it 
on one global static var. 

At m9v011, I had to do something like that, specifying the xtal connected 
to the device. I suspect that this is basically the same thing you're
trying to do at ov7670, but adding another XO-specific hack.

There, I used .s_config callback to set a per-device config, and added
the logic to adjust the xtal clock at the bridge driver. The bridge driver
(in this case, em28xx) just does:

if (dev-em28xx_sensor == EM28XX_MT9V011) {
struct v4l2_subdev *sd;

sd = v4l2_i2c_new_subdev(dev-v4l2_dev,
 dev-i2c_adap, mt9v011, mt9v011, 0, 
mt9v011_addrs);
v4l2_subdev_call(sd, core, s_config, 0, dev-sensor_xtal);
}

The better would be to do the same for ov7670: move the DMI check code to 
the cafe-ccic, where you should add the OLPC specific bits, and pass a 
s_config call specifying the xtal speed to the sensor driver.

This removes completely the need of passing extra parameters to the driver.




 
 Signed-off-by: Daniel Drake d...@laptop.org
 ---
  drivers/media/video/ov7670.c |   71 -
  1 files changed, 62 insertions(+), 9 deletions(-)
 
 diff --git a/drivers/media/video/ov7670.c b/drivers/media/video/ov7670.c
 index 9fffcdd..c4d9ed0 100644
 --- a/drivers/media/video/ov7670.c
 +++ b/drivers/media/video/ov7670.c
 @@ -16,6 +16,7 @@
  #include linux/i2c.h
  #include linux/delay.h
  #include linux/videodev2.h
 +#include linux/dmi.h
  #include media/v4l2-device.h
  #include media/v4l2-chip-ident.h
  #include media/v4l2-mediabus.h
 @@ -30,6 +31,19 @@ module_param(debug, bool, 0644);
  MODULE_PARM_DESC(debug, Debug level (0-1));
  
  /*
 + * What is our fastest frame rate?  It's a function of how the chip
 + * is clocked, and this is an external clock, so we don't know. If we have
 + * a DMI entry describing the platform, use it. If not, assume 30. In both
 + * cases, accept override from a module parameter.
 + */
 +static int clock_speed = 30;
 +static bool clock_speed_from_param = false;
 +static int set_clock_speed_from_param(const char *val, struct kernel_param 
 *kp);
 +module_param_call(clock_speed, set_clock_speed_from_param, param_get_int,
 +   clock_speed, 0440);
 +MODULE_PARM_DESC(clock_speed, External clock speed (Hz));
 +
 +/*
   * Basic window sizes.  These probably belong somewhere more globally
   * useful.
   */
 @@ -43,11 +57,6 @@ MODULE_PARM_DESC(debug, Debug level (0-1));
  #define  QCIF_HEIGHT 144
  
  /*
 - * Our nominal (default) frame rate.
 - */
 -#define OV7670_FRAME_RATE 30
 -
 -/*
   * The 7670 sits on i2c with ID 0x42
   */
  #define OV7670_I2C_ADDR 0x42
 @@ -188,6 +197,44 @@ MODULE_PARM_DESC(debug, Debug level (0-1));
  #define REG_HAECC7   0xaa/* Hist AEC/AGC control 7 */
  #define REG_BD60MAX  0xab/* 60hz banding step limit */
  
 +static int set_clock_speed_from_param(const char *val, struct kernel_param 
 *kp)
 +{
 + int ret = param_set_int(val, kp);
 + if (ret == 0)
 + clock_speed_from_param = true;
 + return ret;
 +}
 +
 +static int __init set_clock_speed_from_dmi(const struct dmi_system_id *dmi)
 +{
 + if (clock_speed_from_param)
 + return 0; /* module param beats DMI */
 +
 + clock_speed = (int) dmi-driver_data;
 + return 0;
 +}
 +
 +static const struct dmi_system_id __initconst dmi_clock_speeds[] = {
 + {
 + .callback = set_clock_speed_from_dmi,
 + .driver_data = (void *) 45,
 + .matches = {
 + DMI_MATCH(DMI_SYS_VENDOR, OLPC),
 + DMI_MATCH(DMI_PRODUCT_NAME, XO),
 + DMI_MATCH(DMI_PRODUCT_VERSION, 1),
 + },
 + },
 + {
 + .callback = set_clock_speed_from_dmi,
 + .driver_data = (void *) 90,
 + .matches = {
 + DMI_MATCH(DMI_SYS_VENDOR, OLPC),
 + DMI_MATCH(DMI_PRODUCT_NAME, XO),
 + 

Re: [PATCH 1/3] ov7670: remove QCIF mode

2010-10-15 Thread Mauro Carvalho Chehab
Em 08-10-2010 18:15, Daniel Drake escreveu:
 On 8 October 2010 22:11, Jonathan Corbet cor...@lwn.net wrote:
 I'm certainly not attached to this mode, but...does it harm anybody if
 it's there?
 
 Yes. Applications like gstreamer will pick this resolution if its the
 closest resolution to the target file resolution. On XO-1 we always
 pick a low res so gstreamer picks this one. And we end up with a video
 that only records a miniscule portion of the FOV.
 
 All the other settings of the camera scale the image so that the whole
 FOV is covered. But this one records at normal resolution, only
 sending a small center portion of the FOV. The same pixels can be read
 by recording at full res and then just cutting out the center bit.

Seems an application-specific issue to me. I would accept a patch at cafe-ccic
limiting the minimum resolution (as it is device-specific), but I agree with
Jon that limiting it at the sensor is not a good thing to do. 

Getting full res means to require higher bandwidths at the bus (and this may be
a problem if someone wants to have more than one camera, and the bridge is USB).
Also, it will eat more CPU to downscale.

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