[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove svn Id keyword from all sources
The patch number 7936 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Remove svn Id keyword from all sources Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-audio.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-context.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-context.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-debug.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-eeprom.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-encoder.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-io.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-io.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-ioread.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-ioread.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-main.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-std.c|1 - linux/drivers/media/video/pvrusb2/pvrusb2-std.h|1 - linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-util.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c |1 - linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h |1 - linux/drivers/media/video/pvrusb2/pvrusb2.h|1 - 45 files changed, 45 deletions(-) diff -r 9d04bba82511 -r cd89b388f1f2 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Wed May 14 23:14:04 2008 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Sun May 25 12:08:13 2008 -0500 @@ -1,6 +1,5 @@ /* * - * $Id$ * * Copyright (C) 2005 Mike Isely <[EMAIL PROTECTED]> * Copyright (C) 2004 Aurelien Alleaume <[EMAIL PROTECTED]> diff -r 9d04bba82511 -r cd89b388f1f2 linux/drivers/media/video/pvrusb2/pvrusb2-audio.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h Wed May 14 23:14:04 2008 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.h Sun May 25 12:08:13 2008 -0500 @@ -1,6 +1,5 @@ /* * - * $Id$ * * Copyright (C) 2005 Mike Isely <[EMAIL PROTECTED]> * Copyright (C) 2004 Aurelien Alleaume <[EMAIL PROTECTED]> diff -r 9d04bba82511 -r cd89b388f1f2 linux/drivers/media/video/pvrusb2/pvrusb2-context.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.c Wed May 14 23:14:04 2008 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.c Sun May 25 12:08:13 2008 -0500 @@ -1,5 +1,4 @@ /* - * $Id$ * * Copyright (C) 2005 Mike Isely <[EMAIL PROTECTED]> * diff -r 9d04bba82511 -r cd89b388f1f2 linux/drivers/media/video/pvrusb2/pvru
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove sysfs interface hackery
The patch number 7939 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Remove sysfs interface hackery Back in the early days of the pvrusb2 driver, the kernel class mechanism in use for the sysfs interface had no means to pass per-attribute information to the show / store functions. This forced me to implement a horrible ugly thunking mechanism (i.e. infer the missing data through the use of dedicated cookie cutter bounce functions). However now we're using a better mechanism which also passes enough additional information to the show / store functions that we no longer need the hack. So eliminate all the crap. Yay! Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 502 +++--- 1 file changed, 135 insertions(+), 367 deletions(-) diff -r 0450d2da1b03 -r e2c992b2818d linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Mon May 26 00:54:24 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Mon May 26 01:00:47 2008 -0500 @@ -71,6 +71,7 @@ struct pvr2_sysfs_ctl_item { struct device_attribute attr_val; struct device_attribute attr_custom; struct pvr2_ctrl *cptr; + int ctl_id; struct pvr2_sysfs *chptr; struct pvr2_sysfs_ctl_item *item_next; struct attribute *attr_gen[7]; @@ -83,38 +84,29 @@ struct pvr2_sysfs_class { struct class class; }; -static ssize_t show_name(int id,struct device *class_dev,char *buf) -{ - struct pvr2_ctrl *cptr; - struct pvr2_sysfs *sfp; +static ssize_t show_name(struct device *class_dev, +struct device_attribute *attr, +char *buf) +{ + struct pvr2_sysfs_ctl_item *cip; const char *name; - - sfp = (struct pvr2_sysfs *)class_dev->driver_data; - if (!sfp) return -EINVAL; - cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id); - if (!cptr) return -EINVAL; - - name = pvr2_ctrl_get_desc(cptr); - pvr2_sysfs_trace("pvr2_sysfs(%p) show_name(cid=%d) is %s",sfp,id,name); - + cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_name); + name = pvr2_ctrl_get_desc(cip->cptr); + pvr2_sysfs_trace("pvr2_sysfs(%p) show_name(cid=%d) is %s", +cip->chptr, cip->ctl_id, name); if (!name) return -EINVAL; - - return scnprintf(buf,PAGE_SIZE,"%s\n",name); -} - -static ssize_t show_type(int id,struct device *class_dev,char *buf) -{ - struct pvr2_ctrl *cptr; - struct pvr2_sysfs *sfp; + return scnprintf(buf, PAGE_SIZE, "%s\n", name); +} + +static ssize_t show_type(struct device *class_dev, +struct device_attribute *attr, +char *buf) +{ + struct pvr2_sysfs_ctl_item *cip; const char *name; enum pvr2_ctl_type tp; - - sfp = (struct pvr2_sysfs *)class_dev->driver_data; - if (!sfp) return -EINVAL; - cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id); - if (!cptr) return -EINVAL; - - tp = pvr2_ctrl_get_type(cptr); + cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_type); + tp = pvr2_ctrl_get_type(cip->cptr); switch (tp) { case pvr2_ctl_int: name = "integer"; break; case pvr2_ctl_enum: name = "enum"; break; @@ -122,403 +114,178 @@ static ssize_t show_type(int id,struct d case pvr2_ctl_bool: name = "boolean"; break; default: name = "?"; break; } - pvr2_sysfs_trace("pvr2_sysfs(%p) show_type(cid=%d) is %s",sfp,id,name); - + pvr2_sysfs_trace("pvr2_sysfs(%p) show_type(cid=%d) is %s", +cip->chptr, cip->ctl_id, name); if (!name) return -EINVAL; - - return scnprintf(buf,PAGE_SIZE,"%s\n",name); -} - -static ssize_t show_min(int id,struct device *class_dev,char *buf) -{ - struct pvr2_ctrl *cptr; - struct pvr2_sysfs *sfp; + return scnprintf(buf, PAGE_SIZE, "%s\n", name); +} + +static ssize_t show_min(struct device *class_dev, + struct device_attribute *attr, + char *buf) +{ + struct pvr2_sysfs_ctl_item *cip; long val; - - sfp = (struct pvr2_sysfs *)class_dev->driver_data; - if (!sfp) return -EINVAL; - cptr = pvr2_hdw_get_ctrl_by_index(sfp->channel.hdw,id); - if (!cptr) return -EINVAL; - val = pvr2_ctrl_get_min(cptr); - - pvr2_sysfs_trace("pvr2_sysfs(%p) show_min(cid=%d) is %ld",sfp,id,val); - - return scnprintf(buf,PA
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Increase enforced encoder wait delay to improve reliability
The patch number 7938 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Increase enforced encoder wait delay to improve reliability The driver enforces a "quiet period" on the encoder in certain situations before attempting to operate it. This seems to help avoid video encoding errors / corruption. The quiet period was 50msec, but through experimentation it has been observed to improve further if the interval is increased to 100msec. Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff -r ecfa9f9c178c -r 0450d2da1b03 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Mon May 26 00:51:57 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Mon May 26 00:54:24 2008 -0500 @@ -45,8 +45,10 @@ #define TIME_MSEC_DECODER_WAIT 50 /* This defines a minimum interval that the encoder must remain quiet - before we are allowed to configure it. */ -#define TIME_MSEC_ENCODER_WAIT 50 + before we are allowed to configure it. I had this originally set to + 50msec, but Martin Dauskardt <[EMAIL PROTECTED]> reports that + things work better when it's set to 100msec. */ +#define TIME_MSEC_ENCODER_WAIT 100 /* This defines the minimum interval that the encoder must successfully run before we consider that the encoder has run at least once since its --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/0450d2da1b0389968061feece62dbb6cd5f11b46 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Change several embedded timer constants to defined values
The patch number 7937 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Change several embedded timer constants to defined values This is primarily a cosmetic change to make it easier to change some of the time constants used in the driver. Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 25 ++-- 1 file changed, 22 insertions(+), 3 deletions(-) diff -r cd89b388f1f2 -r ecfa9f9c178c linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun May 25 12:08:13 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Mon May 26 00:51:57 2008 -0500 @@ -39,6 +39,21 @@ #define TV_MIN_FREQ 5525L #define TV_MAX_FREQ85000L + +/* This defines a minimum interval that the decoder must remain quiet + before we are allowed to start it running. */ +#define TIME_MSEC_DECODER_WAIT 50 + +/* This defines a minimum interval that the encoder must remain quiet + before we are allowed to configure it. */ +#define TIME_MSEC_ENCODER_WAIT 50 + +/* This defines the minimum interval that the encoder must successfully run + before we consider that the encoder has run at least once since its + firmware has been loaded. This measurement is in important for cases + where we can't do something until we know that the encoder has been run + at least once. */ +#define TIME_MSEC_ENCODER_OK 250 static struct pvr2_hdw *unit_pointers[PVR_NUM] = {[ 0 ... PVR_NUM-1 ] = NULL}; static DEFINE_MUTEX(pvr2_unit_mtx); @@ -3706,7 +3721,9 @@ static int state_eval_encoder_config(str the encoder. */ if (!hdw->state_encoder_waitok) { hdw->encoder_wait_timer.expires = - jiffies + (HZ*50/1000); + jiffies + + (HZ * TIME_MSEC_ENCODER_WAIT +/ 1000); add_timer(&hdw->encoder_wait_timer); } } @@ -3830,7 +3847,7 @@ static int state_eval_encoder_run(struct hdw->state_encoder_run = !0; if (!hdw->state_encoder_runok) { hdw->encoder_run_timer.expires = - jiffies + (HZ*250/1000); + jiffies + (HZ * TIME_MSEC_ENCODER_OK / 1000); add_timer(&hdw->encoder_run_timer); } } @@ -3905,7 +3922,9 @@ static int state_eval_decoder_run(struct but before we did the pending check. */ if (!hdw->state_decoder_quiescent) { hdw->quiescent_timer.expires = - jiffies + (HZ*50/1000); + jiffies + + (HZ * TIME_MSEC_DECODER_WAIT +/ 1000); add_timer(&hdw->quiescent_timer); } } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ecfa9f9c178c55e69a551f9a861de4c30ede6004 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix misleading source code comment
The patch number 8175 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Fix misleading source code comment Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -r cb6162341029 -r 3b0792127ce7 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 29 08:54:08 2008 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 29 22:32:35 2008 -0500 @@ -2477,9 +2477,8 @@ static int pvr2_hdw_commit_execute(struc struct pvr2_ctrl *cptr; int disruptive_change; - /* When video standard changes, reset the hres and vres values - - but if the user has pending changes there, then let the changes - take priority. */ + /* Handle some required side effects when the video standard is + changed */ if (hdw->std_dirty) { /* Rewrite the vertical resolution to be appropriate to the video standard that has been selected. */ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/3b0792127ce72a90f84afc49542b237ceb160fca ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Update video_gop_size
The patch number 8176 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Update video_gop_size When switching video standard, ensure that video GOP size remains appropriately configured. Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 29 1 file changed, 23 insertions(+), 6 deletions(-) diff -r 3b0792127ce7 -r 26ae64c4e7cf linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 29 22:32:35 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Jun 29 22:35:52 2008 -0500 @@ -2480,17 +2480,34 @@ static int pvr2_hdw_commit_execute(struc /* Handle some required side effects when the video standard is changed */ if (hdw->std_dirty) { + int nvres; + int gop_size; + if (hdw->std_mask_cur & V4L2_STD_525_60) { + nvres = 480; + gop_size = 15; + } else { + nvres = 576; + gop_size = 12; + } /* Rewrite the vertical resolution to be appropriate to the video standard that has been selected. */ - int nvres; - if (hdw->std_mask_cur & V4L2_STD_525_60) { - nvres = 480; - } else { - nvres = 576; - } if (nvres != hdw->res_ver_val) { hdw->res_ver_val = nvres; hdw->res_ver_dirty = !0; + } + /* Rewrite the GOP size to be appropriate to the video + standard that has been selected. */ + if (gop_size != hdw->enc_ctl_state.video_gop_size) { + struct v4l2_ext_controls cs; + struct v4l2_ext_control c1; + memset(&cs, 0, sizeof(cs)); + memset(&c1, 0, sizeof(c1)); + cs.controls = &c1; + cs.count = 1; + c1.id = V4L2_CID_MPEG_VIDEO_GOP_SIZE; + c1.value = gop_size; + cx2341x_ext_ctrls(&hdw->enc_ctl_state, 0, &cs, + VIDIOC_S_EXT_CTRLS); } } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/26ae64c4e7cf502cd6880d59c77a654bb506ceb0 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Cosmetic macro fix (benign)
The patch number 8475 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Cosmetic macro fix (benign) Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-context.h |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -r 038944f25a29 -r e9d0169325a3 linux/drivers/media/video/pvrusb2/pvrusb2-context.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-context.h Fri Jul 25 17:35:31 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-context.h Fri Jul 25 17:50:52 2008 -0500 @@ -16,8 +16,8 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * */ -#ifndef __PVRUSB2_BASE_H -#define __PVRUSB2_BASE_H +#ifndef __PVRUSB2_CONTEXT_H +#define __PVRUSB2_CONTEXT_H #include #include --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/e9d0169325a329bfccda5a1b68936e758c20f272 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Enable IR chip on HVR-1900 class devices
The patch number 8474 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Enable IR chip on HVR-1900 class devices The Zilog IR chip on HVR-1900 devices is held in reset when the device initializes. We have to bring this chip out of reset before LIRC has any chance of operating the chip. So do it. Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c |5 +- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h | 26 +++ linux/drivers/media/video/pvrusb2/pvrusb2-fx2-cmd.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |9 +++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |4 + 5 files changed, 35 insertions(+), 11 deletions(-) diff -r 5738a6f02a62 -r 038944f25a29 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Thu Jul 24 17:07:33 2008 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Fri Jul 25 17:35:31 2008 -0500 @@ -97,13 +97,13 @@ static const struct pvr2_device_desc pvr .flag_has_cx25840 = !0, .flag_has_wm8775 = !0, .flag_has_hauppauge_rom = !0, - .flag_has_hauppauge_custom_ir = !0, .flag_has_analogtuner = !0, .flag_has_fmradio = !0, .flag_has_composite = !0, .flag_has_svideo = !0, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, + .ir_scheme = PVR2_IR_SCHEME_24XXX, }; @@ -344,6 +344,7 @@ static const struct pvr2_device_desc pvr .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, + .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_73xxx_dvb_props, #endif @@ -453,6 +454,7 @@ static const struct pvr2_device_desc pvr .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .default_std_mask = V4L2_STD_NTSC_M, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, + .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_750xx_dvb_props, #endif @@ -474,6 +476,7 @@ static const struct pvr2_device_desc pvr .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE, .default_std_mask = V4L2_STD_NTSC_M, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, + .ir_scheme = PVR2_IR_SCHEME_ZILOG, #ifdef CONFIG_VIDEO_PVRUSB2_DVB .dvb_props = &pvr2_751xx_dvb_props, #endif diff -r 5738a6f02a62 -r 038944f25a29 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Thu Jul 24 17:07:33 2008 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Jul 25 17:35:31 2008 -0500 @@ -47,6 +47,10 @@ struct pvr2_string_table { #define PVR2_LED_SCHEME_NONE 0 #define PVR2_LED_SCHEME_HAUPPAUGE 1 + +#define PVR2_IR_SCHEME_NONE 0 +#define PVR2_IR_SCHEME_24XXX 1 +#define PVR2_IR_SCHEME_ZILOG 2 /* This describes a particular hardware type (except for the USB device ID which must live in a separate structure due to environmental @@ -126,15 +130,19 @@ struct pvr2_device_desc { ensure that it is found. */ unsigned int flag_has_wm8775:1; - /* Device has IR hardware that can be faked into looking like a - normal Hauppauge i2c IR receiver. This is currently very - specific to the 24xxx device, where Hauppauge had replaced their - 'standard' I2C IR receiver with a bunch of FPGA logic controlled - directly via the FX2. Turning this on tells the pvrusb2 driver - to virtualize the presence of the non-existant IR receiver chip and - implement the virtual receiver in terms of appropriate FX2 - commands. */ - unsigned int flag_has_hauppauge_custom_ir:1; + /* Indicate any specialized IR scheme that might need to be + supported by this driver. If not set, then it is assumed that + IR can work without help from the driver (which is frequently + the case). This is otherwise set to one of + PVR2_IR_SCHEME_. For "", the value "24XXX" indicates a + Hauppauge 24xxx class device which has an FPGA-hosted IR + receiver that can onl
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove BKL
The patch number 8894 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Remove BKL The earlier change from Hans Verkuil that pushed the BKL from video_open() down into the drivers should be unneeded for the pvrusb2 driver. This driver's implementation for open already protects its internal structures through other means, thus the BKL is not required. This change reverses Hans' previous change, for the pvrusb2 driver. It probably would have been a good idea for Hans to previously have asked for my ack before committing his change. Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |6 -- 1 file changed, 6 deletions(-) diff -r dcd663db2c53 -r eb5bc7e6d70e linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sat Aug 30 13:09:31 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sat Aug 30 13:11:16 2008 -0500 @@ -933,7 +933,6 @@ static int pvr2_v4l2_open(struct inode * unsigned int input_cnt,idx; int ret = 0; - lock_kernel(); dip = container_of(video_devdata(file),struct pvr2_v4l2_dev,devbase); vp = dip->v4lp; @@ -944,13 +943,11 @@ static int pvr2_v4l2_open(struct inode * if (!pvr2_hdw_dev_ok(hdw)) { pvr2_trace(PVR2_TRACE_OPEN_CLOSE, "pvr2_v4l2_open: hardware not ready"); - unlock_kernel(); return -EIO; } fhp = kzalloc(sizeof(*fhp),GFP_KERNEL); if (!fhp) { - unlock_kernel(); return -ENOMEM; } @@ -980,7 +977,6 @@ static int pvr2_v4l2_open(struct inode * fhp); kfree(fhp); - unlock_kernel(); return ret; } @@ -997,7 +993,6 @@ static int pvr2_v4l2_open(struct inode * "Destroying pvr_v4l2_fh id=%p (input map failure)", fhp); kfree(fhp); - unlock_kernel(); return -ENOMEM; } input_cnt = 0; @@ -1021,7 +1016,6 @@ static int pvr2_v4l2_open(struct inode * v4l2_prio_open(&vp->prio,&fhp->prio); fhp->fw_mode_flag = pvr2_hdw_cpufw_get_enabled(hdw); - unlock_kernel(); return 0; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/eb5bc7e6d70e9acb5d1e4ba8a84cc82e474a3a45 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Handle USB ID 2040:2950 same as 2040:2900
The patch number 8892 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Handle USB ID 2040:2950 same as 2040:2900 The device 2040:2950 is a really old variant of the PVR USB2 hardware. I have just learned of its existence. For the purposes of the pvrusb2 driver, it is functionally identical to the well known 29xxx series (2040:2900). Amazing that this went undetected for 3+ years. Priority: high Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c |2 ++ 1 file changed, 2 insertions(+) diff -r 6032ecd6ad7e -r abbc739a847f linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sat Aug 30 11:07:04 2008 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sat Aug 30 13:08:28 2008 -0500 @@ -488,6 +488,8 @@ static const struct pvr2_device_desc pvr struct usb_device_id pvr2_device_table[] = { { USB_DEVICE(0x2040, 0x2900), + .driver_info = (kernel_ulong_t)&pvr2_device_29xxx}, + { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */ .driver_info = (kernel_ulong_t)&pvr2_device_29xxx}, { USB_DEVICE(0x2040, 0x2400), .driver_info = (kernel_ulong_t)&pvr2_device_24xxx}, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/abbc739a847f89e7cb43dfd6115e187e86e16bd2 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Mark crop window size change as being disruptive to the encoder
The patch number 8897 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Mark crop window size change as being disruptive to the encoder Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r 35a0b6426c99 -r dc99b98c9edc linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Aug 30 16:26:39 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Aug 31 18:50:59 2008 -0500 @@ -2681,6 +2681,8 @@ static int pvr2_hdw_commit_execute(struc hdw->srate_dirty || hdw->res_ver_dirty || hdw->res_hor_dirty || +hdw->cropw_dirty || +hdw->croph_dirty || hdw->input_dirty || (hdw->active_stream_type != hdw->desired_stream_type)); if (disruptive_change && !hdw->state_pipeline_idle) { --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/dc99b98c9edc90c01d426e030e1538f75639c1f4 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Disable virtual IR device when not needed.
The patch number 8901 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Disable virtual IR device when not needed. Disable "virtual" IR receiver on for 24xxx devices that have an internal IR blaster. In that case there's another another IR receiver present and to leave the virtual receiver available just causes confusion. This means that 24xxx users will no longer see a phantom IR chip. Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 38 --- 1 file changed, 29 insertions(+), 9 deletions(-) diff -r c0d80369cdbc -r d5a9aa7cdb19 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Sun Aug 31 19:02:20 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Sun Aug 31 19:06:11 2008 -0500 @@ -1023,22 +1023,32 @@ static struct i2c_adapter pvr2_i2c_adap_ .client_unregister = pvr2_i2c_detach_inform, }; -static void do_i2c_scan(struct pvr2_hdw *hdw) + +/* Return true if device exists at given address */ +static int do_i2c_probe(struct pvr2_hdw *hdw, int addr) { struct i2c_msg msg[1]; - int i,rc; + int rc; msg[0].addr = 0; msg[0].flags = I2C_M_RD; msg[0].len = 0; msg[0].buf = NULL; - printk("%s: i2c scan beginning\n",hdw->name); + msg[0].addr = addr; + rc = i2c_transfer(&hdw->i2c_adap, msg, ARRAY_SIZE(msg)); + return rc == 1; +} + +static void do_i2c_scan(struct pvr2_hdw *hdw) +{ + int i; + printk(KERN_INFO "%s: i2c scan beginning\n", hdw->name); for (i = 0; i < 128; i++) { - msg[0].addr = i; - rc = i2c_transfer(&hdw->i2c_adap,msg, ARRAY_SIZE(msg)); - if (rc != 1) continue; - printk("%s: i2c scan: found device @ 0x%x\n",hdw->name,i); - } - printk("%s: i2c scan done.\n",hdw->name); + if (do_i2c_probe(hdw, i)) { + printk(KERN_INFO "%s: i2c scan: found device @ 0x%x\n", + hdw->name, i); + } + } + printk(KERN_INFO "%s: i2c scan done.\n", hdw->name); } void pvr2_i2c_core_init(struct pvr2_hdw *hdw) @@ -1083,6 +1093,16 @@ void pvr2_i2c_core_init(struct pvr2_hdw mutex_init(&hdw->i2c_list_lock); hdw->i2c_linked = !0; i2c_add_adapter(&hdw->i2c_adap); + if (hdw->i2c_func[0x18] == i2c_24xxx_ir) { + /* Probe for a different type of IR receiver on this + device. If present, disable the emulated IR receiver. */ + if (do_i2c_probe(hdw, 0x71)) { + pvr2_trace(PVR2_TRACE_INFO, + "Device has newer IR hardware;" + " disabling unneeded virtual IR device"); + hdw->i2c_func[0x18] = NULL; + } + } if (i2c_scan) do_i2c_scan(hdw); } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d5a9aa7cdb19ebc74559d2f6a3dd8fd3c03196dc ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement default value retrieval in sysfs interface
The patch number 8899 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Implement default value retrieval in sysfs interface Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 24 ++ 1 file changed, 24 insertions(+) diff -r c58d1522482b -r 423206de3f89 linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Sun Aug 31 18:55:03 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Sun Aug 31 18:57:54 2008 -0500 @@ -66,6 +66,7 @@ struct pvr2_sysfs_ctl_item { struct device_attribute attr_type; struct device_attribute attr_min; struct device_attribute attr_max; + struct device_attribute attr_def; struct device_attribute attr_enum; struct device_attribute attr_bits; struct device_attribute attr_val; @@ -144,6 +145,24 @@ static ssize_t show_max(struct device *c pvr2_sysfs_trace("pvr2_sysfs(%p) show_max(cid=%d) is %ld", cip->chptr, cip->ctl_id, val); return scnprintf(buf, PAGE_SIZE, "%ld\n", val); +} + +static ssize_t show_def(struct device *class_dev, + struct device_attribute *attr, + char *buf) +{ + struct pvr2_sysfs_ctl_item *cip; + int val; + int ret; + cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); + ret = pvr2_ctrl_get_def(cip->cptr, &val); + pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %d, stat=%d", +cip->chptr, cip->ctl_id, val, ret); + if (ret < 0) { + /* Keep checkpatch.pl quiet */ + return ret; + } + return scnprintf(buf, PAGE_SIZE, "%d\n", val); } static ssize_t show_val_norm(struct device *class_dev, @@ -321,6 +340,10 @@ static void pvr2_sysfs_add_control(struc cip->attr_max.attr.mode = S_IRUGO; cip->attr_max.show = show_max; + cip->attr_def.attr.name = "def_val"; + cip->attr_def.attr.mode = S_IRUGO; + cip->attr_def.show = show_def; + cip->attr_val.attr.name = "cur_val"; cip->attr_val.attr.mode = S_IRUGO; @@ -344,6 +367,7 @@ static void pvr2_sysfs_add_control(struc cip->attr_gen[acnt++] = &cip->attr_name.attr; cip->attr_gen[acnt++] = &cip->attr_type.attr; cip->attr_gen[acnt++] = &cip->attr_val.attr; + cip->attr_gen[acnt++] = &cip->attr_def.attr; cip->attr_val.show = show_val_norm; cip->attr_val.store = store_val_norm; if (pvr2_ctrl_has_custom_symbols(cptr)) { --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/423206de3f898013200854c9d1ef8a023bb81f91 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Add comment elaborating on direct use of swab32()
The patch number 8893 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Add comment elaborating on direct use of swab32() Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 11 +++ 1 file changed, 11 insertions(+) diff -r abbc739a847f -r dcd663db2c53 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Aug 30 13:08:28 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Aug 30 13:09:31 2008 -0500 @@ -1323,6 +1323,17 @@ int pvr2_upload_firmware2(struct pvr2_hd if (bcnt > FIRMWARE_CHUNK_SIZE) bcnt = FIRMWARE_CHUNK_SIZE; memcpy(fw_ptr, fw_entry->data + fw_done, bcnt); /* Usbsnoop log shows that we must swap bytes... */ + /* Some background info: The data being swapped here is a + firmware image destined for the mpeg encoder chip that + lives at the other end of a USB endpoint. The encoder + chip always talks in 32 bit chunks and its storage is + organized into 32 bit words. However from the file + system to the encoder chip everything is purely a byte + stream. The firmware file's contents are always 32 bit + swapped from what the encoder expects. Thus the need + always exists to swap the bytes regardless of the endian + type of the host processor and therefore swab32() makes + the most sense. */ for (icnt = 0; icnt < bcnt/4 ; icnt++) ((u32 *)fw_ptr)[icnt] = swab32(((u32 *)fw_ptr)[icnt]); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/dcd663db2c539ead58cc79157cf51afd960ff04c ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Be able to programmatically retrieve a control's default value
The patch number 8898 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Be able to programmatically retrieve a control's default value The pvrusb2 control mechanism up until now has used a constant int to hold a control's default value. This change makes it possible to retrieve the control's default through some other means, e.g. as a result of a query from lower level software. Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 10 -- linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.h |2 +- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |1 + linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |8 +--- 4 files changed, 15 insertions(+), 6 deletions(-) diff -r dc99b98c9edc -r c58d1522482b linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Sun Aug 31 18:50:59 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Sun Aug 31 18:55:03 2008 -0500 @@ -135,13 +135,19 @@ int pvr2_ctrl_get_min(struct pvr2_ctrl * /* Retrieve control's default value (any type) */ -int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr) +int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr) { int ret = 0; if (!cptr) return 0; LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { - ret = cptr->info->default_value; + if (cptr->info->get_def_value) { + /* Comment to keep checkpatch.pl quiet */ + ret = cptr->info->get_def_value(cptr, valptr); + } else { + /* Comment to keep checkpatch.pl quiet */ + *valptr = cptr->info->default_value; + } } } while(0); LOCK_GIVE(cptr->hdw->big_lock); return ret; diff -r dc99b98c9edc -r c58d1522482b linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.h Sun Aug 31 18:50:59 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.h Sun Aug 31 18:55:03 2008 -0500 @@ -49,7 +49,7 @@ int pvr2_ctrl_get_min(struct pvr2_ctrl * int pvr2_ctrl_get_min(struct pvr2_ctrl *); /* Retrieve control's default value (any type) */ -int pvr2_ctrl_get_def(struct pvr2_ctrl *); +int pvr2_ctrl_get_def(struct pvr2_ctrl *, int *valptr); /* Retrieve control's enumeration count (enum only) */ int pvr2_ctrl_get_cnt(struct pvr2_ctrl *); diff -r dc99b98c9edc -r c58d1522482b linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Aug 31 18:50:59 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Aug 31 18:55:03 2008 -0500 @@ -82,6 +82,7 @@ struct pvr2_ctl_info { /* Control's implementation */ pvr2_ctlf_get_value get_value; /* Get its value */ + pvr2_ctlf_get_value get_def_value; /* Get its default value */ pvr2_ctlf_get_value get_min_value; /* Get minimum allowed value */ pvr2_ctlf_get_value get_max_value; /* Get maximum allowed value */ pvr2_ctlf_set_value set_value; /* Set its value */ diff -r dc99b98c9edc -r c58d1522482b linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sun Aug 31 18:50:59 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sun Aug 31 18:55:03 2008 -0500 @@ -534,7 +534,7 @@ static int pvr2_v4l2_do_ioctl(struct ino lmin = pvr2_ctrl_get_min(hcp); lmax = pvr2_ctrl_get_max(hcp); - ldef = pvr2_ctrl_get_def(hcp); + pvr2_ctrl_get_def(hcp, &ldef); if (w == -1) { w = ldef; } else if (w < lmin) { @@ -544,7 +544,7 @@ static int pvr2_v4l2_do_ioctl(struct ino } lmin = pvr2_ctrl_get_min(vcp); lmax = pvr2_ctrl_get_max(vcp); - ldef = pvr2_ctrl_get_def(vcp); + pvr2_ctrl_get_def(vcp, &ldef); if (h == -1) { h = ldef; } else if (h < lmin) { @@ -605,6 +605,7 @@ static int pvr2_v4l2_do_ioctl(struct ino case VIDIOC_QUERYCTRL: { struct pvr2_ctrl *cptr; +
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fail gracefully if an alien USB ID is used
The patch number 8895 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Fail gracefully if an alien USB ID is used The driver includes an internal table specifying additional information on a per device-type basis. This works great until somebody tries to run-time associate another USB ID with the driver. This change should hopefully allow the driver to fail gracefully under such a circumstance. Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff -r eb5bc7e6d70e -r 29ce1aef64a6 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Aug 30 13:11:16 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Aug 30 16:11:40 2008 -0500 @@ -1932,7 +1932,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct const struct usb_device_id *devid) { unsigned int idx,cnt1,cnt2,m; - struct pvr2_hdw *hdw; + struct pvr2_hdw *hdw = NULL; int valid_std_mask; struct pvr2_ctrl *cptr; const struct pvr2_device_desc *hdw_desc; @@ -1941,6 +1941,16 @@ struct pvr2_hdw *pvr2_hdw_create(struct struct pvr2_ctl_info *ciptr; hdw_desc = (const struct pvr2_device_desc *)(devid->driver_info); + + if (hdw_desc == NULL) { + pvr2_trace(PVR2_TRACE_INIT, "pvr2_hdw_create:" + " No device description pointer," + " unable to continue."); + pvr2_trace(PVR2_TRACE_INIT, "If you have a new device type," + " please contact Mike Isely <[EMAIL PROTECTED]>" + " to get it included in the driver\n"); + goto fail; + } hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/29ce1aef64a6495a98f3718b30a0cea83356ad41 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement cropping pass through
The patch number 8900 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Implement cropping pass through This builds upon the previous pvrusb2 change to more formally implement full cropping support. This enables access from the driver's V4L interface, and enables access to full capabilities from sysfs as well. Note that this is only effective when in analog mode. It also will only work when the underlying digitizer's driver (saa7115 or cx25840 depending on the hardware) also implements the appropriate functions. Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 325 -- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h |9 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 37 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 86 ++ 6 files changed, 390 insertions(+), 74 deletions(-) diff -r 423206de3f89 -r c0d80369cdbc linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Aug 31 18:57:54 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Aug 31 19:02:20 2008 -0500 @@ -308,6 +308,10 @@ struct pvr2_hdw { struct v4l2_tuner tuner_signal_info; int tuner_signal_stale; + /* Cropping capability info */ + struct v4l2_cropcap cropcap_info; + int cropcap_stale; + /* Video standard handling */ v4l2_std_id std_mask_eeprom; // Hardware supported selections v4l2_std_id std_mask_avail; // Which standards we may select from @@ -320,7 +324,6 @@ struct pvr2_hdw { struct pvr2_ctl_info std_info_cur; struct v4l2_standard *std_defs; const char **std_enum_names; - struct v4l2_cropcap cropcap; // Generated string names, one per actual V4L2 standard const char *std_mask_ptrs[32]; diff -r 423206de3f89 -r c0d80369cdbc linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Aug 31 18:57:54 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Aug 31 19:02:20 2008 -0500 @@ -299,6 +299,7 @@ static int pvr2_send_request_ex(struct p unsigned int timeout,int probe_fl, void *write_data,unsigned int write_len, void *read_data,unsigned int read_len); +static int pvr2_hdw_check_cropcap(struct pvr2_hdw *hdw); static void trace_stbit(const char *name,int val) @@ -405,47 +406,210 @@ static int ctrl_freq_set(struct pvr2_ctr static int ctrl_cropl_min_get(struct pvr2_ctrl *cptr, int *left) { - struct v4l2_cropcap *cap = &cptr->hdw->cropcap; - if (cap->bounds.width > 0) { + struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; + int stat = pvr2_hdw_check_cropcap(cptr->hdw); + if (stat != 0) { + /* Keep checkpatch.pl quiet */ + return stat; + } + *left = cap->bounds.left; + return 0; +} + +static int ctrl_cropl_max_get(struct pvr2_ctrl *cptr, int *left) +{ + struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; + int stat = pvr2_hdw_check_cropcap(cptr->hdw); + if (stat != 0) { + /* Keep checkpatch.pl quiet */ + return stat; + } + *left = cap->bounds.left; + if (cap->bounds.width > cptr->hdw->cropw_val) { /* This statement is present purely to shut up checkpatch.pl */ - *left = cap->bounds.left - cap->defrect.left; - } else { - /* This statement is present purely to shut up - checkpatch.pl */ - *left = -119; - } - return 0; -} - -static int ctrl_cropl_max_get(struct pvr2_ctrl *cptr, int *left) -{ - struct v4l2_cropcap *cap = &cptr->hdw->cropcap; - if (cap->bounds.width > 0) { - *left = cap->bounds.left + cap->bounds.width - - cap->defrect.left; - *left += 3; - *left -= cptr->hdw->cropw_val; - } else { - /* This statement is present purely to shut up - checkpatch.pl */ - *left = 340; + *left += cap->bounds.width - cptr->hdw->cropw_val; } return 0; } static int ctrl_cropt_min_get(struct pvr2_ctrl *cptr, int *top) { -
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove comment lines which refer to checkpatch's behavior
The patch number 8902 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Remove comment lines which refer to checkpatch's behavior Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 24 -- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c |8 --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c|1 5 files changed, 2 insertions(+), 35 deletions(-) diff -r d5a9aa7cdb19 -r 71af83ac1d7a linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Sun Aug 31 19:06:11 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Wed Sep 03 19:51:59 2008 -0500 @@ -142,10 +142,8 @@ int pvr2_ctrl_get_def(struct pvr2_ctrl * LOCK_TAKE(cptr->hdw->big_lock); do { if (cptr->info->type == pvr2_ctl_int) { if (cptr->info->get_def_value) { - /* Comment to keep checkpatch.pl quiet */ ret = cptr->info->get_def_value(cptr, valptr); } else { - /* Comment to keep checkpatch.pl quiet */ *valptr = cptr->info->default_value; } } diff -r d5a9aa7cdb19 -r 71af83ac1d7a linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Aug 31 19:06:11 2008 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Wed Sep 03 19:51:59 2008 -0500 @@ -409,7 +409,6 @@ static int ctrl_cropl_min_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *left = cap->bounds.left; @@ -421,13 +420,10 @@ static int ctrl_cropl_max_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *left = cap->bounds.left; if (cap->bounds.width > cptr->hdw->cropw_val) { - /* This statement is present purely to shut up - checkpatch.pl */ *left += cap->bounds.width - cptr->hdw->cropw_val; } return 0; @@ -438,7 +434,6 @@ static int ctrl_cropt_min_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *top = cap->bounds.top; @@ -450,12 +445,10 @@ static int ctrl_cropt_max_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *top = cap->bounds.top; if (cap->bounds.height > cptr->hdw->croph_val) { - /* Keep checkpatch.pl quiet */ *top += cap->bounds.height - cptr->hdw->croph_val; } return 0; @@ -466,12 +459,10 @@ static int ctrl_cropw_max_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *val = 0; if (cap->bounds.width > cptr->hdw->cropl_val) { - /* Keep checkpatch.pl quiet */ *val = cap->bounds.width - cptr->hdw->cropl_val; } return 0; @@ -482,12 +473,10 @@ static int ctrl_croph_max_get(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat = pvr2_hdw_check_cropcap(cptr->hdw); if (stat != 0) { - /* Keep checkpatch.pl quiet */ return stat; } *val = 0; if (cap->bounds.height > cptr->hdw->cropt_val) { - /* Keep checkpatch.pl quiet */ *val = cap->bounds.height - cptr->hdw->cropt_val; } return 0; @@ -498,7 +487,6 @@ static int ctrl_get_cropcapbl(struct pvr struct v4l2_cropcap *cap = &cptr->hdw->cropcap_info; int stat =
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix deadlock problem
The patch number 9300 was added via Mike Isely <[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: Mike Isely <[EMAIL PROTECTED]> pvrusb2: Fix deadlock problem Fix deadlock problem in 2.6.27 caused by new USB core behavior in response to a USB device reset request. With older kernels, the USB device reset was "in line"; the reset simply took place and the driver retained its association with the hardware. However now this reset triggers a disconnect, and worse still the disconnect callback happens in the context of the caller who asked for the device reset. This results in an attempt by the pvrusb2 driver to recursively take a mutex it already has, which deadlocks the driver's worker thread. (Even if the disconnect callback were to happen on a different thread we'd still have problems however - because while the driver should survive and correctly disconnect / reconnect, it will then trigger another device reset during the repeated initialization, which will then cause another disconect, etc, forever.) The fix here is simply to not attempt the device reset (it was of marginal value anyway). Priority: normal Signed-off-by: Mike Isely <[EMAIL PROTECTED]> --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 -- 1 file changed, 6 deletions(-) diff -r e2a8b9b9c294 -r 0bb411d8d2e4 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Oct 17 19:45:55 2008 +0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Oct 19 14:26:05 2008 -0500 @@ -61,7 +61,6 @@ static DEFINE_MUTEX(pvr2_unit_mtx); static DEFINE_MUTEX(pvr2_unit_mtx); static int ctlchg; -static int initusbreset = 1; static int procreload; static int tuner[PVR_NUM] = { [0 ... PVR_NUM-1] = -1 }; static int tolerance[PVR_NUM] = { [0 ... PVR_NUM-1] = 0 }; @@ -72,8 +71,6 @@ MODULE_PARM_DESC(ctlchg, "0=optimize ctl MODULE_PARM_DESC(ctlchg, "0=optimize ctl change 1=always accept new ctl value"); module_param(init_pause_msec, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(init_pause_msec, "hardware initialization settling delay"); -module_param(initusbreset, int, S_IRUGO|S_IWUSR); -MODULE_PARM_DESC(initusbreset, "Do USB reset device on probe"); module_param(procreload, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(procreload, "Attempt init failure recovery with firmware reload"); @@ -1984,9 +1981,6 @@ static void pvr2_hdw_setup_low(struct pv } hdw->fw1_state = FW1_STATE_OK; - if (initusbreset) { - pvr2_hdw_device_reset(hdw); - } if (!pvr2_hdw_dev_ok(hdw)) return; for (idx = 0; idx < hdw->hdw_desc->client_modules.cnt; idx++) { --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/0bb411d8d2e459b250119e672b940cdea060d3d4 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] Fix obvious swapped names in v4l2_subdev logic
The patch number 10240 was added via Mauro Carvalho Chehab 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: Linux Media Mailing List -- From: Mike Isely Fix obvious swapped names in v4l2_subdev logic The VIDIOC_QUERYCTRL command needs to actually do a queryctrl, not a querymenu. Similarly, the VIDIOC_QUERYMENU command needs to actually do a querymenu not a queryctrl. Priority: high Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/v4l2-subdev.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -r ab2c7f84e291 -r 11a5eb383205 linux/drivers/media/video/v4l2-subdev.c --- a/linux/drivers/media/video/v4l2-subdev.c Wed Jan 14 01:40:57 2009 -0600 +++ b/linux/drivers/media/video/v4l2-subdev.c Wed Jan 14 01:58:36 2009 -0600 @@ -28,7 +28,7 @@ int v4l2_subdev_command(struct v4l2_subd { switch (cmd) { case VIDIOC_QUERYCTRL: - return v4l2_subdev_call(sd, core, querymenu, arg); + return v4l2_subdev_call(sd, core, queryctrl, arg); case VIDIOC_G_CTRL: return v4l2_subdev_call(sd, core, g_ctrl, arg); case VIDIOC_S_CTRL: @@ -40,7 +40,7 @@ int v4l2_subdev_command(struct v4l2_subd case VIDIOC_TRY_EXT_CTRLS: return v4l2_subdev_call(sd, core, try_ext_ctrls, arg); case VIDIOC_QUERYMENU: - return v4l2_subdev_call(sd, core, queryctrl, arg); + return v4l2_subdev_call(sd, core, querymenu, arg); case VIDIOC_LOG_STATUS: return v4l2_subdev_call(sd, core, log_status); case VIDIOC_DBG_G_CHIP_IDENT: --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/11a5eb383205519eae34c18738faab501e6e5cb5 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix misleading comment caused by earlier commit
The patch number 10239 was added via Mauro Carvalho Chehab 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix misleading comment caused by earlier commit Previous v4l-dvb changeset id 4cc8ed11e2e0 changed the pvrusb2-hdw internal API regarding i2c chip debug register access. However that change failed to also update the corresponding function comment describing the API. As driver maintained I never saw a request for an ack on that change; there probably should have been one especially since the manner in which this API operates was changed - its interface is now entangled with a v4l specific struct and I would have preferred to keep this API clear of moving-target v4l-isms such as this one if at all possible which is why I had done it the way I did before. But whatever. This commit at least fixes the comment issue. Priority: normal Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff -r d99b0dfef974 -r ab2c7f84e291 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Wed Jan 14 01:24:20 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Wed Jan 14 01:40:57 2009 -0600 @@ -245,8 +245,7 @@ void pvr2_hdw_v4l_store_minor_number(str enum pvr2_v4l_type index,int); /* Direct read/write access to chip's registers: - match_type - how to interpret match_chip (e.g. driver ID, i2c address) - match_chip - chip match value (e.g. I2C_DRIVERD_) + match - specify criteria to identify target chip (this is a v4l dbg struct) reg_id - register number to access setFl - true to set the register, false to read it val_ptr - storage location for source / result. */ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ab2c7f84e291e80fb88daeeb6e5d3f480ce17eac ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Stop advertising VBI capability - it isn't there
The patch number 10236 was added via Mauro Carvalho Chehab 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Stop advertising VBI capability - it isn't there Priority: normal Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 6896782d783d -r ff25f401dc03 linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Wed Jan 14 10:06:12 2009 -0200 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Wed Jan 14 01:21:29 2009 -0600 @@ -92,7 +92,7 @@ static struct v4l2_capability pvr_capabi .card = "Hauppauge WinTV pvr-usb2", .bus_info = "usb", .version= KERNEL_VERSION(0,8,0), - .capabilities = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VBI_CAPTURE | + .capabilities = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | V4L2_CAP_AUDIO | V4L2_CAP_RADIO | V4L2_CAP_READWRITE), .reserved = {0,0,0,0} --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ff25f401dc03eabfcd03d24e3c0bc56779240d80 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Change sysfs serial number handling
The patch number 10238 was added via Mauro Carvalho Chehab 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Change sysfs serial number handling Use the new pvrusb2 internal API to grab the device identifier, rather than generating it directly. This unifies some code and make possible use of that identifier in places other than sysfs. Priority: normal Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 12 ++-- 1 file changed, 2 insertions(+), 10 deletions(-) diff -r f379530a670e -r d99b0dfef974 linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Wed Jan 14 01:22:56 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Wed Jan 14 01:24:20 2009 -0600 @@ -636,16 +636,8 @@ static void class_dev_create(struct pvr2 pvr2_sysfs_trace("Creating class_dev id=%p",class_dev); class_dev->class = &class_ptr->class; - if (pvr2_hdw_get_sn(sfp->channel.hdw)) { - dev_set_name(class_dev, "sn-%lu", -pvr2_hdw_get_sn(sfp->channel.hdw)); - } else if (pvr2_hdw_get_unit_number(sfp->channel.hdw) >= 0) { - dev_set_name(class_dev, "unit-%c", -pvr2_hdw_get_unit_number(sfp->channel.hdw) + 'a'); - } else { - kfree(class_dev); - return; - } + dev_set_name(class_dev, "%s", +pvr2_hdw_get_device_identifier(sfp->channel.hdw)); class_dev->parent = &usb_dev->dev; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d99b0dfef974337dc7500b120d57cda2e9380194 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Generate a device-unique identifier
The patch number 10237 was added via Mauro Carvalho Chehab 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Generate a device-unique identifier Implement a new internal function to create a string device identifier. This ID stays with the specific device, making it useful to user space to identify specific devices. We use the serial number if available; otherwise we give up and just spit out a unit/instance ID. Priority: normal Signed-off-by: Mike Isely Signed-off-by: Mauro Carvalho Chehab --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 12 ++ linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 19 ++ linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h |3 + 3 files changed, 34 insertions(+) diff -r ff25f401dc03 -r f379530a670e linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Wed Jan 14 01:21:29 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Wed Jan 14 01:22:56 2009 -0600 @@ -195,7 +195,19 @@ struct pvr2_hdw { struct mutex big_lock_mutex; int big_lock_held; /* For debugging */ + /* This is a simple string which identifies the instance of this + driver. It is unique within the set of existing devices, but + there is no attempt to keep the name consistent with the same + physical device each time. */ char name[32]; + + /* This is a simple string which identifies the physical device + instance itself - if possible. (If not possible, then it is + based on the specific driver instance, similar to name above.) + The idea here is that userspace might hopefully be able to use + this recognize specific tuners. It will encode a serial number, + if available. */ + char identifier[32]; /* I2C stuff */ struct i2c_adapter i2c_adap; diff -r ff25f401dc03 -r f379530a670e linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Wed Jan 14 01:21:29 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Wed Jan 14 01:22:56 2009 -0600 @@ -1284,6 +1284,12 @@ const char *pvr2_hdw_get_bus_info(struct } +const char *pvr2_hdw_get_device_identifier(struct pvr2_hdw *hdw) +{ + return hdw->identifier; +} + + unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *hdw) { return hdw->freqSelector ? hdw->freqValTelevision : hdw->freqValRadio; @@ -2040,6 +2046,19 @@ static void pvr2_hdw_setup_low(struct pv hdw->tuner_updated = !0; hdw->std_mask_eeprom = V4L2_STD_ALL; } + + if (hdw->serial_number) { + idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1, + "sn-%lu", hdw->serial_number); + } else if (hdw->unit_number >= 0) { + idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1, + "unit-%c", + hdw->unit_number + 'a'); + } else { + idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1, + "unit-??"); + } + hdw->identifier[idx] = 0; pvr2_hdw_setup_std(hdw); diff -r ff25f401dc03 -r f379530a670e linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Wed Jan 14 01:21:29 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Wed Jan 14 01:22:56 2009 -0600 @@ -137,6 +137,9 @@ unsigned long pvr2_hdw_get_sn(struct pvr /* Retrieve bus location info of device */ const char *pvr2_hdw_get_bus_info(struct pvr2_hdw *); + +/* Retrieve per-instance string identifier for this specific device */ +const char *pvr2_hdw_get_device_identifier(struct pvr2_hdw *); /* Called when hardware has been unplugged */ void pvr2_hdw_disconnect(struct pvr2_hdw *); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/f379530a670eb68067a40aa2767272d776543318 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Code module name directly in printk
The patch number 10259 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Code module name directly in printk The name of the pvrusb2 module is not likely to ever change, and there are plenty of other places where the name is directly coded, so there is little utility in using a macro to infer the module name here. In addition, using that macro complicates other uses of the driver involving older kernels where this macro works differently. Yes I know for many places we don't have to worry about that. But my alternative is that I have to build special logic in the pvrusb2 standalone driver to special-case what is otherwise costmetic and that is just plain nuts for something as trivial as this, especially since this change does not at all have any compile time or run time impact on the driver. I'm just removing a nicety that didn't have a lot of value here to begin with. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-main.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -r 99fb9ca46504 -r 410cc591b3b8 linux/drivers/media/video/pvrusb2/pvrusb2-main.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-main.c Fri Jan 16 00:06:02 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-main.c Fri Jan 16 00:09:34 2009 -0600 @@ -138,10 +138,10 @@ static int __init pvr_init(void) ret = usb_register(&pvr_driver); if (ret == 0) - printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_VERSION ":" + printk(KERN_INFO "pvrusb2: " DRIVER_VERSION ":" DRIVER_DESC "\n"); if (pvrusb2_debug) - printk(KERN_INFO KBUILD_MODNAME ": Debug mask is %d (0x%x)\n", + printk(KERN_INFO "pvrusb2: Debug mask is %d (0x%x)\n", pvrusb2_debug,pvrusb2_debug); pvr2_trace(PVR2_TRACE_INIT,"pvr_init complete"); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/410cc591b3b8330f0442447ed91e1afa5be3ef36 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Issue VIDIOC_INT_INIT to v4l2 modules when they first attach
The patch number 10258 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Issue VIDIOC_INT_INIT to v4l2 modules when they first attach It appears that various v4l-dvb drivers are changing to require explicit initialization before use. This change to the pvrusb2 driver implements an automatic issuance of VIDIOC_INT_INIT when a module is bound to the driver, thus conforming to the new behavior. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 23 +- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 14 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |2 4 files changed, 29 insertions(+), 11 deletions(-) diff -r 7981bdd4e25a -r 99fb9ca46504 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.cMon Jan 12 00:18:04 2009 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.cFri Jan 16 00:06:02 2009 -0600 @@ -32,17 +32,19 @@ #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) -#define OP_STANDARD 0 -#define OP_AUDIOMODE 1 -#define OP_BCSH 2 -#define OP_VOLUME 3 -#define OP_FREQ 4 -#define OP_AUDIORATE 5 -#define OP_CROP 6 -#define OP_SIZE 7 -#define OP_LOG 8 +#define OP_INIT 0 /* MUST come first so it is run first */ +#define OP_STANDARD 1 +#define OP_AUDIOMODE 2 +#define OP_BCSH 3 +#define OP_VOLUME 4 +#define OP_FREQ 5 +#define OP_AUDIORATE 6 +#define OP_CROP 7 +#define OP_SIZE 8 +#define OP_LOG 9 static const struct pvr2_i2c_op * const ops[] = { + [OP_INIT] = &pvr2_i2c_op_v4l2_init, [OP_STANDARD] = &pvr2_i2c_op_v4l2_standard, [OP_AUDIOMODE] = &pvr2_i2c_op_v4l2_audiomode, [OP_BCSH] = &pvr2_i2c_op_v4l2_bcsh, @@ -57,7 +59,8 @@ void pvr2_i2c_probe(struct pvr2_hdw *hdw { int id; id = cp->client->driver->id; - cp->ctl_mask = ((1 << OP_STANDARD) | + cp->ctl_mask = ((1 << OP_INIT) | + (1 << OP_STANDARD) | (1 << OP_AUDIOMODE) | (1 << OP_BCSH) | (1 << OP_VOLUME) | diff -r 7981bdd4e25a -r 99fb9ca46504 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c Mon Jan 12 00:18:04 2009 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c Fri Jan 16 00:06:02 2009 -0600 @@ -25,6 +25,20 @@ #include #include #include "compat.h" + +static void execute_init(struct pvr2_hdw *hdw) +{ + u32 dummy = 0; + pvr2_trace(PVR2_TRACE_CHIPS, "i2c v4l2 init"); + pvr2_i2c_core_cmd(hdw, VIDIOC_INT_INIT, &dummy); +} + + +const struct pvr2_i2c_op pvr2_i2c_op_v4l2_init = { + .update = execute_init, + .name = "v4l2_init", +}; + static void set_standard(struct pvr2_hdw *hdw) { diff -r 7981bdd4e25a -r 99fb9ca46504 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h Mon Jan 12 00:18:04 2009 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h Fri Jan 16 00:06:02 2009 -0600 @@ -24,6 +24,7 @@ #include "pvrusb2-i2c-core.h" +extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_init; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_bcsh; diff -r 7981bdd4e25a -r 99fb9ca46504 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Mon Jan 12 00:18:04 2009 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri Jan 16 00:06:02 2009 -0600 @@ -838,7 +838,7 @@ int pvr2_i2c_core_check_stale(struct pvr if (!(msk & pm)) continue; pm &= ~msk; opf = pvr2_i2c_get_op(idx); - if (!opf) continue; + if (!(opf && opf->check)) continue; if (opf->check(hdw)) { sm |= msk; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/99fb9ca465043b084e7935dcba69adafaf661ef8 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Use usb_make_path() to determine device bus location
The patch number 10303 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Use usb_make_path() to determine device bus location Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff -r 6f260d08c4cc -r 2ed72b192848 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Thu Jan 08 12:13:42 2009 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Thu Jan 22 22:20:24 2009 -0600 @@ -2436,10 +2436,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct hdw->usb_intf = intf; hdw->usb_dev = interface_to_usbdev(intf); - scnprintf(hdw->bus_info,sizeof(hdw->bus_info), - "usb %s address %d", - dev_name(&hdw->usb_dev->dev), - hdw->usb_dev->devnum); + usb_make_path(hdw->usb_dev, hdw->bus_info, sizeof(hdw->bus_info)); ifnum = hdw->usb_intf->cur_altsetting->desc.bInterfaceNumber; usb_set_interface(hdw->usb_dev,ifnum,0); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/2ed72b192848bca5ced84116ef43ea3651c26b8e ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Split i2c module handling from i2c adapter
The patch number 11154 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Split i2c module handling from i2c adapter This is the first step in the effort to move the pvrusb2 driver over to using the v4l2-subdev framework. This commit involves mainly splitting apart pvrusb2-i2c-core - part of it is the driver's I2C adapter driver and the rest is the old i2c module handling logic. The i2c module handling junk is moved out to pvrusb2-i2c-track and various header references are correspondingly updated. Yes, this patch has a huge pile of checkpatch complaints, but I'm NOT going to fix any of it. Why? First, I'm moving a large chunk of existing code and I'm not going to spend time adjusting it to match someone's idea of coding style. Second, in the end I expect all that moved code to go away by the time the rework is done so wasting time on it now to adhere to the standard is in the end a large waste of time. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/Makefile |1 linux/drivers/media/video/pvrusb2/pvrusb2-audio.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.h|2 linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c|3 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 417 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.h | 57 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c | 481 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.h | 97 ++ linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h |2 14 files changed, 596 insertions(+), 476 deletions(-) --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ad34ff00b414388610ce7c326aca07dfe6c50cf1 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Set up v4l2_device instance
The patch number 11155 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Set up v4l2_device instance Define a v4l2_device instance in the pvrusb2 driver and initialize / tear it down appropriately. This is a step in the v4l2-subdev adoption effort. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |3 + linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff -r ad34ff00b414 -r cd683973343e linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sat Mar 07 00:06:09 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 20:20:31 2009 -0600 @@ -38,6 +38,7 @@ #include #include "pvrusb2-hdw.h" #include "pvrusb2-io.h" +#include #include #include "pvrusb2-devattr.h" @@ -179,6 +180,8 @@ struct pvr2_hdw { struct usb_device *usb_dev; struct usb_interface *usb_intf; + /* Our handle into the v4l2 sub-device architecture */ + struct v4l2_device v4l2_dev; /* Device description, anything that must adjust behavior based on device specific info will use information held here. */ const struct pvr2_device_desc *hdw_desc; diff -r ad34ff00b414 -r cd683973343e linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Mar 07 00:06:09 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:20:31 2009 -0600 @@ -2209,10 +2209,13 @@ struct pvr2_hdw *pvr2_hdw_create(struct struct pvr2_hdw *hdw = NULL; int valid_std_mask; struct pvr2_ctrl *cptr; + struct usb_device *usb_dev; const struct pvr2_device_desc *hdw_desc; __u8 ifnum; struct v4l2_queryctrl qctrl; struct pvr2_ctl_info *ciptr; + + usb_dev = interface_to_usbdev(intf); hdw_desc = (const struct pvr2_device_desc *)(devid->driver_info); @@ -2398,6 +2401,11 @@ struct pvr2_hdw *pvr2_hdw_create(struct hdw->ctl_read_urb = usb_alloc_urb(0,GFP_KERNEL); if (!hdw->ctl_read_urb) goto fail; + if (v4l2_device_register(&usb_dev->dev, &hdw->v4l2_dev) != 0) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Error registering with v4l core, giving up"); + goto fail; + } mutex_lock(&pvr2_unit_mtx); do { for (idx = 0; idx < PVR_NUM; idx++) { if (unit_pointers[idx]) continue; @@ -2436,7 +2444,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct hdw->flag_ok = !0; hdw->usb_intf = intf; - hdw->usb_dev = interface_to_usbdev(intf); + hdw->usb_dev = usb_dev; usb_make_path(hdw->usb_dev, hdw->bus_info, sizeof(hdw->bus_info)); @@ -2496,6 +2504,13 @@ static void pvr2_hdw_remove_usb_stuff(st hdw->ctl_write_buffer = NULL; } hdw->flag_disconnected = !0; + /* If we don't do this, then there will be a dangling struct device + reference to our disappearing device persisting inside the V4L + core... */ + if (hdw->v4l2_dev.dev) { + dev_set_drvdata(hdw->v4l2_dev.dev, NULL); + hdw->v4l2_dev.dev = NULL; + } hdw->usb_dev = NULL; hdw->usb_intf = NULL; pvr2_hdw_render_useless(hdw); @@ -2528,6 +2543,7 @@ void pvr2_hdw_destroy(struct pvr2_hdw *h } pvr2_i2c_core_done(hdw); pvr2_i2c_track_done(hdw); + v4l2_device_unregister(&hdw->v4l2_dev); pvr2_hdw_remove_usb_stuff(hdw); mutex_lock(&pvr2_unit_mtx); do { if ((hdw->unit_number >= 0) && --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/cd683973343e32ab4b6d76e1290f08dab42e5886 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Changes to further isolate old i2c layer
The patch number 11156 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Changes to further isolate old i2c layer This introduces some additional isolation in the pvrusb2 from the old i2c layer, a step along the way to separate the driver from that layer and to make it easier to introduce the common v4l2-subdev framework as the eventual replacement. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 22 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c |4 + 3 files changed, 19 insertions(+), 9 deletions(-) diff -r cd683973343e -r 5a042a398634 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 20:20:31 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 20:30:37 2009 -0600 @@ -408,6 +408,8 @@ unsigned long pvr2_hdw_get_cur_freq(stru unsigned long pvr2_hdw_get_cur_freq(struct pvr2_hdw *); void pvr2_hdw_set_decoder(struct pvr2_hdw *,struct pvr2_decoder_ctrl *); +void pvr2_hdw_status_poll(struct pvr2_hdw *); + #endif /* __PVRUSB2_HDW_INTERNAL_H */ /* diff -r cd683973343e -r 5a042a398634 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:20:31 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:30:37 2009 -0600 @@ -644,7 +644,7 @@ static int ctrl_freq_max_get(struct pvr2 unsigned long fv; struct pvr2_hdw *hdw = cptr->hdw; if (hdw->tuner_signal_stale) { - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); } fv = hdw->tuner_signal_info.rangehigh; if (!fv) { @@ -666,7 +666,7 @@ static int ctrl_freq_min_get(struct pvr2 unsigned long fv; struct pvr2_hdw *hdw = cptr->hdw; if (hdw->tuner_signal_stale) { - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); } fv = hdw->tuner_signal_info.rangelow; if (!fv) { @@ -860,7 +860,7 @@ static int ctrl_signal_get(struct pvr2_c static int ctrl_signal_get(struct pvr2_ctrl *cptr,int *vp) { struct pvr2_hdw *hdw = cptr->hdw; - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); *vp = hdw->tuner_signal_info.signal; return 0; } @@ -870,7 +870,7 @@ static int ctrl_audio_modes_present_get( int val = 0; unsigned int subchan; struct pvr2_hdw *hdw = cptr->hdw; - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); subchan = hdw->tuner_signal_info.rxsubchans; if (subchan & V4L2_TUNER_SUB_MONO) { val |= (1 << V4L2_TUNER_MODE_MONO); @@ -3032,7 +3032,7 @@ void pvr2_hdw_execute_tuner_poll(struct void pvr2_hdw_execute_tuner_poll(struct pvr2_hdw *hdw) { LOCK_TAKE(hdw->big_lock); do { - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); } while (0); LOCK_GIVE(hdw->big_lock); } @@ -3042,7 +3042,7 @@ static int pvr2_hdw_check_cropcap(struct if (!hdw->cropcap_stale) { return 0; } - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); if (hdw->cropcap_stale) { return -EIO; } @@ -3069,7 +3069,7 @@ int pvr2_hdw_get_tuner_status(struct pvr { LOCK_TAKE(hdw->big_lock); do { if (hdw->tuner_signal_stale) { - pvr2_i2c_core_status_poll(hdw); + pvr2_hdw_status_poll(hdw); } memcpy(vtp,&hdw->tuner_signal_info,sizeof(struct v4l2_tuner)); } while (0); LOCK_GIVE(hdw->big_lock); @@ -3091,8 +3091,8 @@ void pvr2_hdw_trigger_module_log(struct hdw->log_requested = !0; printk(KERN_INFO "pvrusb2: = START STATUS CARD #%d =\n", nr); pvr2_i2c_core_check_stale(hdw); + pvr2_i2c_core_sync(hdw); hdw->log_requested = 0; - pvr2_i2c_core_sync(hdw); pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:"); cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2"); pvr2_hdw_state_log_state(hdw); @@ -4815,6 +4815,12 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hd } +void pvr2_hdw_status_poll(struct pvr2_hdw *hdw) +{ + pvr2_i2c_core_status_poll(hdw); +} + + unsigned int pvr2_hdw_get_input_available(s
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: whitespace trivial tweaks
The patch number 11157 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: whitespace trivial tweaks Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c |2 ++ linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c|1 + linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c |2 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c |2 ++ linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c |1 + 5 files changed, 8 insertions(+) diff -r 5a042a398634 -r 77c121bfd4d0 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 20:30:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 20:32:02 2009 -0600 @@ -33,6 +33,7 @@ struct pvr2_msp3400_handler { struct pvr2_i2c_handler i2c_handler; unsigned long stale_mask; }; + @@ -181,6 +182,7 @@ int pvr2_i2c_msp3400_setup(struct pvr2_h } + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff -r 5a042a398634 -r 77c121bfd4d0 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 20:30:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 20:32:02 2009 -0600 @@ -324,6 +324,7 @@ int pvr2_i2c_cx2584x_v4l_setup(struct pv + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff -r 5a042a398634 -r 77c121bfd4d0 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.cFri Mar 06 20:30:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.cFri Mar 06 20:32:02 2009 -0600 @@ -29,6 +29,7 @@ #include "pvrusb2-cx2584x-v4l.h" #include "pvrusb2-wm8775.h" #include "compat.h" + #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) @@ -106,6 +107,7 @@ const struct pvr2_i2c_op *pvr2_i2c_get_o } + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff -r 5a042a398634 -r 77c121bfd4d0 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 20:30:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 20:32:02 2009 -0600 @@ -26,6 +26,7 @@ #include "compat.h" #define trace_i2c(...) pvr2_trace(PVR2_TRACE_I2C,__VA_ARGS__) + /* @@ -470,6 +471,7 @@ void pvr2_i2c_track_done(struct pvr2_hdw /* Empty for now */ } + /* Stuff for Emacs to see, in order to encourage consistent editing style: *** Local Variables: *** diff -r 5a042a398634 -r 77c121bfd4d0 linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c Fri Mar 06 20:30:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c Fri Mar 06 20:32:02 2009 -0600 @@ -29,6 +29,7 @@ #include #include + struct pvr2_tuner_handler { struct pvr2_hdw *hdw; struct pvr2_i2c_client *client; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/77c121bfd4d04b06bdd7d4655e445dbd4f70caa1 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: New device attribute mechanism to specify sub-devices
The patch number 11158 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: New device attribute mechanism to specify sub-devices Set up new mechanism for declaring and loading appropriate sub-devices when driver initializes. This is another part of the v4l2-subdev adoption. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h | 28 ++ linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 119 ++- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |1 3 files changed, 144 insertions(+), 4 deletions(-) diff -r 77c121bfd4d0 -r 02a80c08dede linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 20:32:02 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 20:42:20 2009 -0600 @@ -31,6 +31,31 @@ This header defines structures used to describe attributes of a device. */ + + +#define PVR2_CLIENT_ID_MSP3400 1 +#define PVR2_CLIENT_ID_CX25840 2 +#define PVR2_CLIENT_ID_SAA7115 3 +#define PVR2_CLIENT_ID_TUNER 4 +#define PVR2_CLIENT_ID_CS53132A 5 + +struct pvr2_device_client_desc { + /* One ovr PVR2_CLIENT_ID_ */ + unsigned char module_id; + + /* Null-terminated array of I2C addresses to try in order + initialize the module. It's safe to make this null terminated + since we're never going to encounter an i2c device with an + address of zero. If this is a null pointer or zero-length, + then no I2C addresses have been specified, in which case we'll + try some compiled in defaults for now. */ + unsigned char *i2c_address_list; +}; + +struct pvr2_device_client_table { + const struct pvr2_device_client_desc *lst; + unsigned char cnt; +}; struct pvr2_string_table { @@ -65,6 +90,9 @@ struct pvr2_device_desc { /* List of additional client modules we need to load */ struct pvr2_string_table client_modules; + + /* List of defined client modules we need to load */ + struct pvr2_device_client_table client_table; /* List of FX2 firmware file names we should search; if empty then FX2 firmware check / load is skipped and we assume the device diff -r 77c121bfd4d0 -r 02a80c08dede linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:32:02 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:42:20 2009 -0600 @@ -105,6 +105,20 @@ MODULE_PARM_DESC(radio_freq, "specify in /* size of a firmware chunk */ #define FIRMWARE_CHUNK_SIZE 0x2000 + +static const char *module_names[] = { + [PVR2_CLIENT_ID_MSP3400] = "msp3400", + [PVR2_CLIENT_ID_CX25840] = "cx25840", + [PVR2_CLIENT_ID_SAA7115] = "saa7115", + [PVR2_CLIENT_ID_TUNER] = "tuner", + [PVR2_CLIENT_ID_CS53132A] = "cs53132a", +}; + + +static const unsigned char *module_i2c_addresses[] = { + [PVR2_CLIENT_ID_TUNER] = "\x60\x61\x62\x63", +}; + /* Define the list of additional controls we'll dynamically construct based on query of the cx2341x module. */ @@ -1951,6 +1965,105 @@ static void pvr2_hdw_setup_std(struct pv } +static unsigned int pvr2_copy_i2c_addr_list( + unsigned short *dst, const unsigned char *src, + unsigned int dst_max) +{ + unsigned int cnt; + if (!src) return 0; + while (src[cnt] && (cnt + 1) < dst_max) { + dst[cnt] = src[cnt]; + cnt++; + } + dst[cnt] = I2C_CLIENT_END; + return cnt; +} + + +static void pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, +const struct pvr2_device_client_desc *cd) +{ + const char *fname; + unsigned char mid; + struct v4l2_subdev *sd; + unsigned int i2ccnt; + const unsigned char *p; + /* Arbitrary count - max # i2c addresses we will probe */ + unsigned short i2caddr[25]; + + mid = cd->module_id; + fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL; + if (!fname) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Module ID %u for device %s is unknown" + " (this is probably a bad thing...)", + mid, + hdw->hdw_desc->description); + return; + } + + i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, cd->i2c_address_list, +ARRAY_SIZE(i2caddr)); + if (!i2ccnt && ((p = (mid < ARRAY_SIZE(mo
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: whitespace tweaks
The patch number 11160 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: whitespace tweaks Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c|2 +- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h |2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff -r 71964ff0e0a0 -r 18be2c6fa5ca linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 20:47:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 20:48:42 2009 -0600 @@ -27,13 +27,13 @@ #include #include "compat.h" + struct pvr2_msp3400_handler { struct pvr2_hdw *hdw; struct pvr2_i2c_client *client; struct pvr2_i2c_handler i2c_handler; unsigned long stale_mask; }; - diff -r 71964ff0e0a0 -r 18be2c6fa5ca linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h Fri Mar 06 20:47:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h Fri Mar 06 20:48:42 2009 -0600 @@ -24,6 +24,7 @@ #include "pvrusb2-i2c-track.h" + extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_init; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_standard; extern const struct pvr2_i2c_op pvr2_i2c_op_v4l2_radio; @@ -38,6 +39,7 @@ void pvr2_v4l2_cmd_stream(struct pvr2_i2 void pvr2_v4l2_cmd_stream(struct pvr2_i2c_client *,int); void pvr2_v4l2_cmd_status_poll(struct pvr2_i2c_client *); + #endif /* __PVRUSB2_CMD_V4L2_H */ /* --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/18be2c6fa5ca44d29b3b703afd5bf763c2b2343f ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Providing means to stop tracking an old i2c module
The patch number 11159 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Providing means to stop tracking an old i2c module This implements a temporary mechanism to "untrack" an i2c module from the old i2c layer. The v4l2-subdev related code in the driver will use this to remove a sub-device from the old i2c layer. In the end, once the old i2c layer is removed, this will also eventually go away. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c | 80 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.h |5 3 files changed, 66 insertions(+), 25 deletions(-) diff -r 02a80c08dede -r 71964ff0e0a0 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:42:20 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:47:10 2009 -0600 @@ -2037,6 +2037,12 @@ static void pvr2_hdw_load_subdev(struct i2caddr); } + /* If we have both old and new i2c layers enabled, make sure that + old layer isn't also tracking this module. This is a debugging + aid, in normal situations there's no reason for both mechanisms + to be enabled. */ + pvr2_i2c_untrack_subdev(hdw, sd); + // ? /* Based on module ID, we should remember subdev pointers so that we can send certain custom commands where diff -r 02a80c08dede -r 71964ff0e0a0 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 20:42:20 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 20:47:10 2009 -0600 @@ -422,39 +422,69 @@ void pvr2_i2c_track_attach_inform(struct if (fl) queue_work(hdw->workqueue,&hdw->worki2csync); } +static void pvr2_i2c_client_disconnect(struct pvr2_i2c_client *cp) +{ + if (cp->handler && cp->handler->func_table->detach) { + cp->handler->func_table->detach(cp->handler->func_data); + } + list_del(&cp->list); + kfree(cp); +} + void pvr2_i2c_track_detach_inform(struct i2c_client *client) { struct pvr2_hdw *hdw = (struct pvr2_hdw *)(client->adapter->algo_data); struct pvr2_i2c_client *cp, *ncp; unsigned long amask = 0; int foundfl = 0; - mutex_lock(&hdw->i2c_list_lock); do { - hdw->cropcap_stale = !0; - list_for_each_entry_safe(cp, ncp, &hdw->i2c_clients, list) { - if (cp->client == client) { - trace_i2c("pvr2_i2c_detach" - " [client=%s @ 0x%x ctxt=%p]", - client->name, - client->addr,cp); - if (cp->handler && - cp->handler->func_table->detach) { - cp->handler->func_table->detach( - cp->handler->func_data); - } - list_del(&cp->list); - kfree(cp); - foundfl = !0; - continue; - } - amask |= cp->ctl_mask; - } - hdw->i2c_active_mask = amask; - } while (0); mutex_unlock(&hdw->i2c_list_lock); + mutex_lock(&hdw->i2c_list_lock); + hdw->cropcap_stale = !0; + list_for_each_entry_safe(cp, ncp, &hdw->i2c_clients, list) { + if (cp->client == client) { + trace_i2c("pvr2_i2c_detach" + " [client=%s @ 0x%x ctxt=%p]", + client->name, + client->addr, cp); + pvr2_i2c_client_disconnect(cp); + foundfl = !0; + continue; + } + amask |= cp->ctl_mask; + } + hdw->i2c_active_mask = amask; + mutex_unlock(&hdw->i2c_list_lock); if (!foundfl) { trace_i2c("pvr2_i2c_detach [client=%s @ 0x%x ctxt=]", - client->name, - client->addr); - } + client->name, client->addr); + } +} + +/* This function is used to remove an i2c client from our tracking + str
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Lay foundation for triggering sub-device updates
The patch number 11163 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Lay foundation for triggering sub-device updates These changes set up the spot where we'll check for and set general updates to any attached sub-devices. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 25 +++- 1 file changed, 18 insertions(+), 7 deletions(-) diff -r 4a33b837984c -r d88a3dde7205 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:58:15 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:01:20 2009 -0600 @@ -2863,6 +2863,14 @@ static const char *get_ctrl_typename(enu } +/* Execute whatever commands are required to update the state of all the + sub-devices so that it matches our current control values. */ +static void pvr2_subdev_update(struct pvr2_hdw *hdw) +{ + /* ? */ +} + + /* Figure out if we need to commit control changes. If so, mark internal state flags to indicate this fact and return true. Otherwise do nothing else and return false. */ @@ -3033,12 +3041,6 @@ static int pvr2_hdw_commit_execute(struc the client drivers in order to keep everything in sync */ pvr2_i2c_core_check_stale(hdw); - for (idx = 0; idx < hdw->control_cnt; idx++) { - cptr = hdw->controls + idx; - if (!cptr->info->clear_dirty) continue; - cptr->info->clear_dirty(cptr); - } - if (hdw->active_stream_type != hdw->desired_stream_type) { /* Handle any side effects of stream config here */ hdw->active_stream_type = hdw->desired_stream_type; @@ -3058,6 +3060,15 @@ static int pvr2_hdw_commit_execute(struc } } + for (idx = 0; idx < hdw->control_cnt; idx++) { + cptr = hdw->controls + idx; + if (!cptr->info->clear_dirty) continue; + cptr->info->clear_dirty(cptr); + } + + /* Check and update state for all sub-devices. */ + pvr2_subdev_update(hdw); + /* Now execute i2c core update */ pvr2_i2c_core_sync(hdw); @@ -3214,8 +3225,8 @@ void pvr2_hdw_trigger_module_log(struct { int nr = pvr2_hdw_get_unit_number(hdw); LOCK_TAKE(hdw->big_lock); do { + printk(KERN_INFO "pvrusb2: = START STATUS CARD #%d =\n", nr); hdw->log_requested = !0; - printk(KERN_INFO "pvrusb2: = START STATUS CARD #%d =\n", nr); pvr2_i2c_core_check_stale(hdw); pvr2_i2c_core_sync(hdw); hdw->log_requested = 0; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d88a3dde72052fa1c9c010c8c0643668fd2b7665 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Set i2c autoprobing to be off by default
The patch number 11161 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Set i2c autoprobing to be off by default In order to keep a sub-device from promiscuously attaching to the pvrusb2 driver, the i2c adapter's class must be cleared. This change clears that class by default. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -r 18be2c6fa5ca -r 47fcb2e518b6 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri Mar 06 20:48:42 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri Mar 06 20:51:35 2009 -0600 @@ -618,7 +618,7 @@ static struct i2c_algorithm pvr2_i2c_alg static struct i2c_adapter pvr2_i2c_adap_template = { .owner = THIS_MODULE, - .class = I2C_CLASS_TV_ANALOG, + .class = 0, .id= I2C_HW_B_BT848, .client_register = pvr2_i2c_attach_inform, .client_unregister = pvr2_i2c_detach_inform, @@ -685,6 +685,7 @@ void pvr2_i2c_core_init(struct pvr2_hdw hdw->i2c_adap.dev.parent = &hdw->usb_dev->dev; hdw->i2c_adap.algo = &hdw->i2c_algo; hdw->i2c_adap.algo_data = hdw; + hdw->i2c_adap.class = I2C_CLASS_TV_ANALOG; hdw->i2c_linked = !0; i2c_set_adapdata(&hdw->i2c_adap, &hdw->v4l2_dev); i2c_add_adapter(&hdw->i2c_adap); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/47fcb2e518b61e9495fb2eaa7576cb1e822fe065 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie up loose ends with v4l2-subdev setup
The patch number 11162 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie up loose ends with v4l2-subdev setup Tie up loose ends with v4l2-subdev setup. Set attached module's group ID to match our internal ID, emit a few useful messages when sub-devices are dealt with, implement better error legs, and fix an error in the old i2c layer (caused by changes related to the v4l2-subdev work here). Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 21 +++- 1 file changed, 15 insertions(+), 6 deletions(-) diff -r 47fcb2e518b6 -r 4a33b837984c linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:51:35 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 20:58:15 2009 -0600 @@ -2037,17 +2037,26 @@ static void pvr2_hdw_load_subdev(struct i2caddr); } + if (!sd) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "Module ID %u for device %s failed to load" + " (this is probably a bad thing...)", + mid, hdw->hdw_desc->description); + return; + } + + /* Tag this sub-device instance with the module ID we know about. + In other places we'll use that tag to determine if the instance + requires special handling. */ + sd->grp_id = mid; + /* If we have both old and new i2c layers enabled, make sure that old layer isn't also tracking this module. This is a debugging aid, in normal situations there's no reason for both mechanisms to be enabled. */ pvr2_i2c_untrack_subdev(hdw, sd); - - // ? - /* Based on module ID, we should remember subdev pointers - so that we can send certain custom commands where - needed. */ - // ? + pvr2_trace(PVR2_TRACE_INIT, "Attached sub-driver %s", fname); + } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/4a33b837984c694508d6afea2e01b07b280abdd4 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement status fetching from sub-devices
The patch number 11166 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement status fetching from sub-devices Implement status fetching operations in terms of calling out to sub-device(s). Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 14 ++ linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c |8 - 2 files changed, 14 insertions(+), 8 deletions(-) diff -r 6e6eaa29c492 -r fdfca6c6e2a0 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:05:00 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:08:17 2009 -0600 @@ -4955,7 +4955,21 @@ int pvr2_hdw_gpio_chg_out(struct pvr2_hd void pvr2_hdw_status_poll(struct pvr2_hdw *hdw) { + struct v4l2_tuner *vtp = &hdw->tuner_signal_info; + memset(vtp, 0, sizeof(*vtp)); pvr2_i2c_core_status_poll(hdw); + /* Note: There apparently is no replacement for VIDIOC_CROPCAP + using v4l2-subdev - therefore we can't support that AT ALL right + now. (Of course, no sub-drivers seem to implement it either. + But now it's a a chicken and egg problem...) */ + v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, g_tuner, +&hdw->tuner_signal_info); + pvr2_trace(PVR2_TRACE_CHIPS, "client status poll" + " type=%u strength=%u audio=0x%x cap=0x%x" + " low=%u hi=%u", + vtp->type, + vtp->signal, vtp->rxsubchans, vtp->capability, + vtp->rangelow, vtp->rangehigh); } diff -r 6e6eaa29c492 -r fdfca6c6e2a0 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 21:05:00 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c Fri Mar 06 21:08:17 2009 -0600 @@ -113,20 +113,12 @@ void pvr2_i2c_core_status_poll(struct pv { struct pvr2_i2c_client *cp; mutex_lock(&hdw->i2c_list_lock); do { - struct v4l2_tuner *vtp = &hdw->tuner_signal_info; - memset(vtp,0,sizeof(*vtp)); list_for_each_entry(cp, &hdw->i2c_clients, list) { if (!cp->detected_flag) continue; if (!cp->status_poll) continue; cp->status_poll(cp); } hdw->tuner_signal_stale = 0; - pvr2_trace(PVR2_TRACE_CHIPS,"i2c status poll" - " type=%u strength=%u audio=0x%x cap=0x%x" - " low=%u hi=%u", - vtp->type, - vtp->signal,vtp->rxsubchans,vtp->capability, - vtp->rangelow,vtp->rangehigh); } while (0); mutex_unlock(&hdw->i2c_list_lock); } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/fdfca6c6e2a068fed8e6430cc41105362e3bc6a4 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Note who our video decoder sub-device is, and set it up
The patch number 11169 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Note who our video decoder sub-device is, and set it up Other code may need to treat the video decoder sub-device in a special manner, so this change implements code to recognize when such a sub-device is connected to the driver, does any special processing for it, and notes who the device is for future reference. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 28 ++ 2 files changed, 29 insertions(+) diff -r 6d62cf42ec18 -r 6b08cd42ae6c linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 21:14:13 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 21:17:11 2009 -0600 @@ -299,6 +299,7 @@ struct pvr2_hdw { int flag_tripped; /* Indicates overall failure to start */ struct pvr2_decoder_ctrl *decoder_ctrl; + unsigned int decoder_client_id; // CPU firmware info (used to help find / save firmware data) char *fw_buffer; diff -r 6d62cf42ec18 -r 6b08cd42ae6c linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:14:13 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:17:11 2009 -0600 @@ -2058,6 +2058,34 @@ static void pvr2_hdw_load_subdev(struct pvr2_trace(PVR2_TRACE_INIT, "Attached sub-driver %s", fname); + /* client-specific setup... */ + switch (mid) { + case PVR2_CLIENT_ID_CX25840: + hdw->decoder_client_id = mid; + { + /* + Mike Isely 19-Nov-2006 - This + bit of nuttiness for cx25840 causes that module + to correctly set up its video scaling. This is + really a problem in the cx25840 module itself, + but we work around it here. The problem has not + been seen in ivtv because there VBI is supported + and set up. We don't do VBI here (at least not + yet) and thus we never attempted to even set it + up. + */ + struct v4l2_format fmt; + memset(&fmt, 0, sizeof(fmt)); + fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; + v4l2_device_call_all(&hdw->v4l2_dev, mid, +video, s_fmt, &fmt); + } + break; + case PVR2_CLIENT_ID_SAA7115: + hdw->decoder_client_id = mid; + break; + default: break; + } } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/6b08cd42ae6cc7ab1fda1d6b444ce8f97c7906e8 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Define value for a null sub-device ID
The patch number 11168 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Define value for a null sub-device ID Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |1 + 1 file changed, 1 insertion(+) diff -r a42c353a04ea -r 6d62cf42ec18 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 21:13:25 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 21:14:13 2009 -0600 @@ -33,6 +33,7 @@ */ +#define PVR2_CLIENT_ID_NULL 0 #define PVR2_CLIENT_ID_MSP3400 1 #define PVR2_CLIENT_ID_CX25840 2 #define PVR2_CLIENT_ID_SAA7115 3 --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/6d62cf42ec18367c139b72fb409cbc7b52adca92 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in various v4l2 operations into the sub-device mechanism
The patch number 11167 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in various v4l2 operations into the sub-device mechanism This is another step in the v42l-subdev assimilation. This implements various call-outs to sub-devices based on state changes within the pvrusb2 driver. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 102 +- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c |1 2 files changed, 99 insertions(+), 4 deletions(-) diff -r fdfca6c6e2a0 -r a42c353a04ea linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:08:17 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:13:25 2009 -0600 @@ -2863,11 +2863,102 @@ static const char *get_ctrl_typename(enu } +static void pvr2_subdev_set_control(struct pvr2_hdw *hdw, int id, + const char *name, int val) +{ + struct v4l2_control ctrl; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 %s=%d", name, val); + memset(&ctrl, 0, sizeof(ctrl)); + ctrl.id = id; + ctrl.value = val; + v4l2_device_call_all(&hdw->v4l2_dev, 0, core, s_ctrl, &ctrl); +} + +#define PVR2_SUBDEV_SET_CONTROL(hdw, id, lab) \ + if ((hdw)->lab##_dirty) { \ + pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ + } + /* Execute whatever commands are required to update the state of all the - sub-devices so that it matches our current control values. */ + sub-devices so that they match our current control values. */ static void pvr2_subdev_update(struct pvr2_hdw *hdw) { - /* ? */ + if (hdw->input_dirty || hdw->std_dirty) { + pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard"); + if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { + v4l2_device_call_all(&hdw->v4l2_dev, 0, +tuner, s_radio); + } else { + v4l2_std_id vs; + vs = hdw->std_mask_cur; + v4l2_device_call_all(&hdw->v4l2_dev, 0, +tuner, s_std, vs); + } + hdw->tuner_signal_stale = !0; + hdw->cropcap_stale = !0; + } + + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_BRIGHTNESS, brightness); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_CONTRAST, contrast); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_SATURATION, saturation); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_HUE, hue); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_AUDIO_MUTE, mute); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_AUDIO_VOLUME, volume); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_AUDIO_BALANCE, balance); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_AUDIO_BASS, bass); + PVR2_SUBDEV_SET_CONTROL(hdw, V4L2_CID_AUDIO_TREBLE, treble); + + if (hdw->input_dirty || hdw->audiomode_dirty) { + struct v4l2_tuner vt; + memset(&vt, 0, sizeof(vt)); + vt.audmode = hdw->audiomode_val; + v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_tuner, &vt); + } + + if (hdw->freqDirty) { + unsigned long fv; + struct v4l2_frequency freq; + fv = pvr2_hdw_get_cur_freq(hdw); + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_freq(%lu)", fv); + if (hdw->tuner_signal_stale) pvr2_hdw_status_poll(hdw); + memset(&freq, 0, sizeof(freq)); + if (hdw->tuner_signal_info.capability & V4L2_TUNER_CAP_LOW) { + /* ((fv * 1000) / 62500) */ + freq.frequency = (fv * 2) / 125; + } else { + freq.frequency = fv / 62500; + } + /* tuner-core currently doesn't seem to care about this, but + let's set it anyway for completeness. */ + if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { + freq.type = V4L2_TUNER_RADIO; + } else { + freq.type = V4L2_TUNER_ANALOG_TV; + } + freq.tuner = 0; + v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, +s_frequency, &freq); + } + + if (hdw->res_hor_dirty || hdw->res_ver_dirty) { + struct v4l2_format fmt; + memset(&fmt, 0, sizeof(fmt)); + fmt.type = V4L2_BUF_TYPE_VIDEO_CAPT
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie-in sub-device log requests
The patch number 11164 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie-in sub-device log requests Trigger a broadcast to attached sub-devices when a logging request is made. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r d88a3dde7205 -r 53132bef1413 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:01:20 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:02:33 2009 -0600 @@ -3230,6 +3230,7 @@ void pvr2_hdw_trigger_module_log(struct pvr2_i2c_core_check_stale(hdw); pvr2_i2c_core_sync(hdw); hdw->log_requested = 0; + v4l2_device_call_all(&hdw->v4l2_dev, 0, core, log_status); pvr2_trace(PVR2_TRACE_INFO,"cx2341x config:"); cx2341x_log_status(&hdw->enc_ctl_state, "pvrusb2"); pvr2_hdw_state_log_state(hdw); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/53132bef141310d2d940c8a3a443269156077197 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in debug register access to sub-devices
The patch number 11165 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in debug register access to sub-devices Implement tie-in for v4l2 debug register access such that the appropriate attached sub-device is handled. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff -r 53132bef1413 -r 6e6eaa29c492 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:02:33 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:05:00 2009 -0600 @@ -5064,7 +5064,10 @@ int pvr2_hdw_register_access(struct pvr2 req.match = *match; req.reg = reg_id; if (setFl) req.val = *val_ptr; - mutex_lock(&hdw->i2c_list_lock); do { + /* It would be nice to know if a sub-device answered the request */ + v4l2_device_call_all(&hdw->v4l2_dev, 0, core, g_register, &req); + if (!setFl) *val_ptr = req.val; + if (!okFl) mutex_lock(&hdw->i2c_list_lock); do { list_for_each_entry(cp, &hdw->i2c_clients, list) { if (!v4l2_chip_match_i2c_client( cp->client, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/6e6eaa29c492339da2b5113cf50d54cf9b4afd63 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in sub-device decoder start/stop
The patch number 11171 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in sub-device decoder start/stop Implement code to send appropriate streaming start/stop commands to attached sub-devices Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 69 +--- 1 file changed, 41 insertions(+), 28 deletions(-) diff -r 3d80e6c9eda6 -r 34cfc6130d38 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:19:43 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:21:30 2009 -0600 @@ -1665,19 +1665,29 @@ static const char *pvr2_get_state_name(u static int pvr2_decoder_enable(struct pvr2_hdw *hdw,int enablefl) { - if (!hdw->decoder_ctrl) { - if (!hdw->flag_decoder_missed) { - pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "WARNING: No decoder present"); - hdw->flag_decoder_missed = !0; - trace_stbit("flag_decoder_missed", - hdw->flag_decoder_missed); - } - return -EIO; - } - hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt,enablefl); - // ? - return 0; + if (hdw->decoder_ctrl) { + hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt, enablefl); + return 0; + } + /* Even though we really only care about the video decoder chip at + this point, we'll broadcast stream on/off to all sub-devices + anyway, just in case somebody else wants to hear the + command... */ + v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl); + if (hdw->decoder_client_id) { + /* We get here if the encoder has been noticed. Otherwise + we'll issue a warning to the user (which should + normally never happen). */ + return 0; + } + if (!hdw->flag_decoder_missed) { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "WARNING: No decoder present"); + hdw->flag_decoder_missed = !0; + trace_stbit("flag_decoder_missed", + hdw->flag_decoder_missed); + } + return -EIO; } @@ -4105,23 +4115,26 @@ int pvr2_hdw_cmd_powerdown(struct pvr2_h int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw) { - if (!hdw->decoder_ctrl) { - pvr2_trace(PVR2_TRACE_INIT, - "Unable to reset decoder: nothing attached"); - return -ENOTTY; - } - - if (!hdw->decoder_ctrl->force_reset) { - pvr2_trace(PVR2_TRACE_INIT, - "Unable to reset decoder: not implemented"); - return -ENOTTY; - } - pvr2_trace(PVR2_TRACE_INIT, "Requesting decoder reset"); - hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt); - // ? - return 0; + if (hdw->decoder_ctrl) { + if (!hdw->decoder_ctrl->force_reset) { + pvr2_trace(PVR2_TRACE_INIT, + "Unable to reset decoder: not implemented"); + return -ENOTTY; + } + hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt); + return 0; + } else { + } + if (hdw->decoder_client_id) { + v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, +core, reset, 0); + return 0; + } + pvr2_trace(PVR2_TRACE_INIT, + "Unable to reset decoder: nothing attached"); + return -ENOTTY; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/34cfc6130d3816df5a3d9f006d67078959894f51 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Cause overall initialization to fail if sub-driver(s) fail
The patch number 11172 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Cause overall initialization to fail if sub-driver(s) fail Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 34 1 file changed, 18 insertions(+), 16 deletions(-) diff -r 34cfc6130d38 -r 4cd8835c1a98 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:21:30 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:24:24 2009 -0600 @@ -1991,8 +1991,8 @@ static unsigned int pvr2_copy_i2c_addr_l } -static void pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, -const struct pvr2_device_client_desc *cd) +static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, + const struct pvr2_device_client_desc *cd) { const char *fname; unsigned char mid; @@ -2006,11 +2006,10 @@ static void pvr2_hdw_load_subdev(struct fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL; if (!fname) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Module ID %u for device %s is unknown" - " (this is probably a bad thing...)", + "Module ID %u for device %s has no name", mid, hdw->hdw_desc->description); - return; + return -EINVAL; } i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, cd->i2c_address_list, @@ -2024,11 +2023,10 @@ static void pvr2_hdw_load_subdev(struct if (!i2ccnt) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Module ID %u for device %s:" - " No i2c addresses" - " (this is probably a bad thing...)", - mid, hdw->hdw_desc->description); - return; + "Module ID %u (%s) for device %s:" + " No i2c addresses", + mid, fname, hdw->hdw_desc->description); + return -EINVAL; } /* Note how the 2nd and 3rd arguments are the same for both @@ -2050,10 +2048,9 @@ static void pvr2_hdw_load_subdev(struct if (!sd) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Module ID %u for device %s failed to load" - " (this is probably a bad thing...)", - mid, hdw->hdw_desc->description); - return; + "Module ID %u (%s) for device %s failed to load", + mid, fname, hdw->hdw_desc->description); + return -EIO; } /* Tag this sub-device instance with the module ID we know about. @@ -2097,6 +2094,8 @@ static void pvr2_hdw_load_subdev(struct break; default: break; } + + return 0; } @@ -2105,6 +2104,7 @@ static void pvr2_hdw_load_modules(struct unsigned int idx; const struct pvr2_string_table *cm; const struct pvr2_device_client_table *ct; + int okFl = !0; cm = &hdw->hdw_desc->client_modules; for (idx = 0; idx < cm->cnt; idx++) { @@ -2113,8 +2113,9 @@ static void pvr2_hdw_load_modules(struct ct = &hdw->hdw_desc->client_table; for (idx = 0; idx < ct->cnt; idx++) { - pvr2_hdw_load_subdev(hdw,&ct->lst[idx]); - } + if (!pvr2_hdw_load_subdev(hdw, &ct->lst[idx])) okFl = 0; + } + if (!okFl) pvr2_hdw_render_useless(hdw); } @@ -2176,6 +2177,7 @@ static void pvr2_hdw_setup_low(struct pv if (!pvr2_hdw_dev_ok(hdw)) return; pvr2_hdw_load_modules(hdw); + if (!pvr2_hdw_dev_ok(hdw)) return; for (idx = 0; idx < CTRLDEF_COUNT; idx++) { cptr = hdw->controls + idx; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/4cd8835c1a987ed335bfe7ba8691195b14cbf203 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix backwards function header comments
The patch number 11173 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix backwards function header comments Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h | 12 +-- 1 file changed, 6 insertions(+), 6 deletions(-) diff -r 4cd8835c1a98 -r c7716313 linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h Fri Mar 06 21:24:24 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.h Fri Mar 06 21:26:24 2009 -0600 @@ -22,16 +22,16 @@ struct pvr2_hdw; -/* Non-intrusively print some useful debugging info from inside the - driver. This should work even if the driver appears to be - wedged. */ -int pvr2_debugifc_print_info(struct pvr2_hdw *, -char *buf_ptr,unsigned int buf_size); - /* Print general status of driver. This will also trigger a probe of the USB link. Unlike print_info(), this one synchronizes with the driver so the information should be self-consistent (but it will hang if the driver is wedged). */ +int pvr2_debugifc_print_info(struct pvr2_hdw *, +char *buf_ptr, unsigned int buf_size); + +/* Non-intrusively print some useful debugging info from inside the + driver. This should work even if the driver appears to be + wedged. */ int pvr2_debugifc_print_status(struct pvr2_hdw *, char *buf_ptr,unsigned int buf_size); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/c7716313450214eaafe6e7d946605e87a882 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Clean-up / placeholders inserted for additional development
The patch number 11170 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Clean-up / placeholders inserted for additional development Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |2 -- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff -r 6b08cd42ae6c -r 3d80e6c9eda6 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 21:17:11 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 21:19:43 2009 -0600 @@ -57,8 +57,6 @@ #define LOCK_TAKE(x) do { mutex_lock(&x##_mutex); x##_held = !0; } while (0) #define LOCK_GIVE(x) do { x##_held = 0; mutex_unlock(&x##_mutex); } while (0) - -struct pvr2_decoder; typedef int (*pvr2_ctlf_is_dirty)(struct pvr2_ctrl *); typedef void (*pvr2_ctlf_clear_dirty)(struct pvr2_ctrl *); diff -r 6b08cd42ae6c -r 3d80e6c9eda6 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:17:11 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:19:43 2009 -0600 @@ -1676,6 +1676,7 @@ static int pvr2_decoder_enable(struct pv return -EIO; } hdw->decoder_ctrl->enable(hdw->decoder_ctrl->ctxt,enablefl); + // ? return 0; } @@ -4119,6 +4120,7 @@ int pvr2_hdw_cmd_decoder_reset(struct pv pvr2_trace(PVR2_TRACE_INIT, "Requesting decoder reset"); hdw->decoder_ctrl->force_reset(hdw->decoder_ctrl->ctxt); + // ? return 0; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/3d80e6c9eda6cd9eff31add517374e0883d98ff1 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement reporting of connected sub-devices
The patch number 11174 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement reporting of connected sub-devices The pvrusb2 driver has a function that reports internal state. It can be accessed from either the debug interface or as the result of a v4l log status request. This change adds information listing sub-devices to the report. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 23 1 file changed, 23 insertions(+) diff -r c7716313 -r fe2468553f13 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:26:24 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:28:28 2009 -0600 @@ -4875,6 +4875,29 @@ static unsigned int pvr2_hdw_report_unlo stats.buffers_processed, stats.buffers_failed); } + case 6: { + struct v4l2_subdev *sd; + unsigned int tcnt = 0; + unsigned int ccnt; + const char *p; + unsigned int id; + ccnt = scnprintf(buf, +acnt, +"Associted v4l2_subdev drivers:"); + tcnt += ccnt; + v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { + id = sd->grp_id; + p = NULL; + if (id < ARRAY_SIZE(module_names)) { + p = module_names[id]; + } + if (!p) p = "(unknown)"; + ccnt = scnprintf(buf + tcnt, +acnt - tcnt, +" %s (%u)", p, id); + } + return tcnt; + } default: break; } return 0; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/fe2468553f13f883f6a6bd12585d457e3d4148ec ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in wm8775 sub-device handling
The patch number 11176 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in wm8775 sub-device handling Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |4 + linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 26 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h |3 + 4 files changed, 33 insertions(+), 1 deletion(-) diff -r 328b94b36215 -r 18f1c12b2a6f linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 21:37:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 21:39:34 2009 -0600 @@ -39,6 +39,7 @@ #define PVR2_CLIENT_ID_SAA7115 3 #define PVR2_CLIENT_ID_TUNER 4 #define PVR2_CLIENT_ID_CS53132A 5 +#define PVR2_CLIENT_ID_WM8775 6 struct pvr2_device_client_desc { /* One ovr PVR2_CLIENT_ID_ */ diff -r 328b94b36215 -r 18f1c12b2a6f linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:37:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:39:34 2009 -0600 @@ -36,6 +36,7 @@ #include "pvrusb2-encoder.h" #include "pvrusb2-debug.h" #include "pvrusb2-fx2-cmd.h" +#include "pvrusb2-wm8775.h" #include "compat.h" #define TV_MIN_FREQ 5525L @@ -110,7 +111,7 @@ typedef void (*pvr2_subdev_update_func)( struct v4l2_subdev *); static const pvr2_subdev_update_func pvr2_module_update_functions[] = { - /* ? */ + [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_update, }; static const char *module_names[] = { @@ -119,6 +120,7 @@ static const char *module_names[] = { [PVR2_CLIENT_ID_SAA7115] = "saa7115", [PVR2_CLIENT_ID_TUNER] = "tuner", [PVR2_CLIENT_ID_CS53132A] = "cs53132a", + [PVR2_CLIENT_ID_WM8775] = "wm8775", }; diff -r 328b94b36215 -r 18f1c12b2a6f linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.cFri Mar 06 21:37:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.cFri Mar 06 21:39:34 2009 -0600 @@ -38,6 +38,8 @@ #include #include "compat.h" + + struct pvr2_v4l_wm8775 { struct pvr2_i2c_handler handler; struct pvr2_i2c_client *client; @@ -159,6 +161,30 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hd } +void pvr2_wm8775_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) +{ + if (hdw->input_dirty) { + struct v4l2_routing route; + + memset(&route, 0, sizeof(route)); + + switch (hdw->input_val) { + case PVR2_CVAL_INPUT_RADIO: + route.input = 1; + break; + default: + /* All other cases just use the second input */ + route.input = 2; + break; + } + pvr2_trace(PVR2_TRACE_CHIPS, "subdev wm8775" + " set_input(val=%d route=0x%x)", + hdw->input_val, route.input); + + sd->ops->audio->s_routing(sd, &route); + } +} + /* diff -r 328b94b36215 -r 18f1c12b2a6f linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.hFri Mar 06 21:37:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.hFri Mar 06 21:39:34 2009 -0600 @@ -37,6 +37,9 @@ #include "pvrusb2-i2c-track.h" int pvr2_i2c_wm8775_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); +#include "pvrusb2-hdw-internal.h" + +void pvr2_wm8775_update(struct pvr2_hdw *, struct v4l2_subdev *sd); #endif /* __PVRUSB2_WM8775_H */ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/18f1c12b2a6f1265fc901bba57a58516a3c8f0e9 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement sub-device specific update framework
The patch number 11175 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement sub-device specific update framework Lay down a foundation whereby it becomes possible to send customized updates to specific sub-devices. (This becomes useful for routing configuration, which is a very sub-device specific operation.) Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 19 +++- 1 file changed, 18 insertions(+), 1 deletion(-) diff -r fe2468553f13 -r 328b94b36215 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:28:28 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:37:10 2009 -0600 @@ -105,6 +105,13 @@ MODULE_PARM_DESC(radio_freq, "specify in /* size of a firmware chunk */ #define FIRMWARE_CHUNK_SIZE 0x2000 + +typedef void (*pvr2_subdev_update_func)(struct pvr2_hdw *, + struct v4l2_subdev *); + +static const pvr2_subdev_update_func pvr2_module_update_functions[] = { + /* ? */ +}; static const char *module_names[] = { [PVR2_CLIENT_ID_MSP3400] = "msp3400", @@ -2924,6 +2931,10 @@ static void pvr2_subdev_set_control(stru sub-devices so that they match our current control values. */ static void pvr2_subdev_update(struct pvr2_hdw *hdw) { + struct v4l2_subdev *sd; + unsigned int id; + pvr2_subdev_update_func fp; + if (hdw->input_dirty || hdw->std_dirty) { pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard"); if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { @@ -2995,7 +3006,13 @@ static void pvr2_subdev_update(struct pv /* Unable to set crop parameters; there is apparently no equivalent for VIDIOC_S_CROP */ - /* ? Cover special cases for specific sub-devices. */ + v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { + id = sd->grp_id; + if (id >= ARRAY_SIZE(pvr2_module_update_functions)) continue; + fp = pvr2_module_update_functions[id]; + if (!fp) continue; + (*fp)(hdw, sd); + } if (hdw->tuner_signal_stale && hdw->cropcap_stale) { pvr2_hdw_status_poll(hdw); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/328b94b36215fc1f4ddfc667d72b05e8b8bdbf7c ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: make sub-device specific update function names uniform
The patch number 11179 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: make sub-device specific update function names uniform Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c|2 +- linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c |2 +- linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h |2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff -r 57689da88630 -r 0be6426f3a16 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:48:09 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:49:19 2009 -0600 @@ -112,7 +112,7 @@ typedef void (*pvr2_subdev_update_func)( struct v4l2_subdev *); static const pvr2_subdev_update_func pvr2_module_update_functions[] = { - [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_update, + [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_subdev_update, [PVR2_CLIENT_ID_SAA7115] = pvr2_saa7115_subdev_update, }; diff -r 57689da88630 -r 0be6426f3a16 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.cFri Mar 06 21:48:09 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.cFri Mar 06 21:49:19 2009 -0600 @@ -161,7 +161,7 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hd } -void pvr2_wm8775_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) +void pvr2_wm8775_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { if (hdw->input_dirty) { struct v4l2_routing route; diff -r 57689da88630 -r 0be6426f3a16 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.hFri Mar 06 21:48:09 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.hFri Mar 06 21:49:19 2009 -0600 @@ -39,7 +39,7 @@ int pvr2_i2c_wm8775_setup(struct pvr2_hd int pvr2_i2c_wm8775_setup(struct pvr2_hdw *,struct pvr2_i2c_client *); #include "pvrusb2-hdw-internal.h" -void pvr2_wm8775_update(struct pvr2_hdw *, struct v4l2_subdev *sd); +void pvr2_wm8775_subdev_update(struct pvr2_hdw *, struct v4l2_subdev *sd); #endif /* __PVRUSB2_WM8775_H */ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/0be6426f3a1679caa7cf16c2aac918cb8845f4b3 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Make audio sample rate update into a sub-device broadcast
The patch number 11178 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Make audio sample rate update into a sub-device broadcast The pvrusb2 driver had previously been using i2c module specific calls to set the sample rate (a long long time ago this was needed). These days it is safe to use a broadcast so let's just broadcast this when communicating audio sample rate to sub-devices. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 20 ++ linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 18 - 2 files changed, 20 insertions(+), 18 deletions(-) diff -r b8f02a5af262 -r 57689da88630 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:43:26 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:48:09 2009 -0600 @@ -3007,6 +3007,26 @@ static void pvr2_subdev_update(struct pv v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_fmt, &fmt); } + if (hdw->srate_dirty) { + u32 val; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_audio %d", + hdw->srate_val); + switch (hdw->srate_val) { + default: + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000: + val = 48000; + break; + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100: + val = 44100; + break; + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000: + val = 32000; + break; + } + v4l2_device_call_all(&hdw->v4l2_dev, 0, +audio, s_clock_freq, val); + } + /* Unable to set crop parameters; there is apparently no equivalent for VIDIOC_S_CROP */ diff -r b8f02a5af262 -r 57689da88630 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:43:26 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:48:09 2009 -0600 @@ -250,24 +250,6 @@ int pvr2_i2c_decoder_v4l_setup(struct pv void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { - if (hdw->srate_dirty) { - u32 val; - pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_audio %d", - hdw->srate_val); - switch (hdw->srate_val) { - default: - case V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000: - val = 48000; - break; - case V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100: - val = 44100; - break; - case V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000: - val = 32000; - break; - } - sd->ops->audio->s_clock_freq(sd, val); - } if (hdw->input_dirty) { struct v4l2_routing route; const struct routing_scheme *sp; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/57689da88630e7ea7cce87181666df3880c1f7e9 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in msp3400 sub-device support
The patch number 11180 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in msp3400 sub-device support Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | 83 +- linux/drivers/media/video/pvrusb2/pvrusb2-audio.h |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 3 files changed, 59 insertions(+), 28 deletions(-) diff -r 0be6426f3a16 -r 753f22400070 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 21:49:19 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 21:52:06 2009 -0600 @@ -28,6 +28,35 @@ #include "compat.h" +struct routing_scheme { + const int *def; + unsigned int cnt; +}; + +static const int routing_scheme0[] = { + [PVR2_CVAL_INPUT_TV]= MSP_INPUT_DEFAULT, + [PVR2_CVAL_INPUT_RADIO] = MSP_INPUT(MSP_IN_SCART2, + MSP_IN_TUNER1, + MSP_DSP_IN_SCART, + MSP_DSP_IN_SCART), + [PVR2_CVAL_INPUT_COMPOSITE] = MSP_INPUT(MSP_IN_SCART1, + MSP_IN_TUNER1, + MSP_DSP_IN_SCART, + MSP_DSP_IN_SCART), + [PVR2_CVAL_INPUT_SVIDEO]= MSP_INPUT(MSP_IN_SCART1, + MSP_IN_TUNER1, + MSP_DSP_IN_SCART, + MSP_DSP_IN_SCART), +}; + +static const struct routing_scheme routing_schemes[] = { + [PVR2_ROUTING_SCHEME_HAUPPAUGE] = { + .def = routing_scheme0, + .cnt = ARRAY_SIZE(routing_scheme0), + }, +}; + + struct pvr2_msp3400_handler { struct pvr2_hdw *hdw; struct pvr2_i2c_client *client; @@ -37,33 +66,6 @@ struct pvr2_msp3400_handler { -struct routing_scheme { - const int *def; - unsigned int cnt; -}; - -static const int routing_scheme0[] = { - [PVR2_CVAL_INPUT_TV]= MSP_INPUT_DEFAULT, - [PVR2_CVAL_INPUT_RADIO] = MSP_INPUT(MSP_IN_SCART2, - MSP_IN_TUNER1, - MSP_DSP_IN_SCART, - MSP_DSP_IN_SCART), - [PVR2_CVAL_INPUT_COMPOSITE] = MSP_INPUT(MSP_IN_SCART1, - MSP_IN_TUNER1, - MSP_DSP_IN_SCART, - MSP_DSP_IN_SCART), - [PVR2_CVAL_INPUT_SVIDEO]= MSP_INPUT(MSP_IN_SCART1, - MSP_IN_TUNER1, - MSP_DSP_IN_SCART, - MSP_DSP_IN_SCART), -}; - -static const struct routing_scheme routing_schemes[] = { - [PVR2_ROUTING_SCHEME_HAUPPAUGE] = { - .def = routing_scheme0, - .cnt = ARRAY_SIZE(routing_scheme0), - }, -}; /* This function selects the correct audio input source */ static void set_stereo(struct pvr2_msp3400_handler *ctxt) @@ -181,7 +183,32 @@ int pvr2_i2c_msp3400_setup(struct pvr2_h return !0; } - +void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) +{ + if (hdw->input_dirty) { + struct v4l2_routing route; + const struct routing_scheme *sp; + unsigned int sid = hdw->hdw_desc->signal_routing_scheme; + + pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); + + if ((sid < ARRAY_SIZE(routing_schemes)) && + ((sp = routing_schemes + sid) != NULL) && + (hdw->input_val >= 0) && + (hdw->input_val < sp->cnt)) { + route.input = sp->def[hdw->input_val]; + } else { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "*** WARNING *** subdev msp3400 set_input:" + " Invalid routing scheme (%u)" + " and/or input (%d)", + sid, hdw->input_val); + return; + } + route.output = MSP_OUTPUT(MSP_SC_IN_DSP_SCART1); + sd->ops->audio->s_routing(sd, &route); + } +} /* Stuff for Emacs to see, in ord
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix silly 80 column issue
The patch number 11181 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix silly 80 column issue Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -r 753f22400070 -r 53dc8296fa04 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:52:06 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:52:42 2009 -0600 @@ -264,7 +264,8 @@ void pvr2_saa7115_subdev_update(struct p } else { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "*** WARNING *** subdev v4l2 set_input:" - " Invalid routing scheme (%u) and/or input (%d)", + " Invalid routing scheme (%u)" + " and/or input (%d)", sid, hdw->input_val); return; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/53dc8296fa0442d1ddfed20eca427248c7b4b6c6 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in cx25840 sub-device support
The patch number 11182 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in cx25840 sub-device support Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 160 ++ linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.h |5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 3 files changed, 105 insertions(+), 62 deletions(-) diff -r 53dc8296fa04 -r efcfeb42898f linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 21:52:42 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 21:54:02 2009 -0600 @@ -40,6 +40,69 @@ #include #include "compat.h" + +struct routing_scheme_item { + int vid; + int aud; +}; + +struct routing_scheme { + const struct routing_scheme_item *def; + unsigned int cnt; +}; + +static const struct routing_scheme_item routing_scheme0[] = { + [PVR2_CVAL_INPUT_TV] = { + .vid = CX25840_COMPOSITE7, + .aud = CX25840_AUDIO8, + }, + [PVR2_CVAL_INPUT_RADIO] = { /* Treat the same as composite */ + .vid = CX25840_COMPOSITE3, + .aud = CX25840_AUDIO_SERIAL, + }, + [PVR2_CVAL_INPUT_COMPOSITE] = { + .vid = CX25840_COMPOSITE3, + .aud = CX25840_AUDIO_SERIAL, + }, + [PVR2_CVAL_INPUT_SVIDEO] = { + .vid = CX25840_SVIDEO1, + .aud = CX25840_AUDIO_SERIAL, + }, +}; + +/* Specific to gotview device */ +static const struct routing_scheme_item routing_schemegv[] = { + [PVR2_CVAL_INPUT_TV] = { + .vid = CX25840_COMPOSITE2, + .aud = CX25840_AUDIO5, + }, + [PVR2_CVAL_INPUT_RADIO] = { + /* line-in is used for radio and composite. A GPIO is + used to switch between the two choices. */ + .vid = CX25840_COMPOSITE1, + .aud = CX25840_AUDIO_SERIAL, + }, + [PVR2_CVAL_INPUT_COMPOSITE] = { + .vid = CX25840_COMPOSITE1, + .aud = CX25840_AUDIO_SERIAL, + }, + [PVR2_CVAL_INPUT_SVIDEO] = { + .vid = (CX25840_SVIDEO_LUMA3|CX25840_SVIDEO_CHROMA4), + .aud = CX25840_AUDIO_SERIAL, + }, +}; + +static const struct routing_scheme routing_schemes[] = { + [PVR2_ROUTING_SCHEME_HAUPPAUGE] = { + .def = routing_scheme0, + .cnt = ARRAY_SIZE(routing_scheme0), + }, + [PVR2_ROUTING_SCHEME_GOTVIEW] = { + .def = routing_schemegv, + .cnt = ARRAY_SIZE(routing_schemegv), + }, +}; + struct pvr2_v4l_cx2584x { struct pvr2_i2c_handler handler; struct pvr2_decoder_ctrl ctrl; @@ -48,68 +111,6 @@ struct pvr2_v4l_cx2584x { unsigned long stale_mask; }; - -struct routing_scheme_item { - int vid; - int aud; -}; - -struct routing_scheme { - const struct routing_scheme_item *def; - unsigned int cnt; -}; - -static const struct routing_scheme_item routing_scheme0[] = { - [PVR2_CVAL_INPUT_TV] = { - .vid = CX25840_COMPOSITE7, - .aud = CX25840_AUDIO8, - }, - [PVR2_CVAL_INPUT_RADIO] = { /* Treat the same as composite */ - .vid = CX25840_COMPOSITE3, - .aud = CX25840_AUDIO_SERIAL, - }, - [PVR2_CVAL_INPUT_COMPOSITE] = { - .vid = CX25840_COMPOSITE3, - .aud = CX25840_AUDIO_SERIAL, - }, - [PVR2_CVAL_INPUT_SVIDEO] = { - .vid = CX25840_SVIDEO1, - .aud = CX25840_AUDIO_SERIAL, - }, -}; - -/* Specific to gotview device */ -static const struct routing_scheme_item routing_schemegv[] = { - [PVR2_CVAL_INPUT_TV] = { - .vid = CX25840_COMPOSITE2, - .aud = CX25840_AUDIO5, - }, - [PVR2_CVAL_INPUT_RADIO] = { - /* line-in is used for radio and composite. A GPIO is - used to switch between the two choices. */ - .vid = CX25840_COMPOSITE1, - .aud = CX25840_AUDIO_SERIAL, - }, - [PVR2_CVAL_INPUT_COMPOSITE] = { - .vid = CX25840_COMPOSITE1, - .aud = CX25840_AUDIO_SERIAL, - }, - [PVR2_CVAL_INPUT_SVIDEO] = { - .vid = (CX25840_SVIDEO_LUMA3|CX25840_SVIDEO_CHROMA4), - .aud = CX25840_AUDIO_SERIAL, - }, -}; - -static const struct routing_scheme routing_schemes[] = { - [PVR2_ROUTING_SCHEME_HAUPPAU
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement more sub-device loading trace and improve error handling
The patch number 11183 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement more sub-device loading trace and improve error handling Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 26 ++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff -r efcfeb42898f -r 62748dee447c linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:54:02 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:56:52 2009 -0600 @@ -2026,6 +2026,10 @@ static int pvr2_hdw_load_subdev(struct p hdw->hdw_desc->description); return -EINVAL; } + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u (%s) for device %s being loaded...", + mid, fname, + hdw->hdw_desc->description); i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, cd->i2c_address_list, ARRAY_SIZE(i2caddr)); @@ -2034,6 +2038,12 @@ static int pvr2_hdw_load_subdev(struct p /* Second chance: Try default i2c address list */ i2ccnt = pvr2_copy_i2c_addr_list(i2caddr, p, ARRAY_SIZE(i2caddr)); + if (i2ccnt) { + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u:" + " Using default i2c address list", + mid); + } } if (!i2ccnt) { @@ -2052,10 +2062,18 @@ static int pvr2_hdw_load_subdev(struct p * "chipid" appears to just be the module name again. So here we * just do the same thing. */ if (i2ccnt == 1) { + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u:" + " Setting up with specified i2c address 0x%x", + mid, i2caddr[0]); sd = v4l2_i2c_new_subdev(&hdw->i2c_adap, fname, fname, i2caddr[0]); } else { + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u:" + " Setting up with address probe list", + mid); sd = v4l2_i2c_new_probed_subdev(&hdw->i2c_adap, fname, fname, i2caddr); @@ -2078,7 +2096,7 @@ static int pvr2_hdw_load_subdev(struct p aid, in normal situations there's no reason for both mechanisms to be enabled. */ pvr2_i2c_untrack_subdev(hdw, sd); - pvr2_trace(PVR2_TRACE_INIT, "Attached sub-driver %s", fname); + pvr2_trace(PVR2_TRACE_INFO, "Attached sub-driver %s", fname); /* client-specific setup... */ @@ -2098,6 +2116,10 @@ static int pvr2_hdw_load_subdev(struct p up. */ struct v4l2_format fmt; + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u:" + " Executing cx25840 VBI hack", + mid); memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; v4l2_device_call_all(&hdw->v4l2_dev, mid, @@ -2128,7 +2150,7 @@ static void pvr2_hdw_load_modules(struct ct = &hdw->hdw_desc->client_table; for (idx = 0; idx < ct->cnt; idx++) { - if (!pvr2_hdw_load_subdev(hdw, &ct->lst[idx])) okFl = 0; + if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0; } if (!okFl) pvr2_hdw_render_useless(hdw); } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/62748dee447c3cb392b50f3e6f4e13b6518a0270 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Tie in saa7115 sub-device handling
The patch number 11177 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Tie in saa7115 sub-device handling Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 64 -- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h |2 3 files changed, 58 insertions(+), 10 deletions(-) diff -r 18f1c12b2a6f -r b8f02a5af262 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:39:34 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:43:26 2009 -0600 @@ -37,6 +37,7 @@ #include "pvrusb2-debug.h" #include "pvrusb2-fx2-cmd.h" #include "pvrusb2-wm8775.h" +#include "pvrusb2-video-v4l.h" #include "compat.h" #define TV_MIN_FREQ 5525L @@ -112,6 +113,7 @@ typedef void (*pvr2_subdev_update_func)( static const pvr2_subdev_update_func pvr2_module_update_functions[] = { [PVR2_CLIENT_ID_WM8775] = pvr2_wm8775_update, + [PVR2_CLIENT_ID_SAA7115] = pvr2_saa7115_subdev_update, }; static const char *module_names[] = { diff -r 18f1c12b2a6f -r b8f02a5af262 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:39:34 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Fri Mar 06 21:43:26 2009 -0600 @@ -28,8 +28,9 @@ */ #include "pvrusb2-video-v4l.h" + + #include "pvrusb2-i2c-cmd-v4l2.h" - #include "pvrusb2-hdw-internal.h" #include "pvrusb2-debug.h" @@ -40,15 +41,6 @@ #include #include "compat.h" -struct pvr2_v4l_decoder { - struct pvr2_i2c_handler handler; - struct pvr2_decoder_ctrl ctrl; - struct pvr2_i2c_client *client; - struct pvr2_hdw *hdw; - unsigned long stale_mask; -}; - - struct routing_scheme { const int *def; unsigned int cnt; @@ -70,6 +62,16 @@ static const struct routing_scheme routi .cnt = ARRAY_SIZE(routing_scheme0), }, }; + +struct pvr2_v4l_decoder { + struct pvr2_i2c_handler handler; + struct pvr2_decoder_ctrl ctrl; + struct pvr2_i2c_client *client; + struct pvr2_hdw *hdw; + unsigned long stale_mask; +}; + + static void set_input(struct pvr2_v4l_decoder *ctxt) { @@ -246,6 +248,48 @@ int pvr2_i2c_decoder_v4l_setup(struct pv } +void pvr2_saa7115_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) +{ + if (hdw->srate_dirty) { + u32 val; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_audio %d", + hdw->srate_val); + switch (hdw->srate_val) { + default: + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_48000: + val = 48000; + break; + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100: + val = 44100; + break; + case V4L2_MPEG_AUDIO_SAMPLING_FREQ_32000: + val = 32000; + break; + } + sd->ops->audio->s_clock_freq(sd, val); + } + if (hdw->input_dirty) { + struct v4l2_routing route; + const struct routing_scheme *sp; + unsigned int sid = hdw->hdw_desc->signal_routing_scheme; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", + hdw->input_val); + if ((sid < ARRAY_SIZE(routing_schemes)) && + ((sp = routing_schemes + sid) != NULL) && + (hdw->input_val >= 0) && + (hdw->input_val < sp->cnt)) { + route.input = sp->def[hdw->input_val]; + } else { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "*** WARNING *** subdev v4l2 set_input:" + " Invalid routing scheme (%u) and/or input (%d)", + sid, hdw->input_val); + return; + } + route.output = 0; + sd->ops->video->s_routing(sd, &route); + } +} /* diff -r 18f1c12b2a6f -r b8f02a5af262 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h Fri Mar 06 21:39:34 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h Fri Mar 06 21:43:26 2009 -0600 @@ -37,6 +37,8 @@ int pvr2_i2c_decoder_v4l_setup(struct pvr2_hd
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix bugs involved in listing of sub-devices
The patch number 11186 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix bugs involved in listing of sub-devices Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 16 +++- 1 file changed, 11 insertions(+), 5 deletions(-) diff -r 97778905664c -r 57e3ff4fde01 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:37:58 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:39:40 2009 -0600 @@ -4951,7 +4951,7 @@ static unsigned int pvr2_hdw_report_unlo unsigned int id; ccnt = scnprintf(buf, acnt, -"Associted v4l2_subdev drivers:"); +"Associated v4l2_subdev drivers:"); tcnt += ccnt; v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { id = sd->grp_id; @@ -4959,10 +4959,16 @@ static unsigned int pvr2_hdw_report_unlo if (id < ARRAY_SIZE(module_names)) { p = module_names[id]; } - if (!p) p = "(unknown)"; - ccnt = scnprintf(buf + tcnt, -acnt - tcnt, -" %s (%u)", p, id); + if (p) { + ccnt = scnprintf(buf + tcnt, +acnt - tcnt, +" %s", p); + } else { + ccnt = scnprintf(buf + tcnt, +acnt - tcnt, +" (unknown id=%u)", id); + } + tcnt += ccnt; } return tcnt; } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/57e3ff4fde01bb2a12939a9dd99c40619aaa5f85 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Define default i2c address for wm8775 sub-device
The patch number 11184 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Define default i2c address for wm8775 sub-device Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r 62748dee447c -r 1304877bfdf3 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:56:52 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:57:42 2009 -0600 @@ -132,6 +132,7 @@ static const char *module_names[] = { static const unsigned char *module_i2c_addresses[] = { [PVR2_CLIENT_ID_TUNER] = "\x60\x61\x62\x63", + [PVR2_CLIENT_ID_WM8775] = "\x1b", }; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/1304877bfdf384db3f53f1c3c4e466a45687a18c ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Sub-device update must happen BEFORE state dirty bits are cleared
The patch number 11188 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Sub-device update must happen BEFORE state dirty bits are cleared The sub-device update mechanism relies on various "dirty" bits in the driver in order to know what pieces of state need to be propagated out to the various sub-devices. But that won't work if the dirty bits are cleared before the update gets a chance to run. This change ensures that the update takes place before the dirty bits are cleared. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff -r f7765d9c15f2 -r 087ab33c5a72 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:42:40 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:45:10 2009 -0600 @@ -3262,14 +3262,14 @@ static int pvr2_hdw_commit_execute(struc } } + /* Check and update state for all sub-devices. */ + pvr2_subdev_update(hdw); + for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; if (!cptr->info->clear_dirty) continue; cptr->info->clear_dirty(cptr); } - - /* Check and update state for all sub-devices. */ - pvr2_subdev_update(hdw); /* Now execute i2c core update */ pvr2_i2c_core_sync(hdw); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/087ab33c5a72ad5514a2a842ab0f7e4ced176b8e ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Broadcast tuner type change to sub-devices
The patch number 11190 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Broadcast tuner type change to sub-devices The tuner sub-device isn't going to work very well unless we tell it the correct tuner type to use... Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 +++- 1 file changed, 17 insertions(+), 1 deletion(-) diff -r d4c15f52 -r 001117c9acd7 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:46:17 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:48:42 2009 -0600 @@ -24,6 +24,7 @@ #include #include #include +#include #include "pvrusb2.h" #include "pvrusb2-std.h" #include "pvrusb2-util.h" @@ -2278,7 +2279,6 @@ static void pvr2_hdw_setup_low(struct pv } pvr2_i2c_core_check_stale(hdw); - hdw->tuner_updated = 0; if (!pvr2_hdw_dev_ok(hdw)) return; @@ -2968,6 +2968,21 @@ static void pvr2_subdev_update(struct pv unsigned int id; pvr2_subdev_update_func fp; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev update..."); + + if (hdw->tuner_updated) { + struct tuner_setup setup; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)", + hdw->tuner_type); + if (((int)(hdw->tuner_type)) >= 0) { + setup.addr = ADDR_UNSET; + setup.type = hdw->tuner_type; + setup.mode_mask = T_RADIO | T_ANALOG_TV; + v4l2_device_call_all(&hdw->v4l2_dev, 0, +tuner, s_type_addr, &setup); + } + } + if (hdw->input_dirty || hdw->std_dirty) { pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_standard"); if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { @@ -3265,6 +3280,7 @@ static int pvr2_hdw_commit_execute(struc /* Check and update state for all sub-devices. */ pvr2_subdev_update(hdw); + hdw->tuner_updated = 0; for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; if (!cptr->info->clear_dirty) continue; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/001117c9acd7c7f7f63f251306e8c83ef8b88e0d ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix uninitialized counter
The patch number 11185 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix uninitialized counter Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 1304877bfdf3 -r 97778905664c linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 21:57:42 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:37:58 2009 -0600 @@ -1996,7 +1996,7 @@ static unsigned int pvr2_copy_i2c_addr_l unsigned short *dst, const unsigned char *src, unsigned int dst_max) { - unsigned int cnt; + unsigned int cnt = 0; if (!src) return 0; while (src[cnt] && (cnt + 1) < dst_max) { dst[cnt] = src[cnt]; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/97778905664c12234f948be53b170a932af9ac8d ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Define default I2C address for cx25840 sub-device
The patch number 11191 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Define default I2C address for cx25840 sub-device Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r 001117c9acd7 -r db30f9fc8e13 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:48:42 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:49:37 2009 -0600 @@ -134,6 +134,7 @@ static const unsigned char *module_i2c_a static const unsigned char *module_i2c_addresses[] = { [PVR2_CLIENT_ID_TUNER] = "\x60\x61\x62\x63", [PVR2_CLIENT_ID_WM8775] = "\x1b", + [PVR2_CLIENT_ID_CX25840] = "\x44", }; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/db30f9fc8e137ffa253239357391055d2d3651f8 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Allow sub-devices to insert correctly
The patch number 11187 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Allow sub-devices to insert correctly A sub-device won't successfully attach to our I2C adapter if its class isn't set to zero. Right the class is still set to I2C_CLASS_TV_ANALOG in order to allow the old mechanism to still work. This change temporarily sets the class to zero during the interval when the sub-device attaches. This code will get removed when the old i2c layer is finally removed from the driver. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r 57e3ff4fde01 -r f7765d9c15f2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:39:40 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:42:40 2009 -0600 @@ -2062,6 +2062,7 @@ static int pvr2_hdw_load_subdev(struct p * and every other place where I can find examples of this, the * "chipid" appears to just be the module name again. So here we * just do the same thing. */ + hdw->i2c_adap.class = 0; if (i2ccnt == 1) { pvr2_trace(PVR2_TRACE_INIT, "Module ID %u:" @@ -2079,6 +2080,7 @@ static int pvr2_hdw_load_subdev(struct p fname, fname, i2caddr); } + hdw->i2c_adap.class = I2C_CLASS_TV_ANALOG; if (!sd) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/f7765d9c15f23d6edff2500fc02ee2586e6f5c1a ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement trace print for stream on / off action
The patch number 11192 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement trace print for stream on / off action Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r db30f9fc8e13 -r d33a84e8b029 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:49:37 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:50:48 2009 -0600 @@ -1691,6 +1691,8 @@ static int pvr2_decoder_enable(struct pv this point, we'll broadcast stream on/off to all sub-devices anyway, just in case somebody else wants to hear the command... */ + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 stream=%s", + (enablefl ? "on" : "off")); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_stream, enablefl); if (hdw->decoder_client_id) { /* We get here if the encoder has been noticed. Otherwise --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d33a84e8b0295780046d24e4bd8feb2e04d67991 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Deal with space-after-comma coding style idiocy
The patch number 11189 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Deal with space-after-comma coding style idiocy Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 087ab33c5a72 -r d4c15f52 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:45:10 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:46:17 2009 -0600 @@ -2969,7 +2969,7 @@ static void pvr2_subdev_update(struct pv pvr2_subdev_update_func fp; if (hdw->input_dirty || hdw->std_dirty) { - pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_standard"); + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_standard"); if (hdw->input_val == PVR2_CVAL_INPUT_RADIO) { v4l2_device_call_all(&hdw->v4l2_dev, 0, tuner, s_radio); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d4c15f529f564a773c58cc588115d70b099f ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Correct some trace print inaccuracies
The patch number 11193 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Correct some trace print inaccuracies Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff -r d33a84e8b029 -r ba9b834bd2f7 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 22:50:48 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 22:51:54 2009 -0600 @@ -325,6 +325,7 @@ int pvr2_i2c_cx2584x_v4l_setup(struct pv void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { + pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x update..."); if (hdw->input_dirty) { struct v4l2_routing route; enum cx25840_video_input vid_input; @@ -350,7 +351,7 @@ void pvr2_cx25840_subdev_update(struct p } pvr2_trace(PVR2_TRACE_CHIPS, - "i2c cx2584x set_input vid=0x%x aud=0x%x", + "subdev cx2584x set_input vid=0x%x aud=0x%x", vid_input, aud_input); route.input = (u32)vid_input; sd->ops->video->s_routing(sd, &route); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ba9b834bd2f756ddee2868204dcc3ae9b4fe2e7c ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Issue required core init broadcast to all sub-devices
The patch number 11195 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Issue required core init broadcast to all sub-devices The v4l2-subdev infrastructure requires that an initialization call must be issued to all attached sub-devices before normal operation can start. This change satisfies that requirement. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r 1e31106c5136 -r 266803ac7ee8 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:57:25 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:59:34 2009 -0600 @@ -2225,6 +2225,8 @@ static void pvr2_hdw_setup_low(struct pv pvr2_hdw_load_modules(hdw); if (!pvr2_hdw_dev_ok(hdw)) return; + v4l2_device_call_all(&hdw->v4l2_dev, 0, core, init, 0); + for (idx = 0; idx < CTRLDEF_COUNT; idx++) { cptr = hdw->controls + idx; if (cptr->info->skip_init) continue; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/266803ac7ee8c65b7d5e507eca40cabbb5c67a77 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix incorrectly named sub-device ID
The patch number 11197 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix incorrectly named sub-device ID Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |2 +- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff -r 898e3d167aa9 -r ad36b57452cb linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 23:00:21 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 23:02:32 2009 -0600 @@ -38,7 +38,7 @@ #define PVR2_CLIENT_ID_CX25840 2 #define PVR2_CLIENT_ID_SAA7115 3 #define PVR2_CLIENT_ID_TUNER 4 -#define PVR2_CLIENT_ID_CS53132A 5 +#define PVR2_CLIENT_ID_CS53L32A 5 #define PVR2_CLIENT_ID_WM8775 6 struct pvr2_device_client_desc { diff -r 898e3d167aa9 -r ad36b57452cb linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:00:21 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:02:32 2009 -0600 @@ -126,7 +126,7 @@ static const char *module_names[] = { [PVR2_CLIENT_ID_CX25840] = "cx25840", [PVR2_CLIENT_ID_SAA7115] = "saa7115", [PVR2_CLIENT_ID_TUNER] = "tuner", - [PVR2_CLIENT_ID_CS53132A] = "cs53132a", + [PVR2_CLIENT_ID_CS53L32A] = "cs53l32a", [PVR2_CLIENT_ID_WM8775] = "wm8775", }; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ad36b57452cb0f89d1d0bf38bf82facdf78d72b6 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement mechanism to force a full sub-device update
The patch number 11194 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement mechanism to force a full sub-device update When a pvrusb2 driver instance first initializes, we need to be sure to send out a complete state update for everything to all attached modules. The old i2c layer did this by keeping a separate mask of "stale" bits for each attached module - and setting that mask to all stale when that module attaches. But the new sub-device adaptation I've implemented here no longer has per-module stale bits. So instead there's now a global "force dirty" bit that is set upon instance initialization, before the sub-devices are attached. After the first update, this bit is cleared, allowing for normal update-on-dirty behavior. In this manner, we ensure that all sub-devices have been properly synchronized at initialization. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c|2 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 21 +- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c|2 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c |2 6 files changed, 17 insertions(+), 13 deletions(-) diff -r ba9b834bd2f7 -r 1e31106c5136 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 22:51:54 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Fri Mar 06 22:57:25 2009 -0600 @@ -185,7 +185,7 @@ int pvr2_i2c_msp3400_setup(struct pvr2_h void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { - if (hdw->input_dirty) { + if (hdw->input_dirty || hdw->force_dirty) { struct v4l2_routing route; const struct routing_scheme *sp; unsigned int sid = hdw->hdw_desc->signal_routing_scheme; diff -r ba9b834bd2f7 -r 1e31106c5136 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 22:51:54 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Fri Mar 06 22:57:25 2009 -0600 @@ -326,7 +326,7 @@ void pvr2_cx25840_subdev_update(struct p void pvr2_cx25840_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) { pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x update..."); - if (hdw->input_dirty) { + if (hdw->input_dirty || hdw->force_dirty) { struct v4l2_routing route; enum cx25840_video_input vid_input; enum cx25840_audio_input aud_input; diff -r ba9b834bd2f7 -r 1e31106c5136 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 22:51:54 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Fri Mar 06 22:57:25 2009 -0600 @@ -288,6 +288,7 @@ struct pvr2_hdw { wait_queue_head_t state_wait_data; + int force_dirty;/* consider all controls dirty if true */ int flag_ok;/* device in known good state */ int flag_disconnected; /* flag_ok == 0 due to disconnect */ int flag_init_ok; /* true if structure is fully initialized */ diff -r ba9b834bd2f7 -r 1e31106c5136 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:51:54 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:57:25 2009 -0600 @@ -2202,6 +2202,8 @@ static void pvr2_hdw_setup_low(struct pv if (!pvr2_hdw_dev_ok(hdw)) return; + hdw->force_dirty = !0; + if (!hdw->hdw_desc->flag_no_powerup) { pvr2_hdw_cmd_powerup(hdw); if (!pvr2_hdw_dev_ok(hdw)) return; @@ -2959,7 +2961,7 @@ static void pvr2_subdev_set_control(stru } #define PVR2_SUBDEV_SET_CONTROL(hdw, id, lab) \ - if ((hdw)->lab##_dirty) { \ + if ((hdw)->lab##_dirty || (hdw)->force_dirty) { \ pvr2_subdev_set_control(hdw, id, #lab, (hdw)->lab##_val); \ } @@ -2973,7 +2975,7 @@ static void pvr2_subdev_update(struct pv pvr2_trace(PVR2_TRACE_CHIPS, "subdev update..."); - if (hdw->tuner_updated) { + if (hdw->tuner_updated || hdw->force_dirty) { struct tuner_setup setup; pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)", hdw->tuner_type);
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Define default I2C address for CS53L32A sub-device
The patch number 11198 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Define default I2C address for CS53L32A sub-device Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r ad36b57452cb -r 3ff4e6b66df1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:02:32 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:03:28 2009 -0600 @@ -137,6 +137,7 @@ static const unsigned char *module_i2c_a [PVR2_CLIENT_ID_SAA7115] = "\x21", [PVR2_CLIENT_ID_WM8775] = "\x1b", [PVR2_CLIENT_ID_CX25840] = "\x44", + [PVR2_CLIENT_ID_CS53L32A] = "\x11", }; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/3ff4e6b66df1e5b6dd7af01525d9881f6a7d6f91 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Convert all device definitions to use new sub-device declarations
The patch number 11199 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Convert all device definitions to use new sub-device declarations Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c | 86 +--- 1 file changed, 41 insertions(+), 45 deletions(-) diff -r 3ff4e6b66df1 -r 65167e9b32b6 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Fri Mar 06 23:03:28 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Fri Mar 06 23:07:12 2009 -0600 @@ -46,10 +46,10 @@ pvr2_device_desc structures. /**/ /* Hauppauge PVR-USB2 Model 29xxx */ -static const char *pvr2_client_29xxx[] = { - "msp3400", - "saa7115", - "tuner", +static const struct pvr2_device_client_desc pvr2_cli_29xxx[] = { + { .module_id = PVR2_CLIENT_ID_SAA7115 }, + { .module_id = PVR2_CLIENT_ID_MSP3400 }, + { .module_id = PVR2_CLIENT_ID_TUNER }, }; static const char *pvr2_fw1_names_29xxx[] = { @@ -59,8 +59,8 @@ static const struct pvr2_device_desc pvr static const struct pvr2_device_desc pvr2_device_29xxx = { .description = "WinTV PVR USB2 Model Category 29xxx", .shortname = "29xxx", - .client_modules.lst = pvr2_client_29xxx, - .client_modules.cnt = ARRAY_SIZE(pvr2_client_29xxx), + .client_table.lst = pvr2_cli_29xxx, + .client_table.cnt = ARRAY_SIZE(pvr2_cli_29xxx), .fx2_firmware.lst = pvr2_fw1_names_29xxx, .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_29xxx), .flag_has_hauppauge_rom = !0, @@ -77,10 +77,10 @@ static const struct pvr2_device_desc pvr /**/ /* Hauppauge PVR-USB2 Model 24xxx */ -static const char *pvr2_client_24xxx[] = { - "cx25840", - "tuner", - "wm8775", +static const struct pvr2_device_client_desc pvr2_cli_24xxx[] = { + { .module_id = PVR2_CLIENT_ID_CX25840 }, + { .module_id = PVR2_CLIENT_ID_TUNER }, + { .module_id = PVR2_CLIENT_ID_WM8775 }, }; static const char *pvr2_fw1_names_24xxx[] = { @@ -90,8 +90,8 @@ static const struct pvr2_device_desc pvr static const struct pvr2_device_desc pvr2_device_24xxx = { .description = "WinTV PVR USB2 Model Category 24xxx", .shortname = "24xxx", - .client_modules.lst = pvr2_client_24xxx, - .client_modules.cnt = ARRAY_SIZE(pvr2_client_24xxx), + .client_table.lst = pvr2_cli_24xxx, + .client_table.cnt = ARRAY_SIZE(pvr2_cli_24xxx), .fx2_firmware.lst = pvr2_fw1_names_24xxx, .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_24xxx), .flag_has_cx25840 = !0, @@ -111,16 +111,16 @@ static const struct pvr2_device_desc pvr /**/ /* GOTVIEW USB2.0 DVD2 */ -static const char *pvr2_client_gotview_2[] = { - "cx25840", - "tuner", +static const struct pvr2_device_client_desc pvr2_cli_gotview_2[] = { + { .module_id = PVR2_CLIENT_ID_CX25840 }, + { .module_id = PVR2_CLIENT_ID_TUNER }, }; static const struct pvr2_device_desc pvr2_device_gotview_2 = { .description = "Gotview USB 2.0 DVD 2", .shortname = "gv2", - .client_modules.lst = pvr2_client_gotview_2, - .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2), + .client_table.lst = pvr2_cli_gotview_2, + .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2), .flag_has_cx25840 = !0, .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3, .flag_has_analogtuner = !0, @@ -140,8 +140,8 @@ static const struct pvr2_device_desc pvr static const struct pvr2_device_desc pvr2_device_gotview_2d = { .description = "Gotview USB 2.0 DVD Deluxe", .shortname = "gv2d", - .client_modules.lst = pvr2_client_gotview_2, - .client_modules.cnt = ARRAY_SIZE(pvr2_client_gotview_2), + .client_table.lst = pvr2_cli_gotview_2, + .client_table.cnt = ARRAY_SIZE(pvr2_cli_gotview_2), .flag_has_cx25840 = !0, .default_tuner_type = TUNER_PHILIPS_FM1216ME_MK3, .flag_has_analogtuner = !0, @@ -187,17 +187,17 @@ static struct pvr2_dvb_props pvr2_
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Make a bunch of dvb config structures const (trivial)
The patch number 11200 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Make a bunch of dvb config structures const (trivial) Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c | 10 +- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |2 +- linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c |2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff -r 65167e9b32b6 -r e5919ada4d49 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Fri Mar 06 23:07:12 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Fri Mar 06 23:08:58 2009 -0600 @@ -181,7 +181,7 @@ static int pvr2_lgh06xf_attach(struct pv return 0; } -static struct pvr2_dvb_props pvr2_onair_creator_fe_props = { +static const struct pvr2_dvb_props pvr2_onair_creator_fe_props = { .frontend_attach = pvr2_lgdt3303_attach, .tuner_attach= pvr2_lgh06xf_attach, }; @@ -241,7 +241,7 @@ static int pvr2_fcv1236d_attach(struct p return 0; } -static struct pvr2_dvb_props pvr2_onair_usb2_fe_props = { +static const struct pvr2_dvb_props pvr2_onair_usb2_fe_props = { .frontend_attach = pvr2_lgdt3302_attach, .tuner_attach= pvr2_fcv1236d_attach, }; @@ -314,7 +314,7 @@ static int pvr2_73xxx_tda18271_8295_atta return 0; } -static struct pvr2_dvb_props pvr2_73xxx_dvb_props = { +static const struct pvr2_dvb_props pvr2_73xxx_dvb_props = { .frontend_attach = pvr2_tda10048_attach, .tuner_attach= pvr2_73xxx_tda18271_8295_attach, }; @@ -419,12 +419,12 @@ static int pvr2_tda18271_8295_attach(str return 0; } -static struct pvr2_dvb_props pvr2_750xx_dvb_props = { +static const struct pvr2_dvb_props pvr2_750xx_dvb_props = { .frontend_attach = pvr2_s5h1409_attach, .tuner_attach= pvr2_tda18271_8295_attach, }; -static struct pvr2_dvb_props pvr2_751xx_dvb_props = { +static const struct pvr2_dvb_props pvr2_751xx_dvb_props = { .frontend_attach = pvr2_s5h1411_attach, .tuner_attach= pvr2_tda18271_8295_attach, }; diff -r 65167e9b32b6 -r e5919ada4d49 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 23:07:12 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri Mar 06 23:08:58 2009 -0600 @@ -103,7 +103,7 @@ struct pvr2_device_desc { #ifdef CONFIG_VIDEO_PVRUSB2_DVB /* callback functions to handle attachment of digital tuner & demod */ - struct pvr2_dvb_props *dvb_props; + const struct pvr2_dvb_props *dvb_props; #endif /* Initial standard bits to use for this device, if not zero. diff -r 65167e9b32b6 -r e5919ada4d49 linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c Fri Mar 06 23:07:12 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-dvb.c Fri Mar 06 23:08:58 2009 -0600 @@ -326,7 +326,7 @@ static int pvr2_dvb_frontend_init(struct static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) { struct pvr2_hdw *hdw = adap->channel.hdw; - struct pvr2_dvb_props *dvb_props = hdw->hdw_desc->dvb_props; + const struct pvr2_dvb_props *dvb_props = hdw->hdw_desc->dvb_props; int ret = 0; if (dvb_props == NULL) { --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/e5919ada4d49bb4506901951450b9c97269120ea ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix space-after-comma idiocy
The patch number 11201 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix space-after-comma idiocy Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r e5919ada4d49 -r db75ba1a3356 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:08:58 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:11:12 2009 -0600 @@ -3056,7 +3056,7 @@ static void pvr2_subdev_update(struct pv fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt.fmt.pix.width = hdw->res_hor_val; fmt.fmt.pix.height = hdw->res_ver_val; - pvr2_trace(PVR2_TRACE_CHIPS,"subdev v4l2 set_size(%dx%d)", + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_size(%dx%d)", fmt.fmt.pix.width, fmt.fmt.pix.height); v4l2_device_call_all(&hdw->v4l2_dev, 0, video, s_fmt, &fmt); } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/db75ba1a33569169aefbadc185e02c7b5252d24f ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Define default I2C addresses for msp3400 and saa7115 sub-devices
The patch number 11196 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Define default I2C addresses for msp3400 and saa7115 sub-devices Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r 266803ac7ee8 -r 898e3d167aa9 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 22:59:34 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Fri Mar 06 23:00:21 2009 -0600 @@ -133,6 +133,8 @@ static const char *module_names[] = { static const unsigned char *module_i2c_addresses[] = { [PVR2_CLIENT_ID_TUNER] = "\x60\x61\x62\x63", + [PVR2_CLIENT_ID_MSP3400] = "\x40", + [PVR2_CLIENT_ID_SAA7115] = "\x21", [PVR2_CLIENT_ID_WM8775] = "\x1b", [PVR2_CLIENT_ID_CX25840] = "\x44", }; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/898e3d167aa9a251dc3ebc3ef3c7e28277101ee5 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix slightly mis-leading header in debug interface output
The patch number 11202 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix slightly mis-leading header in debug interface output Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r db75ba1a3356 -r d03a2df07bfb linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c Fri Mar 06 23:11:12 2009 -0600 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c Sun Mar 08 16:22:48 2009 -0500 @@ -147,7 +147,7 @@ int pvr2_debugifc_print_info(struct pvr2 bcnt += ccnt; acnt -= ccnt; buf += ccnt; ccnt = pvr2_hdw_state_report(hdw,buf,acnt); bcnt += ccnt; acnt -= ccnt; buf += ccnt; - ccnt = scnprintf(buf,acnt,"Attached I2C modules:\n"); + ccnt = scnprintf(buf, acnt, "Attached old-style I2C modules:\n"); bcnt += ccnt; acnt -= ccnt; buf += ccnt; ccnt = pvr2_i2c_report(hdw,buf,acnt); bcnt += ccnt; acnt -= ccnt; buf += ccnt; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/d03a2df07bfb47bc2c569fff52d4b3bb12f18d41 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Implement better reporting on attached sub-devices
The patch number 11203 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Implement better reporting on attached sub-devices Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 119 +++- 1 file changed, 88 insertions(+), 31 deletions(-) diff -r d03a2df07bfb -r 984ba7d1cbc6 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Mar 08 16:22:48 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Mar 08 16:25:46 2009 -0500 @@ -4972,38 +4972,82 @@ static unsigned int pvr2_hdw_report_unlo stats.buffers_processed, stats.buffers_failed); } - case 6: { - struct v4l2_subdev *sd; - unsigned int tcnt = 0; - unsigned int ccnt; - const char *p; - unsigned int id; - ccnt = scnprintf(buf, -acnt, -"Associated v4l2_subdev drivers:"); + default: break; + } + return 0; +} + + +/* Generate report containing info about attached sub-devices and attached + i2c clients, including an indication of which attached i2c clients are + actually sub-devices. */ +static unsigned int pvr2_hdw_report_clients(struct pvr2_hdw *hdw, + char *buf, unsigned int acnt) +{ + struct v4l2_subdev *sd; + unsigned int tcnt = 0; + unsigned int ccnt; + struct i2c_client *client; + struct list_head *item; + void *cd; + const char *p; + unsigned int id; + + ccnt = scnprintf(buf, acnt, "Associated v4l2-subdev drivers:"); + tcnt += ccnt; + v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { + id = sd->grp_id; + p = NULL; + if (id < ARRAY_SIZE(module_names)) p = module_names[id]; + if (p) { + ccnt = scnprintf(buf + tcnt, acnt - tcnt, " %s", p); + tcnt += ccnt; + } else { + ccnt = scnprintf(buf + tcnt, acnt - tcnt, +" (unknown id=%u)", id); + tcnt += ccnt; + } + } + ccnt = scnprintf(buf + tcnt, acnt - tcnt, "\n"); + tcnt += ccnt; + + ccnt = scnprintf(buf + tcnt, acnt - tcnt, "I2C clients:\n"); + tcnt += ccnt; + + mutex_lock(&hdw->i2c_adap.clist_lock); + list_for_each(item, &hdw->i2c_adap.clients) { + client = list_entry(item, struct i2c_client, list); + ccnt = scnprintf(buf + tcnt, acnt - tcnt, +" %s: i2c=%02x", client->name, client->addr); tcnt += ccnt; + cd = i2c_get_clientdata(client); v4l2_device_for_each_subdev(sd, &hdw->v4l2_dev) { - id = sd->grp_id; - p = NULL; - if (id < ARRAY_SIZE(module_names)) { - p = module_names[id]; + if (cd == sd) { + id = sd->grp_id; + p = NULL; + if (id < ARRAY_SIZE(module_names)) { + p = module_names[id]; + } + if (p) { + ccnt = scnprintf(buf + tcnt, +acnt - tcnt, +" subdev=%s", p); + tcnt += ccnt; + } else { + ccnt = scnprintf(buf + tcnt, +acnt - tcnt, +" subdev= id %u)", +id); + tcnt += ccnt; + } + break; } - if (p) { - ccnt = scnprintf(buf + tcnt, -acnt - tcnt, -" %s", p); - } else { - ccnt = scnprintf(buf + tcnt, -acnt - tcnt, -
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove old i2c layer; we use v4l2-subdev now
The patch number 11204 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Remove old i2c layer; we use v4l2-subdev now This change removes the old i2c module controlling layer from the pvrusb2 driver. This is code that first had appeared in the driver back in December 2005. It's history. Now we use v4l2-subdev. Please note also that with this change, the driver will no longer be usable in kernels older that 2.6.22. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/Makefile |7 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | 127 -- linux/drivers/media/video/pvrusb2/pvrusb2-audio.h |4 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c| 221 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.h|5 linux/drivers/media/video/pvrusb2/pvrusb2-debugifc.c |5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h | 29 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c| 87 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-chips-v4l2.c | 119 -- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.c | 339 -- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-cmd-v4l2.h | 53 - linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |4 linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.c | 504 -- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-track.h | 102 -- linux/drivers/media/video/pvrusb2/pvrusb2-tuner.c | 122 -- linux/drivers/media/video/pvrusb2/pvrusb2-tuner.h | 37 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 186 --- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.h |5 linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.c | 124 -- linux/drivers/media/video/pvrusb2/pvrusb2-wm8775.h |3 20 files changed, 3 insertions(+), 2080 deletions(-) --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/9f6fe0d24d95db8fb09328927534cdf352f20ef8 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Remove ancient IVTV specific ioctl functions
The patch number 11205 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Remove ancient IVTV specific ioctl functions Remove ancient IVTV_IOC_G_CODEC and IVTV_IOC_S_CODEC ioctl functions from the pvrusb2 driver. These are very very old, were non-standard, and were only present to keep MythTV happy (their implementation did nothing except to report success). That was long ago; no recent versions of MythTV should require this anymore. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |4 1 file changed, 4 deletions(-) diff -r 9f6fe0d24d95 -r a691179f7248 linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sun Mar 08 16:47:47 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Sun Mar 08 17:14:07 2009 -0500 @@ -953,10 +953,6 @@ static long pvr2_v4l2_ioctl(struct file unsigned int cmd, unsigned long arg) { -/* Temporary hack : use ivtv api until a v4l2 one is available. */ -#define IVTV_IOC_G_CODEC0xFFEE7703 -#define IVTV_IOC_S_CODEC0xFFEE7704 - if (cmd == IVTV_IOC_G_CODEC || cmd == IVTV_IOC_S_CODEC) return 0; return video_usercopy(file, cmd, arg, pvr2_v4l2_do_ioctl); } --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/a691179f7248b7e690779da4afc19bbac36f8036 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Add sub-device for demod
The patch number 11206 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Add sub-device for demod Forgot to include the tda9887 component when moving to v4l2-subdev. I got fooled because its name is "tuner", the same as the tuner module. Silly me. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c |2 ++ linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |1 + linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 3 files changed, 5 insertions(+) diff -r a691179f7248 -r 646a8ef68865 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sun Mar 08 17:14:07 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sat Mar 14 12:09:04 2009 -0500 @@ -50,6 +50,7 @@ static const struct pvr2_device_client_d { .module_id = PVR2_CLIENT_ID_SAA7115 }, { .module_id = PVR2_CLIENT_ID_MSP3400 }, { .module_id = PVR2_CLIENT_ID_TUNER }, + { .module_id = PVR2_CLIENT_ID_DEMOD }, }; static const char *pvr2_fw1_names_29xxx[] = { @@ -81,6 +82,7 @@ static const struct pvr2_device_client_d { .module_id = PVR2_CLIENT_ID_CX25840 }, { .module_id = PVR2_CLIENT_ID_TUNER }, { .module_id = PVR2_CLIENT_ID_WM8775 }, + { .module_id = PVR2_CLIENT_ID_DEMOD }, }; static const char *pvr2_fw1_names_24xxx[] = { diff -r a691179f7248 -r 646a8ef68865 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Sun Mar 08 17:14:07 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Sat Mar 14 12:09:04 2009 -0500 @@ -40,6 +40,7 @@ #define PVR2_CLIENT_ID_TUNER 4 #define PVR2_CLIENT_ID_CS53L32A 5 #define PVR2_CLIENT_ID_WM8775 6 +#define PVR2_CLIENT_ID_DEMOD 7 struct pvr2_device_client_desc { /* One ovr PVR2_CLIENT_ID_ */ diff -r a691179f7248 -r 646a8ef68865 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Mar 08 17:14:07 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Mar 14 12:09:04 2009 -0500 @@ -124,6 +124,7 @@ static const char *module_names[] = { [PVR2_CLIENT_ID_CX25840] = "cx25840", [PVR2_CLIENT_ID_SAA7115] = "saa7115", [PVR2_CLIENT_ID_TUNER] = "tuner", + [PVR2_CLIENT_ID_DEMOD] = "tuner", [PVR2_CLIENT_ID_CS53L32A] = "cs53l32a", [PVR2_CLIENT_ID_WM8775] = "wm8775", }; @@ -131,6 +132,7 @@ static const char *module_names[] = { static const unsigned char *module_i2c_addresses[] = { [PVR2_CLIENT_ID_TUNER] = "\x60\x61\x62\x63", + [PVR2_CLIENT_ID_DEMOD] = "\x43", [PVR2_CLIENT_ID_MSP3400] = "\x40", [PVR2_CLIENT_ID_SAA7115] = "\x21", [PVR2_CLIENT_ID_WM8775] = "\x1b", --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/646a8ef68865359a631de6fb1a0218587ab78dee ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Add composite and s-video input support for OnAir devices
The patch number 11207 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Add composite and s-video input support for OnAir devices Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c | 96 ++ linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.h | 48 + linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c |4 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 11 + 6 files changed, 160 insertions(+), 2 deletions(-) diff -r 646a8ef68865 -r c5cbb3e57563 linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c Sun Mar 15 15:53:29 2009 -0500 @@ -0,0 +1,96 @@ +/* + * + * + * Copyright (C) 2005 Mike Isely + * Copyright (C) 2004 Aurelien Alleaume + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License + * + * 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +/* + + This source file is specifically designed to interface with the + v4l-dvb cs53l32a module. + +*/ + +#include "pvrusb2-cs53l32a.h" + + +#include "pvrusb2-hdw-internal.h" +#include "pvrusb2-debug.h" +#include +#include +#include +#include +#include "compat.h" + +struct routing_scheme { + const int *def; + unsigned int cnt; +}; + + +static const int routing_scheme1[] = { + [PVR2_CVAL_INPUT_TV] = 2, /* 1 or 2 seems to work here */ + [PVR2_CVAL_INPUT_RADIO] = 2, + [PVR2_CVAL_INPUT_COMPOSITE] = 0, + [PVR2_CVAL_INPUT_SVIDEO] = 0, +}; + +static const struct routing_scheme routing_schemes[] = { + [PVR2_ROUTING_SCHEME_ONAIR] = { + .def = routing_scheme1, + .cnt = ARRAY_SIZE(routing_scheme1), + }, +}; + + +void pvr2_cs53l32a_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) +{ + if (hdw->input_dirty || hdw->force_dirty) { + struct v4l2_routing route; + const struct routing_scheme *sp; + unsigned int sid = hdw->hdw_desc->signal_routing_scheme; + pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", + hdw->input_val); + if ((sid < ARRAY_SIZE(routing_schemes)) && + ((sp = routing_schemes + sid) != NULL) && + (hdw->input_val >= 0) && + (hdw->input_val < sp->cnt)) { + route.input = sp->def[hdw->input_val]; + } else { + pvr2_trace(PVR2_TRACE_ERROR_LEGS, + "*** WARNING *** subdev v4l2 set_input:" + " Invalid routing scheme (%u)" + " and/or input (%d)", + sid, hdw->input_val); + return; + } + route.output = 0; + sd->ops->audio->s_routing(sd, &route); + } +} + + +/* + Stuff for Emacs to see, in order to encourage consistent editing style: + *** Local Variables: *** + *** mode: c *** + *** fill-column: 70 *** + *** tab-width: 8 *** + *** c-basic-offset: 8 *** + *** End: *** + */ diff -r 646a8ef68865 -r c5cbb3e57563 linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.h --- /dev/null Thu Jan 01 00:00:00 1970 + +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.h Sun Mar 15 15:53:29 2009 -0500 @@ -0,0 +1,48 @@ +/* + * + * + * Copyright (C) 2005 Mike Isely + * Copyright (C) 2004 Aurelien Alleaume + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FIT
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Use v4l2_device_disconnect()
The patch number 11208 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Use v4l2_device_disconnect() Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff -r c5cbb3e57563 -r 627f6619d984 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Mar 15 15:53:29 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Tue Mar 24 22:30:45 2009 -0500 @@ -2694,10 +2694,7 @@ static void pvr2_hdw_remove_usb_stuff(st /* If we don't do this, then there will be a dangling struct device reference to our disappearing device persisting inside the V4L core... */ - if (hdw->v4l2_dev.dev) { - dev_set_drvdata(hdw->v4l2_dev.dev, NULL); - hdw->v4l2_dev.dev = NULL; - } + v4l2_device_disconnect(&hdw->v4l2_dev); hdw->usb_dev = NULL; hdw->usb_intf = NULL; pvr2_hdw_render_useless(hdw); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/627f6619d984c31a53ba16883dc7cfa40802632a ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix uninitialized tuner_setup field(s)
The patch number 11334 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix uninitialized tuner_setup field(s) Any time a struct (especially one not defined by this driver) is allocated, we MUST zero its underlying storage. This makes our usage of the struct predictable and robust against future changes where fields might be added that we don't know about. Failing to do this with tuner_setup left the config field uninitialized which then caused trouble with the tuner type used for HVR-1950 devices. Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r 10be786bec1c -r ce83b7005e23 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Tue Mar 31 23:51:53 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Tue Mar 31 23:55:26 2009 -0500 @@ -2948,6 +2948,7 @@ static void pvr2_subdev_update(struct pv pvr2_trace(PVR2_TRACE_CHIPS, "subdev tuner set_type(%d)", hdw->tuner_type); if (((int)(hdw->tuner_type)) >= 0) { + memset(&setup, 0, sizeof(setup)); setup.addr = ADDR_UNSET; setup.type = hdw->tuner_type; setup.mode_mask = T_RADIO | T_ANALOG_TV; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/ce83b7005e2319443577d35f57aef7440704cc8c ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_val
The patch number 11333 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Report def_val items in sysfs symbolically, consistent with cur_val Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff -r bc94812ac50a -r 10be786bec1c linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Tue Mar 31 23:49:57 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Tue Mar 31 23:51:53 2009 -0500 @@ -154,14 +154,16 @@ static ssize_t show_def(struct device *c struct pvr2_sysfs_ctl_item *cip; int val; int ret; + unsigned int cnt = 0; cip = container_of(attr, struct pvr2_sysfs_ctl_item, attr_def); ret = pvr2_ctrl_get_def(cip->cptr, &val); - pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %d, stat=%d", -cip->chptr, cip->ctl_id, val, ret); - if (ret < 0) { - return ret; - } - return scnprintf(buf, PAGE_SIZE, "%d\n", val); + if (ret < 0) return ret; + ret = pvr2_ctrl_value_to_sym(cip->cptr, ~0, val, +buf, PAGE_SIZE - 1, &cnt); + pvr2_sysfs_trace("pvr2_sysfs(%p) show_def(cid=%d) is %.*s (%d)", +cip->chptr, cip->ctl_id, cnt, buf, val); + buf[cnt] = '\n'; + return cnt + 1; } static ssize_t show_val_norm(struct device *class_dev, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/10be786bec1c67e796c996ccde037bb7bc174025 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix incorrect reporting of default value for non-integer controls
The patch number 11332 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix incorrect reporting of default value for non-integer controls Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff -r 5567e82c34a0 -r bc94812ac50a linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Tue Mar 31 07:24:14 2009 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-ctrl.c Tue Mar 31 23:49:57 2009 -0500 @@ -138,14 +138,12 @@ int pvr2_ctrl_get_def(struct pvr2_ctrl * int pvr2_ctrl_get_def(struct pvr2_ctrl *cptr, int *valptr) { int ret = 0; - if (!cptr) return 0; - LOCK_TAKE(cptr->hdw->big_lock); do { - if (cptr->info->type == pvr2_ctl_int) { - if (cptr->info->get_def_value) { - ret = cptr->info->get_def_value(cptr, valptr); - } else { - *valptr = cptr->info->default_value; - } + if (!cptr) return -EINVAL; + LOCK_TAKE(cptr->hdw->big_lock); do { + if (cptr->info->get_def_value) { + ret = cptr->info->get_def_value(cptr, valptr); + } else { + *valptr = cptr->info->default_value; } } while(0); LOCK_GIVE(cptr->hdw->big_lock); return ret; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/bc94812ac50a47bc22ddb2b173c87f60acad3f80 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Allocate a routing ID for future support of Terratec Grabster AV400
The patch number 11750 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Allocate a routing ID for future support of Terratec Grabster AV400 Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h |1 + 1 file changed, 1 insertion(+) diff -r 51990f41e3e7 -r 0c73d0aa725b linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Fri May 01 22:36:33 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Sat May 09 16:00:23 2009 -0500 @@ -69,6 +69,7 @@ struct pvr2_string_table { #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0 #define PVR2_ROUTING_SCHEME_GOTVIEW 1 #define PVR2_ROUTING_SCHEME_ONAIR 2 +#define PVR2_ROUTING_SCHEME_AV400 3 #define PVR2_DIGITAL_SCHEME_NONE 0 #define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1 --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/0c73d0aa725b5f5dc07aebeaa3c1234de815a353 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Update to work with upcoming ir_video changes in v4l-dvb core
The patch number 11745 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Update to work with upcoming ir_video changes in v4l-dvb core The ir-kbd-i2c module is about to be updated to match the new style i2c binding model. These pvrusb2 changes maintain compatibility with that change. Note that this does not actually break anything even without the expected ir-kbd-i2c changes yet because previously the pvrusb2 didn't autoload ir-kbd-i2c anyway. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 39 +++ 1 file changed, 39 insertions(+) diff -r d4a710fc106f -r 1a9bcf1b27dc linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Sun Apr 05 23:51:38 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri May 01 20:23:39 2009 -0500 @@ -42,6 +42,18 @@ static int ir_mode[PVR_NUM] = { [0 ... P static int ir_mode[PVR_NUM] = { [0 ... PVR_NUM-1] = 1 }; module_param_array(ir_mode, int, NULL, 0444); MODULE_PARM_DESC(ir_mode,"specify: 0=disable IR reception, 1=normal IR"); + +static int pvr2_disable_ir_video; +module_param_named(disable_autoload_ir_video, pvr2_disable_ir_video, + int, S_IRUGO|S_IWUSR); +MODULE_PARM_DESC(disable_autoload_ir_video, +"1=do not try to autoload ir_video IR receiver"); + +/* Mapping of IR schemes to known I2C addresses - if any */ +static const unsigned char ir_video_addresses[] = { + [PVR2_IR_SCHEME_29XXX] = 0x18, + [PVR2_IR_SCHEME_24XXX] = 0x18, +}; static int pvr2_i2c_write(struct pvr2_hdw *hdw, /* Context */ u8 i2c_addr, /* I2C address we're talking to */ @@ -637,6 +649,31 @@ static void do_i2c_scan(struct pvr2_hdw printk(KERN_INFO "%s: i2c scan done.\n", hdw->name); } +static void pvr2_i2c_register_ir(struct pvr2_hdw *hdw) +{ + struct i2c_board_info info; + unsigned char addr = 0; + if (pvr2_disable_ir_video) { + pvr2_trace(PVR2_TRACE_INFO, + "Automatic binding of ir_video has been disabled."); + return; + } + if (hdw->ir_scheme_active < ARRAY_SIZE(ir_video_addresses)) { + addr = ir_video_addresses[hdw->ir_scheme_active]; + } + if (!addr) { + /* The device either doesn't support I2C-based IR or we + don't know (yet) how to operate IR on the device. */ + return; + } + pvr2_trace(PVR2_TRACE_INFO, + "Binding ir_video to i2c address 0x%02x.", addr); + memset(&info, 0, sizeof(struct i2c_board_info)); + strlcpy(info.type, "ir_video", I2C_NAME_SIZE); + info.addr = addr; + i2c_new_device(&hdw->i2c_adap, &info); +} + void pvr2_i2c_core_init(struct pvr2_hdw *hdw) { unsigned int idx; @@ -692,6 +729,8 @@ void pvr2_i2c_core_init(struct pvr2_hdw } } if (i2c_scan) do_i2c_scan(hdw); + + pvr2_i2c_register_ir(hdw); } void pvr2_i2c_core_done(struct pvr2_hdw *hdw) --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/1a9bcf1b27dc5a9437a959e3c4abd3638e421cec ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Set ir_video autoloading to default disabled
The patch number 11746 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Set ir_video autoloading to default disabled This sets the disable_autoload_ir_video module option to being set, which disables any attempt by the driver to autoload IR support. This changes preserves previous behavior, for now. This change can be set back concurrent with other changes that finally update i2c-kbd-i2c to use the new i2c binding model. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 1a9bcf1b27dc -r 47351856a7af linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri May 01 20:23:39 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c Fri May 01 20:33:16 2009 -0500 @@ -43,7 +43,7 @@ module_param_array(ir_mode, int, NULL, 0 module_param_array(ir_mode, int, NULL, 0444); MODULE_PARM_DESC(ir_mode,"specify: 0=disable IR reception, 1=normal IR"); -static int pvr2_disable_ir_video; +static int pvr2_disable_ir_video = 1; module_param_named(disable_autoload_ir_video, pvr2_disable_ir_video, int, S_IRUGO|S_IWUSR); MODULE_PARM_DESC(disable_autoload_ir_video, --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/47351856a7afb4930056437379d771fe88476918 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Bump up version advertised through v4l interface
The patch number 11747 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Bump up version advertised through v4l interface Kick up the pvrusb2 version number advertised through the v4l interface. This value really has almost no meaning because I don't make a serious attempt to version the driver in this manner (otherwise this one line becomes a nasty hotspot of changes and merge conflicts). The value that is here is really a historical thing. However Hans Verkuil thought it might be a good idea to bump up the number anyway right now since the driver's mechanism for communicating with the v4l core has pretty much completely changed. Sending out a --- linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) different version number can be useful for later debugging in case a problem arises. Priority: normal Signed-off-by: Mike Isely diff -r 47351856a7af -r 465a9b16e03e linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Fri May 01 20:33:16 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Fri May 01 22:04:35 2009 -0500 @@ -91,7 +91,7 @@ static struct v4l2_capability pvr_capabi .driver = "pvrusb2", .card = "Hauppauge WinTV pvr-usb2", .bus_info = "usb", - .version= KERNEL_VERSION(0,8,0), + .version= KERNEL_VERSION(0, 9, 0), .capabilities = (V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_TUNER | V4L2_CAP_AUDIO | V4L2_CAP_RADIO | V4L2_CAP_READWRITE), --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/465a9b16e03e148970d547293d9677182ebc7026 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Select, track, and report IR scheme in use with the device
The patch number 11744 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Select, track, and report IR scheme in use with the device This change defines all possible "IR schemes" related to the pvrusb2 driver, on a per-device basis. That information is then set according to the hardware in use. The idea here is to make possible a more intelligent future decision on which, if any, IR receiver driver might be loaded during initialization. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c |1 linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h | 22 +++--- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |3 + linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 +++- linux/drivers/media/video/pvrusb2/pvrusb2-i2c-core.c | 12 - 5 files changed, 38 insertions(+), 18 deletions(-) diff -r 59f970bfcf5f -r d4a710fc106f linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sat May 09 06:34:19 2009 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.c Sun Apr 05 23:51:38 2009 -0500 @@ -71,6 +71,7 @@ static const struct pvr2_device_desc pvr .flag_has_svideo = !0, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE, + .ir_scheme = PVR2_IR_SCHEME_29XXX, }; diff -r 59f970bfcf5f -r d4a710fc106f linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Sat May 09 06:34:19 2009 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-devattr.h Sun Apr 05 23:51:38 2009 -0500 @@ -78,8 +78,10 @@ struct pvr2_string_table { #define PVR2_LED_SCHEME_HAUPPAUGE 1 #define PVR2_IR_SCHEME_NONE 0 -#define PVR2_IR_SCHEME_24XXX 1 -#define PVR2_IR_SCHEME_ZILOG 2 +#define PVR2_IR_SCHEME_24XXX 1 /* FX2-controlled IR */ +#define PVR2_IR_SCHEME_ZILOG 2 /* HVR-1950 style (must be taken out of reset) */ +#define PVR2_IR_SCHEME_24XXX_MCE 3 /* 24xxx MCE device */ +#define PVR2_IR_SCHEME_29XXX 4 /* Original 29xxx device */ /* This describes a particular hardware type (except for the USB device ID which must live in a separate structure due to environmental @@ -162,19 +164,9 @@ struct pvr2_device_desc { ensure that it is found. */ unsigned int flag_has_wm8775:1; - /* Indicate any specialized IR scheme that might need to be - supported by this driver. If not set, then it is assumed that - IR can work without help from the driver (which is frequently - the case). This is otherwise set to one of - PVR2_IR_SCHEME_. For "", the value "24XXX" indicates a - Hauppauge 24xxx class device which has an FPGA-hosted IR - receiver that can only be reached via FX2 command codes. In - that case the pvrusb2 driver will emulate the behavior of the - older 29xxx device's IR receiver (a "virtual" I2C chip) in terms - of those command codes. For the value "ZILOG", we're dealing - with an IR chip that must be taken out of reset via another FX2 - command code (which is the case for HVR-1950 devices). */ - unsigned int ir_scheme:2; + /* Indicate IR scheme of hardware. If not set, then it is assumed + that IR can work without any help from the driver. */ + unsigned int ir_scheme:3; /* These bits define which kinds of sources the device can handle. Note: Digital tuner presence is inferred by the diff -r 59f970bfcf5f -r d4a710fc106f linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sat May 09 06:34:19 2009 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Apr 05 23:51:38 2009 -0500 @@ -199,6 +199,9 @@ struct pvr2_hdw { pvr2_i2c_func i2c_func[PVR2_I2C_FUNC_CNT]; int i2c_cx25840_hack_state; int i2c_linked; + + /* IR related */ + unsigned int ir_scheme_active; /* IR scheme as seen from the outside */ /* Frequency table */ unsigned int freqTable[FREQTABLE_SIZE]; diff -r 59f970bfcf5f -r d4a710fc106f linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat May 09 06:34:19 2009 -0300 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Apr 05 23:51:38 2009 -0500 @@ -140,6 +140,15 @@ static const unsigned char *module_i2c_a [PVR2_CLIENT_ID
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Re-fix hardware scaling on video standard change
The patch number 12119 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Re-fix hardware scaling on video standard change The cx25840 module's VBI initialization logic uses the current video standard as part of its internal algorithm. This therefore means that we probably need to make sure that the correct video standard has been set before initializing VBI. (Normally we would not care about VBI, but as described in an earlier changeset, VBI must be initialized correctly on the cx25840 in order for the chip's hardware scaler to operate correctly.) It's kind of messy to force the video standard to be set before initializing VBI (mainly because we can't know what the app really wants that early in the initialization process). So this patch does the next best thing: VBI is re-initialized after any point where the video standard has been set. Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |1 + 1 file changed, 1 insertion(+) diff -r c3929c61b365 -r a9003d472efb linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Jun 20 12:45:52 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Jun 20 12:50:14 2009 -0500 @@ -2982,6 +2982,7 @@ static void pvr2_subdev_update(struct pv vs = hdw->std_mask_cur; v4l2_device_call_all(&hdw->v4l2_dev, 0, core, s_std, vs); + pvr2_hdw_cx25840_vbi_hack(hdw); } hdw->tuner_signal_stale = !0; hdw->cropcap_stale = !0; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/a9003d472efb32e3c47eb3d7c5ae596fd0a933c8 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Change initial default frequency setting
The patch number 12120 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Change initial default frequency setting Change default frequency to be US Broadcast channel 3 - with the transition to d igital the previous value has now become useless. This change is PURELY to help with my testing (I need to set some kind of default so it might as well be some thing usable). Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff -r a9003d472efb -r 005d75114445 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Jun 20 12:50:14 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Jun 20 12:51:29 2009 -0500 @@ -86,8 +86,8 @@ module_param_array(tolerance,int, NU module_param_array(tolerance,int, NULL, 0444); MODULE_PARM_DESC(tolerance,"specify stream error tolerance"); -/* US Broadcast channel 7 (175.25 MHz) */ -static int default_tv_freq= 17525L; +/* US Broadcast channel 3 (61.25 MHz), to help with testing */ +static int default_tv_freq= 6125L; /* 104.3 MHz, a usable FM station for my area */ static int default_radio_freq = 10430L; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/005d7511444541a1d26114baf9de717c75d5d7b4 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Improve handling of routing schemes
The patch number 12121 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Improve handling of routing schemes The pvrusb2 driver has a concept of "routing scheme" which defines which physical inputs should be connected based on application's choice of logical input. The correct "routing scheme" depends on the specific device since different devices might wire up their muxes --- linux/drivers/media/video/pvrusb2/pvrusb2-audio.c | 14 +++-- linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c| 14 +++-- linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 24 +- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 24 +- 4 files changed, 44 insertions(+), 32 deletions(-) differently - it can't be coded into the sub-device driver and it can't be just a single setting in the pvrusb2 driver since the driver handles multiple different devices. This concept has been in place for a while and works, however there are cases where a specific input for a specific device has no route - previously due to an oversight this was handled badly. With these changes the driver can now specifically recognize cases where there is no defined route for a given input. Priority: normal Signed-off-by: Mike Isely diff -r 005d75114445 -r 2817f0b90402 linux/drivers/media/video/pvrusb2/pvrusb2-audio.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Sat Jun 20 12:51:29 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-audio.c Sat Jun 20 12:55:31 2009 -0500 @@ -49,11 +49,13 @@ static const int routing_scheme0[] = { MSP_DSP_IN_SCART), }; -static const struct routing_scheme routing_schemes[] = { - [PVR2_ROUTING_SCHEME_HAUPPAUGE] = { - .def = routing_scheme0, - .cnt = ARRAY_SIZE(routing_scheme0), - }, +static const struct routing_scheme routing_def0 = { + .def = routing_scheme0, + .cnt = ARRAY_SIZE(routing_scheme0), +}; + +static const struct routing_scheme *routing_schemes[] = { + [PVR2_ROUTING_SCHEME_HAUPPAUGE] = &routing_def0, }; void pvr2_msp3400_subdev_update(struct pvr2_hdw *hdw, struct v4l2_subdev *sd) @@ -66,7 +68,7 @@ void pvr2_msp3400_subdev_update(struct p pvr2_trace(PVR2_TRACE_CHIPS, "subdev msp3400 v4l2 set_stereo"); if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes + sid) != NULL) && + ((sp = routing_schemes[sid]) != NULL) && (hdw->input_val >= 0) && (hdw->input_val < sp->cnt)) { input = sp->def[hdw->input_val]; diff -r 005d75114445 -r 2817f0b90402 linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c Sat Jun 20 12:51:29 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c Sat Jun 20 12:55:31 2009 -0500 @@ -50,11 +50,13 @@ static const int routing_scheme1[] = { [PVR2_CVAL_INPUT_SVIDEO] = 0, }; -static const struct routing_scheme routing_schemes[] = { - [PVR2_ROUTING_SCHEME_ONAIR] = { - .def = routing_scheme1, - .cnt = ARRAY_SIZE(routing_scheme1), - }, +static const struct routing_scheme routing_def1 = { + .def = routing_scheme1, + .cnt = ARRAY_SIZE(routing_scheme1), +}; + +static const struct routing_scheme *routing_schemes[] = { + [PVR2_ROUTING_SCHEME_ONAIR] = &routing_def1, }; @@ -67,7 +69,7 @@ void pvr2_cs53l32a_subdev_update(struct pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", hdw->input_val); if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes + sid) != NULL) && + ((sp = routing_schemes[sid]) != NULL) && (hdw->input_val >= 0) && (hdw->input_val < sp->cnt)) { input = sp->def[hdw->input_val]; diff -r 005d75114445 -r 2817f0b90402 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Sat Jun 20 12:51:29 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Sat Jun 20 12:55:31 2009 -0500 @@ -69,6 +69,11 @@ static const struct routing_scheme_item }, }; +static const struct routing_scheme routing_def0 = { + .def = routing_scheme0, + .cnt = ARRAY_SIZE(routing_scheme0), +}; + /* Specific to gotview device */ static const struct routing_scheme_item routing_schemegv[] = {
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Fix hardware scaling when used with cx25840
The patch number 12118 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Fix hardware scaling when used with cx25840 The cx25840 module requires that its VBI initialization entry point be called in order for hardware-scaled video capture to work properly - even if we don't care about VBI. Making this behavior even more subtle is that if the capture resolution is set to 720x480 - which is the default that the pvrusb2 driver sets up - then the cx25840 bypasses the hardware scaler. Therefore this problem does not manifest itself until some other resolution, e.g. 640x480, is tried. MythTV typically defaults to 640x480 or 480x480, which means that things break whenever the driver is used with MythTV. This all has been known for a while (since at least Nov 2006), but recent changes in the pvrusb2 driver (specifically in regards to sub-device support) caused this to break again. VBI initialization must happen *after* the chip's firmware is loaded, not before. With this fix, 24xxx devices work correctly again. A related fix that is part of this changeset is that now we re-initialize VBI any time after we issue a reset to the cx25840 driver. Issuing a chip reset erases the state that the VBI setup previously did. Until the HVR-1950 came along this subtlety went unnoticed, because the pvrusb2 driver previously never issued such a reset. But with the HVR-1950 we have to do that reset in order to correctly transition from digital back to analog mode - and since the HVR-1950 always starts in digital mode (required for the DVB side to initialize correctly) then this device has never had a chance to work correctly in analog mode! Analog capture on the HVR-1950 has been broken this *ENTIRE* time. I had missed it until now because I've usually been testing at the default 720x480 resolution which does not require scaling... What fun. By re-initializing VBI after a cx25840 chip reset, correct behavior is restored. Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 55 +--- 1 file changed, 31 insertions(+), 24 deletions(-) diff -r 2899ad868fc6 -r c3929c61b365 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Thu Jun 18 19:31:36 2009 +0200 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sat Jun 20 12:45:52 2009 -0500 @@ -2004,6 +2004,34 @@ static unsigned int pvr2_copy_i2c_addr_l } +static void pvr2_hdw_cx25840_vbi_hack(struct pvr2_hdw *hdw) +{ + /* + Mike Isely 19-Nov-2006 - This bit of nuttiness + for cx25840 causes that module to correctly set up its video + scaling. This is really a problem in the cx25840 module itself, + but we work around it here. The problem has not been seen in + ivtv because there VBI is supported and set up. We don't do VBI + here (at least not yet) and thus we never attempted to even set + it up. + */ + struct v4l2_format fmt; + if (hdw->decoder_client_id != PVR2_CLIENT_ID_CX25840) { + /* We're not using a cx25840 so don't enable the hack */ + return; + } + + pvr2_trace(PVR2_TRACE_INIT, + "Module ID %u:" + " Executing cx25840 VBI hack", + hdw->decoder_client_id); + memset(&fmt, 0, sizeof(fmt)); + fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE; + v4l2_device_call_all(&hdw->v4l2_dev, hdw->decoder_client_id, +video, s_fmt, &fmt); +} + + static int pvr2_hdw_load_subdev(struct pvr2_hdw *hdw, const struct pvr2_device_client_desc *cd) { @@ -2095,30 +2123,6 @@ static int pvr2_hdw_load_subdev(struct p /* client-specific setup... */ switch (mid) { case PVR2_CLIENT_ID_CX25840: - hdw->decoder_client_id = mid; - { - /* - Mike Isely 19-Nov-2006 - This - bit of nuttiness for cx25840 causes that module - to correctly set up its video scaling. This is - really a problem in the cx25840 module itself, - but we work around it here. The problem has not - been seen in ivtv because there VBI is supported - and set up. We don't do VBI here (at least not - yet) and thus we never attempted to even set it - up. - */ - struct v4l2_forma
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: De-obfuscate code which handles routing schemes
The patch number 12122 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: De-obfuscate code which handles routing schemes This change does not change any outward behavior; it merely chops down some large if-conditions with embedded assignments into something a little more maintainable for others (I of course never had a problem with this...). Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c| 12 linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c | 15 -- linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c | 13 3 files changed, 20 insertions(+), 20 deletions(-) diff -r 2817f0b90402 -r 4c7aa16ab7fc linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c Sat Jun 20 12:55:31 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cs53l32a.c Sat Jun 20 12:57:24 2009 -0500 @@ -68,12 +68,11 @@ void pvr2_cs53l32a_subdev_update(struct u32 input; pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", hdw->input_val); - if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes[sid]) != NULL) && - (hdw->input_val >= 0) && - (hdw->input_val < sp->cnt)) { - input = sp->def[hdw->input_val]; - } else { + sp = (sid < ARRAY_SIZE(routing_schemes)) ? + routing_schemes[sid] : NULL; + if ((sp == NULL) || + (hdw->input_val < 0) || + (hdw->input_val >= sp->cnt)) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "*** WARNING *** subdev v4l2 set_input:" " Invalid routing scheme (%u)" @@ -81,6 +80,7 @@ void pvr2_cs53l32a_subdev_update(struct sid, hdw->input_val); return; } + input = sp->def[hdw->input_val]; sd->ops->audio->s_routing(sd, input, 0, 0); } } diff -r 2817f0b90402 -r 4c7aa16ab7fc linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Sat Jun 20 12:55:31 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-cx2584x-v4l.c Sat Jun 20 12:57:24 2009 -0500 @@ -115,13 +115,11 @@ void pvr2_cx25840_subdev_update(struct p const struct routing_scheme *sp; unsigned int sid = hdw->hdw_desc->signal_routing_scheme; - if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes[sid]) != NULL) && - (hdw->input_val >= 0) && - (hdw->input_val < sp->cnt)) { - vid_input = sp->def[hdw->input_val].vid; - aud_input = sp->def[hdw->input_val].aud; - } else { + sp = (sid < ARRAY_SIZE(routing_schemes)) ? + routing_schemes[sid] : NULL; + if ((sp == NULL) || + (hdw->input_val < 0) || + (hdw->input_val >= sp->cnt)) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "*** WARNING *** subdev cx2584x set_input:" " Invalid routing scheme (%u)" @@ -129,7 +127,8 @@ void pvr2_cx25840_subdev_update(struct p sid, hdw->input_val); return; } - + vid_input = sp->def[hdw->input_val].vid; + aud_input = sp->def[hdw->input_val].aud; pvr2_trace(PVR2_TRACE_CHIPS, "subdev cx2584x set_input vid=0x%x aud=0x%x", vid_input, aud_input); diff -r 2817f0b90402 -r 4c7aa16ab7fc linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Sat Jun 20 12:55:31 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-video-v4l.c Sat Jun 20 12:57:24 2009 -0500 @@ -86,12 +86,12 @@ void pvr2_saa7115_subdev_update(struct p pvr2_trace(PVR2_TRACE_CHIPS, "subdev v4l2 set_input(%d)", hdw->input_val); - if ((sid < ARRAY_SIZE(routing_schemes)) && - ((sp = routing_schemes[sid]) != NULL) && - (hdw->input_val >= 0) && - (hdw->input_val < sp->cnt)) { -
[linuxtv-commits] [hg:v4l-dvb] bttv: Fix potential out-of-order field processing
The patch number 13169 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely bttv: Fix potential out-of-order field processing There is a subtle interaction in the bttv driver which can result in fields being repeatedly processed out of order. This is a problem specifically when running in V4L2_FIELD_ALTERNATE mode (probably the most common case). 1. The determination of which fields are associated with which buffers happens in videobuf, before the bttv driver gets a chance to queue the corresponding DMA. Thus by the point when the DMA is queued for a given buffer, the algorithm has to do the queuing based on the buffer's already assigned field type - not based on which field is "next" in the video stream. 2. The driver normally tries to queue both the top and bottom fields at the same time (see bttv_irq_next_video()). It tries to sort out top vs bottom by looking at the field type for the next 2 available buffers and assigning them appropriately. 3. However the bttv driver *always* actually processes the top field first. There's even an interrupt set aside for specifically recognizing when the top field has been processed so that it can be marked done even while the bottom field is still being DMAed. Given all of the above, if one gets into a situation where bttv_irq_next_video() gets entered when the first available buffer has been pre-associated as a bottom field, then the function is going to process the buffers out of order. That first available buffer will be put into the bottom field slot and the buffer after that will be put into the top field slot. Problem is, since the top field is always processed first by the driver, then that second buffer (the one after the first available buffer) will be the first one to be finished. Because of the strict fifo handling of all video buffers, then that top field won't be seen by the app until after the bottom field is also processed. Worse still, the app will get back the chronologically later bottom field first, *before* the top field is received. The buffer's timestamps will even be backwards. While not fatal to most TV apps, this behavior can subtlely degrade userspace deinterlacing (probably will cause jitter). That's probably why it has gone unnoticed. But it will also cause serious problems if the app in question discards all but the latest received buffer (a latency minimizing tactic) - causing one field to only ever be displayed since the other is now always late. Unfortunately once you get into this state, you're stuck this way - because having consumed two buffers, now the next time around the "first" available buffer will again be a bottom field and the same thing happens. How can we get into this state? In a perfect world, where there's always a few free buffers queued to the driver, it should be impossible. However if something disrupts streaming, e.g. if the userspace app can't queue free buffers fast enough for a moment due perhaps to a CPU scheduling glitch, then the driver can get momentarily starved and some number of fields will be dropped. That's OK. But if an odd number of fields get dropped, then that "first" available buffer might be the bottom field and now we're stuck... This patch fixes that problem by deliberately only setting up a single field for one frame if we don't get a top field as the first available buffer. By purposely skipping the other field, then we only handle a single buffer thus bringing things back into proper sync (i.e. top field first) for the next frame. To do this we just drop the few lines in bttv_irq_next_video() that attempt to set up the second buffer when that second buffer isn't for the bottom field. This is definitely a problem in when in V4L2_FIELD_ALTERNATE mode. In the other modes this change either has no effect or doesn't harm things any further anyway. Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/bt8xx/bttv-driver.c | 31 +++--- 1 file changed, 27 insertions(+), 4 deletions(-) diff -r 29e4ba1a09bc -r 760a8bc40280 linux/drivers/media/video/bt8xx/bttv-driver.c --- a/linux/drivers/media/video/bt8xx/bttv-driver.c Sat Sep 19 09:45:22 2009 -0300 +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c Mon Sep 21 10:09:08 2009 -0500 @@ -3828,11 +3828,34 @@ if (!V4L2_FIELD_HAS_BOTH(item->vb.field) && (item->vb.queue.next != &btv->capture)) { item = list_entry(item->vb.queue.next, struct bttv_buffer, vb.queue); + /* Mike Isely - Only check +* and set up the bottom field i
[linuxtv-commits] [hg:v4l-dvb] bttv: Fix reversed polarity error when switching video standard
The patch number 13170 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely bttv: Fix reversed polarity error when switching video standard The bttv driver function which handles switching of the video standard (set_tvnorm() in bttv-driver.c) includes a check which can optionally also reset the cropping configuration to a default value. It is "optional" based on a comparison of the cropcap parameters of the previous vs the newly requested video standard. The comparison is being done with a memcmp(), a function which only returns a true value if the comparison actually fails. This if-statement appears to have been written to assume wrong memcmp() semantics. That is, it was re-initializing the cropping configuration only if the new video standard did NOT have different cropcap values. That doesn't make any sense. One definitely should reset things if the cropcap parameters are different - if there's any comparison to made at all. The effect of this problem was that a transition from, say, PAL to NTSC would leave in place old cropping setup that made sense for the PAL geometry but not for NTSC. If the application doesn't care about cropping it also won't try to reset the cropping configuration, resulting in an improperly cropped video frame. In the case I was testing this actually caused black video frames to be displayed. Another interesting effect of this bug is that if one does something which does NOT change the video standard and this function is run, then the cropping setup gets reset anyway - again because of the backwards comparison. It turns out that just running anything which merely opens and closes the video device node (e.g. v4l-info) will cause this to happen. One can argue that simply opening the device node and not doing anything to it should not mess with any of its state - but because of this behavior, any TV app which does such things (e.g. xawtv) probably therefore doesn't see the problem. The solution is to fix the sense of the if-statement. It's easy to see how this mistake could have been made given how memcmp() works. The patch is therefore removal of a single "!" character from the if-statement in set_tvnorm in bttv-driver.c. Priority: high Signed-off-by: Mike Isely --- linux/drivers/media/video/bt8xx/bttv-driver.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff -r 760a8bc40280 -r e349075171dd linux/drivers/media/video/bt8xx/bttv-driver.c --- a/linux/drivers/media/video/bt8xx/bttv-driver.c Mon Sep 21 10:09:08 2009 -0500 +++ b/linux/drivers/media/video/bt8xx/bttv-driver.c Mon Sep 21 10:42:22 2009 -0500 @@ -1322,7 +1322,7 @@ tvnorm = &bttv_tvnorms[norm]; - if (!memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, &tvnorm->cropcap, + if (memcmp(&bttv_tvnorms[btv->tvnorm].cropcap, &tvnorm->cropcap, sizeof (tvnorm->cropcap))) { bttv_crop_reset(&btv->crop[0], norm); btv->crop[1] = btv->crop[0]; /* current = default */ --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/e349075171ddf939381fad432c23c1269abc4899 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Soften encoder warning message
The patch number 13223 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Soften encoder warning message pvrusb2: Encoder failures are mostly recoverable by the driver. While it would sure be nice not to have the failure happen in the first place, this has been going on for years and I doubt that a real solution will ever present itself. I think that part's firmware is just slightly flakey and we have to deal with it. The driver does deal with it just fine, but the warning message going into the kernel log is probably a little more alarming than it should be. So try to soften up the warning somewhat. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c |5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff -r 8b198ce54889 -r b902478b9d31 linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c Sun Oct 11 22:13:28 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-encoder.c Sun Oct 11 22:18:13 2009 -0500 @@ -316,7 +316,10 @@ pvr2_trace( PVR2_TRACE_ERROR_LEGS, "Giving up on command." - " This is normally recovered by the driver."); + " This is normally recovered via a firmware" + " reload and re-initialization; concern" + " is only warranted if this happens repeatedly" + " and rapidly."); break; } wrData[0] = 0x7; --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/b902478b9d319976749c495371fe3747ee3fd217 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Improve diagnostic info on driver initialization failure
The patch number 13224 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Improve diagnostic info on driver initialization failure It used to be that the only real detectable reason for the driver to fail during initialization would be that if the hardware is simply jammed. However with the advent of the sub-device mechanism in V4L it is possible now to detect if a sub-device module fails to load successfully. The pvrusb2 driver does in fact react to this by also (correctly) failing, however the original diagnostic message "hardware is jammed" was still being reported. This misleads the user because in fact it might not actually be a hardware failure. This change adds logic to tell the difference and then report a more appropriate message to the kernel log. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h |1 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c | 28 -- 2 files changed, 25 insertions(+), 4 deletions(-) diff -r b902478b9d31 -r 418db7d451ab linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Oct 11 22:18:13 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Sun Oct 11 22:21:20 2009 -0500 @@ -270,6 +270,7 @@ int force_dirty;/* consider all controls dirty if true */ int flag_ok;/* device in known good state */ + int flag_modulefail;/* true if at least one module failed to load */ int flag_disconnected; /* flag_ok == 0 due to disconnect */ int flag_init_ok; /* true if structure is fully initialized */ int fw1_state; /* current situation with fw1 */ diff -r b902478b9d31 -r 418db7d451ab linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Oct 11 22:18:13 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Oct 11 22:21:20 2009 -0500 @@ -2047,7 +2047,8 @@ fname = (mid < ARRAY_SIZE(module_names)) ? module_names[mid] : NULL; if (!fname) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Module ID %u for device %s has no name", + "Module ID %u for device %s has no name?" + " The driver might have a configuration problem.", mid, hdw->hdw_desc->description); return -EINVAL; @@ -2075,7 +2076,8 @@ if (!i2ccnt) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "Module ID %u (%s) for device %s:" - " No i2c addresses", + " No i2c addresses." + " The driver might have a configuration problem.", mid, fname, hdw->hdw_desc->description); return -EINVAL; } @@ -2107,7 +2109,9 @@ if (!sd) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, - "Module ID %u (%s) for device %s failed to load", + "Module ID %u (%s) for device %s failed to load." + " Possible missing sub-device kernel module or" + " initialization failure within module.", mid, fname, hdw->hdw_desc->description); return -EIO; } @@ -2149,7 +2153,10 @@ for (idx = 0; idx < ct->cnt; idx++) { if (pvr2_hdw_load_subdev(hdw, &ct->lst[idx]) < 0) okFl = 0; } - if (!okFl) pvr2_hdw_render_useless(hdw); + if (!okFl) { + hdw->flag_modulefail = !0; + pvr2_hdw_render_useless(hdw); + } } @@ -2351,6 +2358,19 @@ break; } } + if (hdw->flag_modulefail) { + pvr2_trace( + PVR2_TRACE_ERROR_LEGS, + "***WARNING*** pvrusb2 driver initialization" + " failed due to the failure of one or more" + " sub-device kernel modules."); + pvr2_trace( + PVR2_TRACE_ERROR_LEGS, + "You need to resolve the failing condition" + " before this driver can function. There" + " should be some earlier messages giving more" + " information
[linuxtv-commits] [hg:v4l-dvb] pvrusb2: Report hardware description to kernel log upon initialization
The patch number 13225 was added via Mike Isely 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: Linux Media Mailing List -- From: Mike Isely pvrusb2: Report hardware description to kernel log upon initialization The driver also contains a piece of configuration data that produces a one line description of the specific hardware being driver (e.g. "Hauppauge 24xxx", "OnAir", etc). This change generates an informational message to the kernel log reporting the hardware type being driven. This is a very useful thing to know when diagnosing problems. Priority: normal Signed-off-by: Mike Isely --- linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c |2 ++ 1 file changed, 2 insertions(+) diff -r 418db7d451ab -r 63c1e26683fb linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Oct 11 22:21:20 2009 -0500 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Sun Oct 11 22:23:37 2009 -0500 @@ -2456,6 +2456,8 @@ hdw = kzalloc(sizeof(*hdw),GFP_KERNEL); pvr2_trace(PVR2_TRACE_INIT,"pvr2_hdw_create: hdw=%p, type \"%s\"", hdw,hdw_desc->description); + pvr2_trace(PVR2_TRACE_INFO, "Hardware description attached: %s", + hdw_desc->description); if (!hdw) goto fail; init_timer(&hdw->quiescent_timer); --- Patch is available at: http://linuxtv.org/hg/v4l-dvb/rev/63c1e26683fb10e20eb29be828fa5e7095108bc0 ___ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits