[linuxtv-commits] [hg:v4l-dvb] Don't increment if a patch were renamed

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8345 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Don't increment if a patch were renamed


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 hgimport |3 +++
 1 file changed, 3 insertions(+)

diff -r 95a1b4af3882 -r 5d98b43bc613 hgimport
--- a/hgimport  Thu Jul 17 10:34:11 2008 -0300
+++ b/hgimport  Thu Jul 17 10:58:44 2008 -0300
@@ -68,6 +68,9 @@ for i in $CS; do
echo -e \t\tNode parents $parents
echo -e \t\tRenamed to $newname
mv $name $newname
+
+   # Avoids incrementing if rename happens
+   j=$((j-1))
fi
else
last=`hg log -r -1|grep changeset`


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/5d98b43bc613deda5d4464ab9626eea698ec48ce

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] merge...

2008-07-17 Thread Patch added by Jean-Francois Moine
The patch number 8347 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

merge...


---

 linux/drivers/media/common/ir-functions.c|4 
 linux/drivers/media/common/tuners/tda18271-priv.h|8 
 linux/drivers/media/common/tuners/tuner-xc2028.c |8 
 linux/drivers/media/dvb/b2c2/flexcop-common.h|6 
 linux/drivers/media/dvb/b2c2/flexcop-usb.c   |3 
 linux/drivers/media/dvb/bt8xx/bt878.h|6 
 linux/drivers/media/dvb/bt8xx/dst_common.h   |6 
 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c|   43 -
 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.h|6 
 linux/drivers/media/dvb/cinergyT2/cinergyT2.c|   24 -
 linux/drivers/media/dvb/dvb-core/dmxdev.h|   10 
 linux/drivers/media/dvb/dvb-core/dvb_demux.h |6 
 linux/drivers/media/dvb/dvb-core/dvb_frontend.h  |6 
 linux/drivers/media/dvb/dvb-core/dvb_net.c   |6 
 linux/drivers/media/dvb/dvb-core/dvbdev.c|2 
 linux/drivers/media/dvb/dvb-usb/a800.c   |3 
 linux/drivers/media/dvb/dvb-usb/af9005.c |3 
 linux/drivers/media/dvb/dvb-usb/anysee.c |3 
 linux/drivers/media/dvb/dvb-usb/au6610.c |3 
 linux/drivers/media/dvb/dvb-usb/cxusb.c  |3 
 linux/drivers/media/dvb/dvb-usb/dibusb-mb.c  |3 
 linux/drivers/media/dvb/dvb-usb/dibusb-mc.c  |3 
 linux/drivers/media/dvb/dvb-usb/digitv.c |3 
 linux/drivers/media/dvb/dvb-usb/dtt200u.c|3 
 linux/drivers/media/dvb/dvb-usb/dvb-usb-remote.c |2 
 linux/drivers/media/dvb/dvb-usb/dvb-usb.h|   10 
 linux/drivers/media/dvb/dvb-usb/gl861.c  |3 
 linux/drivers/media/dvb/dvb-usb/gp8psk.c |3 
 linux/drivers/media/dvb/dvb-usb/m920x.c  |3 
 linux/drivers/media/dvb/dvb-usb/nova-t-usb2.c|3 
 linux/drivers/media/dvb/dvb-usb/umt-010.c|3 
 linux/drivers/media/dvb/dvb-usb/vp702x.c |3 
 linux/drivers/media/dvb/dvb-usb/vp7045.c |3 
 linux/drivers/media/dvb/frontends/bcm3510.c  |6 
 linux/drivers/media/dvb/ttpci/av7110.h   |   14 
 linux/drivers/media/dvb/ttpci/av7110_ir.c|4 
 linux/drivers/media/dvb/ttpci/budget-ci.c|4 
 linux/drivers/media/dvb/ttpci/budget.h   |7 
 linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c  |7 
 linux/drivers/media/dvb/ttusb-dec/ttusb_dec.c|   10 
 linux/drivers/media/radio/miropcm20-rds-core.c   |6 
 linux/drivers/media/radio/radio-aimslab.c|4 
 linux/drivers/media/radio/radio-aztech.c |4 
 linux/drivers/media/radio/radio-maxiradio.c  |6 
 linux/drivers/media/radio/radio-sf16fmi.c|6 
 linux/drivers/media/radio/radio-sf16fmr2.c   |4 
 linux/drivers/media/radio/radio-si470x.c |6 
 linux/drivers/media/radio/radio-typhoon.c|4 
 linux/drivers/media/radio/radio-zoltrix.c|4 
 linux/drivers/media/video/arv.c  |6 
 linux/drivers/media/video/au0828/au0828-core.c   |5 
 linux/drivers/media/video/au0828/au0828.h|8 
 linux/drivers/media/video/bt8xx/bt832.c  |   11 
 linux/drivers/media/video/bt8xx/bttv-cards.c |5 
 linux/drivers/media/video/bt8xx/bttv-driver.c|4 
 linux/drivers/media/video/bt8xx/bttv-gpio.c  |7 
 linux/drivers/media/video/bt8xx/bttv-i2c.c   |4 
 linux/drivers/media/video/bt8xx/bttv-input.c |4 
 linux/drivers/media/video/bt8xx/bttv.h   |2 
 linux/drivers/media/video/bt8xx/bttvp.h  |6 
 linux/drivers/media/video/bw-qcam.c  |2 
 linux/drivers/media/video/bw-qcam.h  |4 
 linux/drivers/media/video/c-qcam.c   |6 
 linux/drivers/media/video/cpia.c |2 
 linux/drivers/media/video/cpia.h |   10 
 linux/drivers/media/video/cpia2/cpia2.h  |4 
 linux/drivers/media/video/cx18/cx18-driver.h |   16 
 linux/drivers/media/video/cx23885/Kconfig|1 
 linux/drivers/media/video/cx23885/cx23885-dvb.c  | 

[linuxtv-commits] [hg:v4l-dvb] gspca: Buffers for USB exchanges cannot be in the stack.

2008-07-17 Thread Patch from Jean-Francois Moine
The patch number 8352 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Jean-Francois Moine  [EMAIL PROTECTED]
gspca: Buffers for USB exchanges cannot be in the stack.


gspca:Protect dq_callback() against simultaneous USB exchanges.
  Temporary buffer for USB exchanges added in the device struct.
(all) Use a temporary buffer for all USB exchanges.

Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/conex.c   |  421 --
 linux/drivers/media/video/gspca/etoms.c   |  493 +++---
 linux/drivers/media/video/gspca/gspca.c   |6 
 linux/drivers/media/video/gspca/gspca.h   |1 
 linux/drivers/media/video/gspca/mars.c|  180 
 linux/drivers/media/video/gspca/ov519.c   |   21 
 linux/drivers/media/video/gspca/pac207.c  |   23 -
 linux/drivers/media/video/gspca/pac7311.c |  355 +++
 linux/drivers/media/video/gspca/sonixb.c  |  163 +++
 linux/drivers/media/video/gspca/sonixj.c  |  313 ++---
 linux/drivers/media/video/gspca/spca500.c |  285 ++--
 linux/drivers/media/video/gspca/spca501.c |   29 -
 linux/drivers/media/video/gspca/spca505.c |   26 -
 linux/drivers/media/video/gspca/spca506.c |   37 -
 linux/drivers/media/video/gspca/spca508.c |   39 -
 linux/drivers/media/video/gspca/spca561.c |  121 ++---
 linux/drivers/media/video/gspca/stk014.c  |   86 +--
 linux/drivers/media/video/gspca/sunplus.c |  295 ++---
 linux/drivers/media/video/gspca/t613.c|  222 -
 linux/drivers/media/video/gspca/tv8532.c  |  400 +++--
 linux/drivers/media/video/gspca/vc032x.c  |   83 +--
 linux/drivers/media/video/gspca/zc3xx.c   |  204 -
 22 files changed, 1850 insertions(+), 1953 deletions(-)

diff discarded since it is too big

---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2b59554e9460ff4f94b556cd00158aa294787494

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Better gain for bridge sn9c10x - sensor ov6650.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8354 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: Better gain for bridge sn9c10x - sensor ov6650.


sonixb:   Better gain for ov6650.

Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |   30 +--
 1 file changed, 13 insertions(+), 17 deletions(-)

diff -r 0fdbcbf65ae1 -r 1c115821c37f linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Mon Jul 14 11:50:26 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Mon Jul 14 12:11:42 2008 +0200
@@ -39,8 +39,8 @@ struct sd {
   sensor, so we use a per cam copy */
atomic_t avg_lum;
 
-   unsigned short gain;
-   unsigned short exposure;
+   unsigned char gain;
+   unsigned char exposure;
unsigned char brightness;
unsigned char autogain;
unsigned char autogain_ignore_frames;
@@ -73,7 +73,7 @@ struct sd {
ignore atleast the 2 next frames for the new settings to come into effect
before doing any other adjustments */
 #define AUTOGAIN_IGNORE_FRAMES 3
-#define AUTOGAIN_DEADZONE 500
+#define AUTOGAIN_DEADZONE 1000
 #define DESIRED_AVG_LUM 7000
 
 /* V4L2 controls supported by the driver */
@@ -107,10 +107,10 @@ static struct ctrl sd_ctrls[] = {
.type= V4L2_CTRL_TYPE_INTEGER,
.name= Gain,
.minimum = 0,
-   .maximum = 511,
+   .maximum = 255,
.step= 1,
-#define GAIN_DEF 255
-#define GAIN_KNEE 400
+#define GAIN_DEF 127
+#define GAIN_KNEE 200
.default_value = GAIN_DEF,
},
.set = sd_setgain,
@@ -122,9 +122,9 @@ static struct ctrl sd_ctrls[] = {
.type = V4L2_CTRL_TYPE_INTEGER,
.name = Exposure,
 #define EXPOSURE_DEF 0
-#define EXPOSURE_KNEE 353 /* 10 fps */
+#define EXPOSURE_KNEE 176 /* 10 fps */
.minimum = 0,
-   .maximum = 511,
+   .maximum = 255,
.step = 1,
.default_value = EXPOSURE_DEF,
.flags = 0,
@@ -589,11 +589,6 @@ static void setsensorgain(struct gspca_d
 static void setsensorgain(struct gspca_dev *gspca_dev)
 {
struct sd *sd = (struct sd *) gspca_dev;
-   unsigned short gain;
-
-   gain = (sd-gain + 1)  1;
-   if (gain  255)
-   gain = 255;
 
switch (sd-sensor) {
 
@@ -601,14 +596,15 @@ static void setsensorgain(struct gspca_d
__u8 i2c[] =
{0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10};
 
-   i2c[4] = 255 - gain;
+   i2c[4] = 255 - sd-gain;
if (i2c_w(gspca_dev, i2c)  0)
goto err;
break;
}
case SENSOR_OV6650: {
__u8 i2c[] = {0xa0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
-   i2c[3] = gain;
+
+   i2c[3] = sd-gain  3;
if (i2c_w(gspca_dev, i2c)  0)
goto err;
break;
@@ -625,7 +621,7 @@ static void setgain(struct gspca_dev *gs
__u8 gain;
__u8 rgb_value;
 
-   gain = sd-gain  5;
+   gain = sd-gain  4;
 
/* red and blue gain */
rgb_value = gain  4 | gain;
@@ -642,7 +638,7 @@ static void setexposure(struct gspca_dev
 {
struct sd *sd = (struct sd *) gspca_dev;
/* translate 0 - 255 to a number of fps in a 30 - 1 scale */
-   int fps = 30 - sd-exposure * 29 / 511;
+   int fps = 30 - sd-exposure * 29 / 255;
 
switch (sd-sensor) {
case SENSOR_TAS5110: {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/1c115821c37f7cc690d2aca4e5fb85b79d4e24a9

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Perfect exposure for sn9c10x, sensor ov6650.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8357 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: Perfect exposure for sn9c10x, sensor ov6650.


Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |   54 ++-
 1 file changed, 43 insertions(+), 11 deletions(-)

diff -r 13fbcd744c76 -r 7035f61808ba linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Tue Jul 15 07:36:30 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Tue Jul 15 11:36:42 2008 +0200
@@ -121,8 +121,8 @@ static struct ctrl sd_ctrls[] = {
.id = V4L2_CID_EXPOSURE,
.type = V4L2_CTRL_TYPE_INTEGER,
.name = Exposure,
-#define EXPOSURE_DEF 0
-#define EXPOSURE_KNEE 176 /* 10 fps */
+#define EXPOSURE_DEF  16 /*  32 ms / 30 fps */
+#define EXPOSURE_KNEE 50 /* 100 ms / 10 fps */
.minimum = 0,
.maximum = 255,
.step = 1,
@@ -637,8 +637,6 @@ static void setexposure(struct gspca_dev
 static void setexposure(struct gspca_dev *gspca_dev)
 {
struct sd *sd = (struct sd *) gspca_dev;
-   /* translate 0 - 255 to a number of fps in a 30 - 1 scale */
-   int fps = 30 - sd-exposure * 29 / 255;
 
switch (sd-sensor) {
case SENSOR_TAS5110: {
@@ -647,19 +645,53 @@ static void setexposure(struct gspca_dev
/* register 19's high nibble contains the sn9c10x clock divider
   The high nibble configures the no fps according to the
   formula: 60 / high_nibble. With a maximum of 30 fps */
-   reg = 60 / fps;
-   if (reg  15)
+   reg = 120 * sd-exposure / 1000;
+   if (reg  2)
+   reg = 2;
+   else if (reg  15)
reg = 15;
reg = (reg  4) | 0x0b;
reg_w(gspca_dev, 0x19, reg, 1);
break;
}
case SENSOR_OV6650: {
-   __u8 i2c[] = {0xa0, 0x60, 0x11, 0xc0, 0x00, 0x00, 0x00, 0x10};
-   i2c[3] = 30 / fps - 1;
-   if (i2c[3]  15)
-   i2c[3] = 15;
-   i2c[3] |= 0xc0;
+   /* The ov6650 has 2 registers which both influence exposure,
+  first there is register 11, whose low nibble sets the no fps
+  according to: fps = 30 / (low_nibble + 1)
+
+  The fps configures the maximum exposure setting, but it is
+  possible to use less exposure then what the fps maximum
+  allows by setting register 10. register 10 configures the
+  actual exposure as quotient of the full exposure, with 0
+  being no exposure at all (not very usefull) and reg10_max
+  being max exposure possible at that framerate.
+
+  The code maps our 0 - 510 ms exposure ctrl to these 2
+  registers, trying to keep fps as high as possible.
+   */
+   __u8 i2c[] = {0xb0, 0x60, 0x10, 0x00, 0xc0, 0x00, 0x00, 0x10};
+   int reg10, reg11;
+   /* No clear idea why, but setting reg10 above this value
+  results in no change */
+   const int reg10_max = 0x4d;
+
+   reg11 = (60 * sd-exposure + 999) / 1000;
+   if (reg11  1)
+   reg11 = 1;
+   else if (reg11  16)
+   reg11 = 16;
+
+   /* frame exposure time in ms = 1000 * reg11 / 30-
+   reg10 = sd-exposure * 2 * reg10_max / (1000 * reg11 / 30) */
+   reg10 = (sd-exposure * 60 * reg10_max) / (1000 * reg11);
+   if (reg10  1) /* 0 is a valid value, but is very _black_ */
+   reg10 = 1;
+   else if (reg10  reg10_max)
+   reg10 = reg10_max;
+
+   /* Write reg 10 and reg11 low nibble */
+   i2c[3] = reg10;
+   i2c[4] |= reg11 - 1;
if (i2c_w(gspca_dev, i2c)  0)
PDEBUG(D_ERR, i2c error exposure);
break;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/7035f61808ba121f25a19ab5ba204f95ac0a2c20

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Real names of the zc3xx registers.

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8359 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
gspca: Real names of the zc3xx registers.


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/zc3xx.c | 8184 
 1 file changed, 4102 insertions(+), 4082 deletions(-)

diff discarded since it is too big

---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/afdd8e33a645444101f662feca0e1d456be29f7e

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Light frequency filter / exposure / clean-up for sn9c103 ov7630.

2008-07-17 Thread Patch from Andoni Zubimendi
The patch number 8367 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Andoni Zubimendi  [EMAIL PROTECTED]
gspca: Light frequency filter / exposure / clean-up for sn9c103 ov7630.


Signed-off-by: Andoni Zubimendi [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |   41 ++-
 1 file changed, 19 insertions(+), 22 deletions(-)

diff -r 52caa9704f42 -r fc673dad0c40 linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Wed Jul 16 17:29:11 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 07:35:52 2008 +0200
@@ -317,22 +317,9 @@ static const __u8 ov7630_sensor_init[][8
{0xa0, 0x21, 0x76, 0x02, 0xbd, 0x06, 0xf6, 0x16},
{0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},   /* gain */
 };
-static const __u8 ov7630_sensor_init_3[][5][8] = {
-{  {0xa0, 0x21, 0x10, 0x36, 0xbd, 0x06, 0xf6, 0x16},  /* exposure */
-   {0xa0, 0x21, 0x76, 0x03, 0xbd, 0x06, 0xf6, 0x16},
-   {0xa0, 0x21, 0x11, 0x01, 0xbd, 0x06, 0xf6, 0x16},
-   {0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},   /* gain */
-   {0xb0, 0x21, 0x2a, 0xa0, 0x1c, 0x06, 0xf6, 0x1d},
-},
-{  {0xa0, 0x21, 0x10, 0x83, 0xbd, 0x06, 0xf6, 0x16},  /* exposure */
-   {0xa0, 0x21, 0x76, 0x00, 0xbd, 0x06, 0xf6, 0x16},
-   {0xa0, 0x21, 0x11, 0x00, 0xbd, 0x06, 0xf6, 0x16},
-   {0xa0, 0x21, 0x00, 0x10, 0xbd, 0x06, 0xf6, 0x15},   /* gain */
-/* {0xb0, 0x21, 0x2a, 0xc0, 0x3c, 0x06, 0xf6, 0x1d},
-   * a0 1c,a0 1f,c0 3c frame rate ?line interval from ov6630 */
-/* {0xb0, 0x21, 0x2a, 0xa0, 0x1f, 0x06, 0xf6, 0x1d},* from win */
-   {0xb0, 0x21, 0x2a, 0x80, 0x60, 0x06, 0xf6, 0x1d},
-}
+static const __u8 ov7630_sensor_init_3[][8] = {
+   {0xa0, 0x21, 0x2a, 0xa0, 0x00, 0x00, 0x00, 0x10},
+   {0xa0, 0x21, 0x2a, 0x80, 0x00, 0x00, 0x00, 0x10},
 };
 
 static const __u8 initPas106[] = {
@@ -719,6 +706,15 @@ static void setexposure(struct gspca_dev
i2c[1] = sd-sensor_addr;
i2c[3] = reg10;
i2c[4] |= reg11 - 1;
+   if (sd-sensor == SENSOR_OV7630_3) {
+   __u8 reg76 = reg10  0x03;
+   __u8 i2c_reg76[] = {0xa0, 0x21, 0x76, 0x00,
+   0x00, 0x00, 0x00, 0x10};
+   reg10 = 2;
+   i2c_reg76[3] = reg76;
+   if (i2c_w(gspca_dev, i2c_reg76)  0)
+   PDEBUG(D_ERR, i2c error exposure);
+   }
if (i2c_w(gspca_dev, i2c)  0)
PDEBUG(D_ERR, i2c error exposure);
break;
@@ -731,12 +727,13 @@ static void setfreq(struct gspca_dev *gs
struct sd *sd = (struct sd *) gspca_dev;
 
switch (sd-sensor) {
-   case SENSOR_OV6650: {
+   case SENSOR_OV6650:
+   case SENSOR_OV7630_3: {
/* Framerate adjust register for artificial light 50 hz flicker
   compensation, identical to ov6630 0x2b register, see ov6630
   datasheet.
   0x4f - (30 fps - 25 fps), 0x00 - no adjustment */
-   __u8 i2c[] = {0xa0, 0x60, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10};
+   __u8 i2c[] = {0xa0, 0x00, 0x2b, 0x00, 0x00, 0x00, 0x00, 0x10};
switch (sd-freq) {
default:
 /* case 0:  * no filter*/
@@ -744,9 +741,10 @@ static void setfreq(struct gspca_dev *gs
i2c[3] = 0;
break;
case 1: /* 50 hz */
-   i2c[3] = 0x4f;
+   i2c[3] = (sd-sensor == SENSOR_OV6650)? 0x4f:0x8a;
break;
}
+   i2c[1] = sd-sensor_addr;
if (i2c_w(gspca_dev, i2c)  0)
PDEBUG(D_ERR, i2c error setfreq);
break;
@@ -830,7 +828,7 @@ static int sd_config(struct gspca_dev *g
sd-sensor_addr = 0x21;
sd-fr_h_sz = 18;   /* size of frame header */
sd-sensor_has_gain = 1;
-   sd-sd_desc.nctrls = 4;
+   sd-sd_desc.nctrls = 5;
sd-sd_desc.dq_callback = do_autogain;
sd-autogain = 0;
break;
@@ -1008,8 +1006,7 @@ static void sd_start(struct gspca_dev *g
i2c_w_vector(gspca_dev, ov7630_sensor_init_com,
 

[linuxtv-commits] [hg:v4l-dvb] gspca: Better code for ov6650 and ov7630.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8366 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: Better code for ov6650 and ov7630.


sonixb:   Common code between ov6650 and ov7630.
  Fix brightness oscillation with ov6650 sensor.

Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |   97 ---
 1 file changed, 37 insertions(+), 60 deletions(-)

diff -r 001d4f4abaa5 -r 52caa9704f42 linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Wed Jul 16 15:32:16 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Wed Jul 16 17:29:11 2008 +0200
@@ -48,7 +48,6 @@ struct sd {
 
unsigned char fr_h_sz;  /* size of frame header */
char sensor;/* Type of image sensor chip */
-   char sensor_has_gain;
 #define SENSOR_HV7131R 0
 #define SENSOR_OV6650 1
 #define SENSOR_OV7630 2
@@ -57,6 +56,8 @@ struct sd {
 #define SENSOR_PAS202 5
 #define SENSOR_TAS5110 6
 #define SENSOR_TAS5130CXX 7
+   char sensor_has_gain;
+   __u8 sensor_addr;
 };
 
 #define COMP2 0x8f
@@ -521,21 +522,14 @@ static void setbrightness(struct gspca_d
__u8 value;
 
switch (sd-sensor) {
-   case SENSOR_OV6650: {
-   __u8 i2cOV6650[] =
-   {0xa0, 0x60, 0x06, 0x11, 0x99, 0x04, 0x94, 0x15};
-
-   i2cOV6650[3] = sd-brightness;
-   if (i2c_w(gspca_dev, i2cOV6650)  0)
-goto err;
-   break;
-   }
+   case  SENSOR_OV6650:
case  SENSOR_OV7630_3:
case  SENSOR_OV7630: {
__u8 i2cOV[] =
-   {0xa0, 0x21, 0x06, 0x36, 0xbd, 0x06, 0xf6, 0x16};
+   {0xa0, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x10};
 
/* change reg 0x06 */
+   i2cOV[1] = sd-sensor_addr;
i2cOV[3] = sd-brightness;
if (i2c_w(gspca_dev, i2cOV)  0)
goto err;
@@ -605,6 +599,7 @@ static void setsensorgain(struct gspca_d
 static void setsensorgain(struct gspca_dev *gspca_dev)
 {
struct sd *sd = (struct sd *) gspca_dev;
+   unsigned char gain = sd-gain;
 
switch (sd-sensor) {
 
@@ -612,23 +607,20 @@ static void setsensorgain(struct gspca_d
__u8 i2c[] =
{0x30, 0x11, 0x02, 0x20, 0x70, 0x00, 0x00, 0x10};
 
-   i2c[4] = 255 - sd-gain;
+   i2c[4] = 255 - gain;
if (i2c_w(gspca_dev, i2c)  0)
goto err;
break;
}
-   case SENSOR_OV6650: {
-   __u8 i2c[] = {0xa0, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
-
-   i2c[3] = sd-gain  3;
-   if (i2c_w(gspca_dev, i2c)  0)
-   goto err;
-   break;
-   }
+
+   case SENSOR_OV6650:
+   gain = 1;
+   /* fall thru */
case SENSOR_OV7630_3: {
-   __u8 i2c[] = {0xa0, 0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
-
-   i2c[3] = sd-gain  2;
+   __u8 i2c[] = {0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10};
+
+   i2c[1] = sd-sensor_addr;
+   i2c[3] = gain  2;
if (i2c_w(gspca_dev, i2c)  0)
goto err;
break;
@@ -678,9 +670,10 @@ static void setexposure(struct gspca_dev
reg_w(gspca_dev, 0x19, reg, 1);
break;
}
-   case SENSOR_OV6650: {
-   /* The ov6650 has 2 registers which both influence exposure,
-  first there is register 11, whose low nibble sets the no fps
+   case SENSOR_OV6650:
+   case SENSOR_OV7630_3: {
+   /* The ov6650 / ov7630 have 2 registers which both influence
+  exposure, register 11, whose low nibble sets the nr off fps
   according to: fps = 30 / (low_nibble + 1)
 
   The fps configures the maximum exposure setting, but it is
@@ -693,15 +686,15 @@ static void setexposure(struct gspca_dev
   The code maps our 0 - 510 ms exposure ctrl to these 2
   registers, trying to keep fps as high as possible.
*/
-   __u8 i2c[] = {0xb0, 0x60, 0x10, 0x00, 0xc0, 0x00, 0x00, 0x10};
+   __u8 i2c[] = {0xb0, 0x00, 0x10, 0x00, 0xc0, 0x00, 0x00, 0x10};
int reg10, reg11;
/* ov6645 datasheet says reg10_max is 9a, but 

[linuxtv-commits] [hg:v4l-dvb] gspca: Bad initialization of sn9c102 ov7630.

2008-07-17 Thread Patch from Jean-Francois Moine
The patch number 8369 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Jean-Francois Moine  [EMAIL PROTECTED]
gspca: Bad initialization of sn9c102 ov7630.


Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |9 -
 linux/drivers/media/video/gspca/vc032x.c |4 ++--
 2 files changed, 10 insertions(+), 3 deletions(-)

diff -r e7aa8d7a1cfd -r 68744dfd933c linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 07:41:50 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 11:37:57 2008 +0200
@@ -274,10 +274,17 @@ static const __u8 initOv7630[] = {
 static const __u8 initOv7630[] = {
0x04, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, /* r01 .. r08 */
0x21, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* r09 .. r10 */
+#if 1
0x00, 0x02, 0x01, 0x0a, /* r11 .. r14 */
0x28, 0x1e, /* H  V sizes r15 .. r16 */
0x68, COMP1, MCK_INIT1, /* r17 .. r19 */
0x1d, 0x10, 0x02, 0x03, 0x0f, 0x0c  /* r1a .. r1f */
+#else /* jfm from win */
+   0x00, 0x01, 0x01, 0x0a, /* r11 .. r14 */
+   0x16, 0x12, /* H  V sizes r15 .. r16 */
+   0x68, COMP2, MCK_INIT1, /* r17 .. r19 */
+   0x1d, 0x10, 0x06, 0x01, 0x00, 0x03  /* r1a .. r1f */
+#endif
 };
 static const __u8 initOv7630_3[] = {
0x44, 0x44, 0x00, 0x1a, 0x20, 0x20, 0x20, 0x80, /* r01 .. r08 */
@@ -964,7 +971,7 @@ static void sd_start(struct gspca_dev *g
case SENSOR_OV7630:
reg01 = 0x06;
reg17 = 0x29;
-   l = 0x10;
+   l = sizeof initOv7630;
break;
case SENSOR_OV7630_3:
reg01 = 0x44;
diff -r e7aa8d7a1cfd -r 68744dfd933c linux/drivers/media/video/gspca/vc032x.c
--- a/linux/drivers/media/video/gspca/vc032x.c  Thu Jul 17 07:41:50 2008 +0200
+++ b/linux/drivers/media/video/gspca/vc032x.c  Thu Jul 17 11:37:57 2008 +0200
@@ -934,14 +934,14 @@ static const __u8 ov7660_initQVGA_data[]
{0xb8, 0x8f, 0xff, 0xcc}, /* ff */
{0x00, 0x29, 0x3c, 0xaa},
{0xb3, 0x01, 0x45, 0xcc}, /* 45 */
-   {0x00, 0x00, 0x00, 0x00}
+   {}
 };
 
 static const __u8 ov7660_50HZ[][4] = {
{0x00, 0x3b, 0x08, 0xaa},
{0x00, 0x9d, 0x40, 0xaa},
{0x00, 0x13, 0xa7, 0xaa},
-   {0x00, 0x00, 0x00, 0x00}
+   {}
 };
 
 static const __u8 ov7660_60HZ[][4] = {


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/68744dfd933c8498c86af6bfe80b633882048566

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Webcam 0461:0821 added.

2008-07-17 Thread Patch from Jean-Francois Moine
The patch number 8370 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Jean-Francois Moine  [EMAIL PROTECTED]
gspca: Webcam 0461:0821 added.


Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c  |4 ++--
 linux/drivers/media/video/gspca/sunplus.c |   12 ++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff -r 68744dfd933c -r fb63a81c3bec linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 11:37:57 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 11:41:03 2008 +0200
@@ -24,8 +24,8 @@
 
 #include gspca.h
 
-#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 1, 7)
-static const char version[] = 2.1.7;
+#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 1, 8)
+static const char version[] = 2.1.8;
 
 MODULE_AUTHOR(Michel Xhaard [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(GSPCA/SN9C102 USB Camera Driver);
diff -r 68744dfd933c -r fb63a81c3bec linux/drivers/media/video/gspca/sunplus.c
--- a/linux/drivers/media/video/gspca/sunplus.c Thu Jul 17 11:37:57 2008 +0200
+++ b/linux/drivers/media/video/gspca/sunplus.c Thu Jul 17 11:41:03 2008 +0200
@@ -24,8 +24,8 @@
 #include gspca.h
 #include jpeg.h
 
-#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 1, 7)
-static const char version[] = 2.1.7;
+#define DRIVER_VERSION_NUMBER  KERNEL_VERSION(2, 1, 8)
+static const char version[] = 2.1.8;
 
 MODULE_AUTHOR(Michel Xhaard [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(GSPCA/SPCA5xx USB Camera Driver);
@@ -858,6 +858,13 @@ static int sd_config(struct gspca_dev *g
 /* break; */
 /* } */
break;
+   case 0x0461:/* MicroInnovation */
+/* switch (product) { */
+/* case 0x0821: */
+   sd-bridge = BRIDGE_SPCA533;
+/* break; */
+/* } */
+   break;
case 0x046d:/* Logitech Labtec */
switch (product) {
case 0x0905:
@@ -1610,6 +1617,7 @@ static const __devinitdata struct usb_de
{USB_DEVICE(0x041e, 0x4012), DVNM(PC-Cam350)},
{USB_DEVICE(0x041e, 0x4013), DVNM(Creative Pccam750)},
{USB_DEVICE(0x0458, 0x7006), DVNM(Genius Dsc 1.3 Smart)},
+   {USB_DEVICE(0x0461, 0x0821), DVNM(Fujifilm MV-1)},
{USB_DEVICE(0x046d, 0x0905), DVNM(Logitech ClickSmart 820)},
{USB_DEVICE(0x046d, 0x0960), DVNM(Logitech ClickSmart 420)},
{USB_DEVICE(0x0471, 0x0322), DVNM(Philips DMVC1300K)},


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/fb63a81c3bec2a27790aae4d9f863e103ca83359

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Small ov6650 fixes.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8372 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: Small ov6650 fixes.


1) Don't change  the red and blue pre-gain's from their defaults
2) Actually make the powerline freq ctrl available to userspace

Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |   19 ++-
 1 file changed, 14 insertions(+), 5 deletions(-)

diff -r 105c9947b715 -r 104eafeea61a linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:12:55 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:24:47 2008 +0200
@@ -246,8 +246,15 @@ static const __u8 ov6650_sensor_init[][8
{0xd0, 0x60, 0x26, 0x01, 0x14, 0xd8, 0xa4, 0x10}, /* format out? */
{0xd0, 0x60, 0x26, 0x01, 0x14, 0xd8, 0xa4, 0x10},
{0xa0, 0x60, 0x30, 0x3d, 0x0A, 0xd8, 0xa4, 0x10},
-   /* Disable autobright ? */
-   {0xb0, 0x60, 0x60, 0x66, 0x68, 0xd8, 0xa4, 0x10},
+   /* Enable rgb brightness control */
+   {0xa0, 0x60, 0x61, 0x08, 0x00, 0x00, 0x00, 0x10},
+   /* HDG: Note windows uses the line below, which sets both register 0x60
+  and 0x61 I believe these registers of the ov6650 are identical as
+  those of the ov7630, because if this is true the windows settings
+  add a bit additional red gain and a lot additional blue gain, which
+  matches my findings that the windows settings make blue much too
+  blue and red a little too red.
+   {0xb0, 0x60, 0x60, 0x66, 0x68, 0xd8, 0xa4, 0x10}, */
/* Some more unknown stuff */
{0xa0, 0x60, 0x68, 0x04, 0x68, 0xd8, 0xa4, 0x10},
{0xd0, 0x60, 0x17, 0x24, 0xd6, 0x04, 0x94, 0x10}, /* Clipreg */
@@ -688,7 +695,8 @@ static void setexposure(struct gspca_dev
   tline * 4 * reg10, which explains why the reg10max we've
   found experimentally for the ov6650 is exactly half that of
   the ov6645. The ov7630 datasheet says the max is 0x41. */
-   const int reg10_max = (sd-sensor == SENSOR_OV6650)? 0x4d:0x41;
+   const int reg10_max = (sd-sensor == SENSOR_OV6650)
+   ? 0x4d : 0x41;
 
reg11 = (60 * sd-exposure + 999) / 1000;
if (reg11  1)
@@ -748,7 +756,8 @@ static void setfreq(struct gspca_dev *gs
i2c[3] = 0;
break;
case 1: /* 50 hz */
-   i2c[3] = (sd-sensor == SENSOR_OV6650)? 0x4f:0x8a;
+   i2c[3] = (sd-sensor == SENSOR_OV6650)
+   ? 0x4f : 0x8a;
break;
}
i2c[1] = sd-sensor_addr;
@@ -820,7 +829,7 @@ static int sd_config(struct gspca_dev *g
sd-sensor = SENSOR_OV6650;
sd-sensor_has_gain = 1;
sd-sensor_addr = 0x60;
-   sd-sd_desc.nctrls = 4;
+   sd-sd_desc.nctrls = 5;
sd-sd_desc.dq_callback = do_autogain;
sif = 1;
break;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/104eafeea61a07f425d68ac75a8af6b14c706299

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: Hue, saturation and contrast controls added for sn9c10x ovxxxx.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8373 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: Hue, saturation and contrast controls added for sn9c10x ov.


(does not work with ov6650)

Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |  177 ++-
 1 file changed, 175 insertions(+), 2 deletions(-)

diff -r 104eafeea61a -r f7cae527fbde linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:24:47 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:30:56 2008 +0200
@@ -45,6 +45,9 @@ struct sd {
unsigned char autogain;
unsigned char autogain_ignore_frames;
unsigned char freq; /* light freq filter setting */
+   unsigned char saturation;
+   unsigned char hue;
+   unsigned char contrast;
 
unsigned char fr_h_sz;  /* size of frame header */
char sensor;/* Type of image sensor chip */
@@ -89,6 +92,12 @@ static int sd_getautogain(struct gspca_d
 static int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val);
 static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
 static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_setsaturation(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_getsaturation(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_sethue(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_gethue(struct gspca_dev *gspca_dev, __s32 *val);
+static int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val);
+static int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val);
 
 static struct ctrl sd_ctrls[] = {
{
@@ -165,6 +174,48 @@ static struct ctrl sd_ctrls[] = {
.set = sd_setfreq,
.get = sd_getfreq,
},
+   {
+   {
+   .id  = V4L2_CID_SATURATION,
+   .type= V4L2_CTRL_TYPE_INTEGER,
+   .name= Saturation,
+   .minimum = 0,
+   .maximum = 255,
+   .step= 1,
+#define SATURATION_DEF 127
+   .default_value = SATURATION_DEF,
+   },
+   .set = sd_setsaturation,
+   .get = sd_getsaturation,
+   },
+   {
+   {
+   .id  = V4L2_CID_HUE,
+   .type= V4L2_CTRL_TYPE_INTEGER,
+   .name= Hue,
+   .minimum = 0,
+   .maximum = 255,
+   .step= 1,
+#define HUE_DEF 127
+   .default_value = HUE_DEF,
+   },
+   .set = sd_sethue,
+   .get = sd_gethue,
+   },
+   {
+   {
+   .id  = V4L2_CID_CONTRAST,
+   .type= V4L2_CTRL_TYPE_INTEGER,
+   .name= Contrast,
+   .minimum = 0,
+   .maximum = 255,
+   .step= 1,
+#define CONTRAST_DEF 127
+   .default_value = CONTRAST_DEF,
+   },
+   .set = sd_setcontrast,
+   .get = sd_getcontrast,
+   },
 };
 
 static struct v4l2_pix_format vga_mode[] = {
@@ -768,6 +819,68 @@ static void setfreq(struct gspca_dev *gs
}
 }
 
+static void setsaturation(struct gspca_dev *gspca_dev)
+{
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   switch (sd-sensor) {
+/* case SENSOR_OV6650: */
+   case SENSOR_OV7630_3:
+   case SENSOR_OV7630: {
+   __u8 i2c[] = {0xa0, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x10};
+   i2c[1] = sd-sensor_addr;
+   i2c[3] = sd-saturation  0xf0;
+   if (i2c_w(gspca_dev, i2c)  0)
+   PDEBUG(D_ERR, i2c error setsaturation);
+   else
+   PDEBUG(D_CONF, saturation set to: %d,
+   (int)sd-saturation);
+   break;
+   }
+   }
+}
+
+static void sethue(struct gspca_dev *gspca_dev)
+{
+   struct sd *sd = (struct sd *) gspca_dev;
+
+   switch (sd-sensor) {
+/* case SENSOR_OV6650: */
+   case SENSOR_OV7630_3:
+   case SENSOR_OV7630: {
+   __u8 i2c[] = {0xa0, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x10};
+   i2c[1] = sd-sensor_addr;
+   i2c[3] = 0x20 | (sd-hue  3);
+   if 

[linuxtv-commits] [hg:v4l-dvb] merge: v4l-dvb

2008-07-17 Thread Patch added by Jean-Francois Moine
The patch number 8368 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

merge: v4l-dvb


---

 linux/drivers/media/dvb/frontends/tda1002x.h |2 
 linux/drivers/media/dvb/siano/smscoreapi.h   |3 
 linux/drivers/media/dvb/ttpci/Makefile   |6 
 linux/drivers/media/video/cx18/cx18-cards.c  |2 
 linux/drivers/media/video/cx18/cx18-cards.h  |1 
 linux/drivers/media/video/cx18/cx18-driver.c |1 
 linux/drivers/media/video/cx18/cx18-driver.h |1 
 linux/drivers/media/video/cx18/cx18-gpio.c   |   62 ++
 linux/drivers/media/video/cx18/cx18-gpio.h   |1 
 linux/drivers/media/video/cx18/cx18-ioctl.c  |   11 
 v4l/compat.h |6 
 v4l2-apps/lib/libv4l/COPYING.LIB |  510 +++
 v4l2-apps/lib/libv4l/ChangeLog   |5 
 v4l2-apps/lib/libv4l/Makefile|2 
 14 files changed, 603 insertions(+), 10 deletions(-)

diff discarded since it is too big

---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/e7aa8d7a1cfd5c157302efdbaee04042bb00bc13

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] gspca: No conflict of 0c45:6011 with the sn9c102 driver.

2008-07-17 Thread Patch from Hans de Goede
The patch number 8374 was added via Jean-Francois Moine [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans de Goede  [EMAIL PROTECTED]
gspca: No conflict of 0c45:6011 with the sn9c102 driver.


The sn9c102 driver claims to support usb-ID 0x0c45:0x6011, which is
a sn9c102 with ov6650 sensor, but the sn9c102 driver does not support the
ov6650 sensor (tested). Also the sn9c102 driver claims to support usb-ID
0x0c45:0x603f, which is a sn9c102 with CISVF10 sensor, but the sn9c102
driver does not support the CISVF10 sensor (not tested).

Signed-off-by: Hans de Goede [EMAIL PROTECTED]
Signed-off-by: Jean-Francois Moine [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/sonixb.c |2 ++
 linux/drivers/media/video/sn9c102/sn9c102_devtable.h |2 --
 2 files changed, 2 insertions(+), 2 deletions(-)

diff -r f7cae527fbde -r ed92c6358ca1 linux/drivers/media/video/gspca/sonixb.c
--- a/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:30:56 2008 +0200
+++ b/linux/drivers/media/video/gspca/sonixb.c  Thu Jul 17 12:34:28 2008 +0200
@@ -1459,7 +1459,9 @@ static __devinitdata struct usb_device_i
{USB_DEVICE(0x0c45, 0x6007), DVNM(Sonix sn9c101 + Tas5110D)},
{USB_DEVICE(0x0c45, 0x6009), DVNM([EMAIL PROTECTED])},
{USB_DEVICE(0x0c45, 0x600d), DVNM([EMAIL PROTECTED])},
+#endif
{USB_DEVICE(0x0c45, 0x6011), DVNM(MAX Webcam Microdia)},
+#ifndef CONFIG_USB_SN9C102
{USB_DEVICE(0x0c45, 0x6019), DVNM(Generic Sonix OV7630)},
{USB_DEVICE(0x0c45, 0x6024), DVNM(Generic Sonix Tas5130c)},
{USB_DEVICE(0x0c45, 0x6025), DVNM(Xcam Shanga)},
diff -r f7cae527fbde -r ed92c6358ca1 
linux/drivers/media/video/sn9c102/sn9c102_devtable.h
--- a/linux/drivers/media/video/sn9c102/sn9c102_devtable.h  Thu Jul 17 
12:30:56 2008 +0200
+++ b/linux/drivers/media/video/sn9c102/sn9c102_devtable.h  Thu Jul 17 
12:34:28 2008 +0200
@@ -44,7 +44,6 @@ static const struct usb_device_id sn9c10
{ SN9C102_USB_DEVICE(0x0c45, 0x6005, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6007, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6009, BRIDGE_SN9C102), },
-   { SN9C102_USB_DEVICE(0x0c45, 0x6011, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x600d, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6019, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6024, BRIDGE_SN9C102), },
@@ -57,7 +56,6 @@ static const struct usb_device_id sn9c10
{ SN9C102_USB_DEVICE(0x0c45, 0x602d, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x602e, BRIDGE_SN9C102), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6030, BRIDGE_SN9C102), },
-   { SN9C102_USB_DEVICE(0x0c45, 0x603f, BRIDGE_SN9C102), },
/* SN9C103 */
{ SN9C102_USB_DEVICE(0x0c45, 0x6080, BRIDGE_SN9C103), },
{ SN9C102_USB_DEVICE(0x0c45, 0x6082, BRIDGE_SN9C103), },


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/ed92c6358ca1a6a4dd37df79888196068973dc41

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] merge: http://linuxtv.org/hg/~jfrancois/gspca/

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8375 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
merge: http://linuxtv.org/hg/~jfrancois/gspca/


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/Documentation/video4linux/gspca.txt|6 
 linux/drivers/media/video/gspca/conex.c  |  421 
 linux/drivers/media/video/gspca/etoms.c  |  493 
 linux/drivers/media/video/gspca/gspca.c  |  252 
 linux/drivers/media/video/gspca/gspca.h  |3 
 linux/drivers/media/video/gspca/mars.c   |  180 
 linux/drivers/media/video/gspca/ov519.c  |   21 
 linux/drivers/media/video/gspca/pac207.c |   91 
 linux/drivers/media/video/gspca/pac7311.c|  355 
 linux/drivers/media/video/gspca/sonixb.c |  873 -
 linux/drivers/media/video/gspca/sonixj.c |  590 
 linux/drivers/media/video/gspca/spca500.c|  285 
 linux/drivers/media/video/gspca/spca501.c|   35 
 linux/drivers/media/video/gspca/spca505.c|   26 
 linux/drivers/media/video/gspca/spca506.c|   37 
 linux/drivers/media/video/gspca/spca508.c|   39 
 linux/drivers/media/video/gspca/spca561.c|  121 
 linux/drivers/media/video/gspca/stk014.c |   86 
 linux/drivers/media/video/gspca/sunplus.c|  305 
 linux/drivers/media/video/gspca/t613.c   |  222 
 linux/drivers/media/video/gspca/tv8532.c |  400 
 linux/drivers/media/video/gspca/vc032x.c |  130 
 linux/drivers/media/video/gspca/zc3xx-reg.h  |  261 
 linux/drivers/media/video/gspca/zc3xx.c  | 8394 +--
 linux/drivers/media/video/sn9c102/sn9c102_devtable.h |2 
 25 files changed, 7213 insertions(+), 6415 deletions(-)

diff discarded since it is too big

---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/e43f5566fa03433d3a4d2686f50786e778751ccb

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] ivtv/cx18: ensure the default control values are correct

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8377 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
ivtv/cx18: ensure the default control values are correct


For several MPEG controls and the volume control the default as returned
by VIDIOC_QUERYCTRL was incorrect and did not match the actual initial
value.

This is now fixed for cx18 and ivtv.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-av-core.c|5 
 linux/drivers/media/video/cx18/cx18-av-core.h|1 
 linux/drivers/media/video/cx2341x.c  |  151 ---
 linux/drivers/media/video/cx25840/cx25840-core.c |4 
 linux/drivers/media/video/cx25840/cx25840-core.h |1 
 5 files changed, 92 insertions(+), 70 deletions(-)

diff -r 68685fc89b67 -r 66afba4ce32f 
linux/drivers/media/video/cx18/cx18-av-core.c
--- a/linux/drivers/media/video/cx18/cx18-av-core.c Thu Jul 17 13:08:40 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-av-core.c Thu Jul 17 14:26:45 
2008 +0200
@@ -80,6 +80,7 @@ static void log_video_status(struct cx18
 
 static void cx18_av_initialize(struct cx18 *cx)
 {
+   struct cx18_av_state *state = cx-av_state;
u32 v;
 
cx18_av_loadfw(cx);
@@ -159,6 +160,8 @@ static void cx18_av_initialize(struct cx
 /* CxDevWrReg(CXADEC_SRC_COMB_CFG, 0x6628021F); */
 /*} */
cx18_av_write4(cx, CXADEC_SRC_COMB_CFG, 0x6628021F);
+   state-default_volume = 228 - cx18_av_read(cx, 0x8d4);
+   state-default_volume = ((state-default_volume / 2) + 23)  9;
 }
 
 /* --- */
@@ -559,6 +562,8 @@ int cx18_av_cmd(struct cx18 *cx, unsigne
 
switch (qc-id) {
case V4L2_CID_AUDIO_VOLUME:
+   return v4l2_ctrl_query_fill(qc, 0, 65535,
+   65535 / 100, state-default_volume);
case V4L2_CID_AUDIO_MUTE:
case V4L2_CID_AUDIO_BALANCE:
case V4L2_CID_AUDIO_BASS:
diff -r 68685fc89b67 -r 66afba4ce32f 
linux/drivers/media/video/cx18/cx18-av-core.h
--- a/linux/drivers/media/video/cx18/cx18-av-core.h Thu Jul 17 13:08:40 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-av-core.h Thu Jul 17 14:26:45 
2008 +0200
@@ -79,6 +79,7 @@ struct cx18_av_state {
u32 audclk_freq;
int audmode;
int vbi_line_offset;
+   int default_volume;
u32 id;
u32 rev;
int is_initialized;
diff -r 68685fc89b67 -r 66afba4ce32f linux/drivers/media/video/cx2341x.c
--- a/linux/drivers/media/video/cx2341x.c   Thu Jul 17 13:08:40 2008 +0200
+++ b/linux/drivers/media/video/cx2341x.c   Thu Jul 17 14:26:45 2008 +0200
@@ -78,6 +78,61 @@ const u32 cx2341x_mpeg_ctrls[] = {
 };
 EXPORT_SYMBOL(cx2341x_mpeg_ctrls);
 
+static const struct cx2341x_mpeg_params default_params = {
+   /* misc */
+   .capabilities = 0,
+   .port = CX2341X_PORT_MEMORY,
+   .width = 720,
+   .height = 480,
+   .is_50hz = 0,
+
+   /* stream */
+   .stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS,
+   .stream_vbi_fmt = V4L2_MPEG_STREAM_VBI_FMT_NONE,
+   .stream_insert_nav_packets = 0,
+
+   /* audio */
+   .audio_sampling_freq = V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000,
+   .audio_encoding = V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
+   .audio_l2_bitrate = V4L2_MPEG_AUDIO_L2_BITRATE_224K,
+   .audio_mode = V4L2_MPEG_AUDIO_MODE_STEREO,
+   .audio_mode_extension = V4L2_MPEG_AUDIO_MODE_EXTENSION_BOUND_4,
+   .audio_emphasis = V4L2_MPEG_AUDIO_EMPHASIS_NONE,
+   .audio_crc = V4L2_MPEG_AUDIO_CRC_NONE,
+   .audio_mute = 0,
+
+   /* video */
+   .video_encoding = V4L2_MPEG_VIDEO_ENCODING_MPEG_2,
+   .video_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3,
+   .video_b_frames = 2,
+   .video_gop_size = 12,
+   .video_gop_closure = 1,
+   .video_bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
+   .video_bitrate = 600,
+   .video_bitrate_peak = 800,
+   .video_temporal_decimation = 0,
+   .video_mute = 0,
+   .video_mute_yuv = 0x008080,  /* YCbCr value for black */
+
+   /* encoding filters */
+   .video_spatial_filter_mode =
+   V4L2_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE_MANUAL,
+   .video_spatial_filter = 0,
+   .video_luma_spatial_filter_type =
+   V4L2_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE_1D_HOR,
+   .video_chroma_spatial_filter_type =
+   V4L2_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE_1D_HOR,
+   .video_temporal_filter_mode =
+ 

[linuxtv-commits] [hg:v4l-dvb] saa7115: use saa7115_auto instead of saa711x as the autodetect driver name.

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8380 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
saa7115: use saa7115_auto instead of saa711x as the autodetect driver name.


Having an _auto suffix is less ambiguous than a 'saa711x' identifier.
It's also used like this in the saa7127 driver.

Thanks to Jean Delvare for suggesting this.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/saa7115.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r 0fa04038d93f -r 15bbc699e8a0 linux/drivers/media/video/saa7115.c
--- a/linux/drivers/media/video/saa7115.c   Thu Jul 17 15:18:31 2008 +0200
+++ b/linux/drivers/media/video/saa7115.c   Thu Jul 17 15:22:51 2008 +0200
@@ -1567,7 +1567,7 @@ static int saa7115_remove(struct i2c_cli
 
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 26)
 static const struct i2c_device_id saa7115_id[] = {
-   { saa711x, 1 }, /* autodetect */
+   { saa7115_auto, 1 }, /* autodetect */
{ saa7111, 0 },
{ saa7113, 0 },
{ saa7114, 0 },


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/15bbc699e8a0a4e03942958986d2955fb684ffc5

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] cx18: move cx18_av_vbi_setup to av-core.c and rename to cx18_av_std_setup

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8378 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
cx18: move cx18_av_vbi_setup to av-core.c and rename to cx18_av_std_setup


Same issue as for cx25840: this function sets up the standard timings
and has nothing to do with VBI setup.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx18/cx18-av-core.c |  143 +
 linux/drivers/media/video/cx18/cx18-av-core.h |2 
 linux/drivers/media/video/cx18/cx18-av-vbi.c  |  147 --
 3 files changed, 147 insertions(+), 145 deletions(-)

diff -r 66afba4ce32f -r 3e7571e9fb09 
linux/drivers/media/video/cx18/cx18-av-core.c
--- a/linux/drivers/media/video/cx18/cx18-av-core.c Thu Jul 17 14:26:45 
2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-av-core.c Thu Jul 17 14:33:08 
2008 +0200
@@ -166,6 +166,147 @@ static void cx18_av_initialize(struct cx
 
 /* --- */
 
+void cx18_av_std_setup(struct cx18 *cx)
+{
+   struct cx18_av_state *state = cx-av_state;
+   v4l2_std_id std = state-std;
+   int hblank, hactive, burst, vblank, vactive, sc;
+   int vblank656, src_decimation;
+   int luma_lpf, uv_lpf, comb;
+   u32 pll_int, pll_frac, pll_post;
+
+   /* datasheet startup, step 8d */
+   if (std  ~V4L2_STD_NTSC)
+   cx18_av_write(cx, 0x49f, 0x11);
+   else
+   cx18_av_write(cx, 0x49f, 0x14);
+
+   if (std  V4L2_STD_625_50) {
+   hblank = 132;
+   hactive = 720;
+   burst = 93;
+   vblank = 36;
+   vactive = 580;
+   vblank656 = 40;
+   src_decimation = 0x21f;
+
+   luma_lpf = 2;
+   if (std  V4L2_STD_PAL) {
+   uv_lpf = 1;
+   comb = 0x20;
+   sc = 688739;
+   } else if (std == V4L2_STD_PAL_Nc) {
+   uv_lpf = 1;
+   comb = 0x20;
+   sc = 556453;
+   } else { /* SECAM */
+   uv_lpf = 0;
+   comb = 0;
+   sc = 672351;
+   }
+   } else {
+   hactive = 720;
+   hblank = 122;
+   vactive = 487;
+   luma_lpf = 1;
+   uv_lpf = 1;
+   vblank = 26;
+   vblank656 = 26;
+
+   src_decimation = 0x21f;
+   if (std == V4L2_STD_PAL_60) {
+   burst = 0x5b;
+   luma_lpf = 2;
+   comb = 0x20;
+   sc = 688739;
+   } else if (std == V4L2_STD_PAL_M) {
+   burst = 0x61;
+   comb = 0x20;
+   sc = 555452;
+   } else {
+   burst = 0x5b;
+   comb = 0x66;
+   sc = 556063;
+   }
+   }
+
+   /* DEBUG: Displays configured PLL frequency */
+   pll_int = cx18_av_read(cx, 0x108);
+   pll_frac = cx18_av_read4(cx, 0x10c)  0x1ff;
+   pll_post = cx18_av_read(cx, 0x109);
+   CX18_DEBUG_INFO(PLL regs = int: %u, frac: %u, post: %u\n,
+   pll_int, pll_frac, pll_post);
+
+   if (pll_post) {
+   int fin, fsc;
+   int pll = 28636363L * u64)pll_int)  25) + pll_frac);
+
+   pll = 25;
+   pll /= pll_post;
+   CX18_DEBUG_INFO(PLL = %d.%06d MHz\n,
+   pll / 100, pll % 100);
+   CX18_DEBUG_INFO(PLL/8 = %d.%06d MHz\n,
+   pll / 800, (pll / 8) % 100);
+
+   fin = ((u64)src_decimation * pll)  12;
+   CX18_DEBUG_INFO(ADC Sampling freq = %d.%06d MHz\n,
+   fin / 100, fin % 100);
+
+   fsc = (((u64)sc) * pll)  24L;
+   CX18_DEBUG_INFO(Chroma sub-carrier freq = %d.%06d MHz\n,
+   fsc / 100, fsc % 100);
+
+   CX18_DEBUG_INFO(hblank %i, hactive %i, 
+   vblank %i , vactive %i, vblank656 %i, src_dec %i,
+   burst 0x%02x, luma_lpf %i, uv_lpf %i, comb 0x%02x,
+sc 0x%06x\n,
+   hblank, hactive, vblank, vactive, vblank656,
+   src_decimation, burst, luma_lpf, uv_lpf, comb, sc);
+   }
+
+   /* Sets horizontal 

[linuxtv-commits] [hg:v4l-dvb] saa7127: Make device detection optional

2008-07-17 Thread Patch from Jean Delvare
The patch number 8379 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Jean Delvare  [EMAIL PROTECTED]
saa7127: Make device detection optional


The saa7127 driver supports all of SAA7126, SAA7127, SAA7128 and
SAA1729 devices. Declare all these devices, so that board drivers can
tell which device is present, instead of always relying on
auto-detection (which needs to write to the chip, eek!).

We still need the detection for ivtv, so a special device name
saa7127_auto can be used when the caller doesn't know exactly which
device is present.

Signed-off-by: Jean Delvare [EMAIL PROTECTED]
Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/ivtv/ivtv-i2c.c |2 -
 linux/drivers/media/video/saa7127.c   |   42 ++
 2 files changed, 28 insertions(+), 16 deletions(-)

diff -r 3e7571e9fb09 -r 0fa04038d93f linux/drivers/media/video/ivtv/ivtv-i2c.c
--- a/linux/drivers/media/video/ivtv/ivtv-i2c.c Thu Jul 17 14:33:08 2008 +0200
+++ b/linux/drivers/media/video/ivtv/ivtv-i2c.c Thu Jul 17 15:18:31 2008 +0200
@@ -135,7 +135,7 @@ static const char * const hw_devicenames
 static const char * const hw_devicenames[] = {
cx25840,
saa7115,
-   saa7127,
+   saa7127_auto, /* saa7127 or saa7129 */
msp3400,
tuner,
wm8775,
diff -r 3e7571e9fb09 -r 0fa04038d93f linux/drivers/media/video/saa7127.c
--- a/linux/drivers/media/video/saa7127.c   Thu Jul 17 14:33:08 2008 +0200
+++ b/linux/drivers/media/video/saa7127.c   Thu Jul 17 15:18:31 2008 +0200
@@ -672,7 +672,6 @@ static int saa7127_probe(struct i2c_clie
 {
struct saa7127_state *state;
struct v4l2_sliced_vbi_data vbi = { 0, 0, 0, 0 };  /* set to disabled */
-   int read_result = 0;
 
/* Check if the adapter supports the needed features */
if (!i2c_check_functionality(client-adapter, I2C_FUNC_SMBUS_BYTE_DATA))
@@ -720,20 +719,29 @@ static int saa7127_probe(struct i2c_clie
saa7127_set_input_type(client, SAA7127_INPUT_TYPE_NORMAL);
saa7127_set_video_enable(client, 1);
 
-   /* Detect if it's an saa7129 */
-   read_result = saa7127_read(client, SAA7129_REG_FADE_KEY_COL2);
-   saa7127_write(client, SAA7129_REG_FADE_KEY_COL2, 0xaa);
-   if (saa7127_read(client, SAA7129_REG_FADE_KEY_COL2) == 0xaa) {
-   v4l_info(client, saa7129 found @ 0x%x (%s)\n,
-   client-addr  1, client-adapter-name);
-   saa7127_write(client, SAA7129_REG_FADE_KEY_COL2, read_result);
+   if (id-driver_data) {  /* Chip type is already known */
+   state-ident = id-driver_data;
+   } else {/* Needs detection */
+   int read_result;
+
+   /* Detect if it's an saa7129 */
+   read_result = saa7127_read(client, SAA7129_REG_FADE_KEY_COL2);
+   saa7127_write(client, SAA7129_REG_FADE_KEY_COL2, 0xaa);
+   if (saa7127_read(client, SAA7129_REG_FADE_KEY_COL2) == 0xaa) {
+   saa7127_write(client, SAA7129_REG_FADE_KEY_COL2,
+   read_result);
+   state-ident = V4L2_IDENT_SAA7129;
+   strlcpy(client-name, saa7129, I2C_NAME_SIZE);
+   } else {
+   state-ident = V4L2_IDENT_SAA7127;
+   strlcpy(client-name, saa7127, I2C_NAME_SIZE);
+   }
+   }
+
+   v4l_info(client, %s found @ 0x%x (%s)\n, client-name,
+   client-addr  1, client-adapter-name);
+   if (state-ident == V4L2_IDENT_SAA7129)
saa7127_write_inittab(client, saa7129_init_config_extra);
-   state-ident = V4L2_IDENT_SAA7129;
-   } else {
-   v4l_info(client, saa7127 found @ 0x%x (%s)\n,
-   client-addr  1, client-adapter-name);
-   state-ident = V4L2_IDENT_SAA7127;
-   }
return 0;
 }
 
@@ -751,7 +759,11 @@ static int saa7127_remove(struct i2c_cli
 
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 26)
 static struct i2c_device_id saa7127_id[] = {
-   { saa7127, 0 },
+   { saa7127_auto, 0 },  /* auto-detection */
+   { saa7126, V4L2_IDENT_SAA7127 },
+   { saa7127, V4L2_IDENT_SAA7127 },
+   { saa7128, V4L2_IDENT_SAA7129 },
+   { saa7129, V4L2_IDENT_SAA7129 },
{ }
 };
 MODULE_DEVICE_TABLE(i2c, saa7127_id);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/0fa04038d93fbd3ef4f29e31820ef350552e1f61

___
linuxtv-commits mailing list

[linuxtv-commits] [hg:v4l-dvb] cx18/smsusb: fix compile errors when building for kernels 2.6.19

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8384 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
cx18/smsusb: fix compile errors when building for kernels  2.6.19


Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/dvb/siano/smsusb.c|2 +-
 linux/drivers/media/video/cx18/cx18-irq.c |4 
 linux/drivers/media/video/cx18/cx18-irq.h |4 
 3 files changed, 9 insertions(+), 1 deletion(-)

diff -r f9f559cf7ece -r dd10ccbd2c9f linux/drivers/media/dvb/siano/smsusb.c
--- a/linux/drivers/media/dvb/siano/smsusb.cThu Jul 17 15:53:31 2008 +0200
+++ b/linux/drivers/media/dvb/siano/smsusb.cThu Jul 17 16:18:30 2008 +0200
@@ -55,7 +55,7 @@ static int smsusb_submit_urb(struct smsu
 static int smsusb_submit_urb(struct smsusb_device_t *dev,
 struct smsusb_urb_t *surb);
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,15)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 19)
 static void smsusb_onresponse(struct urb *urb)
 #else
 static void smsusb_onresponse(struct urb *urb, struct pt_regs *regs)
diff -r f9f559cf7ece -r dd10ccbd2c9f linux/drivers/media/video/cx18/cx18-irq.c
--- a/linux/drivers/media/video/cx18/cx18-irq.c Thu Jul 17 15:53:31 2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-irq.c Thu Jul 17 16:18:30 2008 +0200
@@ -132,7 +132,11 @@ static void hpu_cmd(struct cx18 *cx, u32
CX18_WARN(Unexpected interrupt %08x\n, sw1);
 }
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 18)
+irqreturn_t cx18_irq_handler(int irq, void *dev_id, struct pt_regs *regs)
+#else
 irqreturn_t cx18_irq_handler(int irq, void *dev_id)
+#endif
 {
struct cx18 *cx = (struct cx18 *)dev_id;
u32 sw1, sw1_mask;
diff -r f9f559cf7ece -r dd10ccbd2c9f linux/drivers/media/video/cx18/cx18-irq.h
--- a/linux/drivers/media/video/cx18/cx18-irq.h Thu Jul 17 15:53:31 2008 +0200
+++ b/linux/drivers/media/video/cx18/cx18-irq.h Thu Jul 17 16:18:30 2008 +0200
@@ -30,7 +30,11 @@
 #define SW2_INT_STATUS  0xc73144
 #define SW2_INT_ENABLE_PCI  0xc7315c
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 18)
+irqreturn_t cx18_irq_handler(int irq, void *dev_id, struct pt_regs *regs);
+#else
 irqreturn_t cx18_irq_handler(int irq, void *dev_id);
+#endif
 
 void cx18_irq_work_handler(struct work_struct *work);
 void cx18_dma_stream_dec_prepare(struct cx18_stream *s, u32 offset, int lock);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/dd10ccbd2c9f039deb14a1275ce8854009a8b7dd

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l-dvb: fix compilation issues for kernel 2.6.21

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8383 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
v4l-dvb: fix compilation issues for kernel 2.6.21


- fix unused function warnings in v4l2-i2c-drv.h and v4l2-i2c-drv-legacy.h
- fix ivtvfb.c compile warning that would in fact lead to an oops
- disable DVB_DRX397XD for kernels = 2.6.21: it needs div64_64

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/ivtv/ivtvfb.c   |4 +++
 linux/include/media/v4l2-i2c-drv-legacy.h |   23 +++---
 linux/include/media/v4l2-i2c-drv.h|   15 +++---
 v4l/versions.txt  |2 +
 4 files changed, 26 insertions(+), 18 deletions(-)

diff -r 6668e2f23c3a -r f9f559cf7ece linux/drivers/media/video/ivtv/ivtvfb.c
--- a/linux/drivers/media/video/ivtv/ivtvfb.c   Thu Jul 17 15:37:03 2008 +0200
+++ b/linux/drivers/media/video/ivtv/ivtvfb.c   Thu Jul 17 15:53:31 2008 +0200
@@ -367,6 +367,7 @@ static int ivtvfb_prep_frame(struct ivtv
return ivtvfb_prep_dec_dma_to_device(itv, dest_offset, source, count);
 }
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 22)
 static ssize_t ivtvfb_write(struct fb_info *info, const char __user *buf,
 size_t count, loff_t *ppos)
 {
@@ -448,6 +449,7 @@ static ssize_t ivtvfb_write(struct fb_in
 
return (err) ? err : count;
 }
+#endif
 
 static int ivtvfb_ioctl(struct fb_info *info, unsigned int cmd, unsigned long 
arg)
 {
@@ -909,7 +911,9 @@ static int ivtvfb_blank(int blank_mode, 
 
 static struct fb_ops ivtvfb_ops = {
.owner = THIS_MODULE,
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 22)
.fb_write   = ivtvfb_write,
+#endif
.fb_check_var   = ivtvfb_check_var,
.fb_set_par = ivtvfb_set_par,
.fb_setcolreg   = ivtvfb_setcolreg,
diff -r 6668e2f23c3a -r f9f559cf7ece linux/include/media/v4l2-i2c-drv-legacy.h
--- a/linux/include/media/v4l2-i2c-drv-legacy.h Thu Jul 17 15:37:03 2008 +0200
+++ b/linux/include/media/v4l2-i2c-drv-legacy.h Thu Jul 17 15:53:31 2008 +0200
@@ -37,7 +37,7 @@ struct v4l2_i2c_driver_data {
 };
 
 static struct v4l2_i2c_driver_data v4l2_i2c_data;
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,25)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 25)
 static const struct i2c_client_address_data addr_data;
 #else
 static struct i2c_client_address_data addr_data;
@@ -77,25 +77,25 @@ static int v4l2_i2c_drv_detach_legacy(st
return 0;
 }
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 20)
 static int v4l2_i2c_drv_suspend_helper(struct i2c_client *client, pm_message_t 
state)
 #else
 static int v4l2_i2c_drv_suspend_helper(struct device * dev, pm_message_t state)
 #endif
 {
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
 #endif
return v4l2_i2c_data.suspend ? v4l2_i2c_data.suspend(client, state) : 0;
 }
 
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 20)
 static int v4l2_i2c_drv_resume_helper(struct i2c_client *client)
 #else
 static int v4l2_i2c_drv_resume_helper(struct device * dev)
 #endif
 {
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 20)
struct i2c_client *client = container_of(dev, struct i2c_client, dev);
 #endif
return v4l2_i2c_data.resume ? v4l2_i2c_data.resume(client) : 0;
@@ -107,14 +107,14 @@ static struct i2c_driver v4l2_i2c_driver
 static struct i2c_driver v4l2_i2c_driver_legacy = {
.driver = {
.owner = THIS_MODULE,
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume  = v4l2_i2c_drv_resume_helper,
 #endif
},
.attach_adapter = v4l2_i2c_drv_probe_legacy,
.detach_client = v4l2_i2c_drv_detach_legacy,
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,20)
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 20)
.suspend = v4l2_i2c_drv_suspend_helper,
.resume  = v4l2_i2c_drv_resume_helper,
 #endif
@@ -123,17 +123,18 @@ static struct i2c_driver v4l2_i2c_driver
 /* --- */
 
 /* i2c implementation */
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,22)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 22)
 static struct i2c_driver v4l2_i2c_driver = {
.suspend= v4l2_i2c_drv_suspend_helper,
.resume = 

[linuxtv-commits] [hg:v4l-dvb] gspca/tea575x-tuner: fix compilation for kernels = 2.6.17

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8385 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
gspca/tea575x-tuner: fix compilation for kernels = 2.6.17


Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/gspca/gspca.c |4 
 linux/sound/i2c/other/tea575x-tuner.c   |4 
 2 files changed, 8 insertions(+)

diff -r dd10ccbd2c9f -r 85543a69630e linux/drivers/media/video/gspca/gspca.c
--- a/linux/drivers/media/video/gspca/gspca.c   Thu Jul 17 16:18:30 2008 +0200
+++ b/linux/drivers/media/video/gspca/gspca.c   Thu Jul 17 16:30:11 2008 +0200
@@ -30,7 +30,11 @@
 #include linux/pagemap.h
 #include linux/io.h
 #include asm/page.h
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 19)
+#include asm/uaccess.h
+#else
 #include linux/uaccess.h
+#endif
 #include linux/jiffies.h
 
 #include gspca.h
diff -r dd10ccbd2c9f -r 85543a69630e linux/sound/i2c/other/tea575x-tuner.c
--- a/linux/sound/i2c/other/tea575x-tuner.c Thu Jul 17 16:18:30 2008 +0200
+++ b/linux/sound/i2c/other/tea575x-tuner.c Thu Jul 17 16:30:11 2008 +0200
@@ -167,10 +167,12 @@ static int snd_tea575x_ioctl(struct inod
struct video_audio v;
if(copy_from_user(v, arg, sizeof(v)))
return -EFAULT;
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 17)
if (tea-ops-mute)
tea-ops-mute(tea,
   (v.flags 
VIDEO_AUDIO_MUTE) ? 1 : 0);
+#endif
if(v.audio)
return -EINVAL;
return 0;
@@ -223,9 +225,11 @@ void snd_tea575x_init(struct snd_tea575x
 
snd_tea575x_set_freq(tea);
 
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 17)
/* mute on init */
if (tea-ops-mute)
tea-ops-mute(tea, 1);
+#endif
 }
 
 #if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,17)


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/85543a69630e112de1b8a0f4f70d5361ef167faf

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] btaudio/tvmixer/miropcm20-rds: fix 2.6.16 compilation

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8388 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
btaudio/tvmixer/miropcm20-rds: fix 2.6.16 compilation


Missed a few warnings, this patch fixes them.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/radio/miropcm20-rds.c |4 
 linux/drivers/media/video/tvmixer.c   |6 +-
 linux/sound/oss/btaudio.c |   18 +++---
 3 files changed, 24 insertions(+), 4 deletions(-)

diff -r a4a55538933f -r 19ed57c0bf36 linux/drivers/media/radio/miropcm20-rds.c
--- a/linux/drivers/media/radio/miropcm20-rds.c Thu Jul 17 18:45:00 2008 +0200
+++ b/linux/drivers/media/radio/miropcm20-rds.c Thu Jul 17 19:37:10 2008 +0200
@@ -104,7 +104,11 @@ static ssize_t rds_f_read(struct file *f
}
 }
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
 static const struct file_operations rds_fops = {
+#else
+static struct file_operations rds_fops = {
+#endif
.owner  = THIS_MODULE,
.read   = rds_f_read,
.open   = rds_f_open,
diff -r a4a55538933f -r 19ed57c0bf36 linux/drivers/media/video/tvmixer.c
--- a/linux/drivers/media/video/tvmixer.c   Thu Jul 17 18:45:00 2008 +0200
+++ b/linux/drivers/media/video/tvmixer.c   Thu Jul 17 19:37:10 2008 +0200
@@ -286,7 +286,11 @@ static int tvmixer_clients(struct i2c_cl
return -1;
 
/* everything is fine, register */
-   if ((minor = register_sound_mixer(tvmixer_fops,devnr))  0) {
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
+   if ((minor = register_sound_mixer(tvmixer_fops, devnr))  0) {
+#else
+   if ((minor = register_sound_mixer((struct file_operations 
*)tvmixer_fops, devnr))  0) {
+#endif
printk(KERN_ERR tvmixer: cannot allocate mixer device\n);
return -1;
}
diff -r a4a55538933f -r 19ed57c0bf36 linux/sound/oss/btaudio.c
--- a/linux/sound/oss/btaudio.c Thu Jul 17 18:45:00 2008 +0200
+++ b/linux/sound/oss/btaudio.c Thu Jul 17 19:37:10 2008 +0200
@@ -980,7 +980,11 @@ static int __devinit btaudio_probe(struc
/* register devices */
if (digital) {
rc = bta-dsp_digital =
-   register_sound_dsp(btaudio_digital_dsp_fops,dsp1);
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
+   register_sound_dsp(btaudio_digital_dsp_fops, dsp1);
+#else
+   register_sound_dsp((struct file_operations 
*)btaudio_digital_dsp_fops, dsp1);
+#endif
if (rc  0) {
printk(KERN_WARNING
   btaudio: can't register digital dsp 
(rc=%d)\n,rc);
@@ -991,7 +995,11 @@ static int __devinit btaudio_probe(struc
}
if (analog) {
rc = bta-dsp_analog =
-   register_sound_dsp(btaudio_analog_dsp_fops,dsp2);
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
+   register_sound_dsp(btaudio_analog_dsp_fops, dsp2);
+#else
+   register_sound_dsp((struct file_operations 
*)btaudio_analog_dsp_fops, dsp2);
+#endif
if (rc  0) {
printk(KERN_WARNING
   btaudio: can't register analog dsp 
(rc=%d)\n,rc);
@@ -999,7 +1007,11 @@ static int __devinit btaudio_probe(struc
}
printk(KERN_INFO btaudio: registered device dsp%d [analog]\n,
   bta-dsp_analog  4);
-   rc = bta-mixer_dev = 
register_sound_mixer(btaudio_mixer_fops,mixer);
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
+   rc = bta-mixer_dev = register_sound_mixer(btaudio_mixer_fops, 
mixer);
+#else
+   rc = bta-mixer_dev = register_sound_mixer((struct 
file_operations *)btaudio_mixer_fops, mixer);
+#endif
if (rc  0) {
printk(KERN_WARNING
   btaudio: can't register mixer (rc=%d)\n,rc);


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/19ed57c0bf36f62efa6a5366a7541673a9d64f99

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] videodev: add support for kernels 2.6.19

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8387 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
videodev: add support for kernels  2.6.19


Add the necessary compatibility code to handle the struct device/struct 
class_device

---

 linux/drivers/media/video/videodev.c |  124 +++
 linux/include/media/v4l2-dev.h   |   24 +
 v4l/versions.txt |9 +
 3 files changed, 122 insertions(+), 35 deletions(-)

differences.

It was too much work (with uncertain benefits) to convert several drivers
to handle kernels 2.6.19, so they are not built on these older kernels.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]

diff -r e39527e452e0 -r a4a55538933f linux/drivers/media/video/videodev.c
--- a/linux/drivers/media/video/videodev.c  Thu Jul 17 16:48:19 2008 +0200
+++ b/linux/drivers/media/video/videodev.c  Thu Jul 17 18:45:00 2008 +0200
@@ -376,6 +376,7 @@ EXPORT_SYMBOL(v4l_printk_ioctl);
  * sysfs stuff
  */
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 19)
 static ssize_t show_index(struct device *cd,
 struct device_attribute *attr, char *buf)
 {
@@ -390,34 +391,6 @@ static ssize_t show_name(struct device *
struct video_device *vfd = container_of(cd, struct video_device,
class_dev);
return sprintf(buf, %.*s\n, (int)sizeof(vfd-name), vfd-name);
-}
-
-struct video_device *video_device_alloc(void)
-{
-   struct video_device *vfd;
-
-   vfd = kzalloc(sizeof(*vfd),GFP_KERNEL);
-   return vfd;
-}
-EXPORT_SYMBOL(video_device_alloc);
-
-void video_device_release(struct video_device *vfd)
-{
-   kfree(vfd);
-}
-EXPORT_SYMBOL(video_device_release);
-
-static void video_release(struct device *cd)
-{
-   struct video_device *vfd = container_of(cd, struct video_device,
-   class_dev);
-
-#if 1  /* keep */
-   /* needed until all drivers are fixed */
-   if (!vfd-release)
-   return;
-#endif
-   vfd-release(vfd);
 }
 
 static struct device_attribute video_device_attrs[] = {
@@ -425,11 +398,65 @@ static struct device_attribute video_dev
__ATTR(index, S_IRUGO, show_index, NULL),
__ATTR_NULL
 };
+#else
+static ssize_t show_index(struct class_device *cd, char *buf)
+{
+   struct video_device *vfd = container_of(cd, struct video_device,
+   class_dev);
+   return sprintf(buf, %i\n, vfd-index);
+}
+
+static ssize_t show_name(struct class_device *cd, char *buf)
+{
+   struct video_device *vfd = container_of(cd, struct video_device,
+   class_dev);
+   return sprintf(buf, %.*s\n, (int)sizeof(vfd-name), vfd-name);
+}
+
+static CLASS_DEVICE_ATTR(index, S_IRUGO, show_index, NULL);
+static CLASS_DEVICE_ATTR(name, S_IRUGO, show_name, NULL);
+#endif
+
+struct video_device *video_device_alloc(void)
+{
+   struct video_device *vfd;
+
+   vfd = kzalloc(sizeof(*vfd),GFP_KERNEL);
+   return vfd;
+}
+EXPORT_SYMBOL(video_device_alloc);
+
+void video_device_release(struct video_device *vfd)
+{
+   kfree(vfd);
+}
+EXPORT_SYMBOL(video_device_release);
+
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 19)
+static void video_release(struct class_device *cd)
+#else
+static void video_release(struct device *cd)
+#endif
+{
+   struct video_device *vfd = container_of(cd, struct video_device,
+   class_dev);
+
+#if 1  /* keep */
+   /* needed until all drivers are fixed */
+   if (!vfd-release)
+   return;
+#endif
+   vfd-release(vfd);
+}
 
 static struct class video_class = {
.name= VIDEO_NAME,
+#if LINUX_VERSION_CODE  KERNEL_VERSION(2, 6, 19)
+   .release = video_release,
+#else
.dev_attrs = video_device_attrs,
.dev_release = video_release,
+#endif
 };
 
 /*
@@ -2188,8 +2215,7 @@ int video_register_device_index(struct v
ret = 0;
 #endif
if (ret  0) {
-   printk(KERN_ERR %s: get_index failed\n,
-  __func__);
+   printk(KERN_ERR %s: get_index failed\n, __func__);
goto fail_minor;
}
 
@@ -2200,17 +2226,43 @@ int video_register_device_index(struct v
 
/* sysfs class */
memset(vfd-class_dev, 0x00, sizeof(vfd-class_dev));
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 18)
+   vfd-class_dev.class   = video_class;
+   vfd-class_dev.devt= MKDEV(VIDEO_MAJOR, vfd-minor);
+#endif
+#if 

[linuxtv-commits] [hg:v4l-dvb] videodev/dabusb/dvbdev: fix 2.6.16 compilation

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8386 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
videodev/dabusb/dvbdev: fix 2.6.16 compilation


struct file_operations was made const in 2.6.17. Cast const away when compiling
under 2.6.16.

Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/dvb/dvb-core/dvbdev.c |5 +
 linux/drivers/media/video/dabusb.c|4 
 linux/drivers/media/video/videodev.c  |   11 ++-
 linux/include/media/v4l2-dev.h|4 
 v4l/compat.h  |   13 -
 5 files changed, 31 insertions(+), 6 deletions(-)

diff -r 85543a69630e -r e39527e452e0 linux/drivers/media/dvb/dvb-core/dvbdev.c
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.c Thu Jul 17 16:30:11 2008 +0200
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c Thu Jul 17 16:48:19 2008 +0200
@@ -425,7 +425,12 @@ static int __init init_dvbdev(void)
return retval;
}
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
cdev_init(dvb_device_cdev, dvb_device_fops);
+#else
+   cdev_init(dvb_device_cdev,
+   (struct file_operations *)dvb_device_fops);
+#endif
if ((retval = cdev_add(dvb_device_cdev, dev, MAX_DVB_MINORS)) != 0) {
printk(KERN_ERR dvb-core: unable register character device\n);
goto error;
diff -r 85543a69630e -r e39527e452e0 linux/drivers/media/video/dabusb.c
--- a/linux/drivers/media/video/dabusb.cThu Jul 17 16:30:11 2008 +0200
+++ b/linux/drivers/media/video/dabusb.cThu Jul 17 16:48:19 2008 +0200
@@ -700,7 +700,11 @@ static int dabusb_ioctl (struct inode *i
return ret;
 }
 
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
 static const struct file_operations dabusb_fops =
+#else
+static struct file_operations dabusb_fops =
+#endif
 {
.owner =THIS_MODULE,
.llseek =   no_llseek,
diff -r 85543a69630e -r e39527e452e0 linux/drivers/media/video/videodev.c
--- a/linux/drivers/media/video/videodev.c  Thu Jul 17 16:30:11 2008 +0200
+++ b/linux/drivers/media/video/videodev.c  Thu Jul 17 16:48:19 2008 +0200
@@ -457,7 +457,7 @@ static int video_open(struct inode *inod
unsigned int minor = iminor(inode);
int err = 0;
struct video_device *vfl;
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,17)
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
const struct file_operations *old_fops;
 #else
struct file_operations *old_fops;
@@ -478,7 +478,11 @@ static int video_open(struct inode *inod
}
}
old_fops = file-f_op;
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
file-f_op = fops_get(vfl-fops);
+#else
+   file-f_op = (struct file_operations *)fops_get(vfl-fops);
+#endif
if(file-f_op-open)
err = file-f_op-open(inode,file);
if (err) {
@@ -2265,7 +2269,12 @@ static int __init videodev_init(void)
int ret;
 
printk(KERN_INFO Linux video capture interface: v2.00\n);
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME, video_fops)) {
+#else
+   if (register_chrdev(VIDEO_MAJOR, VIDEO_NAME,
+   (struct file_operations *)video_fops)) {
+#endif
printk(KERN_WARNING video_dev: unable to get major %d\n, 
VIDEO_MAJOR);
return -EIO;
}
diff -r 85543a69630e -r e39527e452e0 linux/include/media/v4l2-dev.h
--- a/linux/include/media/v4l2-dev.hThu Jul 17 16:30:11 2008 +0200
+++ b/linux/include/media/v4l2-dev.hThu Jul 17 16:48:19 2008 +0200
@@ -85,11 +85,7 @@ struct video_device
 struct video_device
 {
/* device ops */
-#if LINUX_VERSION_CODE = KERNEL_VERSION(2,6,17)
const struct file_operations *fops;
-#else
-   struct file_operations *fops;
-#endif
 
/* sysfs */
struct device class_dev;/* v4l device */
diff -r 85543a69630e -r e39527e452e0 v4l/compat.h
--- a/v4l/compat.h  Thu Jul 17 16:30:11 2008 +0200
+++ b/v4l/compat.h  Thu Jul 17 16:48:19 2008 +0200
@@ -170,8 +170,11 @@ static inline struct proc_dir_entry *pro
e = create_proc_entry(a, b, c);
if (e) {
e-owner = THIS_MODULE;
+#if LINUX_VERSION_CODE = KERNEL_VERSION(2, 6, 17)
e-proc_fops = d;
-
+#else
+   e-proc_fops = (struct file_operations *)d;
+#endif
}
return e;
 }
@@ -189,12 +192,20 @@ static inline struct proc_dir_entry *pro
e = create_proc_entry(a, b, c);
if (e) {
e-owner = 

[linuxtv-commits] [hg:v4l-dvb] Firmware compilation is not working yet. Disable at makefile

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8412 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Firmware compilation is not working yet. Disable at makefile


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 v4l/Makefile |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r 91b64238b184 -r bb7e1607aba0 v4l/Makefile
--- a/v4l/Makefile  Fri Jul 18 01:14:44 2008 -0300
+++ b/v4l/Makefile  Fri Jul 18 01:18:19 2008 -0300
@@ -39,7 +39,7 @@ endif # TOPDIR
 #
 # default compilation rule
 
-default:: config-compat.h Makefile.media links oss firmware
+default:: config-compat.h Makefile.media links oss # firmware
@echo Kernel build directory is $(OUTDIR)
$(MAKE) -C $(OUTDIR) SUBDIRS=$(PWD) $(MYCFLAGS) modules
./scripts/rmmod.pl check


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/bb7e1607aba0a9d7ea1bded33823da3fdae357c5

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] sh_mobile_ceu_camera: fix 64-bit compiler warnings

2008-07-17 Thread Patch from Hans Verkuil
The patch number 8410 was added via Hans Verkuil [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Hans Verkuil  [EMAIL PROTECTED]
sh_mobile_ceu_camera: fix 64-bit compiler warnings


Signed-off-by: Hans Verkuil [EMAIL PROTECTED]


---

 linux/drivers/media/video/sh_mobile_ceu_camera.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -r 1edf5aa98f5c -r c8cb24d2aa19 
linux/drivers/media/video/sh_mobile_ceu_camera.c
--- a/linux/drivers/media/video/sh_mobile_ceu_camera.c  Thu Jul 17 19:48:38 
2008 +0200
+++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c  Fri Jul 18 03:35:14 
2008 +0200
@@ -142,7 +142,7 @@ static void free_buffer(struct videobuf_
 {
struct soc_camera_device *icd = vq-priv_data;
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
buf-vb, buf-vb.baddr, buf-vb.bsize);
 
if (in_interrupt())
@@ -179,7 +179,7 @@ static int sh_mobile_ceu_videobuf_prepar
 
buf = container_of(vb, struct sh_mobile_ceu_buffer, vb);
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
vb, vb-baddr, vb-bsize);
 
/* Added list head initialization on alloc */
@@ -232,7 +232,7 @@ static void sh_mobile_ceu_videobuf_queue
struct sh_mobile_ceu_dev *pcdev = ici-priv;
unsigned long flags;
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
vb, vb-baddr, vb-bsize);
 
vb-state = VIDEOBUF_ACTIVE;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/c8cb24d2aa19465f767adafca18e6f04b047ca08

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8413 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/drivers/media/video/sh_mobile_ceu_camera.c |6 +++---
 linux/drivers/media/video/videobuf-dma-contig.c  |2 ++
 v4l/compat.h |3 +++
 3 files changed, 8 insertions(+), 3 deletions(-)

diff -r bb7e1607aba0 -r 911df1a096a3 
linux/drivers/media/video/sh_mobile_ceu_camera.c
--- a/linux/drivers/media/video/sh_mobile_ceu_camera.c  Fri Jul 18 01:18:19 
2008 -0300
+++ b/linux/drivers/media/video/sh_mobile_ceu_camera.c  Fri Jul 18 01:19:27 
2008 -0300
@@ -142,7 +142,7 @@ static void free_buffer(struct videobuf_
 {
struct soc_camera_device *icd = vq-priv_data;
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
buf-vb, buf-vb.baddr, buf-vb.bsize);
 
if (in_interrupt())
@@ -179,7 +179,7 @@ static int sh_mobile_ceu_videobuf_prepar
 
buf = container_of(vb, struct sh_mobile_ceu_buffer, vb);
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
vb, vb-baddr, vb-bsize);
 
/* Added list head initialization on alloc */
@@ -232,7 +232,7 @@ static void sh_mobile_ceu_videobuf_queue
struct sh_mobile_ceu_dev *pcdev = ici-priv;
unsigned long flags;
 
-   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %d\n, __func__,
+   dev_dbg(icd-dev, %s (vb=0x%p) 0x%08lx %zd\n, __func__,
vb, vb-baddr, vb-bsize);
 
vb-state = VIDEOBUF_ACTIVE;
diff -r bb7e1607aba0 -r 911df1a096a3 
linux/drivers/media/video/videobuf-dma-contig.c
--- a/linux/drivers/media/video/videobuf-dma-contig.c   Fri Jul 18 01:18:19 
2008 -0300
+++ b/linux/drivers/media/video/videobuf-dma-contig.c   Fri Jul 18 01:19:27 
2008 -0300
@@ -16,8 +16,10 @@
 
 #include linux/init.h
 #include linux/module.h
+#include linux/mm.h
 #include linux/dma-mapping.h
 #include media/videobuf-dma-contig.h
+#include compat.h
 
 struct videobuf_dma_contig_memory {
u32 magic;
diff -r bb7e1607aba0 -r 911df1a096a3 v4l/compat.h
--- a/v4l/compat.h  Fri Jul 18 01:18:19 2008 -0300
+++ b/v4l/compat.h  Fri Jul 18 01:19:27 2008 -0300
@@ -114,6 +114,9 @@ do {
\
p-length = sz; \
p-offset = off;\
 } while (0)
+
+#define pr_err(fmt, arg...) \
+   printk(KERN_ERR fmt, ##arg)
 #endif
 
 #ifndef BIT_MASK


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/911df1a096a339ae7417abd63af04d8b04612051

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] backport commit 4d2acfbfdf68257e846aaa355edd10fc35ba0feb

2008-07-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8408 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
backport commit 4d2acfbfdf68257e846aaa355edd10fc35ba0feb


Author: David Woodhouse [EMAIL PROTECTED]
Date:   Fri May 23 13:58:12 2008 +0100

firmware: Add CONFIG_EXTRA_FIRMWARE option

This allows arbitrary firmware files to be included in the static kernel
where the firmware loader can find them without requiring userspace to
be alive.

(Updated and CONFIG_EXTRA_FIRMWARE_DIR added with lots of help from
Johannes Berg).

kernel-sync:

This patch will need some extra changes at the building system to allow the
static link of the firmwares.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/firmware/Makefile |   88 
 1 file changed, 88 insertions(+)

diff -r a908550d3112 -r d723928fcc19 linux/firmware/Makefile
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/linux/firmware/Makefile   Thu Jul 17 23:43:10 2008 -0300
@@ -0,0 +1,88 @@
+#
+# kbuild file for firmware/
+#
+
+# Create $(fwabs) from $(CONFIG_EXTRA_FIRMWARE_DIR) -- if it doesn't have a
+# leading /, it's relative to $(srctree).
+fwdir := $(subst ,,$(CONFIG_EXTRA_FIRMWARE_DIR))
+fwabs := $(addprefix $(srctree)/,$(filter-out /%,$(fwdir)))$(filter 
/%,$(fwdir))
+
+fw-external-y := $(subst ,,$(CONFIG_EXTRA_FIRMWARE))
+
+firmware-y:= $(fw-external-y) $(fw-shipped-y)
+firmware-dirs := $(sort $(patsubst %,$(objtree)/$(obj)/%/,$(dir $(firmware-y) 
$(fw-shipped-
+
+quiet_cmd_mkdir = MKDIR   $(patsubst $(objtree)/%,%,$@)
+  cmd_mkdir = mkdir -p $@
+
+quiet_cmd_ihex  = IHEX$@
+  cmd_ihex  = $(OBJCOPY) -Iihex -Obinary $ $@
+
+quiet_cmd_fwbin = MK_FW   $@
+  cmd_fwbin = FWNAME=$(patsubst firmware/%.gen.S,%,$@);   \
+ FWSTR=$(subst /,_,$(subst .,_,$(subst -,_,$(patsubst  \
+   firmware/%.gen.S,%,$@;  \
+ ASM_WORD=$(if $(CONFIG_64BIT),.quad,.long);\
+ ASM_ALIGN=$(if $(CONFIG_64BIT),3,2);   \
+ PROGBITS=$(if $(CONFIG_ARM),%,@)progbits;  \
+ echo /* Generated by firmware/Makefile */$@;\
+ echo .section .rodata   $@;\
+ echo .p2align $${ASM_ALIGN} $@;\
+ echo _fw_$${FWSTR}_bin: $@;\
+ echo .incbin \$(2)\   $@;\
+ echo _fw_end:   $@;\
+ echo.section .rodata.str,\aMS\,$${PROGBITS},1 $@;\
+ echo .p2align $${ASM_ALIGN} $@;\
+ echo _fw_$${FWSTR}_name:$@;\
+ echo .string \$$FWNAME\   $@;\
+ echo .section .builtin_fw,\a\,$${PROGBITS}$@;\
+ echo .p2align $${ASM_ALIGN} $@;\
+ echo $${ASM_WORD} _fw_$${FWSTR}_name$@;\
+ echo $${ASM_WORD} _fw_$${FWSTR}_bin $@;\
+ echo $${ASM_WORD} _fw_end - _fw_$${FWSTR}_bin   $@;
+
+# One of these files will change, or come into existence, whenever
+# the configuration changes between 32-bit and 64-bit. The .S files
+# need to change when that happens.
+wordsize_deps := $(wildcard include/config/64bit.h include/config/32bit.h \
+   include/config/ppc32.h include/config/ppc64.h \
+   include/config/superh32.h include/config/superh64.h \
+   include/config/x86_32.h include/config/x86_64.h)
+
+# Workaround for make  3.81, where .SECONDEXPANSION doesn't work.
+# It'll end up depending on these targets, so make them a PHONY rule which
+# depends on _all_ the directories in $(firmware-dirs), and it'll work out OK.
+PHONY += $(objtree)/$$(%) $(objtree)/$(obj)/$$(%)
+$(objtree)/$$(%) $(objtree)/$(obj)/$$(%): $(firmware-dirs)
+   @true
+
+# For the $$(dir %) trick, where we need % to be expanded first.
+.SECONDEXPANSION:
+
+$(patsubst %,$(obj)/%.gen.S, $(fw-shipped-y)): %: $(wordsize_deps) \
+   | $(objtree)/$$(dir %)
+   $(call cmd,fwbin,$(patsubst %.gen.S,%,$@))
+$(patsubst %,$(obj)/%.gen.S, $(fw-external-y)): %: $(wordsize_deps) \
+   include/config/builtin/firmware/dir.h | $(objtree)/$$(dir %)
+   $(call cmd,fwbin,$(fwabs)/$(patsubst $(obj)/%.gen.S,%,$@))
+
+# The .o files depend on