^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) * Copyright (C) 2005 Mike Isely <isely@pobox.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #ifndef __PVRUSB2_DEVATTR_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) #define __PVRUSB2_DEVATTR_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <linux/mod_devicetable.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <linux/videodev2.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifdef CONFIG_VIDEO_PVRUSB2_DVB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include "pvrusb2-dvb.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) This header defines structures used to describe attributes of a device.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) #define PVR2_CLIENT_ID_NULL 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) #define PVR2_CLIENT_ID_MSP3400 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define PVR2_CLIENT_ID_CX25840 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) #define PVR2_CLIENT_ID_SAA7115 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) #define PVR2_CLIENT_ID_TUNER 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #define PVR2_CLIENT_ID_CS53L32A 5
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define PVR2_CLIENT_ID_WM8775 6
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define PVR2_CLIENT_ID_DEMOD 7
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) struct pvr2_device_client_desc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) /* One ovr PVR2_CLIENT_ID_xxxx */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) unsigned char module_id;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /* Null-terminated array of I2C addresses to try in order
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) initialize the module. It's safe to make this null terminated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) since we're never going to encounter an i2c device with an
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) address of zero. If this is a null pointer or zero-length,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) then no I2C addresses have been specified, in which case we'll
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) try some compiled in defaults for now. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned char *i2c_address_list;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct pvr2_device_client_table {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) const struct pvr2_device_client_desc *lst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) unsigned char cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct pvr2_string_table {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) const char **lst;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) unsigned int cnt;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #define PVR2_ROUTING_SCHEME_GOTVIEW 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #define PVR2_ROUTING_SCHEME_ONAIR 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) #define PVR2_ROUTING_SCHEME_AV400 3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) #define PVR2_ROUTING_SCHEME_HAUP160XXX 4
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) #define PVR2_DIGITAL_SCHEME_NONE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) #define PVR2_DIGITAL_SCHEME_ONAIR 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) #define PVR2_LED_SCHEME_NONE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66) #define PVR2_LED_SCHEME_HAUPPAUGE 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) #define PVR2_IR_SCHEME_NONE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) #define PVR2_IR_SCHEME_24XXX 1 /* FX2-controlled IR */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) #define PVR2_IR_SCHEME_ZILOG 2 /* HVR-1950 style (must be taken out of reset) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71) #define PVR2_IR_SCHEME_24XXX_MCE 3 /* 24xxx MCE device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) #define PVR2_IR_SCHEME_29XXX 4 /* Original 29xxx device */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74) /* This describes a particular hardware type (except for the USB device ID
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) which must live in a separate structure due to environmental
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76) constraints). See the top of pvrusb2-hdw.c for where this is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) instantiated. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78) struct pvr2_device_desc {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) /* Single line text description of hardware */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) const char *description;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) /* Single token identifier for hardware */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83) const char *shortname;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) /* List of additional client modules we need to load */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) struct pvr2_string_table client_modules;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88) /* List of defined client modules we need to load */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) struct pvr2_device_client_table client_table;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) /* List of FX2 firmware file names we should search; if empty then
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92) FX2 firmware check / load is skipped and we assume the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) was initialized from internal ROM. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) struct pvr2_string_table fx2_firmware;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 95)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 96) #ifdef CONFIG_VIDEO_PVRUSB2_DVB
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 97) /* callback functions to handle attachment of digital tuner & demod */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 98) const struct pvr2_dvb_props *dvb_props;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 99)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101) /* Initial standard bits to use for this device, if not zero.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102) Anything set here is also implied as an available standard.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) Note: This is ignored if overridden on the module load line via
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) the video_std module option. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) v4l2_std_id default_std_mask;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) /* V4L tuner type ID to use with this device (only used if the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) driver could not discover the type any other way). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) int default_tuner_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /* Signal routing scheme used by device, contains one of
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112) PVR2_ROUTING_SCHEME_XXX. Schemes have to be defined as we
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113) encounter them. This is an arbitrary integer scheme id; its
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114) meaning is contained entirely within the driver and is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115) interpreted by logic which must send commands to the chip-level
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116) drivers (search for things which touch this field). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117) unsigned char signal_routing_scheme;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119) /* Indicates scheme for controlling device's LED (if any). The
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) driver will turn on the LED when streaming is underway. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) contains one of PVR2_LED_SCHEME_XXX. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) unsigned char led_scheme;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) /* Control scheme to use if there is a digital tuner. This
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) contains one of PVR2_DIGITAL_SCHEME_XXX. This is an arbitrary
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) integer scheme id; its meaning is contained entirely within the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) driver and is interpreted by logic which must control the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) streaming pathway (search for things which touch this field). */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129) unsigned char digital_control_scheme;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131) /* If set, we don't bother trying to load cx23416 firmware. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132) unsigned int flag_skip_cx23416_firmware:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134) /* If set, the encoder must be healthy in order for digital mode to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135) work (otherwise we assume that digital streaming will work even
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136) if we fail to locate firmware for the encoder). If the device
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) doesn't support digital streaming then this flag has no
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) effect. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) unsigned int flag_digital_requires_cx23416:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) /* Device has a hauppauge eeprom which we can interrogate. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) unsigned int flag_has_hauppauge_rom:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144) /* Device does not require a powerup command to be issued. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145) unsigned int flag_no_powerup:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147) /* Device has a cx25840 - this enables special additional logic to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148) handle it. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149) unsigned int flag_has_cx25840:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) /* Device has a wm8775 - this enables special additional logic to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) ensure that it is found. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) unsigned int flag_has_wm8775:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) /* Indicate IR scheme of hardware. If not set, then it is assumed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) that IR can work without any help from the driver. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) unsigned int ir_scheme:3;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159) /* These bits define which kinds of sources the device can handle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160) Note: Digital tuner presence is inferred by the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161) digital_control_scheme enumeration. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162) unsigned int flag_has_fmradio:1; /* Has FM radio receiver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163) unsigned int flag_has_analogtuner:1; /* Has analog tuner */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164) unsigned int flag_has_composite:1; /* Has composite input */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) unsigned int flag_has_svideo:1; /* Has s-video input */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) unsigned int flag_fx2_16kb:1; /* 16KB FX2 firmware OK here */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) /* If this driver is considered experimental, i.e. not all aspects
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) are working correctly and/or it is untested, mark that fact
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) with this flag. */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171) unsigned int flag_is_experimental:1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174) extern struct usb_device_id pvr2_device_table[];
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176) #endif /* __PVRUSB2_HDW_INTERNAL_H */