/* SPDX-License-Identifier: GPL-2.0 */12/*3* tveeprom - Contains structures and functions to work with Hauppauge4* eeproms.5*/67#include <uapi/linux/if_ether.h>89/**10* enum tveeprom_audio_processor - Specifies the type of audio processor11* used on a Hauppauge device.12*13* @TVEEPROM_AUDPROC_NONE: No audio processor present14* @TVEEPROM_AUDPROC_INTERNAL: The audio processor is internal to the15* video processor16* @TVEEPROM_AUDPROC_MSP: The audio processor is a MSPXXXX device17* @TVEEPROM_AUDPROC_OTHER: The audio processor is another device18*/19enum tveeprom_audio_processor {20TVEEPROM_AUDPROC_NONE,21TVEEPROM_AUDPROC_INTERNAL,22TVEEPROM_AUDPROC_MSP,23TVEEPROM_AUDPROC_OTHER,24};2526/**27* struct tveeprom - Contains the fields parsed from Hauppauge eeproms28*29* @has_radio: 1 if the device has radio; 0 otherwise.30*31* @has_ir: If has_ir == 0, then it is unknown what the IR32* capabilities are. Otherwise:33* bit 0) 1 (= IR capabilities are known);34* bit 1) IR receiver present;35* bit 2) IR transmitter (blaster) present.36*37* @has_MAC_address: 0: no MAC, 1: MAC present, 2: unknown.38* @tuner_type: type of the tuner (TUNER_*, as defined at39* include/media/tuner.h).40*41* @tuner_formats: Supported analog TV standards (V4L2_STD_*).42* @tuner_hauppauge_model: Hauppauge's code for the device model number.43* @tuner2_type: type of the second tuner (TUNER_*, as defined44* at include/media/tuner.h).45*46* @tuner2_formats: Tuner 2 supported analog TV standards47* (V4L2_STD_*).48*49* @tuner2_hauppauge_model: tuner 2 Hauppauge's code for the device model50* number.51*52* @audio_processor: analog audio decoder, as defined by enum53* tveeprom_audio_processor.54*55* @decoder_processor: Hauppauge's code for the decoder chipset.56* Unused by the drivers, as they probe the57* decoder based on the PCI or USB ID.58*59* @model: Hauppauge's model number60*61* @revision: Card revision number62*63* @serial_number: Card's serial number64*65* @rev_str: Card revision converted to number66*67* @MAC_address: MAC address for the network interface68*/69struct tveeprom {70u32 has_radio;71u32 has_ir;72u32 has_MAC_address;7374u32 tuner_type;75u32 tuner_formats;76u32 tuner_hauppauge_model;7778u32 tuner2_type;79u32 tuner2_formats;80u32 tuner2_hauppauge_model;8182u32 audio_processor;83u32 decoder_processor;8485u32 model;86u32 revision;87u32 serial_number;88char rev_str[5];89u8 MAC_address[ETH_ALEN];90};9192/**93* tveeprom_hauppauge_analog - Fill struct tveeprom using the contents94* of the eeprom previously filled at95* @eeprom_data field.96*97* @tvee: Struct to where the eeprom parsed data will be filled;98* @eeprom_data: Array with the contents of the eeprom_data. It should99* contain 256 bytes filled with the contents of the100* eeprom read from the Hauppauge device.101*/102void tveeprom_hauppauge_analog(struct tveeprom *tvee,103unsigned char *eeprom_data);104105/**106* tveeprom_read - Reads the contents of the eeprom found at the Hauppauge107* devices.108*109* @c: I2C client struct110* @eedata: Array where the eeprom content will be stored.111* @len: Size of @eedata array. If the eeprom content will be latter112* be parsed by tveeprom_hauppauge_analog(), len should be, at113* least, 256.114*/115int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len);116117118