18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci *  Copyright (C) 2005 Mike Isely <isely@pobox.com>
58c2ecf20Sopenharmony_ci */
68c2ecf20Sopenharmony_ci#ifndef __PVRUSB2_DEVATTR_H
78c2ecf20Sopenharmony_ci#define __PVRUSB2_DEVATTR_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#include <linux/mod_devicetable.h>
108c2ecf20Sopenharmony_ci#include <linux/videodev2.h>
118c2ecf20Sopenharmony_ci#ifdef CONFIG_VIDEO_PVRUSB2_DVB
128c2ecf20Sopenharmony_ci#include "pvrusb2-dvb.h"
138c2ecf20Sopenharmony_ci#endif
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci/*
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci  This header defines structures used to describe attributes of a device.
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci*/
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_NULL 0
238c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_MSP3400 1
248c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_CX25840 2
258c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_SAA7115 3
268c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_TUNER 4
278c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_CS53L32A 5
288c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_WM8775 6
298c2ecf20Sopenharmony_ci#define PVR2_CLIENT_ID_DEMOD 7
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_cistruct pvr2_device_client_desc {
328c2ecf20Sopenharmony_ci	/* One ovr PVR2_CLIENT_ID_xxxx */
338c2ecf20Sopenharmony_ci	unsigned char module_id;
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci	/* Null-terminated array of I2C addresses to try in order
368c2ecf20Sopenharmony_ci	   initialize the module.  It's safe to make this null terminated
378c2ecf20Sopenharmony_ci	   since we're never going to encounter an i2c device with an
388c2ecf20Sopenharmony_ci	   address of zero.  If this is a null pointer or zero-length,
398c2ecf20Sopenharmony_ci	   then no I2C addresses have been specified, in which case we'll
408c2ecf20Sopenharmony_ci	   try some compiled in defaults for now. */
418c2ecf20Sopenharmony_ci	unsigned char *i2c_address_list;
428c2ecf20Sopenharmony_ci};
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_cistruct pvr2_device_client_table {
458c2ecf20Sopenharmony_ci	const struct pvr2_device_client_desc *lst;
468c2ecf20Sopenharmony_ci	unsigned char cnt;
478c2ecf20Sopenharmony_ci};
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_cistruct pvr2_string_table {
518c2ecf20Sopenharmony_ci	const char **lst;
528c2ecf20Sopenharmony_ci	unsigned int cnt;
538c2ecf20Sopenharmony_ci};
548c2ecf20Sopenharmony_ci
558c2ecf20Sopenharmony_ci#define PVR2_ROUTING_SCHEME_HAUPPAUGE 0
568c2ecf20Sopenharmony_ci#define PVR2_ROUTING_SCHEME_GOTVIEW 1
578c2ecf20Sopenharmony_ci#define PVR2_ROUTING_SCHEME_ONAIR 2
588c2ecf20Sopenharmony_ci#define PVR2_ROUTING_SCHEME_AV400 3
598c2ecf20Sopenharmony_ci#define PVR2_ROUTING_SCHEME_HAUP160XXX 4
608c2ecf20Sopenharmony_ci
618c2ecf20Sopenharmony_ci#define PVR2_DIGITAL_SCHEME_NONE 0
628c2ecf20Sopenharmony_ci#define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
638c2ecf20Sopenharmony_ci#define PVR2_DIGITAL_SCHEME_ONAIR 2
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define PVR2_LED_SCHEME_NONE 0
668c2ecf20Sopenharmony_ci#define PVR2_LED_SCHEME_HAUPPAUGE 1
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_ci#define PVR2_IR_SCHEME_NONE 0
698c2ecf20Sopenharmony_ci#define PVR2_IR_SCHEME_24XXX 1 /* FX2-controlled IR */
708c2ecf20Sopenharmony_ci#define PVR2_IR_SCHEME_ZILOG 2 /* HVR-1950 style (must be taken out of reset) */
718c2ecf20Sopenharmony_ci#define PVR2_IR_SCHEME_24XXX_MCE 3 /* 24xxx MCE device */
728c2ecf20Sopenharmony_ci#define PVR2_IR_SCHEME_29XXX 4 /* Original 29xxx device */
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci/* This describes a particular hardware type (except for the USB device ID
758c2ecf20Sopenharmony_ci   which must live in a separate structure due to environmental
768c2ecf20Sopenharmony_ci   constraints).  See the top of pvrusb2-hdw.c for where this is
778c2ecf20Sopenharmony_ci   instantiated. */
788c2ecf20Sopenharmony_cistruct pvr2_device_desc {
798c2ecf20Sopenharmony_ci	/* Single line text description of hardware */
808c2ecf20Sopenharmony_ci	const char *description;
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci	/* Single token identifier for hardware */
838c2ecf20Sopenharmony_ci	const char *shortname;
848c2ecf20Sopenharmony_ci
858c2ecf20Sopenharmony_ci	/* List of additional client modules we need to load */
868c2ecf20Sopenharmony_ci	struct pvr2_string_table client_modules;
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci	/* List of defined client modules we need to load */
898c2ecf20Sopenharmony_ci	struct pvr2_device_client_table client_table;
908c2ecf20Sopenharmony_ci
918c2ecf20Sopenharmony_ci	/* List of FX2 firmware file names we should search; if empty then
928c2ecf20Sopenharmony_ci	   FX2 firmware check / load is skipped and we assume the device
938c2ecf20Sopenharmony_ci	   was initialized from internal ROM. */
948c2ecf20Sopenharmony_ci	struct pvr2_string_table fx2_firmware;
958c2ecf20Sopenharmony_ci
968c2ecf20Sopenharmony_ci#ifdef CONFIG_VIDEO_PVRUSB2_DVB
978c2ecf20Sopenharmony_ci	/* callback functions to handle attachment of digital tuner & demod */
988c2ecf20Sopenharmony_ci	const struct pvr2_dvb_props *dvb_props;
998c2ecf20Sopenharmony_ci
1008c2ecf20Sopenharmony_ci#endif
1018c2ecf20Sopenharmony_ci	/* Initial standard bits to use for this device, if not zero.
1028c2ecf20Sopenharmony_ci	   Anything set here is also implied as an available standard.
1038c2ecf20Sopenharmony_ci	   Note: This is ignored if overridden on the module load line via
1048c2ecf20Sopenharmony_ci	   the video_std module option. */
1058c2ecf20Sopenharmony_ci	v4l2_std_id default_std_mask;
1068c2ecf20Sopenharmony_ci
1078c2ecf20Sopenharmony_ci	/* V4L tuner type ID to use with this device (only used if the
1088c2ecf20Sopenharmony_ci	   driver could not discover the type any other way). */
1098c2ecf20Sopenharmony_ci	int default_tuner_type;
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci	/* Signal routing scheme used by device, contains one of
1128c2ecf20Sopenharmony_ci	   PVR2_ROUTING_SCHEME_XXX.  Schemes have to be defined as we
1138c2ecf20Sopenharmony_ci	   encounter them.  This is an arbitrary integer scheme id; its
1148c2ecf20Sopenharmony_ci	   meaning is contained entirely within the driver and is
1158c2ecf20Sopenharmony_ci	   interpreted by logic which must send commands to the chip-level
1168c2ecf20Sopenharmony_ci	   drivers (search for things which touch this field). */
1178c2ecf20Sopenharmony_ci	unsigned char signal_routing_scheme;
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci	/* Indicates scheme for controlling device's LED (if any).  The
1208c2ecf20Sopenharmony_ci	   driver will turn on the LED when streaming is underway.  This
1218c2ecf20Sopenharmony_ci	   contains one of PVR2_LED_SCHEME_XXX. */
1228c2ecf20Sopenharmony_ci	unsigned char led_scheme;
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci	/* Control scheme to use if there is a digital tuner.  This
1258c2ecf20Sopenharmony_ci	   contains one of PVR2_DIGITAL_SCHEME_XXX.  This is an arbitrary
1268c2ecf20Sopenharmony_ci	   integer scheme id; its meaning is contained entirely within the
1278c2ecf20Sopenharmony_ci	   driver and is interpreted by logic which must control the
1288c2ecf20Sopenharmony_ci	   streaming pathway (search for things which touch this field). */
1298c2ecf20Sopenharmony_ci	unsigned char digital_control_scheme;
1308c2ecf20Sopenharmony_ci
1318c2ecf20Sopenharmony_ci	/* If set, we don't bother trying to load cx23416 firmware. */
1328c2ecf20Sopenharmony_ci	unsigned int flag_skip_cx23416_firmware:1;
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci	/* If set, the encoder must be healthy in order for digital mode to
1358c2ecf20Sopenharmony_ci	   work (otherwise we assume that digital streaming will work even
1368c2ecf20Sopenharmony_ci	   if we fail to locate firmware for the encoder).  If the device
1378c2ecf20Sopenharmony_ci	   doesn't support digital streaming then this flag has no
1388c2ecf20Sopenharmony_ci	   effect. */
1398c2ecf20Sopenharmony_ci	unsigned int flag_digital_requires_cx23416:1;
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci	/* Device has a hauppauge eeprom which we can interrogate. */
1428c2ecf20Sopenharmony_ci	unsigned int flag_has_hauppauge_rom:1;
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci	/* Device does not require a powerup command to be issued. */
1458c2ecf20Sopenharmony_ci	unsigned int flag_no_powerup:1;
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci	/* Device has a cx25840 - this enables special additional logic to
1488c2ecf20Sopenharmony_ci	   handle it. */
1498c2ecf20Sopenharmony_ci	unsigned int flag_has_cx25840:1;
1508c2ecf20Sopenharmony_ci
1518c2ecf20Sopenharmony_ci	/* Device has a wm8775 - this enables special additional logic to
1528c2ecf20Sopenharmony_ci	   ensure that it is found. */
1538c2ecf20Sopenharmony_ci	unsigned int flag_has_wm8775:1;
1548c2ecf20Sopenharmony_ci
1558c2ecf20Sopenharmony_ci	/* Indicate IR scheme of hardware.  If not set, then it is assumed
1568c2ecf20Sopenharmony_ci	   that IR can work without any help from the driver. */
1578c2ecf20Sopenharmony_ci	unsigned int ir_scheme:3;
1588c2ecf20Sopenharmony_ci
1598c2ecf20Sopenharmony_ci	/* These bits define which kinds of sources the device can handle.
1608c2ecf20Sopenharmony_ci	   Note: Digital tuner presence is inferred by the
1618c2ecf20Sopenharmony_ci	   digital_control_scheme enumeration. */
1628c2ecf20Sopenharmony_ci	unsigned int flag_has_fmradio:1;       /* Has FM radio receiver */
1638c2ecf20Sopenharmony_ci	unsigned int flag_has_analogtuner:1;   /* Has analog tuner */
1648c2ecf20Sopenharmony_ci	unsigned int flag_has_composite:1;     /* Has composite input */
1658c2ecf20Sopenharmony_ci	unsigned int flag_has_svideo:1;        /* Has s-video input */
1668c2ecf20Sopenharmony_ci	unsigned int flag_fx2_16kb:1;          /* 16KB FX2 firmware OK here */
1678c2ecf20Sopenharmony_ci
1688c2ecf20Sopenharmony_ci	/* If this driver is considered experimental, i.e. not all aspects
1698c2ecf20Sopenharmony_ci	   are working correctly and/or it is untested, mark that fact
1708c2ecf20Sopenharmony_ci	   with this flag. */
1718c2ecf20Sopenharmony_ci	unsigned int flag_is_experimental:1;
1728c2ecf20Sopenharmony_ci};
1738c2ecf20Sopenharmony_ci
1748c2ecf20Sopenharmony_ciextern struct usb_device_id pvr2_device_table[];
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci#endif /* __PVRUSB2_HDW_INTERNAL_H */
177