Commit | Line | Data |
---|---|---|
326ab27b | 1 | |
ac19ecc6 | 2 | /* |
326ab27b MCC |
3 | * tveeprom - Contains structures and functions to work with Hauppauge |
4 | * eeproms. | |
ac19ecc6 MCC |
5 | */ |
6 | ||
326ab27b MCC |
7 | #include <linux/if_ether.h> |
8 | ||
9 | /** | |
10 | * enum tveeprom_audio_processor - Specifies the type of audio processor | |
11 | * used on a Hauppauge device. | |
12 | * | |
13 | * @TVEEPROM_AUDPROC_NONE: No audio processor present | |
14 | * @TVEEPROM_AUDPROC_INTERNAL: The audio processor is internal to the | |
15 | * video processor | |
16 | * @TVEEPROM_AUDPROC_MSP: The audio processor is a MSPXXXX device | |
17 | * @TVEEPROM_AUDPROC_OTHER: The audio processor is another device | |
18 | */ | |
33001010 | 19 | enum tveeprom_audio_processor { |
33001010 | 20 | TVEEPROM_AUDPROC_NONE, |
33001010 | 21 | TVEEPROM_AUDPROC_INTERNAL, |
33001010 | 22 | TVEEPROM_AUDPROC_MSP, |
33001010 HV |
23 | TVEEPROM_AUDPROC_OTHER, |
24 | }; | |
25 | ||
326ab27b MCC |
26 | /** |
27 | * struct tveeprom - Contains the fields parsed from Hauppauge eeproms | |
28 | * | |
29 | * @has_radio: 1 if the device has radio; 0 otherwise. | |
30 | * @has_ir: If has_ir == 0, then it is unknown what the IR | |
31 | * capabilities are. Otherwise: | |
32 | * bit 0) 1 (= IR capabilities are known); | |
33 | * bit 1) IR receiver present; | |
34 | * bit 2) IR transmitter (blaster) present. | |
35 | * @has_MAC_address: 0: no MAC, 1: MAC present, 2: unknown. | |
36 | * @tuner_type: type of the tuner (TUNER_*, as defined at | |
37 | * include/media/tuner.h). | |
38 | * @tuner_formats: Supported analog TV standards (V4L2_STD_*). | |
39 | * @tuner_hauppauge_model: Hauppauge's code for the device model number. | |
40 | * @tuner2_type: type of the second tuner (TUNER_*, as defined | |
41 | * at include/media/tuner.h). | |
42 | * @tuner2_formats: Tuner 2 supported analog TV standards | |
43 | * (V4L2_STD_*). | |
44 | * @tuner2_hauppauge_model: tuner 2 Hauppauge's code for the device model | |
45 | * number. | |
46 | * @audio_processor: analog audio decoder, as defined by enum | |
47 | * tveeprom_audio_processor. | |
48 | * @decoder_processor: Hauppauge's code for the decoder chipset. | |
49 | * Unused by the drivers, as they probe the | |
50 | * decoder based on the PCI or USB ID. | |
51 | * @model: Hauppauge's model number | |
52 | * @revision: Card revision number | |
53 | * @serial_number: Card's serial number | |
54 | * @rev_str: Card revision converted to number | |
55 | * @MAC_address: MAC address for the network interface | |
56 | */ | |
1da177e4 LT |
57 | struct tveeprom { |
58 | u32 has_radio; | |
b654fcdc | 59 | u32 has_ir; |
326ab27b | 60 | u32 has_MAC_address; |
1da177e4 LT |
61 | |
62 | u32 tuner_type; | |
63 | u32 tuner_formats; | |
f95006f8 | 64 | u32 tuner_hauppauge_model; |
1da177e4 | 65 | |
0f97a931 MCC |
66 | u32 tuner2_type; |
67 | u32 tuner2_formats; | |
f95006f8 | 68 | u32 tuner2_hauppauge_model; |
0f97a931 | 69 | |
1da177e4 | 70 | u32 audio_processor; |
0f97a931 | 71 | u32 decoder_processor; |
1da177e4 LT |
72 | |
73 | u32 model; | |
74 | u32 revision; | |
75 | u32 serial_number; | |
76 | char rev_str[5]; | |
574e2af7 | 77 | u8 MAC_address[ETH_ALEN]; |
1da177e4 LT |
78 | }; |
79 | ||
326ab27b MCC |
80 | /** |
81 | * tveeprom_hauppauge_analog - Fill struct tveeprom using the contents | |
82 | * of the eeprom previously filled at | |
83 | * @eeprom_data field. | |
84 | * | |
85 | * @c: I2C client struct | |
86 | * @tvee: Struct to where the eeprom parsed data will be filled; | |
87 | * @eeprom_data: Array with the contents of the eeprom_data. It should | |
88 | * contain 256 bytes filled with the contents of the | |
89 | * eeprom read from the Hauppauge device. | |
90 | */ | |
0f97a931 | 91 | void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee, |
1da177e4 LT |
92 | unsigned char *eeprom_data); |
93 | ||
326ab27b MCC |
94 | /** |
95 | * tveeprom_read - Reads the contents of the eeprom found at the Hauppauge | |
96 | * devices. | |
97 | * | |
98 | * @c: I2C client struct | |
99 | * @eedata: Array where the eeprom content will be stored. | |
100 | * @len: Size of @eedata array. If the eeprom content will be latter | |
101 | * be parsed by tveeprom_hauppauge_analog(), len should be, at | |
102 | * least, 256. | |
103 | */ | |
1da177e4 | 104 | int tveeprom_read(struct i2c_client *c, unsigned char *eedata, int len); |