Re: [GIT PATCHES FOR 2.6.35] sn9c20x updates

2010-05-05 Thread Brian Johnson
On Sat, May 1, 2010 at 10:36 AM, Brian Johnson  wrote:
> The following changes since commit d3be2fab3a10b6c798a5f9970146d166d3345c37:
>  Jean-François Moine (1):
>        V4L/DVB: gspca - zc3xx: Fix the gamma calculation from the contrast
>
> are available in the git repository at:
>
>  git://gitorious.org/v4l-dvb/v4l-dvb.git devel
>

Added a bugfix for the mt9v111 sensor

  gspca - sn9c20x: Fix non working mt9v111 sensor


Regards,
Brian Johnson
--
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


[GIT PATCHES FOR 2.6.35] sn9c20x updates

2010-05-01 Thread Brian Johnson
The following changes since commit d3be2fab3a10b6c798a5f9970146d166d3345c37:
  Jean-François Moine (1):
V4L/DVB: gspca - zc3xx: Fix the gamma calculation from the contrast

are available in the git repository at:

  git://gitorious.org/v4l-dvb/v4l-dvb.git devel

Brian Johnson (3):
  gspca - sn9c20x: Add another laptop to upsidedown device list
  gspca - sn9c20x: Add another MSI laptop to upsidedown device list
  gspca - sn9c20x: HAS_BUTTON flag -> HAS_NO_BUTTON flag

 drivers/media/video/gspca/sn9c20x.c |   30 ++
 1 files changed, 22 insertions(+), 8 deletions(-)

Regards,
Brian Johnson
--
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


[GIT PATCHES FOR 2.6.35] sn9c20x patches

2010-03-16 Thread Brian Johnson
Mauro,

Oops sorry about forgetting my SOB line on ht e last pull request.
This series has been updated with the proper SOB line.

The following changes since commit 52744e816710ed65e6fc34b79149268d95b2ebdf:
  Hans Verkuil (1):
V4L/DVB: v4l2: sort chip IDs in v4l2-chip-ident.h

are available in the git repository at:

  git://gitorious.org/v4l-dvb/v4l-dvb.git devel

Brian Johnson (5):
  gspca - sn9c20x: use gspca's input device handling
  gspca - sn9c20x: Add support for camera LEDs
  gspca - sn9c20x: Add upside down detection
  gspca - sn9c20x: Add support for cameras using the MT9M112 sensor
  gspca - sn9c20x: Fix bug with OV9655 code

 Documentation/video4linux/gspca.txt |4 +
 drivers/media/video/gspca/Kconfig   |6 -
 drivers/media/video/gspca/sn9c20x.c |  313 +--
 3 files changed, 156 insertions(+), 167 deletions(-)

Regards,
Brian Johnson
--
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


[GIT PATCHES FOR 2.6.34] sn9c20x patches

2010-03-12 Thread Brian Johnson
The following changes since commit 9178a7c062ff0c43e95d826419f9e9454c52ef15:
  Mauro Carvalho Chehab (1):
V4L/DVB: Fix bad whitespacing

are available in the git repository at:

  git://gitorious.org/v4l-dvb/v4l-dvb.git devel

Brian Johnson (5):
  gspca - sn9c20x: use gspca's input device handling
  gspca - sn9c20x: Add support for camera LEDs
  gspca - sn9c20x: Add upside down detection
  gspca - sn9c20x: Add support for cameras using the MT9M112 sensor
  gspca - sn9c20x: Fix bug with OV9655 code

 Documentation/video4linux/gspca.txt |4 +
 drivers/media/video/gspca/Kconfig   |6 -
 drivers/media/video/gspca/sn9c20x.c |  311 +--
 3 files changed, 155 insertions(+), 166 deletions(-)

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


[PULL] http://bitbucket.org/brijohn/v4l-dvb

2009-09-04 Thread Brian Johnson
Mauro,

Please pull from http://bitbucket.org/brijohn/v4l-dvb

for the following 5 changesets:

01/05: gspca - sn9c20x: Reduces size of object
http://bitbucket.org/brijohn/v4l-dvb/changeset/1bff8943b653/

02/05: gspca - sn9c20x: Fix exposure on SOI968 sensors
http://bitbucket.org/brijohn/v4l-dvb/changeset/52d053851896/

03/05: gspca - sn9c20x: Add SXGA support to SOI968
http://bitbucket.org/brijohn/v4l-dvb/changeset/636a931f68a2/

04/05: gspca - sn9c20x: disable exposure/gain controls for MT9M111 sensors.
http://bitbucket.org/brijohn/v4l-dvb/changeset/5eeb3d51bdfc/

05/05: gspca - sn9c20x: Add SXGA support to MT9M111
http://bitbucket.org/brijohn/v4l-dvb/changeset/6f0a4cc8bdd6/


 sn9c20x.c |  201 ++
 1 file changed, 137 insertions(+), 64 deletions(-)

Thanks,
Brian Johnson
--
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] sn9c20x: Reduce data usage, make functions static

2009-09-04 Thread Brian Johnson
Jean-Francois,

The two red tables actually do contain values greater then 127 so
would not fit within a s8 variable, the other four i think may have
only values between -128 and 127 but i haven't gone through and made
sure of that.

Brian

On Fri, Sep 4, 2009 at 5:24 AM, Jean-Francois Moine wrote:
> On Thu, 20 Aug 2009 19:08:58 -0700
> Joe Perches  wrote:
>
>> Compiled, not tested, no hardware
>>
>> Reduces size of object
>>
>> Use s16 instead of int where possible.
>        [snip]
>> -static const int hsv_red_x[] = {
>> +static const s16 hsv_red_x[] = {
>>       41,  44,  46,  48,  50,  52,  54,  56,
>>       58,  60,  62,  64,  66,  68,  70,  72,
>>       74,  76,  78,  80,  81,  83,  85,  87,
>        [snip]
>
> Hi Joe and Brian,
>
> I got the patch but I was wondering if such tables could be even
> smaller with 's8'?
>
> Cheers.
>
> --
> 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


Re: [PATCH] sn9c20x: Reduce data usage, make functions static

2009-08-31 Thread Brian Johnson
Mauro,
Yes, sorry been busy this last week.
I've tested this patch against three separate webcams and everything
works just fine.

I'd also like to ask if it would be possible to get a mercurial
account on linuxtv.org?

Brian Johnson

On Sun, Aug 30, 2009 at 10:24 PM, Mauro Carvalho
Chehab wrote:
> Hi Brian,
>
> Any news about the patch? It is always a good idea to try to reduce the kernel
> size footprint.
>
> Cheers,
> Mauro.
>
> Em Thu, 20 Aug 2009 19:08:58 -0700
> Joe Perches  escreveu:
>
>> Compiled, not tested, no hardware
>>
>> Reduces size of object
>>
>> Use s16 instead of int where possible.
>> Use struct instead of arrays
>>
>> Before:
>> $ size drivers/media/video/gspca/sn9c20x.o
>>    text          data     bss     dec     hex filename
>>   29346          1124    4128   34598    8726 
>> drivers/media/video/gspca/sn9c20x.o
>>
>> After:
>> $ size drivers/media/video/gspca/sn9c20x.o
>>    text          data     bss     dec     hex filename
>>   25042          1124    4112   30278    7646 
>> drivers/media/video/gspca/sn9c20x.o
>>
>> Signed-off-by: Joe Perches 
>> ---
>>  drivers/media/video/gspca/sn9c20x.c |  101 
>> +++---
>>  1 files changed, 56 insertions(+), 45 deletions(-)
>>
>> diff --git a/drivers/media/video/gspca/sn9c20x.c 
>> b/drivers/media/video/gspca/sn9c20x.c
>> index fcfbbd3..8ddf738 100644
>> --- a/drivers/media/video/gspca/sn9c20x.c
>> +++ b/drivers/media/video/gspca/sn9c20x.c
>> @@ -403,7 +403,7 @@ static const struct v4l2_pix_format sxga_mode[] = {
>>               .priv = 3 | MODE_RAW | MODE_SXGA},
>>  };
>>
>> -static const int hsv_red_x[] = {
>> +static const s16 hsv_red_x[] = {
>>       41,  44,  46,  48,  50,  52,  54,  56,
>>       58,  60,  62,  64,  66,  68,  70,  72,
>>       74,  76,  78,  80,  81,  83,  85,  87,
>> @@ -451,7 +451,7 @@ static const int hsv_red_x[] = {
>>       24,  26,  28,  30,  33,  35,  37,  39, 41
>>  };
>>
>> -static const int hsv_red_y[] = {
>> +static const s16 hsv_red_y[] = {
>>       82,  80,  78,  76,  74,  73,  71,  69,
>>       67,  65,  63,  61,  58,  56,  54,  52,
>>       50,  48,  46,  44,  41,  39,  37,  35,
>> @@ -499,7 +499,7 @@ static const int hsv_red_y[] = {
>>       96, 94, 92, 91, 89, 87, 85, 84, 82
>>  };
>>
>> -static const int hsv_green_x[] = {
>> +static const s16 hsv_green_x[] = {
>>       -124, -124, -125, -125, -125, -125, -125, -125,
>>       -125, -126, -126, -125, -125, -125, -125, -125,
>>       -125, -124, -124, -124, -123, -123, -122, -122,
>> @@ -547,7 +547,7 @@ static const int hsv_green_x[] = {
>>       -120, -120, -121, -122, -122, -123, -123, -124, -124
>>  };
>>
>> -static const int hsv_green_y[] = {
>> +static const s16 hsv_green_y[] = {
>>       -100, -99, -98, -97, -95, -94, -93, -91,
>>       -90, -89, -87, -86, -84, -83, -81, -80,
>>       -78, -76, -75, -73, -71, -70, -68, -66,
>> @@ -595,7 +595,7 @@ static const int hsv_green_y[] = {
>>       -109, -108, -107, -106, -105, -104, -103, -102, -100
>>  };
>>
>> -static const int hsv_blue_x[] = {
>> +static const s16 hsv_blue_x[] = {
>>       112, 113, 114, 114, 115, 116, 117, 117,
>>       118, 118, 119, 119, 120, 120, 120, 121,
>>       121, 121, 122, 122, 122, 122, 122, 122,
>> @@ -643,7 +643,7 @@ static const int hsv_blue_x[] = {
>>       104, 105, 106, 107, 108, 109, 110, 111, 112
>>  };
>>
>> -static const int hsv_blue_y[] = {
>> +static const s16 hsv_blue_y[] = {
>>       -11, -13, -15, -17, -19, -21, -23, -25,
>>       -27, -29, -31, -33, -35, -37, -39, -41,
>>       -43, -45, -46, -48, -50, -52, -54, -55,
>> @@ -792,7 +792,17 @@ static u8 hv7131r_gain[] = {
>>       0x78 /* 8x */
>>  };
>>
>> -static u8 soi968_init[][2] = {
>> +struct i2c_reg_u8 {
>> +     u8 reg;
>> +     u8 val;
>> +};
>> +
>> +struct i2c_reg_u16 {
>> +     u8 reg;
>> +     u16 val;
>> +};
>> +
>> +static struct i2c_reg_u8 soi968_init[] = {
>>       {0x12, 0x80}, {0x0c, 0x00}, {0x0f, 0x1f},
>>       {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00},
>>       {0x33, 0x08}, {0x35, 0x8c}, {0x36, 0x0c},
>> @@ -806,7 +816,7 @@ static u8 soi968_init[][2] = {
>>       {0x00, 0x00}, {0x01, 0x80}, {0x02, 0x80},
>>  };
>>
>> -static u8 ov7660_init[][2] = {
>> +static struct i2c_reg_u8 ov7660_init[] = {
>>       {0x0e, 0x80}, {0x0d, 0x08}, {0x0f, 0xc3},
>>       {0x04, 0xc

Re: sn9c20x driver seems ok, but no video

2009-08-06 Thread Brian Johnson
Chris,
The sn9c20x module only supports jpeg, bayer and its own yuv420
format. most applications do not nativly understand these formats and
will therefore require the use of libv4l a user space library able to
convert between formats in order to work. This library was first
included on ubuntu with intrepid, since you are using hardy you will
have to manually download it and compile it yourself or upgrade your
ubuntu system to at least intrepid. If you don't decide to upgrade you
can download the latest version of libv4l at
http://people.atrpms.net/~hdegoede/

Also the driver you are using while it certainly should work fine when
using libv4l for conversion, there is now a gspca based version of
that driver included in the latest v4l-dvb as well as kernel
repositories, You should be able to upgrade from your jaunty kernel to
the current karmic kernel and have the gspca sn9c20x driver included.
You still will need to use the libv4l for handling format conversions
though.

Regards,
Brian Johnson

On Thu, Aug 6, 2009 at 4:29 PM, Chris Hallinan wrote:
> Hi folks,
>
> Trying to get a usb webcam based on SN9C20x driver working on Ubuntu.
>
> Loading the module, everything looks good (log output trimmed for easy 
> reading):
>
>  kernel: usb 7-3: new high speed USB device using ehci_hcd and address 4
>  kernel: usb 7-3: configuration #1 chosen from 1 choice
>  kernel: sn9c20x: SN9C20X USB 2.0 Webcam - 0C45:628F plugged-in.
>  kernel: sn9c20x: Detected OV9650 Sensor.
>  kernel: sn9c20x: Webcam device 0C45:628F is now controlling video
> device /dev/video0
>  kernel: input: SN9C20X Webcam as /class/input/input10
>  kernel: sn9c20x: No ack from I2C slave 0x30 for write to address 0x17
>  kernel: sn9c20x: Using yuv420 output format
>
> However, I've tried several different apps (cheese, Xsane, gstreamer,
> etc) but cannot
> see any video output.  I confess to being completely ignorant on
> issues video, etc. :)
>
> If I type 'cat /dev/video0 >j.dump', the green LED on camera comes on,
> and j.dump is filled with binary data.
>
> However, gst-launch shows this:
> # gst-launch-0.10 v4l2src ! ffmpegcolorspace ! ximagesink
> Setting pipeline to PAUSED ...
> ERROR: Pipeline doesn't want to pause.
> WARNING: from element /pipeline0/v4l2src0: Failed to get current input
> on device '/dev/video0'. May be it is a radio device
> Additional debug info:
> v4l2_calls.c(756): gst_v4l2_get_input (): /pipeline0/v4l2src0: system
> error: Invalid argument
> ERROR: from element /pipeline0/v4l2src0: Could not negotiate format
> Additional debug info:
> gstbasesrc.c(2387): gst_base_src_start (): /pipeline0/v4l2src0:
> Check your filtered caps, if any
> Setting pipeline to NULL ...
> FREEING pipeline ...
>
> I'm running Ubuntu Jaunty kernel (2.6.28) with Hardy userland.
>
> Any input/pointers would be most appreciated!  And if there is a
> better list to post such a question, I'd appreciate it.  I posted on
> micro...@googlegroups.com, but that list hasn't had a single message
> in more than 24 hours!
>
> Thanks,
>
> Chris
>
> --
> Life is like Linux - it never stands still.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] gspca - sn9c20x: Fix up i2c_r functions

2009-07-22 Thread Brian Johnson
Fixes the following issues

* use i2c_w instead of reg_w
* return error on failure
* read the correct number of bytes

Signed-off-by: Brian Johnson 

diff --git a/linux/drivers/media/video/gspca/sn9c20x.c 
b/linux/drivers/media/video/gspca/sn9c20x.c
--- a/linux/drivers/media/video/gspca/sn9c20x.c
+++ b/linux/drivers/media/video/gspca/sn9c20x.c
@@ -1099,12 +1099,12 @@
reg_r(gspca_dev, 0x10c0, 1);
if (gspca_dev->usb_buf[0] & 0x04) {
if (gspca_dev->usb_buf[0] & 0x08)
-   return -1;
+   return -EIO;
return 0;
}
msleep(1);
}
-   return -1;
+   return -EIO;
 }
 
 int i2c_w1(struct gspca_dev *gspca_dev, u8 reg, u8 val)
@@ -1155,7 +1155,7 @@
struct sd *sd = (struct sd *) gspca_dev;
u8 row[8];
 
-   row[0] = 0x81 | 0x10;
+   row[0] = 0x81 | (1 << 4);
row[1] = sd->i2c_addr;
row[2] = reg;
row[3] = 0;
@@ -1163,14 +1163,15 @@
row[5] = 0;
row[6] = 0;
row[7] = 0x10;
-   reg_w(gspca_dev, 0x10c0, row, 8);
-   msleep(1);
-   row[0] = 0x81 | (2 << 4) | 0x02;
+   if (i2c_w(gspca_dev, row) < 0)
+   return -EIO;
+   row[0] = 0x81 | (1 << 4) | 0x02;
row[2] = 0;
-   reg_w(gspca_dev, 0x10c0, row, 8);
-   msleep(1);
-   reg_r(gspca_dev, 0x10c2, 5);
-   *val = gspca_dev->usb_buf[3];
+   if (i2c_w(gspca_dev, row) < 0)
+   return -EIO;
+   if (reg_r(gspca_dev, 0x10c2, 5) < 0)
+   return -EIO;
+   *val = gspca_dev->usb_buf[4];
return 0;
 }
 
@@ -1179,7 +1180,7 @@
struct sd *sd = (struct sd *) gspca_dev;
u8 row[8];
 
-   row[0] = 0x81 | 0x10;
+   row[0] = 0x81 | (1 << 4);
row[1] = sd->i2c_addr;
row[2] = reg;
row[3] = 0;
@@ -1187,14 +1188,15 @@
row[5] = 0;
row[6] = 0;
row[7] = 0x10;
-   reg_w(gspca_dev, 0x10c0, row, 8);
-   msleep(1);
-   row[0] = 0x81 | (3 << 4) | 0x02;
+   if (i2c_w(gspca_dev, row) < 0)
+   return -EIO;
+   row[0] = 0x81 | (2 << 4) | 0x02;
row[2] = 0;
-   reg_w(gspca_dev, 0x10c0, row, 8);
-   msleep(1);
-   reg_r(gspca_dev, 0x10c2, 5);
-   *val = (gspca_dev->usb_buf[2] << 8) | gspca_dev->usb_buf[3];
+   if (i2c_w(gspca_dev, row) < 0)
+   return -EIO;
+   if (reg_r(gspca_dev, 0x10c2, 5) < 0)
+   return -EIO;
+   *val = (gspca_dev->usb_buf[3] << 8) | gspca_dev->usb_buf[4];
return 0;
 }
 
--
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] Add gspca sn9c20x subdriver entry to MAINTAINERS file

2009-07-19 Thread Brian Johnson
Signed-off-by: Brian Johnson 
---
 MAINTAINERS |8 
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 18c3f0c..a28944f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -2599,6 +2599,14 @@ T:   git 
git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-2.6.git
 S: Maintained
 F: drivers/media/video/gspca/pac207.c
 
+GSPCA SN9C20X SUBDRIVER
+P: Brian Johnson
+M: brij...@gmail.com
+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/sn9c20x.c
+
 GSPCA T613 SUBDRIVER
 P: Leandro Costantino
 M: lcostant...@gmail.com
-- 
1.5.6.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 1/2] gspca: add support for v4l2 debugging ioctls

2009-07-18 Thread Brian Johnson
This patch adds support for dbg_g_chip_ident, dbg_g_register,
and dbg_s_register to the gspca core module.

Signed-off-by: Brian Johnson 
---
 drivers/media/video/gspca/gspca.c |   73 +
 drivers/media/video/gspca/gspca.h |9 +
 2 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/gspca/gspca.c 
b/drivers/media/video/gspca/gspca.c
index 1e89600..b8561df 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -727,6 +727,74 @@ static int gspca_get_mode(struct gspca_dev *gspca_dev,
return -EINVAL;
 }
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int vidioc_g_register(struct file *file, void *priv,
+   struct v4l2_dbg_register *reg)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (!gspca_dev->sd_desc->get_register)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+
+static int vidioc_s_register(struct file *file, void *priv,
+   struct v4l2_dbg_register *reg)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (!gspca_dev->sd_desc->set_register)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+#endif
+
+static int vidioc_g_chip_ident(struct file *file, void *priv,
+   struct v4l2_dbg_chip_ident *chip)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+
 static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
struct v4l2_fmtdesc *fmtdesc)
 {
@@ -1883,6 +1951,11 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
.vidioc_s_parm  = vidioc_s_parm,
.vidioc_s_std   = vidioc_s_std,
.vidioc_enum_framesizes = vidioc_enum_framesizes,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_register  = vidioc_g_register,
+   .vidioc_s_register  = vidioc_s_register,
+#endif
+   .vidioc_g_chip_ident= vidioc_g_chip_ident,
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf  = vidiocgmbuf,
 #endif
diff --git a/drivers/media/video/gspca/gspca.h 
b/drivers/media/video/gspca/gspca.h
index bd1faff..46c4eff 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -69,6 +69,10 @@ typedef void (*cam_v_op) (struct gspca_dev *);
 typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
 typedef int (*cam_jpg_op) (struct gspca_dev *,
struct v4l2_jpegcompression *);
+typedef int (*cam_reg_op) (struct gspca_dev *,
+   struct v4l2_dbg_register *);
+typedef int (*cam_ident_op) (struct gspca_dev *,
+   struct v4l2_dbg_chip_ident *);
 typedef int (*cam_streamparm_op) (struct gspca_dev *,
  struct v4l2_streamparm *);
 typedef int (*cam_qmnu_op) (struct gspca_dev *,
@@ -105,6 +109,11 @@ struct sd_desc {
cam_qmnu_op querymenu;
cam_streamparm_op get_streamparm;
cam_streamparm_op set_streamparm;
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   cam_reg_op set_register;
+   cam_reg_op get_register;
+#endif
+   cam_ident_op get_chip_ident;
 };
 
 /* packet types when moving from iso buf to frame buf */
-- 
1.5.6.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 0/2] gspca sn9c20x subdriver rev3

2009-07-18 Thread Brian Johnson
Ok this one just has the following minor changes:

* operations set/get_register in the sd descriptor only exist if 
CONFIG_VIDEO_ADV_DEBUG is defined
* use lowercase letters in hexidecimal notation
* add new supported webcams to linux/Documentation/video4linux/gspca.txt
* check for NULL after kmalloc when creating jpg_hdr

Brian Johnson

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


Re: [PATCH 0/2] gspca sn9c20x subdriver rev2

2009-07-18 Thread Brian Johnson

> shouldn't there be a check when allocating jpg_hdr? or i am missing something?
> 
> 
>  sd->jpeg_hdr = kmalloc(JPEG_HDR_SZ, GFP_KERNEL);
>  jpeg_define(sd->jpeg_hdr, height, width,  0x21);
>  jpeg_set_qual(sd->jpeg_hdr, sd->quality);

Yes probably there should be a check there. I'll one more minor
revision with this plus the changes Jean-Francois mentioned
previously in a bit.

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


Re: [PATCH 0/2] gspca sn9c20x subdriver rev2

2009-07-18 Thread Brian Johnson
> - in the 1st patch, in gspca.c, why is the get_chip_ident check needed
>   in vidioc_g_register / vidioc_s_register)?
> 
According the the current v4l2 spec regarding the set and get
register ioctls drivers that support them must also support the get
chip ident ioctl. As such in the vidioc_s/g_register ioctls I do the
check to ensure that the driver also defines the get_chip_ident ioctl.


Brian Johnson
--
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] gspca: add support for v4l2 debugging ioctls

2009-07-17 Thread Brian Johnson
This patch adds support for dbg_g_chip_ident, dbg_g_register,
and dbg_s_register to the gspca core module.

Signed-off-by: Brian Johnson 
---
 drivers/media/video/gspca/gspca.c |   73 +
 drivers/media/video/gspca/gspca.h |7 
 2 files changed, 80 insertions(+), 0 deletions(-)

diff --git a/drivers/media/video/gspca/gspca.c 
b/drivers/media/video/gspca/gspca.c
index 1e89600..b8561df 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -727,6 +727,74 @@ static int gspca_get_mode(struct gspca_dev *gspca_dev,
return -EINVAL;
 }
 
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int vidioc_g_register(struct file *file, void *priv,
+   struct v4l2_dbg_register *reg)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (!gspca_dev->sd_desc->get_register)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->get_register(gspca_dev, reg);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+
+static int vidioc_s_register(struct file *file, void *priv,
+   struct v4l2_dbg_register *reg)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (!gspca_dev->sd_desc->set_register)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->set_register(gspca_dev, reg);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+#endif
+
+static int vidioc_g_chip_ident(struct file *file, void *priv,
+   struct v4l2_dbg_chip_ident *chip)
+{
+   int ret;
+   struct gspca_dev *gspca_dev = priv;
+
+   if (!gspca_dev->sd_desc->get_chip_ident)
+   return -EINVAL;
+
+   if (mutex_lock_interruptible(&gspca_dev->usb_lock))
+   return -ERESTARTSYS;
+   if (gspca_dev->present)
+   ret = gspca_dev->sd_desc->get_chip_ident(gspca_dev, chip);
+   else
+   ret = -ENODEV;
+   mutex_unlock(&gspca_dev->usb_lock);
+
+   return ret;
+}
+
 static int vidioc_enum_fmt_vid_cap(struct file *file, void  *priv,
struct v4l2_fmtdesc *fmtdesc)
 {
@@ -1883,6 +1951,11 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
.vidioc_s_parm  = vidioc_s_parm,
.vidioc_s_std   = vidioc_s_std,
.vidioc_enum_framesizes = vidioc_enum_framesizes,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_register  = vidioc_g_register,
+   .vidioc_s_register  = vidioc_s_register,
+#endif
+   .vidioc_g_chip_ident= vidioc_g_chip_ident,
 #ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf  = vidiocgmbuf,
 #endif
diff --git a/drivers/media/video/gspca/gspca.h 
b/drivers/media/video/gspca/gspca.h
index bd1faff..4f2a873 100644
--- a/drivers/media/video/gspca/gspca.h
+++ b/drivers/media/video/gspca/gspca.h
@@ -69,6 +69,10 @@ typedef void (*cam_v_op) (struct gspca_dev *);
 typedef int (*cam_cf_op) (struct gspca_dev *, const struct usb_device_id *);
 typedef int (*cam_jpg_op) (struct gspca_dev *,
struct v4l2_jpegcompression *);
+typedef int (*cam_reg_op) (struct gspca_dev *,
+   struct v4l2_dbg_register *);
+typedef int (*cam_ident_op) (struct gspca_dev *,
+   struct v4l2_dbg_chip_ident *);
 typedef int (*cam_streamparm_op) (struct gspca_dev *,
  struct v4l2_streamparm *);
 typedef int (*cam_qmnu_op) (struct gspca_dev *,
@@ -105,6 +109,9 @@ struct sd_desc {
cam_qmnu_op querymenu;
cam_streamparm_op get_streamparm;
cam_streamparm_op set_streamparm;
+   cam_reg_op set_register;
+   cam_reg_op get_register;
+   cam_ident_op get_chip_ident;
 };
 
 /* packet types when moving from iso buf to frame buf */
-- 
1.5.6.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 0/2] gspca sn9c20x subdriver rev2

2009-07-17 Thread Brian Johnson
Mauro,
Here is the updated version of the gspca sn9c20x subdriver.

I've removed the custom debugging support and replaced it with support
for the v4l2 debugging ioctls. The first patch in this set adds support
to the gspca core for those ioctls. Also included are the fixes Hans
sent in his last email.

Regards,
Brian Johnson

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


Re: [PATCH 1/1] gspca: Add sn9c20x subdriver

2009-07-15 Thread Brian Johnson
Hans,
Thanks for the feedback, I'll work on the changes and hopefully post the 
revised patch this weekend.
> Hi,
> 
> First of all many many thanks for doings this!
> There are 4 issues with this driver, 2 of which are blockers:
> 
> 1) The big one is the use of a custom debugging mechanism,
> please use the v4l standard debugging mechanism
> which is activated by the kernel config option
> VIDEO_ADV_DEBUG, please use this define to
> enable / disable the debugging features of this
> driver and use the standard VIDIOC_DBG_G_REGISTER
> and VIDIOC_DBG_S_REGISTER ioctl's instead of an
> sysfs interface. Note I'm not very familiar with
> these myself, please send any questions on this to the
> list.
>
Ok I'll change the debugging code to use those ioctl's instead of debugfs.
> 2) :
> 
>> +case SENSOR_OV7660:
>> +if (ov7660_init_sensor(gspca_dev)<  0)
>> +return -ENODEV;
>> +info("OV7660 sensor detected");
> 
> You are missing a break here! Which I found out because
> my only sn9c20x cam has ab ov7660 sensor
Oops. 

> 
>> +case SENSOR_OV7670:
>> +if (ov7670_init_sensor(gspca_dev)<  0)
>> +return -ENODEV;
>> +info("OV7670 sensor detected");
>> +break;
> 
> 3) My cam works a lot better with the standalone driver
> then with you're gspca version. With your version it shows
> a bayer pattern ish pattern over the whole picture as if
> the bayer pixel order is of, except that the colors are right
> so that is most likely not the cause. I'll investigate this
> further as time permits.
> 
Hmm, Hans can you see if disabling the code for hvflip on the ov7660 helps any?

> 4) The evdev device creation and handling realyl belongs in the
> gspca core, as we can (and should) handle the snapshot button
> in other drivers too, but this is something which can be fixed
> after merging.


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


[PATCH 0/1] gspca support for sn9c20x webcams

2009-07-06 Thread Brian Johnson
Ok so its taken longer then I was orignally planning to send out this
patch. I've tested this with my 0c45:624f camera that uses the OV9650
sensor. It has also been tested as working against at 0c45:6270 camera
using the MT9V111 sensor. 

Regards,
Brian johnson

--
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: Convert cpia driver to v4l2, drop parallel port version support?

2009-06-17 Thread Brian Johnson
Hans de Goede wrote:
>>> sn9c102
>>> Supports a large number of cams also supported by gspca's sonixb / sonixj 
>>> driver, we're using
>>> #ifdef  macros to detect if both are being build at the same time to 
>>> include usb-id's only
>>> in one of the 2.
>> Btw, it would be interesting to work with the out-of-tree microdia driver,
>> since there are some models that are supported only by the alternative 
>> driver.
> 
> Ack, only one small problem, which is another reason why Luca's drivers 
> should slowly be phased
> out, Luca has gone closed source with his sn9cxxx driver.
> 
> There is an out of tree driver for the new sn9c2xx models you talk about 
> though, with active
> developers, I've pushing them to get it into the mainline, I'll give it 
> another try soonish.
> 

Hello I'm one of the developers for the current out of tree sn9c20x driver.  
What needs to be done in order
to get the sn9c20x code into the mainline? Am i right in assuming it would be 
preferred to move the code into 
a sn9c20x gspca subdriver rather then include the complete out of tree driver? 
If this is the case I can work
on a set of patches to implement our code as a gspca subdriver.

Also i have a few questions regarding submitting the patches.

1) In addition to sending them to linux-media should I CC them to anyone in 
particular?
2) The entire patch would likely be about 70k. Should I just send one patch or 
split the
thing up into several?

Thanks,
Brian

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