Re: See signal level

2009-10-03 Thread hermann pitton

Am Sonntag, den 04.10.2009, 03:03 +0100 schrieb Mikhail Ramendik:
> Hello,
> 
> Is there a utility to see the current signal level?
> 
> I want to try correcting the head position on the dish. And I don't
> have any receiver except my PC. So I'd like to move the head around
> while looking at the signal level.

Start here.

The satellite is not stationary ...

http://linuxtv.org/wiki/index.php/Sat_antenna

Cheers,
Hermann


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


Re: See signal level

2009-10-03 Thread Jarod Wilson
On Saturday 03 October 2009 22:03:06 Mikhail Ramendik wrote:
> Hello,
> 
> Is there a utility to see the current signal level?
> 
> I want to try correcting the head position on the dish. And I don't
> have any receiver except my PC. So I'd like to move the head around
> while looking at the signal level.

Try *zap and femon.

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


See signal level

2009-10-03 Thread Mikhail Ramendik
Hello,

Is there a utility to see the current signal level?

I want to try correcting the head position on the dish. And I don't
have any receiver except my PC. So I'd like to move the head around
while looking at the signal level.

-- 
Yours, Mikhail Ramendik
--
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: [2.6.31] ir-kbd-i2c oops.

2009-10-03 Thread Hermann Pitton
Hi,

Am Samstag, den 03.10.2009, 21:09 +0200 schrieb Paweł Sikora:
> On Saturday 03 October 2009 20:15:27 Jean Delvare wrote:
> 
> > > moreover, with this patch i'm observing a flood in dmesg:
> > >
> > > [  938.313245] i2c IR (Pinnacle PCTV): unknown key: key=0x12 raw=0x12
> > > down=1 [  938.419914] i2c IR (Pinnacle PCTV): unknown key: key=0x12
> > > raw=0x12 down=0 [  939.273249] i2c IR (Pinnacle PCTV): unknown key:
> > > key=0x24 raw=0x24 down=1 [  939.379955] i2c IR (Pinnacle PCTV): unknown
> > > key: key=0x24 raw=0x24 down=0
> > 
> > Different issue, and I don't know much about IR support, but these keys
> > aren't listed in ir_codes_pinnacle_color. Maybe you have a different
> > variant of this remote control with more keys and we need to add their
> > definitions.
> 
> i have such one: http://imgbin.org/index.php?page=image&id=812

hm, maybe it is some fake Pinnacle stuff, at least that remote is very
different from the supported ones with gray only or colored keys and
looks very poor.

I would have to boot into vista to check if it could be one of the new
missing remotes. That the original Pinnacle logo with the P with the red
ball and the yellow light point is not on it looks at least suspicious.

> > Which keys are triggering these messages?
> 
> this is the funny thing because i'm not pressing any keys at all.
> the remote control is unused currently becasue i'm using only
> pinnacle svideo input for watching sat-tv with tvtime.

Else, anyway, we have a disabled Pinnacle remote already on the 300i
conflicting with other stuff, we have also devices with the same PCI
subsystem as 310i with and without LNA and now some new remote.

The old undocumented LNA support was broken in favor to have new
undocumented LNA support for some undocumented/unidentified Hauppauge
HVR1110 devices.

Obviously they have been mad enough also not only not to change the
subsystem, but did let even the receiver chip on the same 0x47 address.

I had all my comments already previously.

Hauppauge bought Pinnacle some time back for such products, but we are
far away from to get eeprom and checksum information to sort that mess.

Since I have been told, nobody has access to such information yet, folks
must make their decisions. Seems recent saa7134 Pinnacle stuff is not
the first choice.

Cheers,
Hermann






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


Re: pxa_camera + mt9m1111: Failed to configure for format 50323234

2009-10-03 Thread Guennadi Liakhovetski
On Sat, 3 Oct 2009, Antonio Ospite wrote:

> On Sat, 3 Oct 2009 01:27:04 +0200 (CEST)
> Guennadi Liakhovetski  wrote:
> 
> > On Fri, 2 Oct 2009, Antonio Ospite wrote:
> > 
> > > Hi,
> > > 
> > > after updating to 2.6.32-rc2 I can't capture anymore with the setup in the
> > > subject.
> > 
> > Indeed:-( Please, verify, that this patch fixes your problem (completely 
> > untested), if it does, I'll push it for 2.6.32:
> > 
> > pxa_camera: fix camera pixel format configuration
> > 
> > A typo prevents correct picel format negotiation with client drivers.
> >
> 
> typo in the log message too :) s/picel/pixel/

Thanks:-)

> > Signed-off-by: Guennadi Liakhovetski 
> > ---
> > diff --git a/drivers/media/video/pxa_camera.c 
> > b/drivers/media/video/pxa_camera.c
> > index 6952e96..aa831d5 100644
> > --- a/drivers/media/video/pxa_camera.c
> > +++ b/drivers/media/video/pxa_camera.c
> > @@ -1432,7 +1432,9 @@ static int pxa_camera_set_fmt(struct 
> > soc_camera_device *icd,
> > icd->sense = &sense;
> >  
> > cam_f.fmt.pix.pixelformat = cam_fmt->fourcc;
> > -   ret = v4l2_subdev_call(sd, video, s_fmt, f);
> > +   ret = v4l2_subdev_call(sd, video, s_fmt, &cam_f);
> > +   cam_f.fmt.pix.pixelformat = pix->pixelformat;
> > +   *pix = cam_f.fmt.pix;
> >  
> > icd->sense = NULL;
> 
> Ok, I can capture again even by only fixing the typo: s/f/&cam_f/
> but I don't know if this is complete.

No, that's not.

> Anyways your patch works, but the picture is now shifted, see:
> http://people.openezx.org/ao2/a780-pxa-camera-mt9m111-shifted.jpg
> 
> Is this because of the new cropping code?

Hm, it shouldn't be. Does it look always like this - reproducible? What 
program are you using? What about other geometry configurations? Have you 
ever seen this with previous kernel versions? New cropping - neither 
mplayer nor gstreamer use cropping normally. This seems more like a HSYNC 
problem to me. Double-check platform data? Is it mioa701 or some custom 
board?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
--
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] MAINTAINERS: addition of gspca_gl860 driver

2009-10-03 Thread Olivier Lorin
MAINTAINERS: addition of gspca_gl860 driver

From: Olivier Lorin 

- addition of gspca_gl860 driver

Priority: normal

Signed-off-by: Olivier Lorin 

--- ../a/MAINTAINERS2009-09-20 02:07:33.0 +0200
+++ MAINTAINERS 2009-09-20 02:09:56.0 +0200
@@ -2224,6 +2224,13 @@ T:   git git://git.kernel.org/pub/scm/linu
 S: Maintained
 F: drivers/media/video/gspca/finepix.c
 
+GSPCA GL860 SUBDRIVER
+M: Olivier Lorin 
+L: linux-media@vger.kernel.org
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
+S: Maintained
+F: drivers/media/video/gspca/gl860/
+
 GSPCA M5602 SUBDRIVER
 M: Erik Andren 
 L: linux-media@vger.kernel.org

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


[PATCH 3/3] gspca_gl860/Fixed format : improvement of the driver for OV2640 sensor

2009-10-03 Thread Olivier Lorin
gspca_gl860: improvement of the driver for OV2640 sensor

From: Olivier Lorin 

- simplified initialization sequence
- add flip/mirror support for OV2640
- fix for backlight value range
- fix for red-blue inversion hue mode with V4L1 applications

diff -rupN ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860.h 
./linux/drivers/media/video/gspca/gl860/gl860.h
--- ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860.h
2009-09-24 23:16:10.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.h 2009-09-24 
23:55:32.0 +0200
@@ -23,7 +23,7 @@
 #include "gspca.h"
 
 #define MODULE_NAME "gspca_gl860"
-#define DRIVER_VERSION "0.9d11"
+#define DRIVER_VERSION "0.9e"
 
 #define ctrl_in  gl860_RTx
 #define ctrl_out gl860_RTx
diff -rupN ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860-ov2640.c 
./linux/drivers/media/video/gspca/gl860/gl860-ov2640.c
--- ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860-ov2640.c 
2009-09-24 23:34:57.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860-ov2640.c  2009-09-30 
00:40:49.0 +0200
@@ -107,36 +107,6 @@ static struct validx tbl_sensor_settings
{0x6001, 0x00ff}, {0x6038, 0x000c},
{10, 0x},
{0x6000, 0x0011},
-   /* backlight=31/64 */
-   {0x6001, 0x00ff}, {0x603e, 0x0024}, {0x6034, 0x0025},
-   /* bright=0/256 */
-   {0x6000, 0x00ff}, {0x6009, 0x007c}, {0x6000, 0x007d},
-   /* wbal=64/128 */
-   {0x6000, 0x00ff}, {0x6003, 0x007c}, {0x6040, 0x007d},
-   /* cntr=0/256 */
-   {0x6000, 0x00ff}, {0x6007, 0x007c}, {0x6000, 0x007d},
-   /* sat=128/256 */
-   {0x6000, 0x00ff}, {0x6001, 0x007c}, {0x6080, 0x007d},
-   /* sharpness=0/32 */
-   {0x6000, 0x00ff}, {0x6001, 0x0092}, {0x60c0, 0x0093},
-   /* hue=0/256 */
-   {0x6000, 0x00ff}, {0x6002, 0x007c}, {0x6000, 0x007d},
-   /* gam=32/64 */
-   {0x6000, 0x00ff}, {0x6008, 0x007c}, {0x6020, 0x007d},
-   /* image right up */
-   {0x, 0x},
-   {15, 0x},
-   {0x6001, 0x00ff}, {0x6000, 0x8004},
-   {0x, 0x},
-   {0x60a8, 0x0004},
-   {15, 0x},
-   {0x6001, 0x00ff}, {0x6000, 0x8004},
-   {0x, 0x},
-   {0x60f8, 0x0004},
-   /* image right up */
-   {0x, 0x},
-   /* backlight=31/64 */
-   {0x6001, 0x00ff}, {0x603e, 0x0024}, {0x6034, 0x0025},
 };
 
 static struct validx tbl_640[] = {
@@ -222,17 +192,19 @@ void ov2640_init_settings(struct gspca_d
sd->vcur.hue=   0;
sd->vcur.saturation = 128;
sd->vcur.whitebal   =  64;
+   sd->vcur.mirror =   0;
+   sd->vcur.flip   =   0;
 
sd->vmax.backlight  =  64;
sd->vmax.brightness = 255;
sd->vmax.sharpness  =  31;
sd->vmax.contrast   = 255;
sd->vmax.gamma  =  64;
-   sd->vmax.hue= 255 + 1;
+   sd->vmax.hue= 254 + 2;
sd->vmax.saturation = 255;
sd->vmax.whitebal   = 128;
-   sd->vmax.mirror = 0;
-   sd->vmax.flip   = 0;
+   sd->vmax.mirror = 1;
+   sd->vmax.flip   = 1;
sd->vmax.AC50Hz = 0;
 
sd->dev_camera_settings = ov2640_camera_settings;
@@ -284,6 +256,8 @@ static int ov2640_init_pre_alt(struct gs
sd->vold.gamma= -1;
sd->vold.hue  = -1;
sd->vold.whitebal = -1;
+   sd->vold.mirror = -1;
+   sd->vold.flip   = -1;
 
ov2640_init_post_alt(gspca_dev);
 
@@ -346,18 +320,6 @@ static int ov2640_init_post_alt(struct g
 
fetch_validx(gspca_dev, tbl_sensor_settings_common2,
ARRAY_SIZE(tbl_sensor_settings_common2));
-   ctrl_in(gspca_dev, 0xc0, 2, 0x, 0x, 1, c50);
-   keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-   ARRAY_SIZE(tbl_sensor_settings_common2), n);
-   ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, c28);
-   keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-   ARRAY_SIZE(tbl_sensor_settings_common2), n);
-   ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, ca8);
-   keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-   ARRAY_SIZE(tbl_sensor_settings_common2), n);
-   ctrl_in(gspca_dev, 0xc0, 2, 0x, 0x, 1, c50);
-   keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-   ARRAY_SIZE(tbl_sensor_settings_common2), n);
 
ov2640_camera_settings(gspca_dev);
 
@@ -394,6 +356,8 @@ static int ov2640_camera_settings(struct
s32 sat= sd->vcur.saturation;
s32 hue= sd->vcur.hue;
s32 wbal   = sd->vcur.whitebal;
+   s32 mirror = (((sd->vcur.mirror > 0) ^ sd->mirrorMask) == 0);
+   s32 flip   = (((sd->vcur.flip   > 0) ^ sd->mirrorMask) == 0);
 
if (backlight != sd->vold.backlight) {
/* No sd->vold.backlight=backlight

[PATCH 2/3] gspca_gl860/Fixed format : comment changes and unified naming scheme

2009-10-03 Thread Olivier Lorin
gspca_gl860: comment changes and unified naming scheme

From: Olivier Lorin 

- small changes in comments
- unified naming scheme for subdriver variables

Priority: trivial

Signed-off-by: Olivier Lorin 

diff -rupN ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.c 
./linux/drivers/media/video/gspca/gl860/gl860.c
--- ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.c 2009-09-24 
13:55:34.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.c 2009-09-24 
23:17:32.0 +0200
@@ -1,9 +1,7 @@
-/* @file gl860.c
- * @date 2009-08-27
+/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
+ * Subdriver core
  *
- * Genesys Logic webcam with gl860 subdrivers
- *
- * Driver by Olivier Lorin 
+ * 2009/09/24 Olivier Lorin 
  * GSPCA by Jean-Francois Moine 
  * Thanks BUGabundo and Malmostoso for your amazing help!
  *
diff -rupN ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.h 
./linux/drivers/media/video/gspca/gl860/gl860.h
--- ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.h 2009-09-24 
14:01:41.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.h 2009-09-24 
23:16:10.0 +0200
@@ -1,6 +1,7 @@
-/* @file gl860.h
- * @author Olivier LORIN, tiré du pilote Syntek par Nicolas VIVIEN
- * @date 2009-08-27
+/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
+ * Subdriver declarations
+ *
+ * 2009/09/24 Olivier LORIN 
  *
  * 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
diff -rupN ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860-mi1320.c 
./linux/drivers/media/video/gspca/gl860/gl860-mi1320.c
--- ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860-mi1320.c  
2009-09-18 10:36:24.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860-mi1320.c  2009-09-24 
21:24:59.0 +0200
@@ -1,6 +1,5 @@
-/* @file gl860-mi1320.c
- * @author Olivier LORIN from my logs
- * @date 2009-08-27
+/* Subdriver for the GL860 chip with the MI1320 sensor
+ * Author Olivier LORIN from own logs
  *
  * 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
@@ -127,49 +126,49 @@ static u8 dat_wbalBL[] =
 
 static u8 dat_hvflip1[] = {0xf0, 0x00, 0xf1, 0x00};
 
-static u8 s000[] =
+static u8 dat_common00[] =
"\x00\x01\x07\x6a\x06\x63\x0d\x6a" "\xc0\x00\x10\x10\xc1\x03\xc2\x42"
"\xd8\x04\x58\x00\x04\x02";
-static u8 s001[] =
+static u8 dat_common01[] =
"\x0d\x00\xf1\x0b\x0d\x00\xf1\x08" "\x35\x00\xf1\x22\x68\x00\xf1\x5d"
"\xf0\x00\xf1\x01\x06\x70\xf1\x0e" "\xf0\x00\xf1\x02\xdd\x18\xf1\xe0";
-static u8 s002[] =
+static u8 dat_common02[] =
"\x05\x01\xf1\x84\x06\x00\xf1\x44" "\x07\x00\xf1\xbe\x08\x00\xf1\x1e"
"\x20\x01\xf1\x03\x21\x84\xf1\x00" "\x22\x0d\xf1\x0f\x24\x80\xf1\x00"
"\x34\x18\xf1\x2d\x35\x00\xf1\x22" "\x43\x83\xf1\x83\x59\x00\xf1\xff";
-static u8 s003[] =
+static u8 dat_common03[] =
"\xf0\x00\xf1\x02\x39\x06\xf1\x8c" "\x3a\x06\xf1\x8c\x3b\x03\xf1\xda"
"\x3c\x05\xf1\x30\x57\x01\xf1\x0c" "\x58\x01\xf1\x42\x59\x01\xf1\x0c"
"\x5a\x01\xf1\x42\x5c\x13\xf1\x0e" "\x5d\x17\xf1\x12\x64\x1e\xf1\x1c";
-static u8 s004[] =
+static u8 dat_common04[] =
"\xf0\x00\xf1\x02\x24\x5f\xf1\x20" "\x28\xea\xf1\x02\x5f\x41\xf1\x43";
-static u8 s005[] =
+static u8 dat_common05[] =
"\x02\x00\xf1\xee\x03\x29\xf1\x1a" "\x04\x02\xf1\xa4\x09\x00\xf1\x68"
"\x0a\x00\xf1\x2a\x0b\x00\xf1\x04" "\x0c\x00\xf1\x93\x0d\x00\xf1\x82"
"\x0e\x00\xf1\x40\x0f\x00\xf1\x5f" "\x10\x00\xf1\x4e\x11\x00\xf1\x5b";
-static u8 s006[] =
+static u8 dat_common06[] =
"\x15\x00\xf1\xc9\x16\x00\xf1\x5e" "\x17\x00\xf1\x9d\x18\x00\xf1\x06"
"\x19\x00\xf1\x89\x1a\x00\xf1\x12" "\x1b\x00\xf1\xa1\x1c\x00\xf1\xe4"
"\x1d\x00\xf1\x7a\x1e\x00\xf1\x64" "\xf6\x00\xf1\x5f";
-static u8 s007[] =
+static u8 dat_common07[] =
"\xf0\x00\xf1\x01\x53\x09\xf1\x03" "\x54\x3d\xf1\x1c\x55\x99\xf1\x72"
"\x56\xc1\xf1\xb1\x57\xd8\xf1\xce" "\x58\xe0\xf1\x00\xdc\x0a\xf1\x03"
"\xdd\x45\xf1\x20\xde\xae\xf1\x82" "\xdf\xdc\xf1\xc9\xe0\xf6\xf1\xea"
"\xe1\xff\xf1\x00";
-static u8 s008[] =
+static u8 dat_common08[] =
"\xf0\x00\xf1\x01\x80\x00\xf1\x06" "\x81\xf6\xf1\x08\x82\xfb\xf1\xf7"
"\x83\x00\xf1\xfe\xb6\x07\xf1\x03" "\xb7\x18\xf1\x0c\x84\xfb\xf1\x06"
"\x85\xfb\xf1\xf9\x86\x00\xf1\xff" "\xb8\x07\xf1\x04\xb9\x16\xf1\x0a";
-static u8 s009[] =
+static u8 dat_common09[] =
"\x87\xfa\xf1\x05\x88\xfc\xf1\xf9" "\x89\x00\xf1\xff\xba\x06\xf1\x03"
"\xbb\x17\xf1\x09\x8a\xe8\xf1\x14" "\x8b\xf7\xf1\xf0\x8c\xfd\xf1\xfa"
"\x8d\x00\xf1\x00\xbc\x05\xf1\x01" "\xbd\x0c\xf1\x08\xbe\x00\xf1\x14";
-static u8 s010[] =
+static u8 dat_common10[] =
"\x8e\xea\xf1\x13\x8f\xf7\xf1\xf2" "\x90\xfd\xf1\xfa\

[PATCH 1/3] gspca_gl860/Fixed format : main part update

2009-10-03 Thread Olivier Lorin
I'm sorry, I used a bad format for the 3 previous patches I sent this day.
This is fixed now.


gspca_gl860: improvement of the main driver part

From: Olivier Lorin 

- fix for compilation warning about sd_ctrls
- trace improvement while probing the sensor

Priority: normal

Signed-off-by: Olivier Lorin 

diff -rupN ../gspca-o/linux/drivers/media/video/gspca/gl860/gl860.c 
./linux/drivers/media/video/gspca/gl860/gl860.c
--- ../gspca-o/linux/drivers/media/video/gspca/gl860/gl860.c2009-09-18 
10:36:24.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.c 2009-09-24 
13:55:34.0 +0200
@@ -23,8 +23,8 @@
 #include "gspca.h"
 #include "gl860.h"
 
-MODULE_AUTHOR("Olivier Lorin ");
-MODULE_DESCRIPTION("GSPCA/Genesys Logic GL860 USB Camera Driver");
+MODULE_AUTHOR("Olivier Lorin ");
+MODULE_DESCRIPTION("Genesys Logic USB PC Camera Driver");
 MODULE_LICENSE("GPL");
 
 /* static function declarations */
@@ -53,7 +53,7 @@ MODULE_PARM_DESC(AC50Hz, " Does AC power
 static char sensor[7];
 module_param_string(sensor, sensor, sizeof(sensor), 0644);
 MODULE_PARM_DESC(sensor,
-   " Driver sensor ('MI1320'/'MI2020'/'OV9655'/'OV2640'/'')");
+   " Driver sensor ('MI1320'/'MI2020'/'OV9655'/'OV2640')");
 
 /* webcam controls =*/
 
@@ -119,16 +119,23 @@ static int gl860_build_control_table(str
struct ctrl *sd_ctrls;
int nCtrls = 0;
 
-   if (_MI1320_)
+   switch (sd->sensor) {
+   case ID_MI1320:
sd_ctrls = sd_ctrls_mi1320;
-   else if (_MI2020_)
+   break;
+   case ID_MI2020:
sd_ctrls = sd_ctrls_mi2020;
-   else if (_MI2020b_)
+   break;
+   case ID_MI2020b:
sd_ctrls = sd_ctrls_mi2020b;
-   else if (_OV2640_)
+   break;
+   case ID_OV2640:
sd_ctrls = sd_ctrls_ov2640;
-   else if (_OV9655_)
+   break;
+   default:
sd_ctrls = sd_ctrls_ov9655;
+   break;
+   }
 
memset(sd_ctrls, 0, GL860_NCTRLS * sizeof(struct ctrl));
 
@@ -154,7 +161,7 @@ static int gl860_build_control_table(str
SET_MY_CTRL(V4L2_CID_VFLIP,
V4L2_CTRL_TYPE_BOOLEAN, "Flip", flip)
SET_MY_CTRL(V4L2_CID_POWER_LINE_FREQUENCY,
-   V4L2_CTRL_TYPE_BOOLEAN, "50Hz", AC50Hz)
+   V4L2_CTRL_TYPE_BOOLEAN, "AC power 50Hz", AC50Hz)
 
return nCtrls;
 }
@@ -700,6 +707,7 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x006a, 0x000d, 0, NULL);
msleep(56);
 
+   PDEBUG(D_PROBE, "probing for sensor MI2020 or OV");
nOV = 0;
for (ntry = 0; ntry < 4; ntry++) {
ctrl_out(gspca_dev, 0x40, 1, 0x0040, 0x, 0, NULL);
@@ -709,14 +717,14 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x7a00, 0x8030, 0, NULL);
msleep(10);
ctrl_in(gspca_dev, 0xc0, 2, 0x7a00, 0x8030, 1, &probe);
-   PDEBUG(D_PROBE, "1st probe=%02x", probe);
+   PDEBUG(D_PROBE, "probe=0x%02x", probe);
if (probe == 0xff)
nOV++;
}
 
if (nOV) {
-   PDEBUG(D_PROBE, "0xff -> sensor OV");
-   PDEBUG(D_PROBE, "Probing for sensor OV2640 or OV9655");
+   PDEBUG(D_PROBE, "0xff -> OV");
+   PDEBUG(D_PROBE, "probing for sensor OV2640 or OV9655");
 
nb26 = nb96 = 0;
for (ntry = 0; ntry < 4; ntry++) {
@@ -726,40 +734,38 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x6000, 0x800a,
0, NULL);
msleep(10);
+
/* Wait for 26(OV2640) or 96(OV9655) */
ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x800a,
1, &probe);
 
-   PDEBUG(D_PROBE, "2nd probe=%02x", probe);
-   if (probe == 0x00)
-   nb26++;
if (probe == 0x26 || probe == 0x40) {
+   PDEBUG(D_PROBE,
+   "probe=0x%02x -> OV2640",
+   probe);
sd->sensor = ID_OV2640;
nb26 += 4;
break;
}
if (probe == 0x96 || probe == 0x55) {
+ 

Re: [PATCH] tuner-simple: possible read buffer overflow?

2009-10-03 Thread Trent Piepho
On Sat, 3 Oct 2009, Roel Kluin wrote:
> Prevent read from t_params->ranges[-1].
>
> Signed-off-by: Roel Kluin 
> ---
> This is only required when t_params->count can be 0, can it?

Shouldn't be possible, or the tuner would be useless.

> - if (i == t_params->count) {
> + if (i == t_params->count && i) {
>   tuner_dbg("frequency out of range (%d > %d)\n",
> *frequency, t_params->ranges[i - 1].limit);
>   *frequency = t_params->ranges[--i].limit;
--
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: [2.6.31] ir-kbd-i2c oops.

2009-10-03 Thread Paweł Sikora
On Saturday 03 October 2009 20:15:27 Jean Delvare wrote:

> > moreover, with this patch i'm observing a flood in dmesg:
> >
> > [  938.313245] i2c IR (Pinnacle PCTV): unknown key: key=0x12 raw=0x12
> > down=1 [  938.419914] i2c IR (Pinnacle PCTV): unknown key: key=0x12
> > raw=0x12 down=0 [  939.273249] i2c IR (Pinnacle PCTV): unknown key:
> > key=0x24 raw=0x24 down=1 [  939.379955] i2c IR (Pinnacle PCTV): unknown
> > key: key=0x24 raw=0x24 down=0
> 
> Different issue, and I don't know much about IR support, but these keys
> aren't listed in ir_codes_pinnacle_color. Maybe you have a different
> variant of this remote control with more keys and we need to add their
> definitions.

i have such one: http://imgbin.org/index.php?page=image&id=812

> Which keys are triggering these messages?

this is the funny thing because i'm not pressing any keys at all.
the remote control is unused currently becasue i'm using only
pinnacle svideo input for watching sat-tv with tvtime.
--
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: New device: Dikom DK-300 (maybe Kworld 323U rebranded)

2009-10-03 Thread xwang1976

Hi Dainius,
I'm using the modified driver as you suggested but I can't see analog tv
 because the system has a kernel loop when I try to tune the analog
channels.
Does your card have an analog tuner too?
Do you have a v4l branch or do you know if someone has included your
modification in thr main tree?
Thank you,
Xwang

Dainius Ridzevicius ha scritto:

Hi,

replace files in /v4l-dvb/linux/drivers/media/video/em28xx
with attached ones and make all v4l-dvb.
make && make install. Reboot to clean old modules.

DVB-T on kwordl 323ur is working, watching TV for an hour now.

regards,


On Thu, Aug 13, 2009 at 4:22 PM, > wrote:


Yes,
I'm still interested.
I suppose it is the same device.
In the next days I hope I will be able to take an usbsnoop of the
device under windows xp.
Meantime, I would like to test your drive.
Regards,
Xwang

Dainius Ridzevicius ha scritto:

Hello,

I have got Kworld 323UR hybrid tuner and managed to get dvb-t
lock today, will do some more testing later, but I can email or
post you a link for v4l-dvb sources changed by me (from todays
mercurial) if You are still interested.

Regards,
Dainius


-- 
-





--
-


--
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] tuner-simple: possible read buffer overflow?

2009-10-03 Thread Roel Kluin
Prevent read from t_params->ranges[-1].

Signed-off-by: Roel Kluin 
---
This is only required when t_params->count can be 0, can it?

Roel

diff --git a/drivers/media/common/tuners/tuner-simple.c 
b/drivers/media/common/tuners/tuner-simple.c
index 8abbcc5..e679d5f 100644
--- a/drivers/media/common/tuners/tuner-simple.c
+++ b/drivers/media/common/tuners/tuner-simple.c
@@ -266,7 +266,7 @@ static int simple_config_lookup(struct dvb_frontend *fe,
continue;
break;
}
-   if (i == t_params->count) {
+   if (i == t_params->count && i) {
tuner_dbg("frequency out of range (%d > %d)\n",
  *frequency, t_params->ranges[i - 1].limit);
*frequency = t_params->ranges[--i].limit;
--
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: [2.6.31] ir-kbd-i2c oops.

2009-10-03 Thread Jean Delvare
Hi Pawel,

Please keep the list Cc'd.

On Sat, 3 Oct 2009 17:30:44 +0200, Paweł Sikora wrote:
> On Saturday 03 October 2009 14:04:47 you wrote:
> > OK. So the bug is exactly what I said on my very first reply. And the
> > patch I pointed you to back then should have fixed it:
> > http://patchwork.kernel.org/patch/45707/
> > You said it didn't, which makes me wonder if you really tested it
> > properly...
> 
> hmm, it's possible that i've ran system with wrong initrd
> and it had loaded unpatched /lib/modules/$build.
> i've tested patch 45707 today and it works, so my fault.
> 
> moreover, with this patch i'm observing a flood in dmesg:
> 
> [  938.313245] i2c IR (Pinnacle PCTV): unknown key: key=0x12 raw=0x12 down=1
> [  938.419914] i2c IR (Pinnacle PCTV): unknown key: key=0x12 raw=0x12 down=0
> [  939.273249] i2c IR (Pinnacle PCTV): unknown key: key=0x24 raw=0x24 down=1
> [  939.379955] i2c IR (Pinnacle PCTV): unknown key: key=0x24 raw=0x24 down=0

Different issue, and I don't know much about IR support, but these keys
aren't listed in ir_codes_pinnacle_color. Maybe you have a different
variant of this remote control with more keys and we need to add their
definitions. Which keys are triggering these messages?

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


[PATCH] pac7311: add comment about JPEG header

2009-10-03 Thread Németh Márton
From: Márton Németh 

Add comment about the meaning of the fixed JPEG header bytes used to
create each image.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh 
---
diff -upr e/drivers/media/video/gspca/pac7311.c 
f/drivers/media/video/gspca/pac7311.c
--- e/drivers/media/video/gspca/pac7311.c   2009-10-03 16:23:37.0 
+0200
+++ f/drivers/media/video/gspca/pac7311.c   2009-10-03 19:56:21.0 
+0200
@@ -801,13 +801,32 @@ static void do_autogain(struct gspca_dev
sd->autogain_ignore_frames = PAC_AUTOGAIN_IGNORE_FRAMES;
 }

+/* JPEG header, part 1 */
 static const unsigned char pac7311_jpeg_header1[] = {
-  0xff, 0xd8, 0xff, 0xc0, 0x00, 0x11, 0x08
+  0xff, 0xd8,  /* SOI: Start of Image */
+
+  0xff, 0xc0,  /* SOF0: Start of Frame (Baseline DCT) */
+  0x00, 0x11,  /* length = 17 bytes (including this length field) */
+  0x08 /* Precision: 8 */
+  /* 2 bytes is placed here: number of image lines */
+  /* 2 bytes is placed here: samples per line */
 };

+/* JPEG header, continued */
 static const unsigned char pac7311_jpeg_header2[] = {
-  0x03, 0x01, 0x21, 0x00, 0x02, 0x11, 0x01, 0x03, 0x11, 0x01, 0xff, 0xda,
-  0x00, 0x0c, 0x03, 0x01, 0x00, 0x02, 0x11, 0x03, 0x11, 0x00, 0x3f, 0x00
+  0x03,/* Number of image components: 3 */
+  0x01, 0x21, 0x00,/* ID=1, Subsampling 1x1, Quantization table: 0 */
+  0x02, 0x11, 0x01,/* ID=2, Subsampling 2x1, Quantization table: 1 */
+  0x03, 0x11, 0x01,/* ID=3, Subsampling 2x1, Quantization table: 1 */
+
+  0xff, 0xda,  /* SOS: Start Of Scan */
+  0x00, 0x0c,  /* length = 12 bytes (including this length field) */
+  0x03,/* number of components: 3 */
+  0x01, 0x00,  /* selector 1, table 0x00 */
+  0x02, 0x11,  /* selector 2, table 0x11 */
+  0x03, 0x11,  /* selector 3, table 0x11 */
+  0x00, 0x3f,  /* Spectral selection: 0 .. 63 */
+  0x00 /* Successive approximation: 0 */
 };

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


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

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

Results of the daily build of v4l-dvb:

date:Sat Oct  3 19:00:03 CEST 2009
path:http://www.linuxtv.org/hg/v4l-dvb
changeset:   13044:6b7617d4a0be
gcc version: gcc (GCC) 4.3.1
hardware:x86_64
host os: 2.6.26

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

Detailed results are available here:

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

Full logs are available here:

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

The V4L2 specification failed to build, but the last compiled spec is here:

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

The DVB API specification from this daily build is here:

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

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


Re: AVerTV MCE 116 Plus remote

2009-10-03 Thread Aleksandr V. Piskunov
On Sat, Oct 03, 2009 at 09:19:07AM -0400, Andy Walls wrote:
> On Sat, 2009-10-03 at 00:49 +0300, Aleksandr V. Piskunov wrote:
> > Preliminary version of patch adding support for AVerTV MCE 116 Plus remote.
> > This board has an IR sensor is connected to EM78P153S, general purpose 8-bit
> > microcontroller with a 1024 × 13 bits of OTP-ROM. According to i2cdetect, 
> > it is
> > sitting on address 0x40.
> > 
> > Patch allows ir-kbd-i2c to probe cx2341x boards for this address. Manually
> > loading ir-kbd-i2c now detects remote, every key is working as expected.
> > 
> > As I understand, current I2C/probing code is being redesigned/refactored. 
> > Sheer
> > amount of #ifdefs for every second kernel version is making my eyes bleed, 
> > so
> > please somebody involved check if patch is ok. 
> 
> 
> Aleksandr,
> 
> 
> > Should I also add the 0x40 address to addr_list[] in ivtv-i2c.c? How to 
> > point
> > ivtv to this remote and autoload ir-kbd-i2c?
> 
> No.
> 
> 
> At first glance, this patch doesn't look safe for all ivtv boards so:
> 
>   Naked-by: Andy Walls 
> 
> 
> In ivtv-i2c.c I see:
> 
>   #define IVTV_MSP3400_I2C_ADDR   0x40
> 
> It is probably not good to assume that only an IR microcontroller could
> be at I2C address 0x40 for a CX2341x adapter.
> 

Yea, that did confuse me too yesterday, saw it while searching sources for 0x40.
Thanks for pointing out the problem! Besides after some testing I don't really 
like
the way that IR controller behaves, doesn't always catch keypresses, repeats
chaotically and sends wrong keygroup codes from time to time. Basically in 
order to
get a more or less stable keypress, one has to "doubleclick" the button on 
remote,
strange..

> I will work up an ivtv specific change similar to what I did in
> cx18-cards.c and cx18-i2c.c for IR on the HVR-1600 for bringing up the
> IR for the M116 cards alone.
> 
> What kernel version do you use?
> 

2.8.28, can easily switch to any later for testing.
--
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 resend] firedtv: length field corrupt in ca2host if length>127

2009-10-03 Thread Henrik Kurelid
Hi,

Comments inline.

Regards,
Henrik

> From: Henrik Kurelid 
>
> This solves a problem in firedtv that has become major for Swedish DVB-T
> users the last month or so.  It will most likely solve issues seen by
> other users as well.
>
> If the length of an AVC message is greater than 127, the length field
> should be encoded in LV mode instead of V mode. V mode can only be used
> if the length is 127 or less. This patch ensures that the CA_PMT
> message is always encoded in LV mode so PMT message of greater lengths
> can be supported.
>
> Signed-off-by: Henrik Kurelid 
> Signed-off-by: Stefan Richter 
> ---
>
> On  2 Oct, Henrik Kurelid wrote:
>> Here is a patch that solves a problem in firedtv that has become major for
>> Swedish DVB-T users the last month or so.
>> It will most likely solve issues seen by other users as well.
>> Please review and comment.
>
> I don't have a CA module, hence can't test it myself.  Is the message
> format vendor-defined or ist there a standard for this?
The Ca2Host and Host2Ca messages are vendor specific. According to the 
documentation from DE the same message structure applies to all cards
independent of the delivery system. The patch have been verified by myself on 
DVB-T+CA and at least one user on the DE forums with a similar setup.

> Anyway, I am resending this patch for Mauro to apply, since the original
> posting had lines wrapped.  I also took the liberty to standardize the
> hexadecimal constants to lowercase to match the rest of firedtv-avc.c.
Thanks for cleaning up my mess again, Stefan. I really need to configure my 
mail agent better!

>  drivers/media/dvb/firewire/firedtv-avc.c |   38 ---
>  1 file changed, 20 insertions(+), 18 deletions(-)
>
> Index: linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
> ===
> --- linux-2.6.32-rc1.orig/drivers/media/dvb/firewire/firedtv-avc.c
> +++ linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
> @@ -1050,28 +1050,28 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
>   c->operand[4] = 0; /* slot */
>   c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
>   c->operand[6] = 0; /* more/last */
> - /* c->operand[7] = XXXprogram_info_length + 17; */ /* length */
> - c->operand[8] = list_management;
> - c->operand[9] = 0x01; /* pmt_cmd=OK_descramble */
> + /* Use three bytes for length field in case length > 127 */
> + c->operand[10] = list_management;
> + c->operand[11] = 0x01; /* pmt_cmd=OK_descramble */
>
>   /* TS program map table */
>
> - c->operand[10] = 0x02; /* Table id=2 */
> - c->operand[11] = 0x80; /* Section syntax + length */
> - /* c->operand[12] = XXXprogram_info_length + 12; */
> - c->operand[13] = msg[1]; /* Program number */
> - c->operand[14] = msg[2];
> - c->operand[15] = 0x01; /* Version number=0 + current/next=1 */
> - c->operand[16] = 0x00; /* Section number=0 */
> - c->operand[17] = 0x00; /* Last section number=0 */
> - c->operand[18] = 0x1f; /* PCR_PID=1FFF */
> - c->operand[19] = 0xff;
> - c->operand[20] = (program_info_length >> 8); /* Program info length */
> - c->operand[21] = (program_info_length & 0xff);
> + c->operand[12] = 0x02; /* Table id=2 */
> + c->operand[13] = 0x80; /* Section syntax + length */
> + /* c->operand[14] = XXXprogram_info_length + 12; */
> + c->operand[15] = msg[1]; /* Program number */
> + c->operand[16] = msg[2];
> + c->operand[17] = 0x01; /* Version number=0 + current/next=1 */
> + c->operand[18] = 0x00; /* Section number=0 */
> + c->operand[19] = 0x00; /* Last section number=0 */
> + c->operand[20] = 0x1f; /* PCR_PID=1FFF */
> + c->operand[21] = 0xff;
> + c->operand[22] = (program_info_length >> 8); /* Program info length */
> + c->operand[23] = (program_info_length & 0xff);
>
>   /* CA descriptors at programme level */
>   read_pos = 6;
> - write_pos = 22;
> + write_pos = 24;
>   if (program_info_length > 0) {
>   pmt_cmd_id = msg[read_pos++];
>   if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
> @@ -1113,8 +1113,10 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
>   c->operand[write_pos++] = 0x00;
>   c->operand[write_pos++] = 0x00;
>
> - c->operand[7] = write_pos - 8;
> - c->operand[12] = write_pos - 13;
> + c->operand[7] = 0x82;
> + c->operand[8] = (write_pos - 10) >> 8;
> + c->operand[9] = (write_pos - 10) & 0xff;
> + c->operand[14] = write_pos - 15;
>
>   crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1);
>   c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff;
>
>
> --
> Stefan Richter
> -=-==--= =-=- ---==
> http://arcgraph.de/sr/
>

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


[REVIEW] ivtv, ir-kbd-i2c: Explicit IR support for the AVerTV M116 for newer kernels

2009-10-03 Thread Andy Walls
Aleksandr and Jean,

Zdrastvoitye & Bonjour,

To support the AVerMedia M166's IR microcontroller in ivtv and
ir-kbd-i2c with the new i2c binding model, I have added 3 changesets in

http://linuxtv.org/hg/~awalls/ivtv

01/03: ivtv: Defer legacy I2C IR probing until after setup of known I2C devices
http://linuxtv.org/hg/~awalls/ivtv?cmd=changeset;node=3d243437f046

02/03: ivtv: Add explicit IR controller initialization for the AVerTV M116
http://linuxtv.org/hg/~awalls/ivtv?cmd=changeset;node=0127ed2ea55b

03/03: ir-kbd-i2c: Add support for the AVerTV M116 with the new binding model
http://linuxtv.org/hg/~awalls/ivtv?cmd=changeset;node=c10e0d5d895c


 ir-kbd-i2c.c   |1 
 ivtv/ivtv-cards.c  |3 -
 ivtv/ivtv-cards.h  |   35 +++---
 ivtv/ivtv-driver.c |3 +
 ivtv/ivtv-i2c.c|  128 ++---
 ivtv/ivtv-i2c.h|1 
 6 files changed, 118 insertions(+), 53 deletions(-)

I cannot really test them as I still am using an older kernel.  Could
you please review, and test them if possible?

Change 01/03 actually fixes a problem I inadvertantly let slip by for
ivtv in newer kernels, because I missed it in my initial review.  In
ivtv, we should really only do IR chip probing after all other known I2C
devices on a card are registered.

Regards,
Andy

--
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] drivers/media/dvb/dvb-usb: memset region size error

2009-10-03 Thread Jan Ceuleers
>From bb568359751d84b485dbbf04f1317a77c6c3f6f0 Mon Sep 17 00:00:00 2001
From: Jan Ceuleers 
Date: Sat, 3 Oct 2009 16:58:51 +0200
Subject: [PATCH] drivers/media/dvb/dvb-usb: memset region size error

The size of the region to be memset() should be the size
of the target rather than the size of the pointer to it.

Compile-tested only.

Signed-off-by: Jan Ceuleers 
---
 drivers/media/dvb/dvb-usb/ce6230.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/dvb/dvb-usb/ce6230.c 
b/drivers/media/dvb/dvb-usb/ce6230.c
index 0737c63..3df2045 100644
--- a/drivers/media/dvb/dvb-usb/ce6230.c
+++ b/drivers/media/dvb/dvb-usb/ce6230.c
@@ -105,7 +105,7 @@ static int ce6230_i2c_xfer(struct i2c_adapter *adap, struct 
i2c_msg msg[],
int i = 0;
struct req_t req;
int ret = 0;
-   memset(&req, 0, sizeof(&req));
+   memset(&req, 0, sizeof(req));
 
if (num > 2)
return -EINVAL;
-- 
1.5.4.3

--
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] drivers/media/video/em28xx: memset region size error

2009-10-03 Thread Jan Ceuleers
>From 2082ccb34a1ef5f67ec0618ed05d2f15c67d1da0 Mon Sep 17 00:00:00 2001
From: Jan Ceuleers 
Date: Sat, 3 Oct 2009 16:51:31 +0200
Subject: [PATCH] drivers/media/video/em28xx: memset region size error

The size of the region to be memset() should be the size
of the target rather than the size of the pointer to it.

Compile-tested only.

Signed-off-by: Jan Ceuleers 
---
 drivers/media/video/em28xx/em28xx-cards.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/em28xx/em28xx-cards.c 
b/drivers/media/video/em28xx/em28xx-cards.c
index bdb249b..dd4f19b 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -2234,7 +2234,7 @@ void em28xx_register_i2c_ir(struct em28xx *dev)
if (disable_ir)
return;
 
-   memset(&dev->info, 0, sizeof(&dev->info));
+   memset(&dev->info, 0, sizeof(dev->info));
memset(&dev->init_data, 0, sizeof(dev->init_data));
strlcpy(dev->info.type, "ir_video", I2C_NAME_SIZE);
 
-- 
1.5.4.3
--
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] pac7311: remove redundant register page switching

2009-10-03 Thread Németh Márton
Hi,

do you know any reason (i.e. a special device needs this) why switch to
register page 0 is done twice in the setcolors() function of pac7311?

I removed the redundant page switch and my Labtec Webcam 2200 still
behaves correctly when I change the "Saturation" control.

Regards,

Márton Németh

---
From: Márton Németh 

Remove redundant register page switching to page 0 when changing the
color control.

The change was tested with Labtec Webcam 2200 (USB ID: 093a:2626).

Signed-off-by: Márton Németh 
---
diff -upr d/drivers/media/video/gspca/pac7311.c 
e/drivers/media/video/gspca/pac7311.c
--- d/drivers/media/video/gspca/pac7311.c   2009-10-03 09:02:31.0 
+0200
+++ e/drivers/media/video/gspca/pac7311.c   2009-10-03 16:23:37.0 
+0200
@@ -579,7 +579,6 @@ static void setcolors(struct gspca_dev *
reg_w(gspca_dev, 0xff, 0x03);   /* page 3 */
reg_w(gspca_dev, 0x11, 0x01);
reg_w(gspca_dev, 0xff, 0x00);   /* page 0 */
-   reg_w(gspca_dev, 0xff, 0x00);   /* page 0 */
for (i = 0; i < 9; i++) {
v = a[i] * sd->colors / COLOR_MAX + b[i];
reg_w(gspca_dev, 0x0f + 2 * i, (v >> 8) & 0x07);
--
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] drivers/media/video/saa7164: memset region size error

2009-10-03 Thread Jan Ceuleers
>From 357033c321c3d9a98300b7dbe330fbb5008c092b Mon Sep 17 00:00:00 2001
From: Jan Ceuleers 
Date: Sat, 3 Oct 2009 16:42:15 +0200
Subject: [PATCH] drivers/media/video/saa7164: memset region size error

The size of the region to be memset() should be the size
of the target rather than the size of the pointer to it.

Compile-tested only.

Signed-off-by: Jan Ceuleers 
---
 drivers/media/video/saa7164/saa7164-cmd.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/saa7164/saa7164-cmd.c 
b/drivers/media/video/saa7164/saa7164-cmd.c
index c45966e..9c1d3ac 100644
--- a/drivers/media/video/saa7164/saa7164-cmd.c
+++ b/drivers/media/video/saa7164/saa7164-cmd.c
@@ -347,7 +347,7 @@ int saa7164_cmd_send(struct saa7164_dev *dev, u8 id, 
tmComResCmd_t command,
 
/* Prepare some basic command/response structures */
memset(&command_t, 0, sizeof(command_t));
-   memset(&response_t, 0, sizeof(&response_t));
+   memset(&response_t, 0, sizeof(response_t));
pcommand_t = &command_t;
presponse_t = &response_t;
command_t.id = id;
-- 
1.5.4.3

--
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: Viewing HD?

2009-10-03 Thread HoP
Seems your installed ffmpeg libavcodec library
has no support for PAFF+spatial. Check if update
of such library can help.

Good starting point for PAFF understanging:
http://forum.doom9.org/showthread.php?p=927675

and mplayer with PAFF:
http://forum.doom9.org/archive/index.php/t-130797.html

/Honza

PS: I'm not sure if this ML is correct target for your question
as it is main development ML for linux-media (v4l2+dvb)
subsystem inside kernel. Your question is rather application specific.

2009/10/3 Mikhail Ramendik :
> Hello,
>
> I have an AverMedia Pro A700 DVB-S card, working well with Kaffeine;
> the dish is tuned to Astra 28.2E (in Ireland).
>
> However, I am unable to view HD. I tried BBC HD and nothing is shown;
> the terminal output mentions "illegal aspect ratio".
>
> Instant recording worked. In mplayer, the result was viewed very
> jerkily, with many messages saying "PAFF + spatial direct mode is not
> implemented"; the codec was ffmpeg h.264. CPU load was maxed out
> (Pentium 3 GHz).
>
> Is there any way to view HD - live or recorded? Or if the CPU is not
> powerful enough, which will be? And, as a CPU workaround, is there a
> way to recode in non-realtime, without losing data? (With the "not
> implemented" messages, I am wary of using mencoder).
>
> --
> Yours, Mikhail Ramendik
> --
> 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: Viewing HD?

2009-10-03 Thread Anssi Hannula
Mikhail Ramendik wrote:
> Hello,

Hi!

[...]
> Instant recording worked. In mplayer, the result was viewed very
> jerkily, with many messages saying "PAFF + spatial direct mode is not
> implemented"; the codec was ffmpeg h.264. CPU load was maxed out
> (Pentium 3 GHz).

AFAIK this support was added quite some time ago; you need to upgrade
your mplayer.

-- 
Anssi Hannula
--
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_camera + mt9m1111: Failed to configure for format 50323234

2009-10-03 Thread Antonio Ospite
On Sat, 3 Oct 2009 01:27:04 +0200 (CEST)
Guennadi Liakhovetski  wrote:

> On Fri, 2 Oct 2009, Antonio Ospite wrote:
> 
> > Hi,
> > 
> > after updating to 2.6.32-rc2 I can't capture anymore with the setup in the
> > subject.
> 
> Indeed:-( Please, verify, that this patch fixes your problem (completely 
> untested), if it does, I'll push it for 2.6.32:
> 
> pxa_camera: fix camera pixel format configuration
> 
> A typo prevents correct picel format negotiation with client drivers.
>

typo in the log message too :) s/picel/pixel/
 
> Signed-off-by: Guennadi Liakhovetski 
> ---
> diff --git a/drivers/media/video/pxa_camera.c 
> b/drivers/media/video/pxa_camera.c
> index 6952e96..aa831d5 100644
> --- a/drivers/media/video/pxa_camera.c
> +++ b/drivers/media/video/pxa_camera.c
> @@ -1432,7 +1432,9 @@ static int pxa_camera_set_fmt(struct soc_camera_device 
> *icd,
>   icd->sense = &sense;
>  
>   cam_f.fmt.pix.pixelformat = cam_fmt->fourcc;
> - ret = v4l2_subdev_call(sd, video, s_fmt, f);
> + ret = v4l2_subdev_call(sd, video, s_fmt, &cam_f);
> + cam_f.fmt.pix.pixelformat = pix->pixelformat;
> + *pix = cam_f.fmt.pix;
>  
>   icd->sense = NULL;

Ok, I can capture again even by only fixing the typo: s/f/&cam_f/
but I don't know if this is complete.

Anyways your patch works, but the picture is now shifted, see:
http://people.openezx.org/ao2/a780-pxa-camera-mt9m111-shifted.jpg

Is this because of the new cropping code?

Thanks,
   Antonio

-- 
Antonio Ospite
http://ao2.it

PGP public key ID: 0x4553B001

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


pgp6rApMQImdK.pgp
Description: PGP signature


Patch for TeVii S470

2009-10-03 Thread Niels Ole Salscheider
Hello,

I have downloaded and compiled the linuxtv sources from 
http://mercurial.intuxication.org/hg/s2-liplianin in order to get my TeVii 
S470 working. Nevertheless, I get the folowing error if I try to tune any 
channel:

Oct  3 11:15:51 Server kernel: ds3000_firmware_ondemand: Waiting for firmware 
upload (dvb-fe-ds3000.fw)...
Oct  3 11:15:51 Server kernel: i2c-adapter i2c-1: firmware: requesting dvb-fe-
ds3000.fw
Oct  3 11:15:51 Server kernel: [ cut here ]
Oct  3 11:15:51 Server kernel: WARNING: at fs/sysfs/dir.c:487 
sysfs_add_one+0x12d/0x160()
Oct  3 11:15:51 Server kernel: Hardware name: System Product Name
Oct  3 11:15:51 Server kernel: sysfs: cannot create duplicate filename 
'/devices/pci:00/:00:05.0/:02:00.0/i2c-adapter/i2c-1/i2c-1'
Oct  3 11:15:51 Server kernel: Modules linked in: af_packet hwmon_vid i2c_dev 
powernow_k8 kvm_amd kvm nfsd nfs_acl exportfs nfs lockd auth_rpcgss sunrpc 
dvb_pll ds3000 stv0299 cx23885 cx2341x v4l2_common videodev v4l1_compat 
b2c2_flexcop_pci v4l2_compat_ioctl32 b2c2_flexcop videobuf_dma_sg videobuf_dvb 
dvb_core videobuf_core processor i2c_piix4 btcx_risc cx24123 atiixp thermal 
tveeprom ide_core cx24113 ehci_hcd ohci_hcd s5h1420 thermal_sys shpchp usbcore 
floppy atl1 ata_generic 8250_pnp rtc_cmos pata_acpi rtc_core pci_hotplug 8250 
mii sg serial_core k8temp rtc_lib hwmon button unix
Oct  3 11:15:51 Server kernel: Pid: 2548, comm: kdvb-ad-1-fe-0 Not tainted 
2.6.31-gentoo #1
Oct  3 11:15:51 Server kernel: Call Trace:
Oct  3 11:15:51 Server kernel: [] ? sysfs_add_one+0x12d/0x160
Oct  3 11:15:51 Server kernel: [] ? 
warn_slowpath_common+0x89/0x100
Oct  3 11:15:51 Server kernel: [] ? sysfs_pathname+0x44/0x70
Oct  3 11:15:51 Server kernel: [] ? 
warn_slowpath_fmt+0x61/0x90
Oct  3 11:15:51 Server kernel: [] ? sysfs_pathname+0x44/0x70
Oct  3 11:15:51 Server kernel: [] ? 
kmem_cache_alloc+0x9b/0x160
Oct  3 11:15:51 Server kernel: [] ? sysfs_pathname+0x44/0x70
Oct  3 11:15:51 Server kernel: [] ? sysfs_add_one+0x12d/0x160
Oct  3 11:15:51 Server kernel: [] ? create_dir+0x70/0xe0
Oct  3 11:15:51 Server kernel: [] ? sysfs_create_dir+0x3f/0x70
Oct  3 11:15:51 Server kernel: [] ? 
kobject_add_internal+0x109/0x210
Oct  3 11:15:51 Server kernel: [] ? kobject_add+0x64/0xb0
Oct  3 11:15:51 Server kernel: [] ? dev_set_name+0x5d/0x80
Oct  3 11:15:51 Server kernel: [] ? kobject_get+0x26/0x50
Oct  3 11:15:51 Server kernel: [] ? device_add+0x18f/0x680
Oct  3 11:15:51 Server kernel: [] ? 
_request_firmware+0x2ae/0x5d0
Oct  3 11:15:51 Server kernel: [] ? ds3000_tune+0xaf6/0xe98 
[ds3000]
Oct  3 11:15:51 Server kernel: [] ? 
try_to_del_timer_sync+0x64/0x90
Oct  3 11:15:51 Server kernel: [] ? 
dvb_frontend_swzigzag_autotune+0xe1/0x260 [dvb_core]
Oct  3 11:15:51 Server kernel: [] ? process_timeout+0x0/0x40
Oct  3 11:15:51 Server kernel: [] ? 
dvb_frontend_swzigzag+0x26a/0x2c0 [dvb_core]
Oct  3 11:15:51 Server kernel: [] ? 
dvb_frontend_thread+0x450/0x770 [dvb_core]
Oct  3 11:15:51 Server kernel: [] ? 
autoremove_wake_function+0x0/0x60
Oct  3 11:15:51 Server kernel: [] ? 
dvb_frontend_thread+0x0/0x770 [dvb_core]
Oct  3 11:15:51 Server kernel: [] ? 
dvb_frontend_thread+0x0/0x770 [dvb_core]
Oct  3 11:15:51 Server kernel: [] ? kthread+0xb6/0xd0
Oct  3 11:15:51 Server kernel: [] ? child_rip+0xa/0x20
Oct  3 11:15:51 Server kernel: [] ? kthread+0x0/0xd0
Oct  3 11:15:51 Server kernel: [] ? child_rip+0x0/0x20
Oct  3 11:15:51 Server kernel: ---[ end trace 478953c6d1c9275f ]---


The following patch solves this problem for me:

diff -r 82a256f5d842 linux/drivers/media/dvb/frontends/ds3000.c
--- a/linux/drivers/media/dvb/frontends/ds3000.cWed Sep 23 20:44:12 
2009 +0300
+++ b/linux/drivers/media/dvb/frontends/ds3000.cSat Oct 03 15:28:52 
2009 +0200
@@ -444,7 +444,7 @@
/* Load firmware */
/* request the firmware, this will block until someone uploads 
it */
printk("%s: Waiting for firmware upload (%s)...\n", __func__, 
DS3000_DEFAULT_FIRMWARE);
-   ret = request_firmware(&fw, DS3000_DEFAULT_FIRMWARE, &state-
>i2c->dev);
+   ret = request_firmware(&fw, DS3000_DEFAULT_FIRMWARE, state-
>i2c->dev.parent);
printk("%s: Waiting for firmware upload(2)...\n", __func__);
if (ret) {
printk("%s: No firmware uploaded (timeout or file not 
found?)\n", __func__);

Kind regards

Ole
--
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: AVerTV MCE 116 Plus remote

2009-10-03 Thread Andy Walls
On Sat, 2009-10-03 at 00:49 +0300, Aleksandr V. Piskunov wrote:
> Preliminary version of patch adding support for AVerTV MCE 116 Plus remote.
> This board has an IR sensor is connected to EM78P153S, general purpose 8-bit
> microcontroller with a 1024 × 13 bits of OTP-ROM. According to i2cdetect, it 
> is
> sitting on address 0x40.
> 
> Patch allows ir-kbd-i2c to probe cx2341x boards for this address. Manually
> loading ir-kbd-i2c now detects remote, every key is working as expected.
> 
> As I understand, current I2C/probing code is being redesigned/refactored. 
> Sheer
> amount of #ifdefs for every second kernel version is making my eyes bleed, so
> please somebody involved check if patch is ok. 


Aleksandr,


> Should I also add the 0x40 address to addr_list[] in ivtv-i2c.c? How to point
> ivtv to this remote and autoload ir-kbd-i2c?

No.


At first glance, this patch doesn't look safe for all ivtv boards so:

Naked-by: Andy Walls 


In ivtv-i2c.c I see:

#define IVTV_MSP3400_I2C_ADDR   0x40

It is probably not good to assume that only an IR microcontroller could
be at I2C address 0x40 for a CX2341x adapter.

I will work up an ivtv specific change similar to what I did in
cx18-cards.c and cx18-i2c.c for IR on the HVR-1600 for bringing up the
IR for the M116 cards alone.

What kernel version do you use?

Regards,
Andy


> diff --git a/linux/drivers/media/video/ir-kbd-i2c.c 
> b/linux/drivers/media/video/ir-kbd-i2c.c
> --- a/linux/drivers/media/video/ir-kbd-i2c.c
> +++ b/linux/drivers/media/video/ir-kbd-i2c.c
> @@ -461,7 +461,7 @@
>   }
>   break;
>   case 0x40:
> - name= "AVerMedia Cardbus remote";
> + name= "AVerMedia RM-FP/RM-KH remote";
>   ir->get_key = get_key_avermedia_cardbus;
>   ir_type = IR_TYPE_OTHER;
>   ir_codes= &ir_codes_avermedia_cardbus_table;
> @@ -706,8 +706,12 @@
>   ir_attach(adap, msg.addr, 0, 0);
>   }
>  
> - /* Special case for AVerMedia Cardbus remote */
> - if (adap->id == I2C_HW_SAA7134) {
> + /* Special case for AVerMedia remotes:
> +* AVerTV Hybrid+FM Cardbus
> +* AVerTV MCE 116 Plus
> +* probably others with RM-FP, RM-KH remotes and microcontroller
> +  chip @ 0x40 */
> + if ((adap->id == I2C_HW_SAA7134) || (adap->id == I2C_HW_B_CX2341X)) {
>   unsigned char subaddr, data;
>   struct i2c_msg msg[] = { { .addr = 0x40, .flags = 0,
>  .buf = &subaddr, .len = 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


Viewing HD?

2009-10-03 Thread Mikhail Ramendik
Hello,

I have an AverMedia Pro A700 DVB-S card, working well with Kaffeine;
the dish is tuned to Astra 28.2E (in Ireland).

However, I am unable to view HD. I tried BBC HD and nothing is shown;
the terminal output mentions "illegal aspect ratio".

Instant recording worked. In mplayer, the result was viewed very
jerkily, with many messages saying "PAFF + spatial direct mode is not
implemented"; the codec was ffmpeg h.264. CPU load was maxed out
(Pentium 3 GHz).

Is there any way to view HD - live or recorded? Or if the CPU is not
powerful enough, which will be? And, as a CPU workaround, is there a
way to recode in non-realtime, without losing data? (With the "not
implemented" messages, I am wary of using mencoder).

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


[PATCH 3/3] gspca_gl860

2009-10-03 Thread Olivier Lorin

gspca - gl860: add flip/mirror for OV2640

From: Olivier Lorin 

- add flip/mirror support for OV2640
- fix for backlight value range
- fix for red-blue inversion hue mode with V4L1 applications

diff -rupN ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860.h 
./linux/drivers/media/video/gspca/gl860/gl860.h
--- ../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860.h   
2009-09-24 23:16:10.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.h2009-09-24 
23:55:32.0 +0200

@@ -23,7 +23,7 @@
#include "gspca.h"

#define MODULE_NAME "gspca_gl860"
-#define DRIVER_VERSION "0.9d11"
+#define DRIVER_VERSION "0.9e"

#define ctrl_in  gl860_RTx
#define ctrl_out gl860_RTx
diff -rupN 
../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860-ov2640.c 
./linux/drivers/media/video/gspca/gl860/gl860-ov2640.c
--- 
../gspca-msrc2/linux/drivers/media/video/gspca/gl860/gl860-ov2640.c   
2009-09-24 23:34:57.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860-ov2640.c2009-09-30 
00:40:49.0 +0200

@@ -107,36 +107,6 @@ static struct validx tbl_sensor_settings
{0x6001, 0x00ff}, {0x6038, 0x000c},
{10, 0x},
{0x6000, 0x0011},
-/* backlight=31/64 */
-{0x6001, 0x00ff}, {0x603e, 0x0024}, {0x6034, 0x0025},
-/* bright=0/256 */
-{0x6000, 0x00ff}, {0x6009, 0x007c}, {0x6000, 0x007d},
-/* wbal=64/128 */
-{0x6000, 0x00ff}, {0x6003, 0x007c}, {0x6040, 0x007d},
-/* cntr=0/256 */
-{0x6000, 0x00ff}, {0x6007, 0x007c}, {0x6000, 0x007d},
-/* sat=128/256 */
-{0x6000, 0x00ff}, {0x6001, 0x007c}, {0x6080, 0x007d},
-/* sharpness=0/32 */
-{0x6000, 0x00ff}, {0x6001, 0x0092}, {0x60c0, 0x0093},
-/* hue=0/256 */
-{0x6000, 0x00ff}, {0x6002, 0x007c}, {0x6000, 0x007d},
-/* gam=32/64 */
-{0x6000, 0x00ff}, {0x6008, 0x007c}, {0x6020, 0x007d},
-/* image right up */
-{0x, 0x},
-{15, 0x},
-{0x6001, 0x00ff}, {0x6000, 0x8004},
-{0x, 0x},
-{0x60a8, 0x0004},
-{15, 0x},
-{0x6001, 0x00ff}, {0x6000, 0x8004},
-{0x, 0x},
-{0x60f8, 0x0004},
-/* image right up */
-{0x, 0x},
-/* backlight=31/64 */
-{0x6001, 0x00ff}, {0x603e, 0x0024}, {0x6034, 0x0025},
};

static struct validx tbl_640[] = {
@@ -222,17 +192,19 @@ void ov2640_init_settings(struct gspca_d
sd->vcur.hue=   0;
sd->vcur.saturation = 128;
sd->vcur.whitebal   =  64;
+sd->vcur.mirror =   0;
+sd->vcur.flip   =   0;

sd->vmax.backlight  =  64;
sd->vmax.brightness = 255;
sd->vmax.sharpness  =  31;
sd->vmax.contrast   = 255;
sd->vmax.gamma  =  64;
-sd->vmax.hue= 255 + 1;
+sd->vmax.hue= 254 + 2;
sd->vmax.saturation = 255;
sd->vmax.whitebal   = 128;
-sd->vmax.mirror = 0;
-sd->vmax.flip   = 0;
+sd->vmax.mirror = 1;
+sd->vmax.flip   = 1;
sd->vmax.AC50Hz = 0;

sd->dev_camera_settings = ov2640_camera_settings;
@@ -284,6 +256,8 @@ static int ov2640_init_pre_alt(struct gs
sd->vold.gamma= -1;
sd->vold.hue  = -1;
sd->vold.whitebal = -1;
+sd->vold.mirror = -1;
+sd->vold.flip   = -1;

ov2640_init_post_alt(gspca_dev);

@@ -346,18 +320,6 @@ static int ov2640_init_post_alt(struct g

n = fetch_validx(gspca_dev, tbl_sensor_settings_common2,
ARRAY_SIZE(tbl_sensor_settings_common2));
-ctrl_in(gspca_dev, 0xc0, 2, 0x, 0x, 1, c50);
-keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-ARRAY_SIZE(tbl_sensor_settings_common2), n);
-ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, c28);
-keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-ARRAY_SIZE(tbl_sensor_settings_common2), n);
-ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x8004, 1, ca8);
-keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-ARRAY_SIZE(tbl_sensor_settings_common2), n);
-ctrl_in(gspca_dev, 0xc0, 2, 0x, 0x, 1, c50);
-keep_on_fetching_validx(gspca_dev, tbl_sensor_settings_common2,
-ARRAY_SIZE(tbl_sensor_settings_common2), n);

ov2640_camera_settings(gspca_dev);

@@ -394,6 +356,8 @@ static int ov2640_camera_settings(struct
s32 sat= sd->vcur.saturation;
s32 hue= sd->vcur.hue;
s32 wbal   = sd->vcur.whitebal;
+s32 mirror = (((sd->vcur.mirror > 0) ^ sd->mirrorMask) == 0);
+s32 flip   = (((sd->vcur.flip   > 0) ^ sd->mirrorMask) == 0);

if (backlight != sd->vold.backlight) {
/* No sd->vold.backlight=backlight; (to be done again later) */
@@ -402,9 +366,9 @@ static int ov2640_camera_settings(struct

ctrl_out(gspca_dev, 0x40, 1, 0x6001 , 0x00ff,
0, NULL);
-ctrl_out(gspca_dev, 0x40, 1, 0x601f + backlight , 0x0024,
+ctrl_out(gspca_dev, 0x40, 1, 0x601e + backlight , 0x0024,
0, NULL);
-ctrl_out(gspca_dev, 0x40, 1, 0x

Re: [PATCH 2/3] gspca_gl860

2009-10-03 Thread Olivier Lorin

gspca - gl860: comment changes and naming scheme egalization

From: Olivier Lorin 

- small changes in comments
- unified naming scheme for subdriver variables

Priority: trivial

Signed-off-by: Olivier Lorin 

diff -rupN ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.c 
./linux/drivers/media/video/gspca/gl860/gl860.c
--- ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.c
2009-09-24 13:55:34.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.c2009-09-24 
23:17:32.0 +0200

@@ -1,9 +1,7 @@
-/* @file gl860.c
- * @date 2009-08-27
+/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
+ * Subdriver core
 *
- * Genesys Logic webcam with gl860 subdrivers
- *
- * Driver by Olivier Lorin 
+ * 2009/09/24 Olivier Lorin 
 * GSPCA by Jean-Francois Moine 
 * Thanks BUGabundo and Malmostoso for your amazing help!
 *
diff -rupN ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.h 
./linux/drivers/media/video/gspca/gl860/gl860.h
--- ../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860.h
2009-09-24 14:01:41.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.h2009-09-24 
23:16:10.0 +0200

@@ -1,6 +1,7 @@
-/* @file gl860.h
- * @author Olivier LORIN, tiré du pilote Syntek par Nicolas VIVIEN
- * @date 2009-08-27
+/* GSPCA subdrivers for Genesys Logic webcams with the GL860 chip
+ * Subdriver declarations
+ *
+ * 2009/09/24 Olivier LORIN 
 *
 * 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
diff -rupN 
../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860-mi1320.c 
./linux/drivers/media/video/gspca/gl860/gl860-mi1320.c
--- 
../gspca-msrc/linux/drivers/media/video/gspca/gl860/gl860-mi1320.c
2009-09-18 10:36:24.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860-mi1320.c2009-09-24 
21:24:59.0 +0200

@@ -1,6 +1,5 @@
-/* @file gl860-mi1320.c
- * @author Olivier LORIN from my logs
- * @date 2009-08-27
+/* Subdriver for the GL860 chip with the MI1320 sensor
+ * Author Olivier LORIN from own logs
 *
 * 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
@@ -127,49 +126,49 @@ static u8 dat_wbalBL[] =

static u8 dat_hvflip1[] = {0xf0, 0x00, 0xf1, 0x00};

-static u8 s000[] =
+static u8 dat_common00[] =
"\x00\x01\x07\x6a\x06\x63\x0d\x6a" "\xc0\x00\x10\x10\xc1\x03\xc2\x42"
"\xd8\x04\x58\x00\x04\x02";
-static u8 s001[] =
+static u8 dat_common01[] =
"\x0d\x00\xf1\x0b\x0d\x00\xf1\x08" "\x35\x00\xf1\x22\x68\x00\xf1\x5d"
"\xf0\x00\xf1\x01\x06\x70\xf1\x0e" "\xf0\x00\xf1\x02\xdd\x18\xf1\xe0";
-static u8 s002[] =
+static u8 dat_common02[] =
"\x05\x01\xf1\x84\x06\x00\xf1\x44" "\x07\x00\xf1\xbe\x08\x00\xf1\x1e"
"\x20\x01\xf1\x03\x21\x84\xf1\x00" "\x22\x0d\xf1\x0f\x24\x80\xf1\x00"
"\x34\x18\xf1\x2d\x35\x00\xf1\x22" "\x43\x83\xf1\x83\x59\x00\xf1\xff";
-static u8 s003[] =
+static u8 dat_common03[] =
"\xf0\x00\xf1\x02\x39\x06\xf1\x8c" "\x3a\x06\xf1\x8c\x3b\x03\xf1\xda"
"\x3c\x05\xf1\x30\x57\x01\xf1\x0c" "\x58\x01\xf1\x42\x59\x01\xf1\x0c"
"\x5a\x01\xf1\x42\x5c\x13\xf1\x0e" "\x5d\x17\xf1\x12\x64\x1e\xf1\x1c";
-static u8 s004[] =
+static u8 dat_common04[] =
"\xf0\x00\xf1\x02\x24\x5f\xf1\x20" "\x28\xea\xf1\x02\x5f\x41\xf1\x43";
-static u8 s005[] =
+static u8 dat_common05[] =
"\x02\x00\xf1\xee\x03\x29\xf1\x1a" "\x04\x02\xf1\xa4\x09\x00\xf1\x68"
"\x0a\x00\xf1\x2a\x0b\x00\xf1\x04" "\x0c\x00\xf1\x93\x0d\x00\xf1\x82"
"\x0e\x00\xf1\x40\x0f\x00\xf1\x5f" "\x10\x00\xf1\x4e\x11\x00\xf1\x5b";
-static u8 s006[] =
+static u8 dat_common06[] =
"\x15\x00\xf1\xc9\x16\x00\xf1\x5e" "\x17\x00\xf1\x9d\x18\x00\xf1\x06"
"\x19\x00\xf1\x89\x1a\x00\xf1\x12" "\x1b\x00\xf1\xa1\x1c\x00\xf1\xe4"
"\x1d\x00\xf1\x7a\x1e\x00\xf1\x64" "\xf6\x00\xf1\x5f";
-static u8 s007[] =
+static u8 dat_common07[] =
"\xf0\x00\xf1\x01\x53\x09\xf1\x03" "\x54\x3d\xf1\x1c\x55\x99\xf1\x72"
"\x56\xc1\xf1\xb1\x57\xd8\xf1\xce" "\x58\xe0\xf1\x00\xdc\x0a\xf1\x03"
"\xdd\x45\xf1\x20\xde\xae\xf1\x82" "\xdf\xdc\xf1\xc9\xe0\xf6\xf1\xea"
"\xe1\xff\xf1\x00";
-static u8 s008[] =
+static u8 dat_common08[] =
"\xf0\x00\xf1\x01\x80\x00\xf1\x06" "\x81\xf6\xf1\x08\x82\xfb\xf1\xf7"
"\x83\x00\xf1\xfe\xb6\x07\xf1\x03" "\xb7\x18\xf1\x0c\x84\xfb\xf1\x06"
"\x85\xfb\xf1\xf9\x86\x00\xf1\xff" "\xb8\x07\xf1\x04\xb9\x16\xf1\x0a";
-static u8 s009[] =
+static u8 dat_common09[] =
"\x87\xfa\xf1\x05\x88\xfc\xf1\xf9" "\x89\x00\xf1\xff\xba\x06\xf1\x03"
"\xbb\x17\xf1\x09\x8a\xe8\xf1\x14" "\x8b\xf7\xf1\xf0\x8c\xfd\xf1\xfa"
"\x8d\x00\xf1\x00\xbc\x05\xf1\x01" "\xbd\x0c\xf1\x08\xbe\x00\xf1\x14";
-static u8 s010[] =
+static u8 dat_common10[] =
"\x8e\xea\xf1\x13\x8f\xf7\xf1\xf2" "\x90\xfd\xf1\xfa\x91\x00\xf1\x00"
"\xbf\x05\xf1\x01\xc0\x0a\xf1\x08" "\xc1\x00\xf1\x0c\x92\xed\xf1\x0f"
"\x93\xf9\xf1\

[PATCH 1/3] gspca_gl860

2009-10-03 Thread Olivier Lorin

gspca - gl860: improvement of the main driver part

From: Olivier Lorin 

- fix for warning compilation about sd_ctrls
- trace improvement while probing the sensor

Priority: normal

Signed-off-by: Olivier Lorin 

diff -rupN ../gspca-o/linux/drivers/media/video/gspca/gl860/gl860.c 
./linux/drivers/media/video/gspca/gl860/gl860.c
--- ../gspca-o/linux/drivers/media/video/gspca/gl860/gl860.c
2009-09-18 10:36:24.0 +0200
+++ ./linux/drivers/media/video/gspca/gl860/gl860.c2009-09-24 
13:55:34.0 +0200

@@ -23,8 +23,8 @@
#include "gspca.h"
#include "gl860.h"

-MODULE_AUTHOR("Olivier Lorin ");
-MODULE_DESCRIPTION("GSPCA/Genesys Logic GL860 USB Camera Driver");
+MODULE_AUTHOR("Olivier Lorin ");
+MODULE_DESCRIPTION("Genesys Logic USB PC Camera Driver");
MODULE_LICENSE("GPL");

/* static function declarations 
*/

@@ -53,7 +53,7 @@ MODULE_PARM_DESC(AC50Hz, " Does AC power
static char sensor[7];
module_param_string(sensor, sensor, sizeof(sensor), 0644);
MODULE_PARM_DESC(sensor,
-" Driver sensor ('MI1320'/'MI2020'/'OV9655'/'OV2640'/'')");
+" Driver sensor ('MI1320'/'MI2020'/'OV9655'/'OV2640')");

/* webcam controls 
=*/


@@ -119,16 +119,23 @@ static int gl860_build_control_table(str
struct ctrl *sd_ctrls;
int nCtrls = 0;

-if (_MI1320_)
+switch (sd->sensor) {
+case ID_MI1320:
sd_ctrls = sd_ctrls_mi1320;
-else if (_MI2020_)
+break;
+case ID_MI2020:
sd_ctrls = sd_ctrls_mi2020;
-else if (_MI2020b_)
+break;
+case ID_MI2020b:
sd_ctrls = sd_ctrls_mi2020b;
-else if (_OV2640_)
+break;
+case ID_OV2640:
sd_ctrls = sd_ctrls_ov2640;
-else if (_OV9655_)
+break;
+default:
sd_ctrls = sd_ctrls_ov9655;
+break;
+}

memset(sd_ctrls, 0, GL860_NCTRLS * sizeof(struct ctrl));

@@ -154,7 +161,7 @@ static int gl860_build_control_table(str
SET_MY_CTRL(V4L2_CID_VFLIP,
V4L2_CTRL_TYPE_BOOLEAN, "Flip", flip)
SET_MY_CTRL(V4L2_CID_POWER_LINE_FREQUENCY,
-V4L2_CTRL_TYPE_BOOLEAN, "50Hz", AC50Hz)
+V4L2_CTRL_TYPE_BOOLEAN, "AC power 50Hz", AC50Hz)

return nCtrls;
}
@@ -700,6 +707,7 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x006a, 0x000d, 0, NULL);
msleep(56);

+PDEBUG(D_PROBE, "probing for sensor MI2020 or OV");
nOV = 0;
for (ntry = 0; ntry < 4; ntry++) {
ctrl_out(gspca_dev, 0x40, 1, 0x0040, 0x, 0, NULL);
@@ -709,14 +717,14 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x7a00, 0x8030, 0, NULL);
msleep(10);
ctrl_in(gspca_dev, 0xc0, 2, 0x7a00, 0x8030, 1, &probe);
-PDEBUG(D_PROBE, "1st probe=%02x", probe);
+PDEBUG(D_PROBE, "probe=0x%02x", probe);
if (probe == 0xff)
nOV++;
}

if (nOV) {
-PDEBUG(D_PROBE, "0xff -> sensor OV");
-PDEBUG(D_PROBE, "Probing for sensor OV2640 or OV9655");
+PDEBUG(D_PROBE, "0xff -> OV");
+PDEBUG(D_PROBE, "probing for sensor OV2640 or OV9655");

nb26 = nb96 = 0;
for (ntry = 0; ntry < 4; ntry++) {
@@ -726,40 +734,38 @@ static int gl860_guess_sensor(struct gsp
ctrl_out(gspca_dev, 0x40, 1, 0x6000, 0x800a,
0, NULL);
msleep(10);
+
/* Wait for 26(OV2640) or 96(OV9655) */
ctrl_in(gspca_dev, 0xc0, 2, 0x6000, 0x800a,
1, &probe);

-PDEBUG(D_PROBE, "2nd probe=%02x", probe);
-if (probe == 0x00)
-nb26++;
if (probe == 0x26 || probe == 0x40) {
+PDEBUG(D_PROBE,
+"probe=0x%02x -> OV2640",
+probe);
sd->sensor = ID_OV2640;
nb26 += 4;
break;
}
if (probe == 0x96 || probe == 0x55) {
+PDEBUG(D_PROBE,
+"probe=0x%02x -> OV9655",
+probe);
sd->sensor = ID_OV9655;
nb96 += 4;
break;
}
+PDEBUG(D_PROBE, "probe=0x%02x", probe);
+if (probe == 0x00)
+nb26++;
if (probe == 0xff)
nb96++;
msleep(3);
}
-if (nb26 < 4 && nb96 < 4) {
-PDEBUG(D_PROBE, "No relevant answer ");
-PDEBUG(D_PROBE, "* 1.3Mpixels -> use OV9655");
-PDEBUG(D_PROBE, "* 2.0Mpixels -> use OV2640");
-PDEBUG(D_PROBE,
-"To force a sensor, add that line to "
-"/etc/modprobe.d/options.conf:");
-

Re: [2.6.31] ir-kbd-i2c oops.

2009-10-03 Thread Jean Delvare
Hi Pawel,

On Sat, 3 Oct 2009 12:08:36 +0200, Paweł Sikora wrote:
> On Thursday 01 October 2009 13:43:43 Jean Delvare wrote:
> 
> > Pawel, please give a try to the following patch. Please keep the debug
> > patches apply too, in case we need additional info.
> 
> the second patch helps. here's a dmesg log.

OK. So the bug is exactly what I said on my very first reply. And the
patch I pointed you to back then should have fixed it:
http://patchwork.kernel.org/patch/45707/
You said it didn't, which makes me wonder if you really tested it
properly...

Anyway this is already fixed upstream, and the fix should be backported
to 2.6.31-stable quickly. I'll make sure it happens.

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


[PATCH 1/2] SH: add support for the RJ54N1CB0C camera for the kfr2r09 platform

2009-10-03 Thread Guennadi Liakhovetski
Signed-off-by: Guennadi Liakhovetski 
---
 arch/sh/boards/mach-kfr2r09/setup.c |  139 +++
 1 files changed, 139 insertions(+), 0 deletions(-)

diff --git a/arch/sh/boards/mach-kfr2r09/setup.c 
b/arch/sh/boards/mach-kfr2r09/setup.c
index c08d33f..ce01d6a 100644
--- a/arch/sh/boards/mach-kfr2r09/setup.c
+++ b/arch/sh/boards/mach-kfr2r09/setup.c
@@ -18,6 +18,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -212,11 +214,131 @@ static struct platform_device kfr2r09_usb0_gadget_device 
= {
.resource   = kfr2r09_usb0_gadget_resources,
 };
 
+static struct sh_mobile_ceu_info sh_mobile_ceu_info = {
+   .flags = SH_CEU_FLAG_USE_8BIT_BUS,
+};
+
+static struct resource kfr2r09_ceu_resources[] = {
+   [0] = {
+   .name   = "CEU",
+   .start  = 0xfe91,
+   .end= 0xfe91009f,
+   .flags  = IORESOURCE_MEM,
+   },
+   [1] = {
+   .start  = 52,
+   .end  = 52,
+   .flags  = IORESOURCE_IRQ,
+   },
+   [2] = {
+   /* place holder for contiguous memory */
+   },
+};
+
+static struct platform_device kfr2r09_ceu_device = {
+   .name   = "sh_mobile_ceu",
+   .id = 0, /* "ceu0" clock */
+   .num_resources  = ARRAY_SIZE(kfr2r09_ceu_resources),
+   .resource   = kfr2r09_ceu_resources,
+   .dev= {
+   .platform_data  = &sh_mobile_ceu_info,
+   },
+   .archdata = {
+   .hwblk_id = HWBLK_CEU0,
+   },
+};
+
+static struct i2c_board_info kfr2r09_i2c_camera = {
+   I2C_BOARD_INFO("rj54n1cb0c", 0x50),
+};
+
+static struct clk *camera_clk;
+
+#define DRVCRB 0xA405018C
+static int camera_power(struct device *dev, int mode)
+{
+   int ret;
+
+   if (mode) {
+   long rate;
+
+   camera_clk = clk_get(NULL, "video_clk");
+   if (IS_ERR(camera_clk))
+   return PTR_ERR(camera_clk);
+
+   /* set VIO_CKO clock to 25MHz */
+   rate = clk_round_rate(camera_clk, 2500);
+   ret = clk_set_rate(camera_clk, rate);
+   if (ret < 0)
+   goto eclkrate;
+
+   /* set DRVCRB
+*
+* use 1.8 V for VccQ_VIO
+* use 2.85V for VccQ_SR
+*/
+   ctrl_outw((ctrl_inw(DRVCRB) & ~0x0003) | 0x0001, DRVCRB);
+
+   /* reset clear */
+   ret = gpio_request(GPIO_PTB4, NULL);
+   if (ret < 0)
+   goto eptb4;
+   ret = gpio_request(GPIO_PTB7, NULL);
+   if (ret < 0)
+   goto eptb7;
+
+   ret = gpio_direction_output(GPIO_PTB4, 1);
+   if (!ret)
+   ret = gpio_direction_output(GPIO_PTB7, 1);
+   if (ret < 0)
+   goto egpioout;
+   msleep(1);
+
+   ret = clk_enable(camera_clk);   /* start VIO_CKO */
+   if (ret < 0)
+   goto eclkon;
+
+   return 0;
+   }
+
+   ret = 0;
+
+   clk_disable(camera_clk);
+eclkon:
+   gpio_set_value(GPIO_PTB7, 0);
+egpioout:
+   gpio_set_value(GPIO_PTB4, 0);
+   gpio_free(GPIO_PTB7);
+eptb7:
+   gpio_free(GPIO_PTB4);
+eptb4:
+eclkrate:
+   clk_put(camera_clk);
+   return ret;
+}
+
+static struct soc_camera_link rj54n1_link = {
+   .power  = camera_power,
+   .board_info = &kfr2r09_i2c_camera,
+   .i2c_adapter_id = 1,
+   .module_name= "rj54n1cb0c",
+};
+
+static struct platform_device kfr2r09_camera = {
+   .name   = "soc-camera-pdrv",
+   .id = 0,
+   .dev= {
+   .platform_data = &rj54n1_link,
+   },
+};
+
 static struct platform_device *kfr2r09_devices[] __initdata = {
&kfr2r09_nor_flash_device,
&kfr2r09_nand_flash_device,
&kfr2r09_sh_keysc_device,
&kfr2r09_sh_lcdc_device,
+   &kfr2r09_ceu_device,
+   &kfr2r09_camera,
 };
 
 #define BSC_CS0BCR 0xfec10004
@@ -361,6 +483,23 @@ static int __init kfr2r09_devices_setup(void)
if (kfr2r09_usb0_gadget_setup() == 0)
platform_device_register(&kfr2r09_usb0_gadget_device);
 
+   /* CEU */
+   gpio_request(GPIO_FN_VIO_CKO, NULL);
+   gpio_request(GPIO_FN_VIO0_CLK, NULL);
+   gpio_request(GPIO_FN_VIO0_VD, NULL);
+   gpio_request(GPIO_FN_VIO0_HD, NULL);
+   gpio_request(GPIO_FN_VIO0_FLD, NULL);
+   gpio_request(GPIO_FN_VIO0_D7, NULL);
+   gpio_request(GPIO_FN_VIO0_D6, NULL);
+   gpio_request(GPIO_FN_VIO0_D5, NULL);
+   gpio_request(GPIO_FN_VIO0_D4, NULL);
+   gpio_request(GPIO_FN_VIO0_D3, NULL);
+   gpio_request(GPIO_FN_VIO0_D2, NULL);
+   gpio_request(GPIO_FN_VIO0_D1, NULL);
+   gpio_request(GPIO_FN_VIO0_D0, NULL);
+
+   platform_res

[PATCH 1/2] soc-camera: add a new driver for the RJ54N1CB0C camera sensor from Sharp

2009-10-03 Thread Guennadi Liakhovetski
This adds an soc-camera / v4l2-subdev driver for the RJ54N1CB0C CMOS camera
sensor from Sharp. The sensor is very picky about initialisation and
configuration sequences. The driver limits artificially maximum window size by
800x600, although the sensor supports 1600x1200. Sizes above 800x600 don't seem
to work correctly, besides, examples from the system integrator use sizes above
640x480 only for still photography. Unfortunately, I had to use "magic"
register-value pairs for undocumented and "reserved" registers. This version of
the driver also omits some functionality, like cropping, which hasn't been
sufficiently tested yet and will be added later.

Signed-off-by: Guennadi Liakhovetski 
---
 drivers/media/video/Kconfig  |6 +
 drivers/media/video/Makefile |1 +
 drivers/media/video/rj54n1cb0c.c | 1219 ++
 include/media/v4l2-chip-ident.h  |3 +
 4 files changed, 1229 insertions(+), 0 deletions(-)
 create mode 100644 drivers/media/video/rj54n1cb0c.c

diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index c318676..0ab7ccd 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -847,6 +847,12 @@ config SOC_CAMERA_MT9V022
help
  This driver supports MT9V022 cameras from Micron
 
+config SOC_CAMERA_RJ54N1
+   tristate "rj54n1cb0c support"
+   depends on SOC_CAMERA && I2C
+   help
+ This is a rj54n1cb0c video driver
+
 config SOC_CAMERA_TW9910
tristate "tw9910 support"
depends on SOC_CAMERA && I2C
diff --git a/drivers/media/video/Makefile b/drivers/media/video/Makefile
index e706cee..2851e5e 100644
--- a/drivers/media/video/Makefile
+++ b/drivers/media/video/Makefile
@@ -79,6 +79,7 @@ obj-$(CONFIG_SOC_CAMERA_MT9V022)  += mt9v022.o
 obj-$(CONFIG_SOC_CAMERA_OV772X)+= ov772x.o
 obj-$(CONFIG_SOC_CAMERA_OV9640)+= ov9640.o
 obj-$(CONFIG_SOC_CAMERA_TW9910)+= tw9910.o
+obj-$(CONFIG_SOC_CAMERA_RJ54N1)+= rj54n1cb0c.o
 
 # And now the v4l2 drivers:
 
diff --git a/drivers/media/video/rj54n1cb0c.c b/drivers/media/video/rj54n1cb0c.c
new file mode 100644
index 000..373f2a3
--- /dev/null
+++ b/drivers/media/video/rj54n1cb0c.c
@@ -0,0 +1,1219 @@
+/*
+ * Driver for RJ54N1CB0C CMOS Image Sensor from Micron
+ *
+ * Copyright (C) 2009, Guennadi Liakhovetski 
+ *
+ * This program 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.
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#define RJ54N1_DEV_CODE0x0400
+#define RJ54N1_DEV_CODE2   0x0401
+#define RJ54N1_OUT_SEL 0x0403
+#define RJ54N1_XY_OUTPUT_SIZE_S_H  0x0404
+#define RJ54N1_X_OUTPUT_SIZE_S_L   0x0405
+#define RJ54N1_Y_OUTPUT_SIZE_S_L   0x0406
+#define RJ54N1_XY_OUTPUT_SIZE_P_H  0x0407
+#define RJ54N1_X_OUTPUT_SIZE_P_L   0x0408
+#define RJ54N1_Y_OUTPUT_SIZE_P_L   0x0409
+#define RJ54N1_LINE_LENGTH_PCK_S_H 0x040a
+#define RJ54N1_LINE_LENGTH_PCK_S_L 0x040b
+#define RJ54N1_LINE_LENGTH_PCK_P_H 0x040c
+#define RJ54N1_LINE_LENGTH_PCK_P_L 0x040d
+#define RJ54N1_RESIZE_N0x040e
+#define RJ54N1_RESIZE_N_STEP   0x040f
+#define RJ54N1_RESIZE_STEP 0x0410
+#define RJ54N1_RESIZE_HOLD_H   0x0411
+#define RJ54N1_RESIZE_HOLD_L   0x0412
+#define RJ54N1_H_OBEN_OFS  0x0413
+#define RJ54N1_V_OBEN_OFS  0x0414
+#define RJ54N1_RESIZE_CONTROL  0x0415
+#define RJ54N1_INC_USE_SEL_H   0x0425
+#define RJ54N1_INC_USE_SEL_L   0x0426
+#define RJ54N1_MIRROR_STILL_MODE   0x0427
+#define RJ54N1_INIT_START  0x0428
+#define RJ54N1_SCALE_1_2_LEV   0x0429
+#define RJ54N1_SCALE_4_LEV 0x042a
+#define RJ54N1_Y_GAIN  0x04d8
+#define RJ54N1_APT_GAIN_UP 0x04fa
+#define RJ54N1_RA_SEL_UL   0x0530
+#define RJ54N1_BYTE_SWAP   0x0531
+#define RJ54N1_OUT_SIGPO   0x053b
+#define RJ54N1_FRAME_LENGTH_S_H0x0595
+#define RJ54N1_FRAME_LENGTH_S_L0x0596
+#define RJ54N1_FRAME_LENGTH_P_H0x0597
+#define RJ54N1_FRAME_LENGTH_P_L0x0598
+#define RJ54N1_IOC 0x05ef
+#define RJ54N1_TG_BYPASS   0x0700
+#define RJ54N1_PLL_L   0x0701
+#define RJ54N1_PLL_N   0x0702
+#define RJ54N1_PLL_EN  0x0704
+#define RJ54N1_RATIO_TG0x0706
+#define RJ54N1_RATIO_T 0x0707
+#define RJ54N1_RATIO_R 0x0708
+#define RJ54N1_RAMP_TGCLK_EN   0x0709
+#define RJ54N1_OCLK_DSP0x0710
+#define RJ54N1_RATIO_OP0x0711
+#define RJ54N1_RATIO_O 0x0

[PATCH] sh_mobile_ceu_camera: fix cropping for scaling clients

2009-10-03 Thread Guennadi Liakhovetski
Fix a bug in cropping calculation, when the client is also scaling the image.

Signed-off-by: Guennadi Liakhovetski 
---
 drivers/media/video/sh_mobile_ceu_camera.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/sh_mobile_ceu_camera.c 
b/drivers/media/video/sh_mobile_ceu_camera.c
index 65ac474..2f78b4f 100644
--- a/drivers/media/video/sh_mobile_ceu_camera.c
+++ b/drivers/media/video/sh_mobile_ceu_camera.c
@@ -1173,8 +1173,8 @@ static int get_scales(struct soc_camera_device *icd,
width_in = scale_up(cam->ceu_rect.width, *scale_h);
height_in = scale_up(cam->ceu_rect.height, *scale_v);
 
-   *scale_h = calc_generic_scale(cam->ceu_rect.width, icd->user_width);
-   *scale_v = calc_generic_scale(cam->ceu_rect.height, icd->user_height);
+   *scale_h = calc_generic_scale(width_in, icd->user_width);
+   *scale_v = calc_generic_scale(height_in, icd->user_height);
 
return 0;
 }
-- 
1.6.2.4

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


[PATCH resend] firedtv: length field corrupt in ca2host if length>127

2009-10-03 Thread Stefan Richter
From: Henrik Kurelid 

This solves a problem in firedtv that has become major for Swedish DVB-T
users the last month or so.  It will most likely solve issues seen by
other users as well.

If the length of an AVC message is greater than 127, the length field
should be encoded in LV mode instead of V mode. V mode can only be used
if the length is 127 or less. This patch ensures that the CA_PMT
message is always encoded in LV mode so PMT message of greater lengths
can be supported.

Signed-off-by: Henrik Kurelid 
Signed-off-by: Stefan Richter 
---

On  2 Oct, Henrik Kurelid wrote:
> Here is a patch that solves a problem in firedtv that has become major for
> Swedish DVB-T users the last month or so.
> It will most likely solve issues seen by other users as well.
> Please review and comment.

I don't have a CA module, hence can't test it myself.  Is the message
format vendor-defined or ist there a standard for this?

Anyway, I am resending this patch for Mauro to apply, since the original
posting had lines wrapped.  I also took the liberty to standardize the
hexadecimal constants to lowercase to match the rest of firedtv-avc.c.

 drivers/media/dvb/firewire/firedtv-avc.c |   38 ---
 1 file changed, 20 insertions(+), 18 deletions(-)

Index: linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
===
--- linux-2.6.32-rc1.orig/drivers/media/dvb/firewire/firedtv-avc.c
+++ linux-2.6.32-rc1/drivers/media/dvb/firewire/firedtv-avc.c
@@ -1050,28 +1050,28 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
c->operand[4] = 0; /* slot */
c->operand[5] = SFE_VENDOR_TAG_CA_PMT; /* ca tag */
c->operand[6] = 0; /* more/last */
-   /* c->operand[7] = XXXprogram_info_length + 17; */ /* length */
-   c->operand[8] = list_management;
-   c->operand[9] = 0x01; /* pmt_cmd=OK_descramble */
+   /* Use three bytes for length field in case length > 127 */
+   c->operand[10] = list_management;
+   c->operand[11] = 0x01; /* pmt_cmd=OK_descramble */
 
/* TS program map table */
 
-   c->operand[10] = 0x02; /* Table id=2 */
-   c->operand[11] = 0x80; /* Section syntax + length */
-   /* c->operand[12] = XXXprogram_info_length + 12; */
-   c->operand[13] = msg[1]; /* Program number */
-   c->operand[14] = msg[2];
-   c->operand[15] = 0x01; /* Version number=0 + current/next=1 */
-   c->operand[16] = 0x00; /* Section number=0 */
-   c->operand[17] = 0x00; /* Last section number=0 */
-   c->operand[18] = 0x1f; /* PCR_PID=1FFF */
-   c->operand[19] = 0xff;
-   c->operand[20] = (program_info_length >> 8); /* Program info length */
-   c->operand[21] = (program_info_length & 0xff);
+   c->operand[12] = 0x02; /* Table id=2 */
+   c->operand[13] = 0x80; /* Section syntax + length */
+   /* c->operand[14] = XXXprogram_info_length + 12; */
+   c->operand[15] = msg[1]; /* Program number */
+   c->operand[16] = msg[2];
+   c->operand[17] = 0x01; /* Version number=0 + current/next=1 */
+   c->operand[18] = 0x00; /* Section number=0 */
+   c->operand[19] = 0x00; /* Last section number=0 */
+   c->operand[20] = 0x1f; /* PCR_PID=1FFF */
+   c->operand[21] = 0xff;
+   c->operand[22] = (program_info_length >> 8); /* Program info length */
+   c->operand[23] = (program_info_length & 0xff);
 
/* CA descriptors at programme level */
read_pos = 6;
-   write_pos = 22;
+   write_pos = 24;
if (program_info_length > 0) {
pmt_cmd_id = msg[read_pos++];
if (pmt_cmd_id != 1 && pmt_cmd_id != 4)
@@ -1113,8 +1113,10 @@ int avc_ca_pmt(struct firedtv *fdtv, cha
c->operand[write_pos++] = 0x00;
c->operand[write_pos++] = 0x00;
 
-   c->operand[7] = write_pos - 8;
-   c->operand[12] = write_pos - 13;
+   c->operand[7] = 0x82;
+   c->operand[8] = (write_pos - 10) >> 8;
+   c->operand[9] = (write_pos - 10) & 0xff;
+   c->operand[14] = write_pos - 15;
 
crc32_csum = crc32_be(0, &c->operand[10], c->operand[12] - 1);
c->operand[write_pos - 4] = (crc32_csum >> 24) & 0xff;


-- 
Stefan Richter
-=-==--= =-=- ---==
http://arcgraph.de/sr/

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


Re: [linux-dvb] What is the status of the driver TT CT-3650

2009-10-03 Thread Jens Kjellerup
I have tried the TT Ct2650 C/T CI as a DVB-T tuner with the same  
negative result. I have heard that there is some work going on but  
haven't hear of any definitive positive results yet.


As i am no programmer but fairly well in using linux i cam contribute  
on testing and documenting if there is some positive results.


Still hoping...

Citat af Hasse Hagen Johansen :


Hi

I have recently bought such a card and tried to get it working. Does
anyone know if it is possible. I have compiled the dvb drivers from
s2-liplianin

And tried to use the scan program from the dvb-apps mercurial tarball. I
also compile scan-s2 and tried that, but I always get "tuning failed"

Anyone know how to get this working or this card is in a working state
under linux. Because if it not working yet I will stop wasting my time
:-)

Regards
Hasse H. Johansen

___
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






--
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/3] pac7311: remove magic values for END_OF_SEQUENCE and LOAD_PAGE{3,4}

2009-10-03 Thread Németh Márton
From: Márton Németh 

Change the magic values 0, 254 and 255 to END_OF_SEQUENCE, LOAD_PAGE4 and
LOAD_PAGE3 respectively for better source code readability.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh 
---
diff -upr b/drivers/media/video/gspca/pac7311.c 
c/drivers/media/video/gspca/pac7311.c
--- b/drivers/media/video/gspca/pac7311.c   2009-10-03 08:27:36.0 
+0200
+++ c/drivers/media/video/gspca/pac7311.c   2009-10-03 08:47:30.0 
+0200
@@ -244,6 +244,10 @@ static const struct v4l2_pix_format vga_
.priv = 0},
 };

+#define LOAD_PAGE3 255
+#define LOAD_PAGE4 254
+#define END_OF_SEQUENCE0
+
 /* pac 7302 */
 static const __u8 init_7302[] = {
 /* index,value */
@@ -302,7 +306,7 @@ static const __u8 start_7302[] = {
0xff, 1,0x02,   /* page 2 */
0x22, 1,0x00,
0xff, 1,0x03,   /* page 3 */
-   0x00, 255,  /* load the page 3 */
+   0, LOAD_PAGE3,  /* load the page 3 */
0x11, 1,0x01,
0xff, 1,0x02,   /* page 2 */
0x13, 1,0x00,
@@ -313,7 +317,7 @@ static const __u8 start_7302[] = {
0x6e, 1,0x08,
0xff, 1,0x01,   /* page 1 */
0x78, 1,0x00,
-   0, 0/* end of sequence */
+   0, END_OF_SEQUENCE  /* end of sequence */
 };

 #define SKIP   0xaa
@@ -379,9 +383,9 @@ static const __u8 start_7311[] = {
0xf0, 13,   0x01, 0x00, 0x00, 0x00, 0x22, 0x00, 0x20, 0x00,
0x3f, 0x00, 0x0a, 0x01, 0x00,
0xff, 1,0x04,   /* page 4 */
-   0x00, 254,  /* load the page 4 */
+   0, LOAD_PAGE4,  /* load the page 4 */
0x11, 1,0x01,
-   0, 0/* end of sequence */
+   0, END_OF_SEQUENCE  /* end of sequence */
 };

 /* page 4 - the value SKIP says skip the index - see reg_w_page() */
@@ -461,12 +465,12 @@ static void reg_w_var(struct gspca_dev *
index = *seq++;
len = *seq++;
switch (len) {
-   case 0:
+   case END_OF_SEQUENCE:
return;
-   case 254:
+   case LOAD_PAGE4:
reg_w_page(gspca_dev, page4_7311, sizeof page4_7311);
break;
-   case 255:
+   case LOAD_PAGE3:
reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
break;
default:
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] pac7311: remove magic value for USB_BUF_SZ

2009-10-03 Thread Németh Márton
From: Márton Németh 

The length check in reg_w_var() function is because the buffer contents
is copied to gspca_dev->usb_buf which has the size of USB_BUF_SZ bytes as
defined in drivers/media/video/gspca/gspca.h. Replace the number with
symbol for better readability and maintainability.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh 
---
diff -upr c/drivers/media/video/gspca/pac7311.c 
d/drivers/media/video/gspca/pac7311.c
--- c/drivers/media/video/gspca/pac7311.c   2009-10-03 08:47:30.0 
+0200
+++ d/drivers/media/video/gspca/pac7311.c   2009-10-03 09:02:31.0 
+0200
@@ -474,7 +474,7 @@ static void reg_w_var(struct gspca_dev *
reg_w_page(gspca_dev, page3_7302, sizeof page3_7302);
break;
default:
-   if (len > 64) {
+   if (len > USB_BUF_SZ) {
PDEBUG(D_ERR|D_STREAM,
"Incorrect variable sequence");
return;
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/3] pac7311: remove magic value for SKIP

2009-10-03 Thread Németh Márton
From: Márton Németh 

Change the magic value 0xaa to SKIP for better understandability.

The change was tested with Labtec Webcam 2200.

Signed-off-by: Márton Németh 
---
diff -upr a/drivers/media/video/gspca/pac7311.c 
b/drivers/media/video/gspca/pac7311.c
--- a/drivers/media/video/gspca/pac7311.c   2009-09-28 17:40:19.0 
+0200
+++ b/drivers/media/video/gspca/pac7311.c   2009-10-03 08:27:36.0 
+0200
@@ -316,7 +316,8 @@ static const __u8 start_7302[] = {
0, 0/* end of sequence */
 };

-/* page 3 - the value 0xaa says skip the index - see reg_w_page() */
+#define SKIP   0xaa
+/* page 3 - the value SKIP says skip the index - see reg_w_page() */
 static const __u8 page3_7302[] = {
0x90, 0x40, 0x03, 0x50, 0xc2, 0x01, 0x14, 0x16,
0x14, 0x12, 0x00, 0x00, 0x00, 0x02, 0x33, 0x00,
@@ -383,13 +384,13 @@ static const __u8 start_7311[] = {
0, 0/* end of sequence */
 };

-/* page 4 - the value 0xaa says skip the index - see reg_w_page() */
+/* page 4 - the value SKIP says skip the index - see reg_w_page() */
 static const __u8 page4_7311[] = {
-   0xaa, 0xaa, 0x04, 0x54, 0x07, 0x2b, 0x09, 0x0f,
-   0x09, 0x00, 0xaa, 0xaa, 0x07, 0x00, 0x00, 0x62,
-   0x08, 0xaa, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
-   0x00, 0x00, 0x00, 0x03, 0xa0, 0x01, 0xf4, 0xaa,
-   0xaa, 0x00, 0x08, 0xaa, 0x03, 0xaa, 0x00, 0x68,
+   SKIP, SKIP, 0x04, 0x54, 0x07, 0x2b, 0x09, 0x0f,
+   0x09, 0x00, SKIP, SKIP, 0x07, 0x00, 0x00, 0x62,
+   0x08, SKIP, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
+   0x00, 0x00, 0x00, 0x03, 0xa0, 0x01, 0xf4, SKIP,
+   SKIP, 0x00, 0x08, SKIP, 0x03, SKIP, 0x00, 0x68,
0xca, 0x10, 0x06, 0x78, 0x00, 0x00, 0x00, 0x00,
0x23, 0x28, 0x04, 0x11, 0x00, 0x00
 };
@@ -438,7 +439,7 @@ static void reg_w_page(struct gspca_dev
int index;

for (index = 0; index < len; index++) {
-   if (page[index] == 0xaa)/* skip this index */
+   if (page[index] == SKIP)/* skip this index */
continue;
gspca_dev->usb_buf[0] = page[index];
usb_control_msg(gspca_dev->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: Race in gspca main or missing lock in stv06xx subdriver?

2009-10-03 Thread Jean-Francois Moine
On Thu, 1 Oct 2009 15:23:29 +0200
Erik Andrén  wrote:

> 2009/9/15 Jean-Francois Moine :
[snip]
> > I think you may have found a big problem, and this one should exist
> > in all drivers!
> >
> > As I understood, you say that the URB completion routine (isoc_irq)
> > may be run many times at the same time.
[snip]
> > Then, to fix this problem, I see only one solution: have a private
> > tasklet to do the video streaming, as this is done for some bulk
> > transfer...
[snip]
> Are you currently working on anything addressing this issue or do we
> need some further discussion?

Hi Erik,

No, I am not working on this problem: I cannot reproduce it (easy test:
have a static variable which is incremented in the irq function -
isoc_irq() in gspca.c - and warn when it is non null at entry).

May you (or anyone) check it?

Then, the simplest solution is not a tasklet, but to use only one URB
(change the '#define DEF_NURBS' to 1 instead of 3 in gspca.c).

Best regards.

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