The patch number 10362 was added via Jean-Francois Moine <moin...@free.fr> 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 <linux-me...@vger.kernel.org> ------ merge: v4l-dvb --- 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 | 6 ++- linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c | 12 +----- linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | 2 - linux/drivers/media/video/v4l2-subdev.c | 4 +- 6 files changed, 40 insertions(+), 15 deletions(-) diff -r e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h Thu Jan 15 12:03:07 2009 +0100 @@ -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 e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.c Thu Jan 15 12:03:07 2009 +0100 @@ -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 e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h --- a/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-hdw.h Thu Jan 15 12:03:07 2009 +0100 @@ -138,6 +138,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 *); @@ -242,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_xxxx) + 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. */ diff -r e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-sysfs.c Thu Jan 15 12:03:07 2009 +0100 @@ -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; diff -r e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c --- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c Thu Jan 15 12:03:07 2009 +0100 @@ -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} diff -r e07b6c998393 -r 10b7e4064ce5 linux/drivers/media/video/v4l2-subdev.c --- a/linux/drivers/media/video/v4l2-subdev.c Thu Jan 15 12:01:32 2009 +0100 +++ b/linux/drivers/media/video/v4l2-subdev.c Thu Jan 15 12:03:07 2009 +0100 @@ -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/10b7e4064ce56120610d29aab03c0d8184d42c7a _______________________________________________ linuxtv-commits mailing list linuxtv-commits@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits