提交 e8f5bacf 编写于 作者: M Mike Isely 提交者: Mauro Carvalho Chehab

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: NMike Isely <isely@pobox.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 84147f3d
...@@ -137,11 +137,11 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = { ...@@ -137,11 +137,11 @@ static const struct pvr2_device_desc pvr2_device_onair_creator = {
.client_modules.lst = pvr2_client_onair_creator, .client_modules.lst = pvr2_client_onair_creator,
.client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator), .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_creator),
.default_tuner_type = TUNER_LG_TDVS_H06XF, .default_tuner_type = TUNER_LG_TDVS_H06XF,
.flag_has_digitaltuner = !0,
.flag_has_analogtuner = !0, .flag_has_analogtuner = !0,
.flag_has_composite = !0, .flag_has_composite = !0,
.flag_has_svideo = !0, .flag_has_svideo = !0,
.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
.digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
}; };
#endif #endif
...@@ -163,11 +163,11 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = { ...@@ -163,11 +163,11 @@ static const struct pvr2_device_desc pvr2_device_onair_usb2 = {
.client_modules.lst = pvr2_client_onair_usb2, .client_modules.lst = pvr2_client_onair_usb2,
.client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2), .client_modules.cnt = ARRAY_SIZE(pvr2_client_onair_usb2),
.default_tuner_type = TUNER_PHILIPS_ATSC, .default_tuner_type = TUNER_PHILIPS_ATSC,
.flag_has_digitaltuner = !0,
.flag_has_analogtuner = !0, .flag_has_analogtuner = !0,
.flag_has_composite = !0, .flag_has_composite = !0,
.flag_has_svideo = !0, .flag_has_svideo = !0,
.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
.digital_control_scheme = PVR2_DIGITAL_SCHEME_ONAIR,
}; };
#endif #endif
...@@ -229,11 +229,11 @@ static const struct pvr2_device_desc pvr2_device_75xxx = { ...@@ -229,11 +229,11 @@ static const struct pvr2_device_desc pvr2_device_75xxx = {
.fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx), .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_75xxx),
.flag_has_cx25840 = !0, .flag_has_cx25840 = !0,
.flag_has_hauppauge_rom = !0, .flag_has_hauppauge_rom = !0,
.flag_has_digitaltuner = !0,
.flag_has_analogtuner = !0, .flag_has_analogtuner = !0,
.flag_has_composite = !0, .flag_has_composite = !0,
.flag_has_svideo = !0, .flag_has_svideo = !0,
.signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE, .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
.default_std_mask = V4L2_STD_NTSC_M, .default_std_mask = V4L2_STD_NTSC_M,
}; };
......
...@@ -39,6 +39,10 @@ struct pvr2_string_table { ...@@ -39,6 +39,10 @@ struct pvr2_string_table {
#define PVR2_ROUTING_SCHEME_HAUPPAUGE 0 #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
#define PVR2_ROUTING_SCHEME_GOTVIEW 1 #define PVR2_ROUTING_SCHEME_GOTVIEW 1
#define PVR2_DIGITAL_SCHEME_NONE 0
#define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
#define PVR2_DIGITAL_SCHEME_ONAIR 2
/* This describes a particular hardware type (except for the USB device ID /* This describes a particular hardware type (except for the USB device ID
which must live in a separate structure due to environmental which must live in a separate structure due to environmental
constraints). See the top of pvrusb2-hdw.c for where this is constraints). See the top of pvrusb2-hdw.c for where this is
...@@ -66,6 +70,13 @@ struct pvr2_device_desc { ...@@ -66,6 +70,13 @@ struct pvr2_device_desc {
drivers (search for things which touch this field). */ drivers (search for things which touch this field). */
unsigned int signal_routing_scheme; unsigned int signal_routing_scheme;
/* Control scheme to use if there is a digital tuner. This
contains one of PVR2_DIGITAL_SCHEME_XXX. This is an arbitrary
integer scheme id; its meaning is contained entirely within the
driver and is interpreted by logic which must control the
streaming pathway (search for things which touch this field). */
unsigned int digital_control_scheme;
/* V4L tuner type ID to use with this device (only used if the /* V4L tuner type ID to use with this device (only used if the
driver could not discover the type any other way). */ driver could not discover the type any other way). */
int default_tuner_type; int default_tuner_type;
...@@ -103,10 +114,11 @@ struct pvr2_device_desc { ...@@ -103,10 +114,11 @@ struct pvr2_device_desc {
commands. */ commands. */
char flag_has_hauppauge_custom_ir; char flag_has_hauppauge_custom_ir;
/* These bits define which kinds of sources the device can handle. */ /* These bits define which kinds of sources the device can handle.
Note: Digital tuner presence is inferred by the
digital_control_scheme enumeration. */
char flag_has_fmradio; /* Has FM radio receiver */ char flag_has_fmradio; /* Has FM radio receiver */
char flag_has_analogtuner; /* Has analog tuner */ char flag_has_analogtuner; /* Has analog tuner */
char flag_has_digitaltuner; /* Has digital tuner */
char flag_has_composite; /* Has composite input */ char flag_has_composite; /* Has composite input */
char flag_has_svideo; /* Has s-video input */ char flag_has_svideo; /* Has s-video input */
}; };
......
...@@ -1852,7 +1852,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf, ...@@ -1852,7 +1852,9 @@ struct pvr2_hdw *pvr2_hdw_create(struct usb_interface *intf,
/* Calculate which inputs are OK */ /* Calculate which inputs are OK */
m = 0; m = 0;
if (hdw_desc->flag_has_analogtuner) m |= 1 << PVR2_CVAL_INPUT_TV; if (hdw_desc->flag_has_analogtuner) m |= 1 << PVR2_CVAL_INPUT_TV;
if (hdw_desc->flag_has_digitaltuner) m |= 1 << PVR2_CVAL_INPUT_DTV; if (hdw_desc->digital_control_scheme != PVR2_DIGITAL_SCHEME_NONE) {
m |= 1 << PVR2_CVAL_INPUT_DTV;
}
if (hdw_desc->flag_has_svideo) m |= 1 << PVR2_CVAL_INPUT_SVIDEO; if (hdw_desc->flag_has_svideo) m |= 1 << PVR2_CVAL_INPUT_SVIDEO;
if (hdw_desc->flag_has_composite) m |= 1 << PVR2_CVAL_INPUT_COMPOSITE; if (hdw_desc->flag_has_composite) m |= 1 << PVR2_CVAL_INPUT_COMPOSITE;
if (hdw_desc->flag_has_fmradio) m |= 1 << PVR2_CVAL_INPUT_RADIO; if (hdw_desc->flag_has_fmradio) m |= 1 << PVR2_CVAL_INPUT_RADIO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册