diff options
author | Mike Isely <isely@pobox.com> | 2009-04-06 00:51:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:59 -0400 |
commit | 27eab3840baaee469eb6377607520ca2128b66f7 (patch) | |
tree | 775915613da853314d7302d5218b7b72882b44be /drivers/media/video/pvrusb2/pvrusb2-hdw.c | |
parent | 06e61f8d5f5df68104168ac20d0527ecee13638a (diff) |
V4L/DVB (11744): 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.
Signed-off-by: Mike Isely <isely@pobox.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/pvrusb2/pvrusb2-hdw.c')
-rw-r--r-- | drivers/media/video/pvrusb2/pvrusb2-hdw.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index add3395d3248..686df1afbbaf 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -142,6 +142,15 @@ static const unsigned char *module_i2c_addresses[] = { | |||
142 | }; | 142 | }; |
143 | 143 | ||
144 | 144 | ||
145 | static const char *ir_scheme_names[] = { | ||
146 | [PVR2_IR_SCHEME_NONE] = "none", | ||
147 | [PVR2_IR_SCHEME_29XXX] = "29xxx", | ||
148 | [PVR2_IR_SCHEME_24XXX] = "24xxx (29xxx emulation)", | ||
149 | [PVR2_IR_SCHEME_24XXX_MCE] = "24xxx (MCE device)", | ||
150 | [PVR2_IR_SCHEME_ZILOG] = "Zilog", | ||
151 | }; | ||
152 | |||
153 | |||
145 | /* Define the list of additional controls we'll dynamically construct based | 154 | /* Define the list of additional controls we'll dynamically construct based |
146 | on query of the cx2341x module. */ | 155 | on query of the cx2341x module. */ |
147 | struct pvr2_mpeg_ids { | 156 | struct pvr2_mpeg_ids { |
@@ -2170,7 +2179,7 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) | |||
2170 | } | 2179 | } |
2171 | 2180 | ||
2172 | /* Take the IR chip out of reset, if appropriate */ | 2181 | /* Take the IR chip out of reset, if appropriate */ |
2173 | if (hdw->hdw_desc->ir_scheme == PVR2_IR_SCHEME_ZILOG) { | 2182 | if (hdw->ir_scheme_active == PVR2_IR_SCHEME_ZILOG) { |
2174 | pvr2_issue_simple_cmd(hdw, | 2183 | pvr2_issue_simple_cmd(hdw, |
2175 | FX2CMD_HCW_ZILOG_RESET | | 2184 | FX2CMD_HCW_ZILOG_RESET | |
2176 | (1 << 8) | | 2185 | (1 << 8) | |
@@ -2451,6 +2460,7 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, | |||
2451 | GFP_KERNEL); | 2460 | GFP_KERNEL); |
2452 | if (!hdw->controls) goto fail; | 2461 | if (!hdw->controls) goto fail; |
2453 | hdw->hdw_desc = hdw_desc; | 2462 | hdw->hdw_desc = hdw_desc; |
2463 | hdw->ir_scheme_active = hdw->hdw_desc->ir_scheme; | ||
2454 | for (idx = 0; idx < hdw->control_cnt; idx++) { | 2464 | for (idx = 0; idx < hdw->control_cnt; idx++) { |
2455 | cptr = hdw->controls + idx; | 2465 | cptr = hdw->controls + idx; |
2456 | cptr->hdw = hdw; | 2466 | cptr->hdw = hdw; |
@@ -4809,6 +4819,12 @@ static unsigned int pvr2_hdw_report_unlocked(struct pvr2_hdw *hdw,int which, | |||
4809 | stats.buffers_processed, | 4819 | stats.buffers_processed, |
4810 | stats.buffers_failed); | 4820 | stats.buffers_failed); |
4811 | } | 4821 | } |
4822 | case 6: { | ||
4823 | unsigned int id = hdw->ir_scheme_active; | ||
4824 | return scnprintf(buf, acnt, "ir scheme: id=%d %s", id, | ||
4825 | (id >= ARRAY_SIZE(ir_scheme_names) ? | ||
4826 | "?" : ir_scheme_names[id])); | ||
4827 | } | ||
4812 | default: break; | 4828 | default: break; |
4813 | } | 4829 | } |
4814 | return 0; | 4830 | return 0; |