Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137696
b: refs/heads/master
c: 13a8879
h: refs/heads/master
v: v3
  • Loading branch information
Mike Isely authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 447f0a4 commit 63fb6f7
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d166b02ea6b03766f6fd867fb1fef378a57683e5
refs/heads/master: 13a887971b6c97751fce62ab803ee93a42a23c5d
12 changes: 12 additions & 0 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,20 @@ 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;
struct i2c_algorithm i2c_algo;
Expand Down
19 changes: 19 additions & 0 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,12 @@ const char *pvr2_hdw_get_bus_info(struct pvr2_hdw *hdw)
}


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;
Expand Down Expand Up @@ -2024,6 +2030,19 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
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);

if (!get_default_tuner_type(hdw)) {
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/media/video/pvrusb2/pvrusb2-hdw.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ unsigned long pvr2_hdw_get_sn(struct pvr2_hdw *);
/* 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 *);

Expand Down

0 comments on commit 63fb6f7

Please sign in to comment.