[linuxtv-commits] [hg:v4l-dvb] v4l2-ioctl: do not try to handle private V4L1 ioctls

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8629 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]
v4l2-ioctl: do not try to handle private V4L1 ioctls


Some drivers (e.g. zoran) have private V4L1 ioctls. Do not try to
pass them to v4l1_compat_translate because then the driver will
never see them.

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


---

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

diff -r fcf263987edf -r 19fa785a4606 linux/drivers/media/video/v4l2-ioctl.c
--- a/linux/drivers/media/video/v4l2-ioctl.cTue Aug 05 10:14:13 2008 -0300
+++ b/linux/drivers/media/video/v4l2-ioctl.cSun Jul 27 21:37:23 2008 +0200
@@ -675,7 +675,7 @@ static int __video_do_ioctl(struct inode
 __video_do_ioctl will be called again, with one or more
 V4L2 ioctls.
 /
-   if (_IOC_TYPE(cmd) == 'v')
+   if (_IOC_TYPE(cmd) == 'v'  _IOC_NR(cmd)  BASE_VIDIOCPRIVATE)
return v4l_compat_translate_ioctl(inode, file, cmd, arg,
__video_do_ioctl);
 #endif


---

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

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


[linuxtv-commits] [hg:v4l-dvb] v4l2-apps: some capture_example improvements

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8631 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]
v4l2-apps: some capture_example improvements


- show progress even when sending captured data to stdout
- use bytesused rather than length
- use /dev/video0 instead of /dev/video (conform xawtv tools)

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


---

 v4l2-apps/test/capture_example.c |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

diff -r 5019762167d9 -r 9fe8543561fc v4l2-apps/test/capture_example.c
--- a/v4l2-apps/test/capture_example.c  Fri Jul 25 15:31:23 2008 +0200
+++ b/v4l2-apps/test/capture_example.c  Sun Jul 27 21:49:25 2008 +0200
@@ -68,11 +68,11 @@ static int xioctl(int fh, int request, v
 
 static void process_image(const void *p, int size)
 {
-   if (!out_buf)
-   fputc('.', stdout);
-   else
+   if (out_buf)
fwrite(p, size, 1, stdout);
 
+   fflush(stderr);
+   fprintf(stderr, .);
fflush(stdout);
 }
 
@@ -125,7 +125,7 @@ static int read_frame(void)
 
assert(buf.index  n_buffers);
 
-   process_image(buffers[buf.index].start, 
buffers[buf.index].length);
+   process_image(buffers[buf.index].start, buf.bytesused);
 
if (-1 == xioctl(fd, VIDIOC_QBUF, buf))
errno_exit(VIDIOC_QBUF);
@@ -160,7 +160,7 @@ static int read_frame(void)
 
assert(i  n_buffers);
 
-   process_image((void *) buf.m.userptr, buf.length);
+   process_image((void *) buf.m.userptr, buf.bytesused);
 
if (-1 == xioctl(fd, VIDIOC_QBUF, buf))
errno_exit(VIDIOC_QBUF);
@@ -571,7 +571,7 @@ static void usage(FILE *fp, int argc, ch
fprintf(fp,
 Usage: %s [options]\n\n
 Options:\n
--d | --device name   Video device name [/dev/video]\n
+-d | --device name   Video device name [/dev/video0]\n
 -h | --help  Print this message\n
 -m | --mmap  Use memory mapped buffers\n
 -r | --read  Use read() calls\n
@@ -596,7 +596,7 @@ long_options [] = {
 
 int main(int argc, char **argv)
 {
-   dev_name = /dev/video;
+   dev_name = /dev/video0;
 
for (;;) {
int idx;
@@ -650,5 +650,6 @@ int main(int argc, char **argv)
stop_capturing();
uninit_device();
close_device();
+   fprintf(stderr, \n);
return 0;
 }


---

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

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


[linuxtv-commits] [hg:v4l-dvb] First mxb cleanup phase

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8630 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]
First mxb cleanup phase


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


---

 linux/drivers/media/video/mxb.c  |   15 --
 linux/drivers/media/video/tda9840.c  |  192 ++-
 linux/drivers/media/video/tea6415c.c |  135 ++
 linux/drivers/media/video/tea6420.c  |  157 --
 4 files changed, 182 insertions(+), 317 deletions(-)

diff -r 19fa785a4606 -r 5019762167d9 linux/drivers/media/video/mxb.c
--- a/linux/drivers/media/video/mxb.c   Sun Jul 27 21:37:23 2008 +0200
+++ b/linux/drivers/media/video/mxb.c   Fri Jul 25 15:31:23 2008 +0200
@@ -467,15 +467,15 @@ static int mxb_attach(struct saa7146_dev
/* checking for i2c-devices can be omitted here, because we
   already did this in mxb_vl42_probe */
 
-   saa7146_vv_init(dev,vv_data);
-   if( 0 != saa7146_register_device(mxb-video_dev, dev, mxb, 
VFL_TYPE_GRABBER)) {
+   saa7146_vv_init(dev, vv_data);
+   if (saa7146_register_device(mxb-video_dev, dev, mxb, 
VFL_TYPE_GRABBER)) {
ERR((cannot register capture v4l2 device. skipping.\n));
return -1;
}
 
/* initialization stuff (vbi) (only for revision  0 and for extensions 
which want it)*/
-   if( 0 != MXB_BOARD_CAN_DO_VBI(dev)) {
-   if( 0 != saa7146_register_device(mxb-vbi_dev, dev, mxb, 
VFL_TYPE_VBI)) {
+   if (MXB_BOARD_CAN_DO_VBI(dev)) {
+   if (saa7146_register_device(mxb-vbi_dev, dev, mxb, 
VFL_TYPE_VBI)) {
ERR((cannot register vbi v4l2 device. skipping.\n));
}
}
@@ -487,7 +487,7 @@ static int mxb_attach(struct saa7146_dev
i2c_use_client(mxb-saa7111a);
i2c_use_client(mxb-tuner);
 
-   printk(mxb: found 'Multimedia eXtension Board'-%d.\n,mxb_num);
+   printk(mxb: found Multimedia eXtension Board #%d.\n, mxb_num);
 
mxb_num++;
mxb_init_done(dev);
@@ -738,8 +738,8 @@ static int mxb_ioctl(struct saa7146_fh *
DEB_EE((VIDIOC_G_TUNER: %d\n, t-index));
 
memset(t,0,sizeof(*t));
-   strcpy(t-name, Television);
-
+
+   strlcpy(t-name, Television, sizeof(t-name));
t-type = V4L2_TUNER_ANALOG_TV;
t-capability = V4L2_TUNER_CAP_NORM | V4L2_TUNER_CAP_STEREO | 
V4L2_TUNER_CAP_LANG1 | V4L2_TUNER_CAP_LANG2 | V4L2_TUNER_CAP_SAP;
t-rangelow = 772;  /* 48.25 MHZ / 62.5 kHz = 772, see 
fi1216mk2-specs, page 2 */
@@ -747,7 +747,6 @@ static int mxb_ioctl(struct saa7146_fh *
/* FIXME: add the real signal strength here */
t-signal = 0x;
t-afc = 0;
-
mxb-tda9840-driver-command(mxb-tda9840,TDA9840_DETECT, 
byte);
t-audmode = mxb-cur_mode;
 
diff -r 19fa785a4606 -r 5019762167d9 linux/drivers/media/video/tda9840.c
--- a/linux/drivers/media/video/tda9840.c   Sun Jul 27 21:37:23 2008 +0200
+++ b/linux/drivers/media/video/tda9840.c   Fri Jul 25 15:31:23 2008 +0200
@@ -2,6 +2,7 @@
 tda9840 - i2c-driver for the tda9840 by SGS Thomson
 
 Copyright (C) 1998-2003 Michael Hunold [EMAIL PROTECTED]
+Copyright (C) 2008 Hans Verkuil [EMAIL PROTECTED]
 
 The tda9840 is a stereo/dual sound processor with digital
 identification. It can be found at address 0x84 on the i2c-bus.
@@ -28,16 +29,19 @@
 #include linux/module.h
 #include linux/ioctl.h
 #include linux/i2c.h
+#include media/v4l2-common.h
+#include media/v4l2-i2c-drv-legacy.h
+#include tda9840.h
 #include compat.h
 
-#include tda9840.h
-
-static int debug;  /* insmod parameter */
+MODULE_AUTHOR(Michael Hunold [EMAIL PROTECTED]);
+MODULE_DESCRIPTION(tda9840 driver);
+MODULE_LICENSE(GPL);
+
+static int debug;
 module_param(debug, int, 0644);
-MODULE_PARM_DESC(debug, Turn on/off device debugging (default:off).);
-
-#define dprintk(args...) \
-   do { if (debug) { printk(%s: %s()[%d]: , KBUILD_MODNAME, 
__func__, __LINE__); printk(args); } } while (0)
+
+MODULE_PARM_DESC(debug, Debug level (0-1));
 
 #defineSWITCH  0x00
 #defineLEVEL_ADJUST0x02
@@ -50,18 +54,21 @@ static unsigned short normal_i2c[] = { I
 /* magic definition of all other variables and things */
 I2C_CLIENT_INSMOD;
 
-static struct i2c_driver driver;
-static struct i2c_client client_template;
-
-static int command(struct i2c_client *client, unsigned int cmd, void *arg)
+static void tda9840_write(struct i2c_client *client, u8 reg, u8 val)
+{
+   if 

[linuxtv-commits] [hg:v4l-dvb] ivtv: update ivtv version number

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8633 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: update ivtv version number


Since for 2.6.27 ivtvfb uses DMA for write it is important that
you can identify which ivtv version supports this and which doesn't.
Increase the version number so we can tell the difference.

Thanks to Ian Armstrong for pointing this out to me.

Priority: high

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


---

 linux/drivers/media/video/ivtv/ivtv-version.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r 1adb21a23378 -r 82cd672b0fb2 
linux/drivers/media/video/ivtv/ivtv-version.h
--- a/linux/drivers/media/video/ivtv/ivtv-version.h Mon Jul 28 00:14:39 
2008 +0200
+++ b/linux/drivers/media/video/ivtv/ivtv-version.h Thu Aug 07 18:26:25 
2008 +0200
@@ -22,7 +22,7 @@
 
 #define IVTV_DRIVER_NAME ivtv
 #define IVTV_DRIVER_VERSION_MAJOR 1
-#define IVTV_DRIVER_VERSION_MINOR 3
+#define IVTV_DRIVER_VERSION_MINOR 4
 #define IVTV_DRIVER_VERSION_PATCHLEVEL 0
 
 #define IVTV_VERSION __stringify(IVTV_DRIVER_VERSION_MAJOR) . 
__stringify(IVTV_DRIVER_VERSION_MINOR) . 
__stringify(IVTV_DRIVER_VERSION_PATCHLEVEL)


---

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

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


[linuxtv-commits] [hg:v4l-dvb] v4l2: extend MPEG Encoding API with AVC and AAC

2008-08-09 Thread Patch from Janne Grunau
The patch number 8634 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: Janne Grunau  [EMAIL PROTECTED]
v4l2: extend MPEG Encoding API with AVC and AAC


Adds Advanced Audio Coding (AAC) and MPEG-4 Advanced Video Coding
(AVC/H.264) as audio/video codecs to the extended controls API.
Updates cx2341x driver to the new values.

Priority: normal

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


---

 linux/drivers/media/video/cx2341x.c |5 -
 linux/drivers/media/video/v4l2-common.c |   14 --
 linux/include/linux/videodev2.h |6 --
 3 files changed, 16 insertions(+), 9 deletions(-)

diff -r 82cd672b0fb2 -r 7853c6099651 linux/drivers/media/video/cx2341x.c
--- a/linux/drivers/media/video/cx2341x.c   Thu Aug 07 18:26:25 2008 +0200
+++ b/linux/drivers/media/video/cx2341x.c   Fri Aug 08 12:21:00 2008 +0200
@@ -509,7 +509,10 @@ int cx2341x_ctrl_query(const struct cx23
/* this setting is read-only for the cx2341x since the
   V4L2_CID_MPEG_STREAM_TYPE really determines the
   MPEG-1/2 setting */
-   err = v4l2_ctrl_query_fill_std(qctrl);
+   err = v4l2_ctrl_query_fill(qctrl,
+  V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
+  V4L2_MPEG_VIDEO_ENCODING_MPEG_2, 1,
+  V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
if (err == 0)
qctrl-flags |= V4L2_CTRL_FLAG_READ_ONLY;
return err;
diff -r 82cd672b0fb2 -r 7853c6099651 linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Thu Aug 07 18:26:25 2008 +0200
+++ b/linux/drivers/media/video/v4l2-common.c   Fri Aug 08 12:21:00 2008 +0200
@@ -188,9 +188,10 @@ const char **v4l2_ctrl_get_menu(u32 id)
NULL
};
static const char *mpeg_audio_encoding[] = {
-   Layer I,
-   Layer II,
-   Layer III,
+   MPEG-1 Layer I,
+   MPEG-1 Layer II,
+   MPEG-1 Layer III,
+   MPEG-4 AAC,
NULL
};
static const char *mpeg_audio_l1_bitrate[] = {
@@ -272,6 +273,7 @@ const char **v4l2_ctrl_get_menu(u32 id)
static const char *mpeg_video_encoding[] = {
MPEG-1,
MPEG-2,
+   MPEG-4 AVC,
NULL
};
static const char *mpeg_video_aspect[] = {
@@ -359,7 +361,7 @@ int v4l2_ctrl_query_fill(struct v4l2_que
/* MPEG controls */
case V4L2_CID_MPEG_CLASS:   name = MPEG Encoder Controls; 
break;
case V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ: name = Audio Sampling 
Frequency; break;
-   case V4L2_CID_MPEG_AUDIO_ENCODING:  name = Audio Encoding Layer; 
break;
+   case V4L2_CID_MPEG_AUDIO_ENCODING:  name = Audio Encoding; break;
case V4L2_CID_MPEG_AUDIO_L1_BITRATE:name = Audio Layer I Bitrate; 
break;
case V4L2_CID_MPEG_AUDIO_L2_BITRATE:name = Audio Layer II 
Bitrate; break;
case V4L2_CID_MPEG_AUDIO_L3_BITRATE:name = Audio Layer III 
Bitrate; break;
@@ -494,7 +496,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2
case V4L2_CID_MPEG_AUDIO_ENCODING:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
-   V4L2_MPEG_AUDIO_ENCODING_LAYER_3, 1,
+   V4L2_MPEG_AUDIO_ENCODING_AAC, 1,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2);
case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
return v4l2_ctrl_query_fill(qctrl,
@@ -536,7 +538,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2
case V4L2_CID_MPEG_VIDEO_ENCODING:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_VIDEO_ENCODING_MPEG_1,
-   V4L2_MPEG_VIDEO_ENCODING_MPEG_2, 1,
+   V4L2_MPEG_VIDEO_ENCODING_MPEG_4_AVC, 1,
V4L2_MPEG_VIDEO_ENCODING_MPEG_2);
case V4L2_CID_MPEG_VIDEO_ASPECT:
return v4l2_ctrl_query_fill(qctrl,
diff -r 82cd672b0fb2 -r 7853c6099651 linux/include/linux/videodev2.h
--- a/linux/include/linux/videodev2.h   Thu Aug 07 18:26:25 2008 +0200
+++ b/linux/include/linux/videodev2.h   Fri Aug 08 12:21:00 2008 +0200
@@ -908,6 +908,7 @@ enum v4l2_mpeg_audio_encoding {
V4L2_MPEG_AUDIO_ENCODING_LAYER_1 = 0,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2 = 1,

[linuxtv-commits] [hg:v4l-dvb] v4l2: add v4l2_ctrl_query_menu_valid_items support function

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8637 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]
v4l2: add v4l2_ctrl_query_menu_valid_items support function


v4l2_ctrl_query_menu_valid_items() makes it easy to handle control menus
that have a lot of invalid 'holes'. For example, many MPEG encoders only
support a limited subset of audio bitrates. In that case a driver can
specify an array listing the set of valid bitrates and pass that to
this function.

Priority: normal

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


---

 linux/drivers/media/video/v4l2-common.c |   27 +---
 linux/include/media/v4l2-common.h   |2 +
 2 files changed, 26 insertions(+), 3 deletions(-)

diff -r 5e200c8fd7fe -r e79d11d6a256 linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Fri Aug 08 12:55:00 2008 +0200
+++ b/linux/drivers/media/video/v4l2-common.c   Fri Aug 08 13:34:19 2008 +0200
@@ -644,6 +644,7 @@ int v4l2_ctrl_query_menu(struct v4l2_que
 {
int i;
 
+   qmenu-reserved = 0;
if (menu_items == NULL ||
(qctrl  (qmenu-index  qctrl-minimum || qmenu-index  
qctrl-maximum)))
return -EINVAL;
@@ -651,10 +652,30 @@ int v4l2_ctrl_query_menu(struct v4l2_que
if (menu_items[i] == NULL || menu_items[i][0] == '\0')
return -EINVAL;
snprintf(qmenu-name, sizeof(qmenu-name), menu_items[qmenu-index]);
+   return 0;
+}
+EXPORT_SYMBOL(v4l2_ctrl_query_menu);
+
+/* Fill in a struct v4l2_querymenu based on the specified array of valid
+   menu items (terminated by V4L2_CTRL_MENU_IDS_END).
+   Use this if there are 'holes' in the list of valid menu items. */
+int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 
*ids)
+{
+   const char **menu_items = v4l2_ctrl_get_menu(qmenu-id);
+
qmenu-reserved = 0;
-   return 0;
-}
-EXPORT_SYMBOL(v4l2_ctrl_query_menu);
+   if (menu_items == NULL || ids == NULL)
+   return -EINVAL;
+   while (*ids != V4L2_CTRL_MENU_IDS_END) {
+   if (*ids++ == qmenu-index) {
+   snprintf(qmenu-name, sizeof(qmenu-name),
+  menu_items[qmenu-index]);
+   return 0;
+   }
+   }
+   return -EINVAL;
+}
+EXPORT_SYMBOL(v4l2_ctrl_query_menu_valid_items);
 
 /* ctrl_classes points to an array of u32 pointers, the last element is
a NULL pointer. Each u32 array is a 0-terminated array of control IDs.
diff -r 5e200c8fd7fe -r e79d11d6a256 linux/include/media/v4l2-common.h
--- a/linux/include/media/v4l2-common.h Fri Aug 08 12:55:00 2008 +0200
+++ b/linux/include/media/v4l2-common.h Fri Aug 08 13:34:19 2008 +0200
@@ -82,6 +82,8 @@ int v4l2_ctrl_query_fill_std(struct v4l2
 int v4l2_ctrl_query_fill_std(struct v4l2_queryctrl *qctrl);
 int v4l2_ctrl_query_menu(struct v4l2_querymenu *qmenu,
struct v4l2_queryctrl *qctrl, const char **menu_items);
+#define V4L2_CTRL_MENU_IDS_END (0x)
+int v4l2_ctrl_query_menu_valid_items(struct v4l2_querymenu *qmenu, const u32 
*ids);
 u32 v4l2_ctrl_next(const u32 * const *ctrl_classes, u32 id);
 
 /* - */


---

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

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


[linuxtv-commits] [hg:v4l-dvb] bt87x: depends on PCI

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8638 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]
bt87x: depends on PCI


Building bt87x fails on machines without PCI bus.
Add dependency on CONFIG_PCI.

Priority: normal

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


---

 v4l/Kconfig.sound |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -r e79d11d6a256 -r e2e0744ec9cd v4l/Kconfig.sound
--- a/v4l/Kconfig.sound Fri Aug 08 13:34:19 2008 +0200
+++ b/v4l/Kconfig.sound Fri Aug 08 16:09:07 2008 +0200
@@ -5,7 +5,7 @@ comment ALSA sound
 
 config SND_BT87X
tristate Bt87x Audio Capture
-   depends on SND
+   depends on SND  PCI
select SND_PCM
help
  If you want to record audio from TV cards based on


---

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

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


[linuxtv-commits] [hg:v4l-dvb] v4l: add AC-3 audio support to the MPEG Encoding API

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8635 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: add AC-3 audio support to the MPEG Encoding API


Some models of the saa6752hs support AC-3. Extend the API with the
necessary controls for AC-3.

Priority: normal

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


---

 linux/drivers/media/video/v4l2-common.c |   42 +---
 linux/include/linux/videodev2.h |   23 +
 2 files changed, 60 insertions(+), 5 deletions(-)

diff -r 7853c6099651 -r 11f681c008ee linux/drivers/media/video/v4l2-common.c
--- a/linux/drivers/media/video/v4l2-common.c   Fri Aug 08 12:21:00 2008 +0200
+++ b/linux/drivers/media/video/v4l2-common.c   Fri Aug 08 12:38:07 2008 +0200
@@ -188,10 +188,11 @@ const char **v4l2_ctrl_get_menu(u32 id)
NULL
};
static const char *mpeg_audio_encoding[] = {
-   MPEG-1 Layer I,
-   MPEG-1 Layer II,
-   MPEG-1 Layer III,
-   MPEG-4 AAC,
+   MPEG-1/2 Layer I,
+   MPEG-1/2 Layer II,
+   MPEG-1/2 Layer III,
+   MPEG-2/4 AAC,
+   AC-3,
NULL
};
static const char *mpeg_audio_l1_bitrate[] = {
@@ -245,6 +246,28 @@ const char **v4l2_ctrl_get_menu(u32 id)
320 kbps,
NULL
};
+   static const char *mpeg_audio_ac3_bitrate[] = {
+   32 kbps,
+   40 kbps,
+   48 kbps,
+   56 kbps,
+   64 kbps,
+   80 kbps,
+   96 kbps,
+   112 kbps,
+   128 kbps,
+   160 kbps,
+   192 kbps,
+   224 kbps,
+   256 kbps,
+   320 kbps,
+   384 kbps,
+   448 kbps,
+   512 kbps,
+   576 kbps,
+   640 kbps,
+   NULL
+   };
static const char *mpeg_audio_mode[] = {
Stereo,
Joint Stereo,
@@ -314,6 +337,8 @@ const char **v4l2_ctrl_get_menu(u32 id)
return mpeg_audio_l2_bitrate;
case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
return mpeg_audio_l3_bitrate;
+   case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
+   return mpeg_audio_ac3_bitrate;
case V4L2_CID_MPEG_AUDIO_MODE:
return mpeg_audio_mode;
case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
@@ -365,6 +390,7 @@ int v4l2_ctrl_query_fill(struct v4l2_que
case V4L2_CID_MPEG_AUDIO_L1_BITRATE:name = Audio Layer I Bitrate; 
break;
case V4L2_CID_MPEG_AUDIO_L2_BITRATE:name = Audio Layer II 
Bitrate; break;
case V4L2_CID_MPEG_AUDIO_L3_BITRATE:name = Audio Layer III 
Bitrate; break;
+   case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:   name = Audio AC-3 Bitrate; 
break;
case V4L2_CID_MPEG_AUDIO_MODE:  name = Audio Stereo Mode; 
break;
case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION: name = Audio Stereo Mode 
Extension; break;
case V4L2_CID_MPEG_AUDIO_EMPHASIS:  name = Audio Emphasis; break;
@@ -410,6 +436,7 @@ int v4l2_ctrl_query_fill(struct v4l2_que
case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
case V4L2_CID_MPEG_AUDIO_L2_BITRATE:
case V4L2_CID_MPEG_AUDIO_L3_BITRATE:
+   case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
case V4L2_CID_MPEG_AUDIO_MODE:
case V4L2_CID_MPEG_AUDIO_MODE_EXTENSION:
case V4L2_CID_MPEG_AUDIO_EMPHASIS:
@@ -496,7 +523,7 @@ int v4l2_ctrl_query_fill_std(struct v4l2
case V4L2_CID_MPEG_AUDIO_ENCODING:
return v4l2_ctrl_query_fill(qctrl,
V4L2_MPEG_AUDIO_ENCODING_LAYER_1,
-   V4L2_MPEG_AUDIO_ENCODING_AAC, 1,
+   V4L2_MPEG_AUDIO_ENCODING_AC3, 1,
V4L2_MPEG_AUDIO_ENCODING_LAYER_2);
case V4L2_CID_MPEG_AUDIO_L1_BITRATE:
return v4l2_ctrl_query_fill(qctrl,
@@ -513,6 +540,11 @@ int v4l2_ctrl_query_fill_std(struct v4l2
V4L2_MPEG_AUDIO_L3_BITRATE_32K,
V4L2_MPEG_AUDIO_L3_BITRATE_320K, 1,
V4L2_MPEG_AUDIO_L3_BITRATE_192K);
+   case V4L2_CID_MPEG_AUDIO_AC3_BITRATE:
+   return v4l2_ctrl_query_fill(qctrl,
+   V4L2_MPEG_AUDIO_AC3_BITRATE_32K,
+   V4L2_MPEG_AUDIO_AC3_BITRATE_640K, 1,
+   

[linuxtv-commits] [hg:v4l-dvb] saa6752hs: cleanup and add AC-3 support

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8639 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]
saa6752hs: cleanup and add AC-3 support


Cleaned up the saa6752hs i2c driver.
Add AC-3 support.
Add VIDIOC_CHIP_IDENT support.

Priority: normal

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


---

 linux/drivers/media/video/saa7134/saa6752hs.c   |  287 +++-
 linux/drivers/media/video/saa7134/saa7134-empress.c |   22 
 linux/drivers/media/video/v4l2-common.c |6 
 linux/include/media/v4l2-chip-ident.h   |4 
 4 files changed, 207 insertions(+), 112 deletions(-)

diff -r e2e0744ec9cd -r d37911e0e629 
linux/drivers/media/video/saa7134/saa6752hs.c
--- a/linux/drivers/media/video/saa7134/saa6752hs.c Fri Aug 08 16:09:07 
2008 +0200
+++ b/linux/drivers/media/video/saa7134/saa6752hs.c Fri Aug 08 17:43:59 
2008 +0200
@@ -1,3 +1,27 @@
+ /*
+saa6752hs - i2c-driver for the saa6752hs by Philips
+
+Copyright (C) 2004 Andrew de Quincey
+
+AC-3 support:
+
+Copyright (C) 2008 Hans Verkuil [EMAIL PROTECTED]
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License vs published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mvss Ave, Cambridge, MA 02139, USA.
+  */
+
 #include linux/module.h
 #include linux/kernel.h
 #include linux/string.h
@@ -11,6 +35,8 @@
 #include compat.h
 #include linux/videodev2.h
 #include media/v4l2-common.h
+#include media/v4l2-chip-ident.h
+#include media/v4l2-i2c-drv-legacy.h
 #include linux/init.h
 #include linux/crc32.h
 
@@ -27,9 +53,6 @@ MODULE_DESCRIPTION(device driver for sa
 MODULE_DESCRIPTION(device driver for saa6752hs MPEG2 encoder);
 MODULE_AUTHOR(Andrew de Quincey);
 MODULE_LICENSE(GPL);
-
-static struct i2c_driver driver;
-static struct i2c_client client_template;
 
 enum saa6752hs_videoformat {
SAA6752HS_VF_D1 = 0,/* standard D1 video format: 720x576 */
@@ -47,7 +70,9 @@ struct saa6752hs_mpeg_params {
__u16   ts_pid_pcr;
 
/* audio */
-   enum v4l2_mpeg_audio_l2_bitrate au_l2_bitrate;
+   enum v4l2_mpeg_audio_encodingau_encoding;
+   enum v4l2_mpeg_audio_l2_bitrate  au_l2_bitrate;
+   enum v4l2_mpeg_audio_ac3_bitrate au_ac3_bitrate;
 
/* video */
enum v4l2_mpeg_video_aspect vi_aspect;
@@ -71,7 +96,9 @@ static const struct v4l2_format v4l2_for
 };
 
 struct saa6752hs_state {
-   struct i2c_client client;
+   int   chip;
+   u32   revision;
+   int   has_ac3;
struct saa6752hs_mpeg_params  params;
enum saa6752hs_videoformatvideo_format;
v4l2_std_id   standard;
@@ -158,7 +185,9 @@ static struct saa6752hs_mpeg_params para
.vi_bitrate_peak = 6000,
.vi_bitrate_mode = V4L2_MPEG_VIDEO_BITRATE_MODE_VBR,
 
+   .au_encoding = V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
.au_l2_bitrate   = V4L2_MPEG_AUDIO_L2_BITRATE_256K,
+   .au_ac3_bitrate  = V4L2_MPEG_AUDIO_AC3_BITRATE_384K,
 };
 
 /* -- */
@@ -231,8 +260,9 @@ static int saa6752hs_chip_command(struct
 
 
 static int saa6752hs_set_bitrate(struct i2c_client* client,
-struct saa6752hs_mpeg_params* params)
-{
+struct saa6752hs_state *h)
+{
+   struct saa6752hs_mpeg_params *params = h-params;
u8 buf[3];
int tot_bitrate;
 
@@ -264,11 +294,22 @@ static int saa6752hs_set_bitrate(struct 
tot_bitrate = params-vi_bitrate;
}
 
+   /* set the audio encoding */
+   buf[0] = 0x93;
+   if (params-au_encoding == V4L2_MPEG_AUDIO_ENCODING_AC3)
+   buf[1] = 1;
+   else
+   buf[1] = 0;
+   i2c_master_send(client, buf, 2);
+
/* set the audio bitrate */
buf[0] = 0x94;
-   buf[1] = (V4L2_MPEG_AUDIO_L2_BITRATE_256K == params-au_l2_bitrate) ? 0 
: 1;
+   if (params-au_encoding == 

[linuxtv-commits] [hg:v4l-dvb] arv: fix compilation errors/warnings

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8641 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]
arv: fix compilation errors/warnings


- add PCI dependency for btcx
- fix compile errors (doesn't like ';' at the end of a #if 0)

Priority: normal

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


---

 linux/drivers/media/video/Kconfig |1 +
 linux/drivers/media/video/arv.c   |   12 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diff -r 251408a0666a -r deeb5dfb37a1 linux/drivers/media/video/Kconfig
--- a/linux/drivers/media/video/Kconfig Fri Aug 08 18:27:16 2008 +0200
+++ b/linux/drivers/media/video/Kconfig Fri Aug 08 20:47:07 2008 +0200
@@ -34,6 +34,7 @@ config VIDEOBUF_DVB
select VIDEOBUF_GEN
 
 config VIDEO_BTCX
+   depends on PCI
tristate
 
 config VIDEO_IR
diff -r 251408a0666a -r deeb5dfb37a1 linux/drivers/media/video/arv.c
--- a/linux/drivers/media/video/arv.c   Fri Aug 08 18:27:16 2008 +0200
+++ b/linux/drivers/media/video/arv.c   Fri Aug 08 20:47:07 2008 +0200
@@ -39,7 +39,7 @@
 #include asm/dma.h
 #include asm/byteorder.h
 
-#if 0 /* keep */;
+#if 0 /* keep */
 #define DEBUG(n, args...) printk(args)
 #define CHECK_LOST 1
 #else
@@ -579,11 +579,11 @@ static void ar_interrupt(int irq, void *
 * we have to start capture.
 */
disable_dma();
-#if 0 /* keep */;
+#if 0 /* keep */
ar_outl(ar-line_buff, M32R_DMA0CDA_PORTL); /* needless? */
 #endif
memcpy(ar-frame[0], ar-line_buff, ar-line_bytes);
-#if 0 /* keep */;
+#if 0 /* keep */
ar_outl(0xa1861300, M32R_DMA0CR0_PORTL);
 #endif
enable_dma();
@@ -609,7 +609,7 @@ static void ar_interrupt(int irq, void *
ar_outl(arvcr1, ARVCR1);/* disable */
wake_up_interruptible(ar-wait);
} else {
-#if 0 /* keep */;
+#if 0 /* keep */
ar_outl(ar-line_buff, M32R_DMA0CDA_PORTL);
ar_outl(0xa1861300, M32R_DMA0CR0_PORTL);
 #endif
@@ -693,7 +693,7 @@ static int ar_initialize(struct video_de
printk(.);
iic(2,0x78,0x8e,0x0c,0x00);
iic(2,0x78,0x8f,0x00,0x00);
-#if 0 /* keep */;
+#if 0 /* keep */
iic(2,0x78,0x90,0x00,0x00); /* AWB on=1 off=0 */
 #endif
iic(2,0x78,0x93,0x01,0x00);
@@ -712,7 +712,7 @@ static int ar_initialize(struct video_de
iic(2,0x78,0x9e,0x2e,0x00);
iic(2,0x78,0xb8,0x78,0x00);
iic(2,0x78,0xba,0x05,0x00);
-#if 0 /* keep */;
+#if 0 /* keep */
iic(2,0x78,0x83,0x8c,0x00); /* brightness */
 #endif
printk(.);


---

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

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


[linuxtv-commits] [hg:v4l-dvb] saa6752hs: add PMT table for AC3

2008-08-09 Thread Patch from Hans Verkuil
The patch number 8640 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]
saa6752hs: add PMT table for AC3


The PMT table for AC3 audio is different.
Thanks to Dmitry Belimov for providing the table data.

Priority: normal

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


---

 linux/drivers/media/video/saa7134/saa6752hs.c |   63 ++
 1 file changed, 50 insertions(+), 13 deletions(-)

diff -r d37911e0e629 -r 251408a0666a 
linux/drivers/media/video/saa7134/saa6752hs.c
--- a/linux/drivers/media/video/saa7134/saa6752hs.c Fri Aug 08 17:43:59 
2008 +0200
+++ b/linux/drivers/media/video/saa7134/saa6752hs.c Fri Aug 08 18:27:16 
2008 +0200
@@ -173,6 +173,39 @@ static u8 PMT[] = {
0x00, 0x00, 0x00, 0x00 /* CRC32 */
 };
 
+static u8 PMT_AC3[] = {
+   0xc2, /* i2c register */
+   0x01, /* table number for encoder(1) */
+   0x47, /* sync */
+
+   0x40, /* transport_error_indicator(0), payload_unit_start(1), 
transport_priority(0) */
+   0x10, /* PMT PID (0x0010) */
+   0x10, /* transport_scrambling_control(00), 
adaptation_field_control(01), continuity_counter(0) */
+
+   0x00, /* PSI pointer to start of table */
+
+   0x02, /* TID (2) */
+   0xb0, 0x1a, /* section_syntax_indicator(1), section_length(26) */
+
+   0x00, 0x01, /* program_number(1) */
+
+   0xc1, /* version_number(0), current_next_indicator(1) */
+
+   0x00, 0x00, /* section_number(0), last_section_number(0) */
+
+   0xe1, 0x04, /* PCR_PID (0x0104) */
+
+   0xf0, 0x00, /* program_info_length(0) */
+
+   0x02, 0xe1, 0x00, 0xf0, 0x00, /* video stream type(2), pid */
+   0x06, 0xe1, 0x03, 0xf0, 0x03, /* audio stream type(6), pid */
+   0x6a, /* AC3 */
+   0x01, /* Descriptor_length(1) */
+   0x00, /* component_type_flag(0), bsid_flag(0), mainid_flag(0), 
asvc_flag(0), reserved flags(0) */
+
+   0xED, 0xDE, 0x2D, 0xF3 /* CRC32 BE */
+};
+
 static struct saa6752hs_mpeg_params param_defaults =
 {
.ts_pid_pmt  = 16,
@@ -187,7 +220,7 @@ static struct saa6752hs_mpeg_params para
 
.au_encoding = V4L2_MPEG_AUDIO_ENCODING_LAYER_2,
.au_l2_bitrate   = V4L2_MPEG_AUDIO_L2_BITRATE_256K,
-   .au_ac3_bitrate  = V4L2_MPEG_AUDIO_AC3_BITRATE_384K,
+   .au_ac3_bitrate  = V4L2_MPEG_AUDIO_AC3_BITRATE_256K,
 };
 
 /* -- */
@@ -296,10 +329,7 @@ static int saa6752hs_set_bitrate(struct 
 
/* set the audio encoding */
buf[0] = 0x93;
-   if (params-au_encoding == V4L2_MPEG_AUDIO_ENCODING_AC3)
-   buf[1] = 1;
-   else
-   buf[1] = 0;
+   buf[1] = (params-au_encoding == V4L2_MPEG_AUDIO_ENCODING_AC3);
i2c_master_send(client, buf, 2);
 
/* set the audio bitrate */
@@ -628,6 +658,7 @@ static int saa6752hs_init(struct i2c_cli
 {
unsigned char buf[9], buf2[4];
struct saa6752hs_state *h;
+   unsigned size;
u32 crc;
unsigned char localPAT[256];
unsigned char localPMT[256];
@@ -686,7 +717,13 @@ static int saa6752hs_init(struct i2c_cli
localPAT[sizeof(PAT) - 1] = crc  0xFF;
 
/* compute PMT */
-   memcpy(localPMT, PMT, sizeof(PMT));
+   if (h-params.au_encoding == V4L2_MPEG_AUDIO_ENCODING_AC3) {
+   size = sizeof(PMT_AC3);
+   memcpy(localPMT, PMT_AC3, size);
+   } else {
+   size = sizeof(PMT);
+   memcpy(localPMT, PMT, size);
+   }
localPMT[3] = 0x40 | ((h-params.ts_pid_pmt  8)  0x0f);
localPMT[4] = h-params.ts_pid_pmt  0xff;
localPMT[15] = 0xE0 | ((h-params.ts_pid_pcr  8)  0x0F);
@@ -695,11 +732,11 @@ static int saa6752hs_init(struct i2c_cli
localPMT[21] = h-params.ts_pid_video  0xFF;
localPMT[25] = 0xE0 | ((h-params.ts_pid_audio  8)  0x0F);
localPMT[26] = h-params.ts_pid_audio  0xFF;
-   crc = crc32_be(~0, localPMT[7], sizeof(PMT) - 7 - 4);
-   localPMT[sizeof(PMT) - 4] = (crc  24)  0xFF;
-   localPMT[sizeof(PMT) - 3] = (crc  16)  0xFF;
-   localPMT[sizeof(PMT) - 2] = (crc  8)  0xFF;
-   localPMT[sizeof(PMT) - 1] = crc  0xFF;
+   crc = crc32_be(~0, localPMT[7], size - 7 - 4);
+   localPMT[size - 4] = (crc  24)  0xFF;
+   localPMT[size - 3] = (crc  16)  0xFF;
+   localPMT[size - 2] = (crc  8)  0xFF;
+   localPMT[size - 1] = crc  0xFF;
 
/* Set Audio PID */
buf[0] = 0xC1;
@@ -720,8 +757,8 @@ static int saa6752hs_init(struct i2c_cli
i2c_master_send(client,buf,3);
 
/* Send SI tables */
-

[linuxtv-commits] [hg:v4l-dvb] Add support for DViCO FusionHDTV DVB-T Dual Express

2008-08-09 Thread Patch from Steven Toth
The patch number 8644 was added via Steven Toth [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: Steven Toth  [EMAIL PROTECTED]
Add support for DViCO FusionHDTV DVB-T Dual Express


Add support for the DViCO FusionHDTV DVB-T Dual Express card, based on
work by Chris Pascoe and Stephen Backway.

Signed-off-by: Steven Toth [EMAIL PROTECTED]
Signed-off-by: Anton Blanchard [EMAIL PROTECTED]


---

 linux/Documentation/video4linux/CARDLIST.cx23885  |1 
 linux/drivers/media/video/cx23885/cx23885-cards.c |   24 +
 linux/drivers/media/video/cx23885/cx23885-dvb.c   |   34 ++
 linux/drivers/media/video/cx23885/cx23885.h   |1 
 4 files changed, 60 insertions(+)

diff -r c2ad00518e83 -r d61c3d922e98 
linux/Documentation/video4linux/CARDLIST.cx23885
--- a/linux/Documentation/video4linux/CARDLIST.cx23885  Mon Aug 04 20:38:46 
2008 -0400
+++ b/linux/Documentation/video4linux/CARDLIST.cx23885  Mon Aug 04 20:39:53 
2008 -0400
@@ -9,3 +9,4 @@
   8 - Hauppauge WinTV-HVR1700 [0070:8101]
   9 - Hauppauge WinTV-HVR1400 [0070:8010]
  10 - DViCO FusionHDTV7 Dual Express  [18ac:d618]
+ 11 - DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
diff -r c2ad00518e83 -r d61c3d922e98 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:38:46 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:39:53 
2008 -0400
@@ -150,6 +150,11 @@ struct cx23885_board cx23885_boards[] = 
.portb  = CX23885_MPEG_DVB,
.portc  = CX23885_MPEG_DVB,
},
+   [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP] = {
+   .name   = DViCO FusionHDTV DVB-T Dual Express,
+   .portb  = CX23885_MPEG_DVB,
+   .portc  = CX23885_MPEG_DVB,
+   },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -221,6 +226,10 @@ struct cx23885_subid cx23885_subids[] = 
.subvendor = 0x18ac,
.subdevice = 0xd618,
.card  = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP,
+   },{
+   .subvendor = 0x18ac,
+   .subdevice = 0xdb78,
+   .card  = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP,
},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -341,6 +350,7 @@ static int cx23885_tuner_callback(struct
bitmask = 0x04;
break;
case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
+   case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
if (command == 0) {
 
/* Two identical tuners on two different i2c buses,
@@ -484,6 +494,19 @@ void cx23885_gpio_setup(struct cx23885_d
mdelay(20);
cx_set(GP0_IO, 0x000f000f);
break;
+   case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
+   /* GPIO-0 portb xc3028 reset */
+   /* GPIO-1 portb zl10353 reset */
+   /* GPIO-2 portc xc3028 reset */
+   /* GPIO-3 portc zl10353 reset */
+
+   /* Put the parts into reset and back */
+   cx_set(GP0_IO, 0x000f);
+   mdelay(20);
+   cx_clear(GP0_IO, 0x000f);
+   mdelay(20);
+   cx_set(GP0_IO, 0x000f000f);
+   break;
}
 }
 
@@ -535,6 +558,7 @@ void cx23885_card_setup(struct cx23885_d
 
switch (dev-board) {
case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
+   case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
ts2-gen_ctrl_val  = 0xc; /* Serial bus + punctured clock */
ts2-ts_clk_en_val = 0x1; /* Enable TS_CLK */
ts2-src_sel_val   = CX23885_SRC_SEL_PARALLEL_MPEG_VIDEO;
diff -r c2ad00518e83 -r d61c3d922e98 
linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:38:46 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:39:53 
2008 -0400
@@ -43,6 +43,7 @@
 #include tuner-simple.h
 #include dib7000p.h
 #include dibx000_common.h
+#include zl10353.h
 
 static unsigned int debug;
 
@@ -302,6 +303,12 @@ static struct dib7000p_config hauppauge_
.spur_protect = 0,
 
.output_mode = OUTMODE_MPEG2_SERIAL,
+};
+
+static struct zl10353_config dvico_fusionhdtv_xc3028 = {
+   .demod_address = 0x0f,
+   .if2   = 45600,
+   .no_tuner  = 1,
 };
 
 static int 

[linuxtv-commits] [hg:v4l-dvb] Support IR remote on FusionHDTV DVB-T Dual Express

2008-08-09 Thread Patch from Steven Toth
The patch number 8645 was added via Steven Toth [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: Steven Toth  [EMAIL PROTECTED]
Support IR remote on FusionHDTV DVB-T Dual Express


From Chris Pascoe [EMAIL PROTECTED]
Support IR remote on FusionHDTV DVB-T Dual Express

Signed-off-by: Steven Toth [EMAIL PROTECTED]
Signed-off-by: Anton Blanchard [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx23885/cx23885-cards.c |3 +++
 1 file changed, 3 insertions(+)

diff -r d61c3d922e98 -r 9d8ea30fa526 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:39:53 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:41:06 
2008 -0400
@@ -521,6 +521,9 @@ int cx23885_ir_init(struct cx23885_dev *
case CX23885_BOARD_HAUPPAUGE_HVR1400:
/* FIXME: Implement me */
break;
+   case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
+   request_module(ir-kbd-i2c);
+   break;
}
 
return 0;


---

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

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


[linuxtv-commits] [hg:v4l-dvb] cx23885: Convert framework to use a single tuner callback function.

2008-08-09 Thread Patch from Steven Toth
The patch number 8646 was added via Steven Toth [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: Steven Toth  [EMAIL PROTECTED]
cx23885: Convert framework to use a single tuner callback function.


Code reduction. Tuner callback now assumes that tsport is passed as the void 
arg.

Signed-off-by: Steven Toth [EMAIL PROTECTED]


---

 linux/drivers/media/video/cx23885/cx23885-cards.c |   31 +++---
 linux/drivers/media/video/cx23885/cx23885-dvb.c   |   16 ---
 linux/drivers/media/video/cx23885/cx23885.h   |3 -
 3 files changed, 18 insertions(+), 32 deletions(-)

diff -r 9d8ea30fa526 -r 2bade2ed7ac8 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 20:41:06 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Mon Aug 04 21:18:19 
2008 -0400
@@ -330,10 +330,14 @@ static void hauppauge_eeprom(struct cx23
dev-name, tv.model);
 }
 
-static int cx23885_tuner_callback(struct cx23885_dev *dev, int port,
- int command, int arg)
+int cx23885_tuner_callback(void *priv, int command, int arg)
 {
+   struct cx23885_tsport *port = priv;
+   struct cx23885_dev *dev = port-dev;
u32 bitmask = 0;
+
+   if (command == XC2028_RESET_CLK)
+   return 0;
 
if (command != 0) {
printk(KERN_ERR %s(): Unknown command 0x%x.\n,
@@ -355,9 +359,9 @@ static int cx23885_tuner_callback(struct
 
/* Two identical tuners on two different i2c buses,
 * we need to reset the correct gpio. */
-   if (port == 0)
+   if (port-nr == 0)
bitmask = 0x01;
-   else if (port == 1)
+   else if (port-nr == 1)
bitmask = 0x04;
}
break;
@@ -371,25 +375,6 @@ static int cx23885_tuner_callback(struct
}
 
return 0;
-}
-
-int cx23885_xc5000_tuner_callback(void *priv, int command, int arg)
-{
-   struct cx23885_i2c *bus = priv;
-   struct cx23885_dev *dev = bus-dev;
-
-   return cx23885_tuner_callback(dev, bus-nr, command, arg);
-}
-
-int cx23885_xc3028_tuner_callback(void *priv, int command, int arg)
-{
-   struct cx23885_tsport *port = priv;
-   struct cx23885_dev *dev = port-dev;
-
-   if (command == XC2028_RESET_CLK)
-   return 0;
-
-   return cx23885_tuner_callback(dev, port-nr, command, arg);
 }
 
 void cx23885_gpio_setup(struct cx23885_dev *dev)
diff -r 9d8ea30fa526 -r 2bade2ed7ac8 
linux/drivers/media/video/cx23885/cx23885-dvb.c
--- a/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 20:41:06 
2008 -0400
+++ b/linux/drivers/media/video/cx23885/cx23885-dvb.c   Mon Aug 04 21:18:19 
2008 -0400
@@ -190,13 +190,13 @@ static struct xc5000_config hauppauge_hv
 static struct xc5000_config hauppauge_hvr1500q_tunerconfig = {
.i2c_address  = 0x61,
.if_khz   = 5380,
-   .tuner_callback   = cx23885_xc5000_tuner_callback,
+   .tuner_callback   = cx23885_tuner_callback,
 };
 
 static struct xc5000_config dvico_xc5000_tunerconfig = {
.i2c_address  = 0x64,
.if_khz   = 5380,
-   .tuner_callback   = cx23885_xc5000_tuner_callback,
+   .tuner_callback   = cx23885_tuner_callback,
 };
 
 static struct tda829x_config tda829x_no_probe = {
@@ -392,7 +392,7 @@ static int dvb_register(struct cx23885_t
if (port-dvb.frontend != NULL)
dvb_attach(xc5000_attach, port-dvb.frontend,
i2c_bus-i2c_adap,
-   hauppauge_hvr1500q_tunerconfig, i2c_bus);
+   hauppauge_hvr1500q_tunerconfig, port);
break;
case CX23885_BOARD_HAUPPAUGE_HVR1500:
i2c_bus = dev-i2c_bus[1];
@@ -404,7 +404,8 @@ static int dvb_register(struct cx23885_t
struct xc2028_config cfg = {
.i2c_adap  = i2c_bus-i2c_adap,
.i2c_addr  = 0x61,
-   .callback  = cx23885_xc3028_tuner_callback,
+   .video_dev = port,
+   .callback  = cx23885_tuner_callback,
};
static struct xc2028_ctrl ctl = {
.fname   = xc3028-v27.fw,
@@ -443,7 +444,8 @@ static int dvb_register(struct cx23885_t
struct xc2028_config cfg = {
 

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

2008-08-09 Thread Patch from Mauro Carvalho Chehab
The patch number 8647 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/~stoth/v4l-dvb



Priority: normal

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


---

 linux/Documentation/video4linux/CARDLIST.cx23885  |1 
 linux/drivers/media/video/cx23885/cx23885-cards.c |   46 ++--
 linux/drivers/media/video/cx23885/cx23885-dvb.c   |   78 +++---
 linux/drivers/media/video/cx23885/cx23885.h   |1 
 4 files changed, 82 insertions(+), 44 deletions(-)

diff -r deeb5dfb37a1 -r 405d3e926ffd 
linux/Documentation/video4linux/CARDLIST.cx23885
--- a/linux/Documentation/video4linux/CARDLIST.cx23885  Fri Aug 08 20:47:07 
2008 +0200
+++ b/linux/Documentation/video4linux/CARDLIST.cx23885  Sat Aug 09 09:21:15 
2008 -0300
@@ -9,3 +9,4 @@
   8 - Hauppauge WinTV-HVR1700 [0070:8101]
   9 - Hauppauge WinTV-HVR1400 [0070:8010]
  10 - DViCO FusionHDTV7 Dual Express  [18ac:d618]
+ 11 - DViCO FusionHDTV DVB-T Dual Express [18ac:db78]
diff -r deeb5dfb37a1 -r 405d3e926ffd 
linux/drivers/media/video/cx23885/cx23885-cards.c
--- a/linux/drivers/media/video/cx23885/cx23885-cards.c Fri Aug 08 20:47:07 
2008 +0200
+++ b/linux/drivers/media/video/cx23885/cx23885-cards.c Sat Aug 09 09:21:15 
2008 -0300
@@ -27,6 +27,7 @@
 
 #include compat.h
 #include cx23885.h
+#include tuner-xc2028.h
 
 /* -- */
 /* board config info  */
@@ -149,6 +150,11 @@ struct cx23885_board cx23885_boards[] = 
.portb  = CX23885_MPEG_DVB,
.portc  = CX23885_MPEG_DVB,
},
+   [CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP] = {
+   .name   = DViCO FusionHDTV DVB-T Dual Express,
+   .portb  = CX23885_MPEG_DVB,
+   .portc  = CX23885_MPEG_DVB,
+   },
 };
 const unsigned int cx23885_bcount = ARRAY_SIZE(cx23885_boards);
 
@@ -220,6 +226,10 @@ struct cx23885_subid cx23885_subids[] = 
.subvendor = 0x18ac,
.subdevice = 0xd618,
.card  = CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP,
+   },{
+   .subvendor = 0x18ac,
+   .subdevice = 0xdb78,
+   .card  = CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP,
},
 };
 const unsigned int cx23885_idcount = ARRAY_SIZE(cx23885_subids);
@@ -320,14 +330,14 @@ static void hauppauge_eeprom(struct cx23
dev-name, tv.model);
 }
 
-/* Tuner callback function for cx23885 boards. Currently only needed
- * for HVR1500Q, which has an xc5000 tuner.
- */
 int cx23885_tuner_callback(void *priv, int command, int arg)
 {
-   struct cx23885_i2c *bus = priv;
-   struct cx23885_dev *dev = bus-dev;
+   struct cx23885_tsport *port = priv;
+   struct cx23885_dev *dev = port-dev;
u32 bitmask = 0;
+
+   if (command == XC2028_RESET_CLK)
+   return 0;
 
if (command != 0) {
printk(KERN_ERR %s(): Unknown command 0x%x.\n,
@@ -336,19 +346,22 @@ int cx23885_tuner_callback(void *priv, i
}
 
switch(dev-board) {
+   case CX23885_BOARD_HAUPPAUGE_HVR1400:
+   case CX23885_BOARD_HAUPPAUGE_HVR1500:
case CX23885_BOARD_HAUPPAUGE_HVR1500Q:
-   /* Tuner Reset Command from xc5000 */
+   /* Tuner Reset Command */
if (command == 0)
bitmask = 0x04;
break;
case CX23885_BOARD_DVICO_FUSIONHDTV_7_DUAL_EXP:
+   case CX23885_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL_EXP:
if (command == 0) {
 
/* Two identical tuners on two different i2c buses,
 * we need to reset the correct gpio. */
-   if (bus-nr == 0)
+   if (port-nr == 0)
bitmask = 0x01;
-   else if (bus-nr == 1)
+   else if (port-nr == 1)
bitmask = 0x04;
}
break;
@@ -458,6 +471,19 @@ void cx23885_gpio_setup(struct cx23885_d
/* GPIO-1 s5h1409 demod reset i2c bus 0 */
/* GPIO-2 xc5000 tuner reset i2c bus 1 */
/* GPIO-3 s5h1409 demod reset i2c bus 0 */
+
+   /* Put the parts into reset and back */
+   cx_set(GP0_IO, 0x000f);
+   mdelay(20);
+