Re: DUTV005 USB DVB-T dongle

2009-01-31 Thread Luca Olivetti
El Fri, 30 Jan 2009 17:32:14 -0800
Brandon Philips bran...@ifup.org escribió:

  Moosy's got a lot of info, USB dumps and datasheets at
  http://sites.google.com/site/moosyresearch/dutv005
  
  I'm ready to lend the device to a developer willing to create a
  Linux driver for it because it's basically useless for me now.
  
  (please ignore the previous e-mails sent from a wrong e-mail
  address)
 
 CC'ing the linux-media list which includes the DVB developers. Perhaps
 someone from that list has some idea about the device or would be
 interested in helping out.

Antti Palosaari, a few days ago, said he's trying to write a driver for
this device.

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


Fwd: [linux-dvb] Technotrend C-2300 and CAM

2009-01-31 Thread Jan Schneider

Not sure if linux-dvb messages are automatically forwarded...

- Weitergeleitete Nachricht von j...@horde.org -
 Datum: Sat, 31 Jan 2009 12:43:51 +0100
   Von: Jan Schneider j...@horde.org
Antwort an: linux-media@vger.kernel.org
   Betreff: [linux-dvb] Technotrend C-2300 and CAM
An: linux-...@linuxtv.org

Hi,

for some reason, my CAM (Alphacrypt Classic) doesn't seem to be
detected by my Technotrend C-2300/CI combination. There is nothing in
the kernel log/syslog when inserting or removing the card. I updated
the card to the latest firmware (3.18) to no avail.
I don't even know where to start debugging. No windows here, so I
can't really tell whether this is a hardware problem.
Any hints on where to start looking would help. The combination seems
to work fine for almost everybody, beside one single thread on this
list in 2007 that didn't come to a conclusion either.

Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/


___
linux-dvb users mailing list
For V4L/DVB development, please use instead linux-media@vger.kernel.org
linux-...@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb


- Ende der weitergeleiteten Nachricht -


Jan.

--
Do you need professional PHP or Horde consulting?
http://horde.org/consulting/

--
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: [OMAPZOOM][PATCH v2 2/6] Increase isp workaround buffer size for 8MP sensor.

2009-01-31 Thread Alexey Klimov
Hello, Dominic
May i ask few questions ?

Well, looks like it's unrelated to your patch. Lines that don't looks
okay to me appear in your patch.

On Fri, 2009-01-30 at 17:45 -0600, Dominic Curran wrote:
 From: Dominic Curran dcur...@ti.com
 Subject: [OMAPZOOM][PATCH v2 2/6] Increase isp workaround buffer size for 8MP 
 sensor.
 
 A temporary buffer is created to hold the image while it is written by
 Previewer module and then read by Resizer module. This is called LSC
 Workaround. To take into account the Sony IMX046 8MP sensor that buffer
 needs to be increased in size.
 Changed the #defines to be upper case.
 Patch also fixes the initialization of a couple of CCDC values.
 
 Signed-off-by: Dominic Curran dcur...@ti.com
 ---
  drivers/media/video/isp/isp.c |   10 +-
  drivers/media/video/isp/isp.h |7 +--
  drivers/media/video/isp/ispccdc.c |2 ++
  drivers/media/video/isp/ispmmu.h  |3 +++
  4 files changed, 15 insertions(+), 7 deletions(-)
 
 Index: omapzoom04/drivers/media/video/isp/isp.c
 ===
 --- omapzoom04.orig/drivers/media/video/isp/isp.c
 +++ omapzoom04/drivers/media/video/isp/isp.c
 @@ -1172,20 +1172,20 @@ void omapisp_unset_callback()
   **/
  u32 isp_buf_allocation(void)
  {
 - buff_addr = (void *) vmalloc(buffer_size);
 + buff_addr = (void *) vmalloc(ISP_BUFFER_MAX_SIZE);
  
   if (!buff_addr) {
   printk(KERN_ERR Cannot allocate memory );

Will user understand what module (or system of kernel) provide this
printk message ? Should module name be here ?

   return -ENOMEM;
   }
  
 - sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, no_of_pages);
 + sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, ISP_BUFFER_MAX_PAGES);
   if (!sglist_alloc) {
   printk(KERN_ERR videobuf_vmalloc_to_sg error);

Well, may be here too..
By the way, why there is no \n in the end of messages in this
function ?

   return -ENOMEM;
   }
 - num_sc = dma_map_sg(NULL, sglist_alloc, no_of_pages, 1);
 - buff_addr_mapped = ispmmu_map_sg(sglist_alloc, no_of_pages);
 + num_sc = dma_map_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
 + buff_addr_mapped = ispmmu_map_sg(sglist_alloc, ISP_BUFFER_MAX_PAGES);
   if (!buff_addr_mapped) {
   printk(KERN_ERR ispmmu_map_sg mapping failed );

Probably the same thing here.
May be someone can correct sitation if necessary..

   return -ENOMEM;
 @@ -1217,7 +1217,7 @@ void isp_buf_free(void)
  {
   if (alloc_done == 1) {
   ispmmu_unmap(buff_addr_mapped);
 - dma_unmap_sg(NULL, sglist_alloc, no_of_pages, 1);
 + dma_unmap_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
   kfree(sglist_alloc);
   vfree(buff_addr);
   alloc_done = 0;
 Index: omapzoom04/drivers/media/video/isp/isp.h
 ===
 --- omapzoom04.orig/drivers/media/video/isp/isp.h
 +++ omapzoom04/drivers/media/video/isp/isp.h
 @@ -26,6 +26,9 @@
  #define OMAP_ISP_TOP_H
  #include media/videobuf-dma-sg.h
  #include linux/videodev2.h
 +
 +#include ispmmu.h
 +
  #define OMAP_ISP_CCDC(1  0)
  #define OMAP_ISP_PREVIEW (1  1)
  #define OMAP_ISP_RESIZER (1  2)
 @@ -69,8 +72,8 @@
  #define NUM_ISP_CAPTURE_FORMATS  (sizeof(isp_formats) /\
   sizeof(isp_formats[0]))
  #define ISP_WORKAROUND 1
 -#define buffer_size (1024 * 1024 * 10)
 -#define no_of_pages (buffer_size / (4 * 1024))
 +#define ISP_BUFFER_MAX_SIZE (1024 * 1024 * 16)
 +#define ISP_BUFFER_MAX_PAGES (ISP_BUFFER_MAX_SIZE / ISPMMU_PAGE_SIZE)
  
  typedef int (*isp_vbq_callback_ptr) (struct videobuf_buffer *vb);
  typedef void (*isp_callback_t) (unsigned long status,
 Index: omapzoom04/drivers/media/video/isp/ispccdc.c
 ===
 --- omapzoom04.orig/drivers/media/video/isp/ispccdc.c
 +++ omapzoom04/drivers/media/video/isp/ispccdc.c
 @@ -1265,6 +1265,8 @@ int ispccdc_config_size(u32 input_w, u32
   }
  
   if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP) {
 + ispccdc_obj.ccdcin_woffset = 0;
 + ispccdc_obj.ccdcin_hoffset = 0;
   omap_writel((ispccdc_obj.ccdcin_woffset 
   ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
   (ispccdc_obj.ccdcin_w 
 Index: omapzoom04/drivers/media/video/isp/ispmmu.h
 ===
 --- omapzoom04.orig/drivers/media/video/isp/ispmmu.h
 +++ omapzoom04/drivers/media/video/isp/ispmmu.h
 @@ -59,6 +59,9 @@
  /* Number of entries per L2 Page table */
  #define ISPMMU_L2D_ENTRIES_NR256
  
 +/* Size of MMU page in bytes */
 +#define ISPMMU_PAGE_SIZE 4096
 +
  /*
   * Statically allocate 16KB for L2 page 

[PATCH] newport: newport_*wait() return 0 on timeout

2009-01-31 Thread Roel Kluin
With a postfix decrement t reaches -1 on timeout which results in a
return of 0.

Signed-off-by: Roel Kluin roel.kl...@gmail.com
---
diff --git a/include/video/newport.h b/include/video/newport.h
index 1f5ebea..001b935 100644
--- a/include/video/newport.h
+++ b/include/video/newport.h
@@ -453,7 +453,7 @@ static __inline__ int newport_wait(struct newport_regs 
*regs)
 {
int t = BUSY_TIMEOUT;
 
-   while (t--)
+   while (--t)
if (!(regs-cset.status  NPORT_STAT_GBUSY))
break;
return !t;
@@ -463,7 +463,7 @@ static __inline__ int newport_bfwait(struct newport_regs 
*regs)
 {
int t = BUSY_TIMEOUT;
 
-   while (t--)
+   while (--t)
if(!(regs-cset.status  NPORT_STAT_BBUSY))
break;
return !t;
--
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: [REVIEW PATCH 2/2] OMAP3EVM Multi-Media Daughter Card Support

2009-01-31 Thread Alexey Klimov
Hello, Vaibhav
May i tell few suggestions ?

On Fri, 2009-01-30 at 00:52 +0530, hvaib...@ti.com wrote:
 From: Vaibhav Hiremath hvaib...@ti.com
 
 This is second version of OMAP3EVM Mulit-Media/Mass Market
 Daughter Card support.
 
 Fixes:
 - Cleaned unused header files, struct formating, and unused
   comments.
 - Pad/mux configuration handled in mux.ch
 - mux.ch related changes moved to seperate patch
 - Renamed file board-omap3evm-dc.c to board-omap3evm-dc-v4l.c
   to make more explicit.
 - Added some more meaningful name for Kconfig option
 
 TODO:
 - Camera sensor support (for future development).
 - Driver header file inclusion (dependency on ISP-Camera patches)
   I am working with Sergio to seperate/move header file to standard
   location.
 - Still need to fix naming convention for DC
 
 Tested:
 - TVP5146 (BT656) decoder interface on top of
   Sergio's ISP-Camera patches.
 - Loopback application, capturing image through TVP5146
   and saving it to file per frame.
 - Basic functionality of HSUSB Transceiver USB-83320
 
 Signed-off-by: Brijesh Jadav brijes...@ti.com
 Signed-off-by: Hardik Shah hardik.s...@ti.com
 Signed-off-by: Vaibhav Hiremath hvaib...@ti.com
 ---
  arch/arm/mach-omap2/Kconfig |8 +-
  arch/arm/mach-omap2/Makefile|1 +
  arch/arm/mach-omap2/board-omap3evm-dc-v4l.c |  348 
 +++
  arch/arm/mach-omap2/board-omap3evm-dc.h |   42 
  4 files changed, 398 insertions(+), 1 deletions(-)
  create mode 100644 arch/arm/mach-omap2/board-omap3evm-dc-v4l.c
  create mode 100644 arch/arm/mach-omap2/board-omap3evm-dc.h
 
 diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig
 index 8fa650d..c1cf770 100644
 --- a/arch/arm/mach-omap2/Kconfig
 +++ b/arch/arm/mach-omap2/Kconfig
 @@ -113,7 +113,7 @@ config MACH_OMAP_LDP
   bool OMAP3 LDP board
   depends on ARCH_OMAP3  ARCH_OMAP34XX
 
 -config MACH_OMAP2EVM
 +config MACH_OMAP2EVM
   bool OMAP 2530 EVM board
   depends on ARCH_OMAP2  ARCH_OMAP24XX
 
 @@ -125,6 +125,12 @@ config MACH_OMAP3EVM
   bool OMAP 3530 EVM board
   depends on ARCH_OMAP3  ARCH_OMAP34XX
 
 +config MACH_OMAP3EVM_MMDC
 + bool OMAP 3530 EVM Mass Market Daughter Card board
 + depends on MACH_OMAP3EVM
 + help
 +   Set this if you've got a Mass Market Daughter Card board.
 +
  config MACH_OMAP3_BEAGLE
   bool OMAP3 BEAGLE board
   depends on ARCH_OMAP3  ARCH_OMAP34XX
 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile
 index 631166d..45f52ca 100644
 --- a/arch/arm/mach-omap2/Makefile
 +++ b/arch/arm/mach-omap2/Makefile
 @@ -58,6 +58,7 @@ obj-$(CONFIG_MACH_OMAP3EVM) += board-omap3evm.o \
  usb-musb.o usb-ehci.o \
  board-omap3evm-flash.o \
  twl4030-generic-scripts.o
 +obj-$(CONFIG_MACH_OMAP3EVM_MMDC) += board-omap3evm-dc-v4l.o
  obj-$(CONFIG_MACH_OMAP3_BEAGLE)  += board-omap3beagle.o \
  usb-musb.o usb-ehci.o \
  mmc-twl4030.o \
 diff --git a/arch/arm/mach-omap2/board-omap3evm-dc-v4l.c 
 b/arch/arm/mach-omap2/board-omap3evm-dc-v4l.c
 new file mode 100644
 index 000..a7b785e
 --- /dev/null
 +++ b/arch/arm/mach-omap2/board-omap3evm-dc-v4l.c
 @@ -0,0 +1,348 @@
 +/*
 + * arch/arm/mach-omap2/board-omap3evm-dc-v4l.c
 + *
 + * Driver for OMAP3 EVM Mass Market Daughter Card
 + *
 + * Copyright (C) 2008 Texas Instruments Inc
 + * Author: Vaibhav Hiremath hvaib...@ti.com
 + *
 + * Contributors:
 + * Anuj Aggarwal anuj.aggar...@ti.com
 + * Sivaraj R siva...@ti.com
 + *
 + * This package is free software; you can redistribute it and/or modify
 + * it under the terms of the GNU General Public License version 2 as
 + * published by the Free Software Foundation.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software
 + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 + *
 + */
 +
 +#include linux/init.h
 +#include linux/i2c.h
 +#include linux/gpio.h
 +#include linux/videodev2.h
 +
 +#include mach/mux.h
 +
 +#include media/v4l2-int-device.h
 +#include media/tvp514x.h
 +
 +/* Include V4L2 ISP-Camera driver related header file */
 +#include ../drivers/media/video/omap34xxcam.h
 +#include ../drivers/media/video/isp/ispreg.h
 +
 +#include board-omap3evm-dc.h
 +
 +#define MODULE_NAME  omap3evmdc
 +
 +/* Macro Definitions */
 +
 +/* GPIO pins */
 +#define GPIO134_SEL_TVP_Y(134)
 +#define 

RE: [OMAPZOOM][PATCH v2 2/6] Increase isp workaround buffer size for 8MP sensor.

2009-01-31 Thread Curran, Dominic



From: Alexey Klimov [klimov.li...@gmail.com]
Sent: Saturday, January 31, 2009 9:08 AM
To: Curran, Dominic
Cc: linux-media@vger.kernel.org; linux-omap; greg.ho...@hp.com
Subject: Re: [OMAPZOOM][PATCH v2 2/6] Increase isp workaround buffer size for 
8MP sensor.

Hello, Dominic
May i ask few questions ?

Well, looks like it's unrelated to your patch. Lines that don't looks
okay to me appear in your patch.

On Fri, 2009-01-30 at 17:45 -0600, Dominic Curran wrote:
 From: Dominic Curran dcur...@ti.com
 Subject: [OMAPZOOM][PATCH v2 2/6] Increase isp workaround buffer size for 8MP
 sensor.

 A temporary buffer is created to hold the image while it is written by
 Previewer module and then read by Resizer module. This is called LSC
 Workaround. To take into account the Sony IMX046 8MP sensor that buffer
 needs to be increased in size.
 Changed the #defines to be upper case.
 Patch also fixes the initialization of a couple of CCDC values.

 Signed-off-by: Dominic Curran dcur...@ti.com
 ---
  drivers/media/video/isp/isp.c |   10 +-
  drivers/media/video/isp/isp.h |7 +--
  drivers/media/video/isp/ispccdc.c |2 ++
  drivers/media/video/isp/ispmmu.h  |3 +++
  4 files changed, 15 insertions(+), 7 deletions(-)

 Index: omapzoom04/drivers/media/video/isp/isp.c
 ===
 --- omapzoom04.orig/drivers/media/video/isp/isp.c
 +++ omapzoom04/drivers/media/video/isp/isp.c
 @@ -1172,20 +1172,20 @@ void omapisp_unset_callback()
   **/
  u32 isp_buf_allocation(void)
  {
 - buff_addr = (void *) vmalloc(buffer_size);
 + buff_addr = (void *) vmalloc(ISP_BUFFER_MAX_SIZE);

   if (!buff_addr) {
   printk(KERN_ERR Cannot allocate memory );

Will user understand what module (or system of kernel) provide this
printk message ? Should module name be here ?

[DC] Agree.

   return -ENOMEM;
   }

 - sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, no_of_pages);
 + sglist_alloc = videobuf_vmalloc_to_sg(buff_addr, ISP_BUFFER_MAX_PAGES);
   if (!sglist_alloc) {
   printk(KERN_ERR videobuf_vmalloc_to_sg error);

Well, may be here too..
By the way, why there is no \n in the end of messages in this
function ?

[DC] Agree.


   return -ENOMEM;
   }
 - num_sc = dma_map_sg(NULL, sglist_alloc, no_of_pages, 1);
 - buff_addr_mapped = ispmmu_map_sg(sglist_alloc, no_of_pages);
 + num_sc = dma_map_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
 + buff_addr_mapped = ispmmu_map_sg(sglist_alloc, ISP_BUFFER_MAX_PAGES);
   if (!buff_addr_mapped) {
   printk(KERN_ERR ispmmu_map_sg mapping failed );

Probably the same thing here.
May be someone can correct sitation if necessary..

[DC] Agree.
Thanks Alexey. I will create an extra patch to cleanup those printk's.
  

   return -ENOMEM;
 @@ -1217,7 +1217,7 @@ void isp_buf_free(void)
  {
   if (alloc_done == 1) {
   ispmmu_unmap(buff_addr_mapped);
 - dma_unmap_sg(NULL, sglist_alloc, no_of_pages, 1);
 + dma_unmap_sg(NULL, sglist_alloc, ISP_BUFFER_MAX_PAGES, 1);
   kfree(sglist_alloc);
   vfree(buff_addr);
   alloc_done = 0;
 Index: omapzoom04/drivers/media/video/isp/isp.h
 ===
 --- omapzoom04.orig/drivers/media/video/isp/isp.h
 +++ omapzoom04/drivers/media/video/isp/isp.h
 @@ -26,6 +26,9 @@
  #define OMAP_ISP_TOP_H
  #include media/videobuf-dma-sg.h
  #include linux/videodev2.h
 +
 +#include ispmmu.h
 +
  #define OMAP_ISP_CCDC(1  0)
  #define OMAP_ISP_PREVIEW (1  1)
  #define OMAP_ISP_RESIZER (1  2)
 @@ -69,8 +72,8 @@
  #define NUM_ISP_CAPTURE_FORMATS  (sizeof(isp_formats) /\
   sizeof(isp_formats[0]))
  #define ISP_WORKAROUND 1
 -#define buffer_size (1024 * 1024 * 10)
 -#define no_of_pages (buffer_size / (4 * 1024))
 +#define ISP_BUFFER_MAX_SIZE (1024 * 1024 * 16)
 +#define ISP_BUFFER_MAX_PAGES (ISP_BUFFER_MAX_SIZE / ISPMMU_PAGE_SIZE)

  typedef int (*isp_vbq_callback_ptr) (struct videobuf_buffer *vb);
  typedef void (*isp_callback_t) (unsigned long status,
 Index: omapzoom04/drivers/media/video/isp/ispccdc.c
 ===
 --- omapzoom04.orig/drivers/media/video/isp/ispccdc.c
 +++ omapzoom04/drivers/media/video/isp/ispccdc.c
 @@ -1265,6 +1265,8 @@ int ispccdc_config_size(u32 input_w, u32
   }

   if (ispccdc_obj.ccdc_outfmt == CCDC_OTHERS_VP) {
 + ispccdc_obj.ccdcin_woffset = 0;
 + ispccdc_obj.ccdcin_hoffset = 0;
   omap_writel((ispccdc_obj.ccdcin_woffset 
   ISPCCDC_FMT_HORZ_FMTSPH_SHIFT) |
   (ispccdc_obj.ccdcin_w 
 Index: omapzoom04/drivers/media/video/isp/ispmmu.h
 

[no subject]

2009-01-31 Thread christopherwanderson
Can I get as much disassembly of the PAC7302 drivers with your comments next to 
it? I am trying to improve my webcam and currently disassembling the driver, in 
Vista64 with IDA Pro. (I still have the 32 bit driver files as I upgraded from 
xp32)
I am helping on the gAIM/Pidgin voice/video chat and this driver isn't where I  
would like it to be. I need better color balance, even after changing alot of 
options I still turn out orange quite a bit.
I have Assembly expierence, I own the Intel Instruction Manuals, so figuring 
out the actual given driver with a little bit of help based on the current 
progress should not be difficult
Christopher W. Anderson 
 
--
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


PAC7302 disassembly

2009-01-31 Thread christopherwanderson
Can I get as much disassembly of the PAC7302 drivers with your comments next to 
it? I am trying to improve my webcam and currently disassembling the driver, in 
Vista64 with IDA Pro. (I still have the 32 bit driver files as I upgraded from 
xp32) 
I am helping on the gAIM/Pidgin voice/video chat and this driver isn't where I  
would like it to be. I need better color balance, even after changing alot of 
options I still turn out orange quite a bit. 
I have Assembly expierence, I own the Intel Instruction Manuals, so figuring 
out 
the actual given driver with a little bit of help based on the current progress 
should not be difficult 
Christopher W. Anderson 
--
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: PXA Quick capture interface with HV7131RP-Camera

2009-01-31 Thread Bennet Fischer
Hi


I am trying to get a camera to work together with an PXA270 processor.
My system has the following specs:

Platform: Gumstix Verdex Pro
Camera: HV7131RP
OS: Linux 2.6.28

I wrote a simple driver for the camera which omits all the i2c-stuff
because the camera starts already in a default configuration which
works fine for me.
A V4L2-device is generated and everything looks fine. But when i start
to capture, no data arrives BUT the Quick Capture Interface outputs a
MCLK and the camera responds with a PCLK, LV and FV (and data of
couse).
For getting a bit closer to the origin of the problem I disabled DMA
in pxa_camera.c and enabled all Interrupts in the CICR0 register. No
interrupt is generated. Even by disabling DMA and IRQ and looking into
CISR nothing happens.
I checked all the CIF registers bitwise. The polarity of the LV and FV
is correct, the alternate pin functions are correct, the interrupt bit
is non-masked, the size of the pixel matrix is correct. I'm a bit
desperate because at the moment I have no idea what to do next. I
would be thankful for any hint.


Greetings,
Bennet.
--
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][RESEND] Added support for AVerMedia Cardbus Hybrid remote control

2009-01-31 Thread Oldrich Jedlicka
Hi all,

I've found a way to get the remote control for AVerMedia Cardbus Hybrid (and 
possibly other Cardbus cards like Cardbus Plus) work, so here is the patch 
for it. Currently only the Hybrid (E506R) uses it.

Patch was created against v4l-dvb Mercurial tree (22.1.2009), tested with 
vanilla 2.6.28.1. Works for me.

The first mail (22.1.2009 on Linux-DVB ML) didn't get any attention, so here 
is a resend version, now on unified Linux-media ML.

Enjoy (and please apply :-)). Comments are more than welcome.

Regards,
Oldrich.
# HG changeset patch
# User Oldřich Jedlička oldium@seznam.cz
# Date 1232648889 -3600
# Node ID 2b8e5fc5b41f12950de265a4459dbdeee03f1776
# Parent  66e0b01971de89076fcc9a7ef624b35d5451cbe4
Added support for AVerMedia Cardbus Hybrid remote control

From: Oldřich Jedlička oldium@seznam.cz

Added support for I2C device at address 0x40 and subaddress 0x0d/0x0b
that provides remote control key reading support for AVerMedia Cardbus
Hybrid card, possibly for other AVerMedia Cardbus cards.

The I2C address 0x40 doesn't like the SAA7134's 0xfd quirk, so it was
disabled.

Priority: normal

Signed-off-by: Oldřich Jedlička oldium@seznam.cz

diff -r 66e0b01971de -r 2b8e5fc5b41f linux/drivers/media/common/ir-keymaps.c
--- a/linux/drivers/media/common/ir-keymaps.c	Thu Jan 22 19:27:07 2009 +0100
+++ b/linux/drivers/media/common/ir-keymaps.c	Thu Jan 22 19:28:09 2009 +0100
@@ -154,6 +154,65 @@
 };
 EXPORT_SYMBOL_GPL(ir_codes_avermedia_m135a);
 
+/* Oldrich Jedlicka oldium@seznam.cz */
+IR_KEYTAB_TYPE ir_codes_avermedia_cardbus[IR_KEYTAB_SIZE] = {
+	[ 0x00 ] = KEY_POWER,
+	[ 0x01 ] = KEY_TUNER,		/* TV/FM */
+	[ 0x03 ] = KEY_TEXT,		/* Teletext */
+	[ 0x04 ] = KEY_EPG,
+	[ 0x05 ] = KEY_1,
+	[ 0x06 ] = KEY_2,
+	[ 0x07 ] = KEY_3,
+	[ 0x08 ] = KEY_AUDIO,
+	[ 0x09 ] = KEY_4,
+	[ 0x0a ] = KEY_5,
+	[ 0x0b ] = KEY_6,
+	[ 0x0c ] = KEY_ZOOM,		/* Full screen */
+	[ 0x0d ] = KEY_7,
+	[ 0x0e ] = KEY_8,
+	[ 0x0f ] = KEY_9,
+	[ 0x10 ] = KEY_PAGEUP,		/* 16-CH PREV */
+	[ 0x11 ] = KEY_0,
+	[ 0x12 ] = KEY_INFO,
+	[ 0x13 ] = KEY_AGAIN,		/* CH RTN - channel return */
+	[ 0x14 ] = KEY_MUTE,
+	[ 0x15 ] = KEY_EDIT,		/* Autoscan */
+	[ 0x17 ] = KEY_SAVE,		/* Screenshot */
+	[ 0x18 ] = KEY_PLAYPAUSE,
+	[ 0x19 ] = KEY_RECORD,
+	[ 0x1a ] = KEY_PLAY,
+	[ 0x1b ] = KEY_STOP,
+	[ 0x1c ] = KEY_FASTFORWARD,
+	[ 0x1d ] = KEY_REWIND,
+	[ 0x1e ] = KEY_VOLUMEDOWN,
+	[ 0x1f ] = KEY_VOLUMEUP,
+	[ 0x22 ] = KEY_SLEEP,		/* Sleep */
+	[ 0x23 ] = KEY_ZOOM,		/* Aspect */
+	[ 0x26 ] = KEY_SCREEN,		/* Pos */
+	[ 0x27 ] = KEY_ANGLE,		/* Size */
+	[ 0x28 ] = KEY_SELECT,		/* Select */
+	[ 0x29 ] = KEY_BLUE,		/* Blue/Picture */
+	[ 0x2a ] = KEY_BACKSPACE,	/* Back */
+	[ 0x2b ] = KEY_MEDIA,		/* PIP (Picture-in-picture) */
+	[ 0x2c ] = KEY_DOWN,
+	[ 0x2e ] = KEY_DOT,
+	[ 0x2f ] = KEY_TV,		/* Live TV */
+	[ 0x32 ] = KEY_LEFT,
+	[ 0x33 ] = KEY_CLEAR,		/* Clear */
+	[ 0x35 ] = KEY_RED,		/* Red/TV */
+	[ 0x36 ] = KEY_UP,
+	[ 0x37 ] = KEY_HOME,		/* Home */
+	[ 0x39 ] = KEY_GREEN,		/* Green/Video */
+	[ 0x3d ] = KEY_YELLOW,		/* Yellow/Music */
+	[ 0x3e ] = KEY_OK,		/* Ok */
+	[ 0x3f ] = KEY_RIGHT,
+	[ 0x40 ] = KEY_NEXT,		/* Next */
+	[ 0x41 ] = KEY_PREVIOUS,	/* Previous */
+	[ 0x42 ] = KEY_CHANNELDOWN,	/* Channel down */
+	[ 0x43 ] = KEY_CHANNELUP	/* Channel up */
+};
+EXPORT_SYMBOL_GPL(ir_codes_avermedia_cardbus);
+
 /* Attila Kondoros attila.kondo...@chello.hu */
 IR_KEYTAB_TYPE ir_codes_apac_viewcomp[IR_KEYTAB_SIZE] = {
 
diff -r 66e0b01971de -r 2b8e5fc5b41f linux/drivers/media/video/ir-kbd-i2c.c
--- a/linux/drivers/media/video/ir-kbd-i2c.c	Thu Jan 22 19:27:07 2009 +0100
+++ b/linux/drivers/media/video/ir-kbd-i2c.c	Thu Jan 22 19:28:09 2009 +0100
@@ -16,6 +16,8 @@
  *  Henry Wong he...@stuffedcow.net
  *  Mark Schultz n9...@yahoo.com
  *  Brian Rogers brian_rog...@comcast.net
+ * modified for AVerMedia Cardbus by
+ *  Oldrich Jedlicka oldium@seznam.cz
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License as published by
@@ -217,6 +219,46 @@
 	return 1;
 }
 
+static int get_key_avermedia_cardbus(struct IR_i2c *ir,
+ u32 *ir_key, u32 *ir_raw)
+{
+	unsigned char subaddr, key, keygroup;
+	struct i2c_msg msg[] = {{.addr=ir-c.addr, .flags=0, .buf=subaddr,
+.len = 1},
+{.addr=ir-c.addr, .flags=I2C_M_RD, .buf=key,
+.len = 1}};
+	subaddr = 0x0d;
+	if (2 != i2c_transfer(ir-c.adapter, msg, 2)) {
+		dprintk(1, read error\n);
+		return -EIO;
+	}
+
+	if (key == 0xff)
+		return 0;
+
+	subaddr = 0x0b;
+	msg[1].buf = keygroup;
+	if (2 != i2c_transfer(ir-c.adapter, msg, 2)) {
+		dprintk(1, read error\n);
+		return -EIO;
+	}
+
+	if (keygroup == 0xff)
+		return 0;
+
+	dprintk(1, read key 0x%02x/0x%02x\n, key, keygroup);
+	if (keygroup  2 || keygroup  3) {
+		/* Only a warning */
+		dprintk(1, warning: invalid key group 0x%02x for key 0x%02x\n,
+keygroup, key);
+	}
+	key |= (keygroup  1)  6;
+
+	*ir_key = key;
+	*ir_raw