aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Isely <isely@pobox.com>2008-04-22 13:45:40 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:47 -0400
commite8f5bacfcf2ba9a98674f3cd51b63020920e16aa (patch)
treef46cd2df55e5087cd53f461f4469232d140e05bd
parent84147f3dd9187cd0c9810801be1282419a8ea00a (diff)
V4L/DVB (7308): pvrusb2: Define digital control scheme device attributes
Unlike analog control, control of the digital side is not nearly as uniform among different devices. So we have to specify the correct digital control scheme as a new device attribute. Signed-off-by: Mike Isely <isely@pobox.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.h16
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-hdw.c4
3 files changed, 20 insertions, 6 deletions
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index 4522ad6320c2..1a60591e38b5 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -137,11 +137,11 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = {
137 .client_modules.lst = pvr2_client_onair_creator, 137 .client_modules.lst = pvr2_client_onair_creator,
138 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator), 138 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
139 .default_tuner_type = TUNER_LG_TDVS_H06XF, 139 .default_tuner_type = TUNER_LG_TDVS_H06XF,
140 .flag_has_digitaltuner = !0,
141 .flag_has_analogtuner = !0, 140 .flag_has_analogtuner = !0,
142 .flag_has_composite = !0, 141 .flag_has_composite = !0,
143 .flag_has_svideo = !0, 142 .flag_has_svideo = !0,
144 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 143 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
144 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
145}; 145};
146#endif 146#endif
147 147
@@ -163,11 +163,11 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
163 .client_modules.lst = pvr2_client_onair_usb2, 163 .client_modules.lst = pvr2_client_onair_usb2,
164 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2), 164 .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
165 .default_tuner_type = TUNER_PHILIPS_ATSC, 165 .default_tuner_type = TUNER_PHILIPS_ATSC,
166 .flag_has_digitaltuner = !0,
167 .flag_has_analogtuner = !0, 166 .flag_has_analogtuner = !0,
168 .flag_has_composite = !0, 167 .flag_has_composite = !0,
169 .flag_has_svideo = !0, 168 .flag_has_svideo = !0,
170 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 169 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
170 .digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
171}; 171};
172#endif 172#endif
173 173
@@ -229,11 +229,11 @@ static const struct pvr2_device_desc pvr2_device_75xxx = {
229 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx), 229 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
230 .flag_has_cx25840 = !0, 230 .flag_has_cx25840 = !0,
231 .flag_has_hauppauge_rom = !0, 231 .flag_has_hauppauge_rom = !0,
232 .flag_has_digitaltuner = !0,
233 .flag_has_analogtuner = !0, 232 .flag_has_analogtuner = !0,
234 .flag_has_composite = !0, 233 .flag_has_composite = !0,
235 .flag_has_svideo = !0, 234 .flag_has_svideo = !0,
236 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, 235 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
236 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
237 .default_std_mask = V4L2_STD_NTSC_M, 237 .default_std_mask = V4L2_STD_NTSC_M,
238}; 238};
239 239
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.h b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
index b564121803bb..4e4798d6139f 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.h
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.h
@@ -39,6 +39,10 @@ struct pvr2_string_table {
39#define PVR2_ROUTING_SCHEME_HAUPPAUGE 0 39#define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
40#define PVR2_ROUTING_SCHEME_GOTVIEW 1 40#define PVR2_ROUTING_SCHEME_GOTVIEW 1
41 41
42#define PVR2_DIGITAL_SCHEME_NONE 0
43#define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
44#define PVR2_DIGITAL_SCHEME_ONAIR 2
45
42/* This describes a particular hardware type (except for the USB device ID 46/* This describes a particular hardware type (except for the USB device ID
43 which must live in a separate structure due to environmental 47 which must live in a separate structure due to environmental
44 constraints). See the top of pvrusb2-hdw.c for where this is 48 constraints). See the top of pvrusb2-hdw.c for where this is
@@ -66,6 +70,13 @@ struct pvr2_device_desc {
66 drivers (search for things which touch this field). */ 70 drivers (search for things which touch this field). */
67 unsigned int signal_routing_scheme; 71 unsigned int signal_routing_scheme;
68 72
73 /* Control scheme to use if there is a digital tuner. This
74 contains one of PVR2_DIGITAL_SCHEME_XXX. This is an arbitrary
75 integer scheme id; its meaning is contained entirely within the
76 driver and is interpreted by logic which must control the
77 streaming pathway (search for things which touch this field). */
78 unsigned int digital_control_scheme;
79
69 /* V4L tuner type ID to use with this device (only used if the 80 /* V4L tuner type ID to use with this device (only used if the
70 driver could not discover the type any other way). */ 81 driver could not discover the type any other way). */
71 int default_tuner_type; 82 int default_tuner_type;
@@ -103,10 +114,11 @@ struct pvr2_device_desc {
103 commands. */ 114 commands. */
104 char flag_has_hauppauge_custom_ir; 115 char flag_has_hauppauge_custom_ir;
105 116
106 /* These bits define which kinds of sources the device can handle. */ 117 /* These bits define which kinds of sources the device can handle.
118 Note: Digital tuner presence is inferred by the
119 digital_control_scheme enumeration. */
107 char flag_has_fmradio; /* Has FM radio receiver */ 120 char flag_has_fmradio; /* Has FM radio receiver */
108 char flag_has_analogtuner; /* Has analog tuner */ 121 char flag_has_analogtuner; /* Has analog tuner */
109 char flag_has_digitaltuner; /* Has digital tuner */
110 char flag_has_composite; /* Has composite input */ 122 char flag_has_composite; /* Has composite input */
111 char flag_has_svideo; /* Has s-video input */ 123 char flag_has_svideo; /* Has s-video input */
112}; 124};
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
index 8eabb67e5895..7016d3eda324 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c
@@ -1852,7 +1852,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
1852 /* Calculate which inputs are OK */ 1852 /* Calculate which inputs are OK */
1853 m = 0; 1853 m = 0;
1854 if (hdw_desc->flag_has_analogtuner) m |= 1 << PVR2_CVAL_INPUT_TV; 1854 if (hdw_desc->flag_has_analogtuner) m |= 1 << PVR2_CVAL_INPUT_TV;
1855 if (hdw_desc->flag_has_digitaltuner) m |= 1 << PVR2_CVAL_INPUT_DTV; 1855 if (hdw_desc->digital_control_scheme != PVR2_DIGITAL_SCHEME_NONE) {
1856 m |= 1 << PVR2_CVAL_INPUT_DTV;
1857 }
1856 if (hdw_desc->flag_has_svideo) m |= 1 << PVR2_CVAL_INPUT_SVIDEO; 1858 if (hdw_desc->flag_has_svideo) m |= 1 << PVR2_CVAL_INPUT_SVIDEO;
1857 if (hdw_desc->flag_has_composite) m |= 1 << PVR2_CVAL_INPUT_COMPOSITE; 1859 if (hdw_desc->flag_has_composite) m |= 1 << PVR2_CVAL_INPUT_COMPOSITE;
1858 if (hdw_desc->flag_has_fmradio) m |= 1 << PVR2_CVAL_INPUT_RADIO; 1860 if (hdw_desc->flag_has_fmradio) m |= 1 << PVR2_CVAL_INPUT_RADIO;