Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  *
0004  *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
0005  */
0006 #ifndef __PVRUSB2_DEVATTR_H
0007 #define __PVRUSB2_DEVATTR_H
0008 
0009 #include <linux/mod_devicetable.h>
0010 #include <linux/videodev2.h>
0011 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0012 #include "pvrusb2-dvb.h"
0013 #endif
0014 
0015 /*
0016 
0017   This header defines structures used to describe attributes of a device.
0018 
0019 */
0020 
0021 
0022 #define PVR2_CLIENT_ID_NULL 0
0023 #define PVR2_CLIENT_ID_MSP3400 1
0024 #define PVR2_CLIENT_ID_CX25840 2
0025 #define PVR2_CLIENT_ID_SAA7115 3
0026 #define PVR2_CLIENT_ID_TUNER 4
0027 #define PVR2_CLIENT_ID_CS53L32A 5
0028 #define PVR2_CLIENT_ID_WM8775 6
0029 #define PVR2_CLIENT_ID_DEMOD 7
0030 
0031 struct pvr2_device_client_desc {
0032     /* One ovr PVR2_CLIENT_ID_xxxx */
0033     unsigned char module_id;
0034 
0035     /* Null-terminated array of I2C addresses to try in order
0036        initialize the module.  It's safe to make this null terminated
0037        since we're never going to encounter an i2c device with an
0038        address of zero.  If this is a null pointer or zero-length,
0039        then no I2C addresses have been specified, in which case we'll
0040        try some compiled in defaults for now. */
0041     unsigned char *i2c_address_list;
0042 };
0043 
0044 struct pvr2_device_client_table {
0045     const struct pvr2_device_client_desc *lst;
0046     unsigned char cnt;
0047 };
0048 
0049 
0050 struct pvr2_string_table {
0051     const char **lst;
0052     unsigned int cnt;
0053 };
0054 
0055 #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
0056 #define PVR2_ROUTING_SCHEME_GOTVIEW 1
0057 #define PVR2_ROUTING_SCHEME_ONAIR 2
0058 #define PVR2_ROUTING_SCHEME_AV400 3
0059 #define PVR2_ROUTING_SCHEME_HAUP160XXX 4
0060 
0061 #define PVR2_DIGITAL_SCHEME_NONE 0
0062 #define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
0063 #define PVR2_DIGITAL_SCHEME_ONAIR 2
0064 
0065 #define PVR2_LED_SCHEME_NONE 0
0066 #define PVR2_LED_SCHEME_HAUPPAUGE 1
0067 
0068 #define PVR2_IR_SCHEME_NONE 0
0069 #define PVR2_IR_SCHEME_24XXX 1 /* FX2-controlled IR */
0070 #define PVR2_IR_SCHEME_ZILOG 2 /* HVR-1950 style (must be taken out of reset) */
0071 #define PVR2_IR_SCHEME_24XXX_MCE 3 /* 24xxx MCE device */
0072 #define PVR2_IR_SCHEME_29XXX 4 /* Original 29xxx device */
0073 
0074 /* This describes a particular hardware type (except for the USB device ID
0075    which must live in a separate structure due to environmental
0076    constraints).  See the top of pvrusb2-hdw.c for where this is
0077    instantiated. */
0078 struct pvr2_device_desc {
0079     /* Single line text description of hardware */
0080     const char *description;
0081 
0082     /* Single token identifier for hardware */
0083     const char *shortname;
0084 
0085     /* List of additional client modules we need to load */
0086     struct pvr2_string_table client_modules;
0087 
0088     /* List of defined client modules we need to load */
0089     struct pvr2_device_client_table client_table;
0090 
0091     /* List of FX2 firmware file names we should search; if empty then
0092        FX2 firmware check / load is skipped and we assume the device
0093        was initialized from internal ROM. */
0094     struct pvr2_string_table fx2_firmware;
0095 
0096 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
0097     /* callback functions to handle attachment of digital tuner & demod */
0098     const struct pvr2_dvb_props *dvb_props;
0099 
0100 #endif
0101     /* Initial standard bits to use for this device, if not zero.
0102        Anything set here is also implied as an available standard.
0103        Note: This is ignored if overridden on the module load line via
0104        the video_std module option. */
0105     v4l2_std_id default_std_mask;
0106 
0107     /* V4L tuner type ID to use with this device (only used if the
0108        driver could not discover the type any other way). */
0109     int default_tuner_type;
0110 
0111     /* Signal routing scheme used by device, contains one of
0112        PVR2_ROUTING_SCHEME_XXX.  Schemes have to be defined as we
0113        encounter them.  This is an arbitrary integer scheme id; its
0114        meaning is contained entirely within the driver and is
0115        interpreted by logic which must send commands to the chip-level
0116        drivers (search for things which touch this field). */
0117     unsigned char signal_routing_scheme;
0118 
0119     /* Indicates scheme for controlling device's LED (if any).  The
0120        driver will turn on the LED when streaming is underway.  This
0121        contains one of PVR2_LED_SCHEME_XXX. */
0122     unsigned char led_scheme;
0123 
0124     /* Control scheme to use if there is a digital tuner.  This
0125        contains one of PVR2_DIGITAL_SCHEME_XXX.  This is an arbitrary
0126        integer scheme id; its meaning is contained entirely within the
0127        driver and is interpreted by logic which must control the
0128        streaming pathway (search for things which touch this field). */
0129     unsigned char digital_control_scheme;
0130 
0131     /* If set, we don't bother trying to load cx23416 firmware. */
0132     unsigned int flag_skip_cx23416_firmware:1;
0133 
0134     /* If set, the encoder must be healthy in order for digital mode to
0135        work (otherwise we assume that digital streaming will work even
0136        if we fail to locate firmware for the encoder).  If the device
0137        doesn't support digital streaming then this flag has no
0138        effect. */
0139     unsigned int flag_digital_requires_cx23416:1;
0140 
0141     /* Device has a hauppauge eeprom which we can interrogate. */
0142     unsigned int flag_has_hauppauge_rom:1;
0143 
0144     /* Device does not require a powerup command to be issued. */
0145     unsigned int flag_no_powerup:1;
0146 
0147     /* Device has a cx25840 - this enables special additional logic to
0148        handle it. */
0149     unsigned int flag_has_cx25840:1;
0150 
0151     /* Device has a wm8775 - this enables special additional logic to
0152        ensure that it is found. */
0153     unsigned int flag_has_wm8775:1;
0154 
0155     /* Indicate IR scheme of hardware.  If not set, then it is assumed
0156        that IR can work without any help from the driver. */
0157     unsigned int ir_scheme:3;
0158 
0159     /* These bits define which kinds of sources the device can handle.
0160        Note: Digital tuner presence is inferred by the
0161        digital_control_scheme enumeration. */
0162     unsigned int flag_has_fmradio:1;       /* Has FM radio receiver */
0163     unsigned int flag_has_analogtuner:1;   /* Has analog tuner */
0164     unsigned int flag_has_composite:1;     /* Has composite input */
0165     unsigned int flag_has_svideo:1;        /* Has s-video input */
0166     unsigned int flag_fx2_16kb:1;          /* 16KB FX2 firmware OK here */
0167 
0168     /* If this driver is considered experimental, i.e. not all aspects
0169        are working correctly and/or it is untested, mark that fact
0170        with this flag. */
0171     unsigned int flag_is_experimental:1;
0172 };
0173 
0174 extern struct usb_device_id pvr2_device_table[];
0175 
0176 #endif /* __PVRUSB2_HDW_INTERNAL_H */