[PATCH] v4l: 702: included audio chips enum

- Included audio chips enum

Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Mauro Carvalho Chehab 2005-11-08 21:36:56 -08:00 committed by Linus Torvalds
parent 6af90ab5e7
commit 90a7ed47a3
2 changed files with 263 additions and 184 deletions

View File

@ -40,6 +40,7 @@
#include <media/tuner.h>
#include <media/tveeprom.h>
#include "audiochip.h"
MODULE_DESCRIPTION("i2c Hauppauge eeprom decoder driver");
MODULE_AUTHOR("John Klar");
@ -189,7 +190,7 @@ hauppauge_tuner[] =
{ TUNER_LG_PAL_NEW_TAPC, "TCL 2002MB 3"},
{ TUNER_LG_PAL_NEW_TAPC, "TCL 2002MI 3"},
{ TUNER_TCL_2002N, "TCL 2002N 6A"},
{ TUNER_ABSENT, "Philips FQ1236 MK3"},
{ TUNER_PHILIPS_FM1236_MK3, "Philips FQ1236 MK3"},
{ TUNER_ABSENT, "Samsung TCPN 2121P30A"},
{ TUNER_ABSENT, "Samsung TCPE 4121P30A"},
{ TUNER_PHILIPS_FM1216ME_MK3, "TCL MFPE05 2"},
@ -217,24 +218,60 @@ hauppauge_tuner[] =
{ TUNER_ABSENT, "TCL 1676NM-WM"},
};
/* This list is supplied by Hauppauge. Thanks! */
static const char *audioIC[] = {
static struct HAUPPAUGE_AUDIOIC
{
enum audiochip id;
char *name;
}
audioIC[] =
{
/* 0-4 */
"None", "TEA6300", "TEA6320", "TDA9850", "MSP3400C",
{AUDIO_CHIP_NONE, "None"},
{AUDIO_CHIP_TEA6300, "TEA6300"},
{AUDIO_CHIP_TEA6300, "TEA6320"},
{AUDIO_CHIP_TDA985X, "TDA9850"},
{AUDIO_CHIP_MSP34XX, "MSP3400C"},
/* 5-9 */
"MSP3410D", "MSP3415", "MSP3430", "MSP3438", "CS5331",
{AUDIO_CHIP_MSP34XX, "MSP3410D"},
{AUDIO_CHIP_MSP34XX, "MSP3415"},
{AUDIO_CHIP_MSP34XX, "MSP3430"},
{AUDIO_CHIP_UNKNOWN, "MSP3438"},
{AUDIO_CHIP_UNKNOWN, "CS5331"},
/* 10-14 */
"MSP3435", "MSP3440", "MSP3445", "MSP3411", "MSP3416",
{AUDIO_CHIP_MSP34XX, "MSP3435"},
{AUDIO_CHIP_MSP34XX, "MSP3440"},
{AUDIO_CHIP_MSP34XX, "MSP3445"},
{AUDIO_CHIP_UNKNOWN, "MSP3411"},
{AUDIO_CHIP_UNKNOWN, "MSP3416"},
/* 15-19 */
"MSP3425", "MSP3451", "MSP3418", "Type 0x12", "OKI7716",
{AUDIO_CHIP_MSP34XX, "MSP3425"},
{AUDIO_CHIP_UNKNOWN, "MSP3451"},
{AUDIO_CHIP_UNKNOWN, "MSP3418"},
{AUDIO_CHIP_UNKNOWN, "Type 0x12"},
{AUDIO_CHIP_UNKNOWN, "OKI7716"},
/* 20-24 */
"MSP4410", "MSP4420", "MSP4440", "MSP4450", "MSP4408",
{AUDIO_CHIP_UNKNOWN, "MSP4410"},
{AUDIO_CHIP_UNKNOWN, "MSP4420"},
{AUDIO_CHIP_UNKNOWN, "MSP4440"},
{AUDIO_CHIP_UNKNOWN, "MSP4450"},
{AUDIO_CHIP_UNKNOWN, "MSP4408"},
/* 25-29 */
"MSP4418", "MSP4428", "MSP4448", "MSP4458", "Type 0x1d",
{AUDIO_CHIP_UNKNOWN, "MSP4418"},
{AUDIO_CHIP_UNKNOWN, "MSP4428"},
{AUDIO_CHIP_UNKNOWN, "MSP4448"},
{AUDIO_CHIP_UNKNOWN, "MSP4458"},
{AUDIO_CHIP_UNKNOWN, "Type 0x1d"},
/* 30-34 */
"CX880", "CX881", "CX883", "CX882", "CX25840",
{AUDIO_CHIP_INTERNAL, "CX880"},
{AUDIO_CHIP_INTERNAL, "CX881"},
{AUDIO_CHIP_INTERNAL, "CX883"},
{AUDIO_CHIP_INTERNAL, "CX882"},
{AUDIO_CHIP_INTERNAL, "CX25840"},
/* 35-38 */
"CX25841", "CX25842", "CX25843", "CX23418",
{AUDIO_CHIP_INTERNAL, "CX25841"},
{AUDIO_CHIP_INTERNAL, "CX25842"},
{AUDIO_CHIP_INTERNAL, "CX25843"},
{AUDIO_CHIP_INTERNAL, "CX23418"},
};
/* This list is supplied by Hauppauge. Thanks! */
@ -318,9 +355,9 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
** # of inputs/outputs ???
*/
int i, j, len, done, beenhere, tag;
int i, j, len, done, beenhere, tag,start;
int tuner1 = 0, t_format1 = 0;
int tuner1 = 0, t_format1 = 0, audioic=-1;
char *t_name1 = NULL;
const char *t_fmt_name1[8] = { " none", "", "", "", "", "", "", "" };
@ -330,7 +367,15 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
memset(tvee, 0, sizeof(*tvee));
done = len = beenhere = 0;
for (i = 0; !done && i < 256; i += len) {
/* Hack for processing eeprom for em28xx */
if ((eeprom_data[0]==0x1a)&&(eeprom_data[1]==0xeb)&&
(eeprom_data[2]==0x67)&&(eeprom_data[3]==0x95))
start=0xa0;
else
start=0;
for (i = start; !done && i < 256; i += len) {
if (eeprom_data[i] == 0x84) {
len = eeprom_data[i + 1] + (eeprom_data[i + 2] << 8);
i += 3;
@ -388,7 +433,11 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
Note mask with 0x7F, high bit used on some older models
to indicate 4052 mux was removed in favor of using MSP
inputs directly. */
tvee->audio_processor = eeprom_data[i+2] & 0x7f;
audioic = eeprom_data[i+2] & 0x7f;
if (audioic < sizeof(audioIC)/sizeof(*audioIC))
tvee->audio_processor = audioIC[audioic].id;
else
tvee->audio_processor = AUDIO_CHIP_UNKNOWN;
break;
/* case 0x03: tag 'EEInfo' */
@ -406,7 +455,12 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
Note mask with 0x7F, high bit used on some older models
to indicate 4052 mux was removed in favor of using MSP
inputs directly. */
tvee->audio_processor = eeprom_data[i+1] & 0x7f;
audioic = eeprom_data[i+1] & 0x7f;
if (audioic < sizeof(audioIC)/sizeof(*audioIC))
tvee->audio_processor = audioIC[audioic].id;
else
tvee->audio_processor = AUDIO_CHIP_UNKNOWN;
break;
case 0x06:
@ -540,9 +594,17 @@ void tveeprom_hauppauge_analog(struct i2c_client *c, struct tveeprom *tvee,
t_fmt_name2[4], t_fmt_name2[5], t_fmt_name2[6], t_fmt_name2[7],
t_format2);
}
if (audioic<0) {
tveeprom_info("audio processor is unknown (no idx)\n");
tvee->audio_processor=AUDIO_CHIP_UNKNOWN;
} else {
if (audioic < sizeof(audioIC)/sizeof(*audioIC))
tveeprom_info("audio processor is %s (idx %d)\n",
STRM(audioIC, tvee->audio_processor),
tvee->audio_processor);
audioIC[audioic].name,audioic);
else
tveeprom_info("audio processor is unknown (idx %d)\n",
audioic);
}
if (tvee->decoder_processor) {
tveeprom_info("decoder processor is %s (idx %d)\n",
STRM(decoderIC, tvee->decoder_processor),

View File

@ -4,6 +4,23 @@
#ifndef AUDIOCHIP_H
#define AUDIOCHIP_H
enum audiochip {
AUDIO_CHIP_NONE,
AUDIO_CHIP_UNKNOWN,
/* Provided by video chip */
AUDIO_CHIP_INTERNAL,
/* Provided by tvaudio.c */
AUDIO_CHIP_TDA8425,
AUDIO_CHIP_TEA6300,
AUDIO_CHIP_TEA6420,
AUDIO_CHIP_TDA9840,
AUDIO_CHIP_TDA985X,
AUDIO_CHIP_TDA9874,
AUDIO_CHIP_PIC16C54,
/* Provided by msp3400.c */
AUDIO_CHIP_MSP34XX
};
/* ---------------------------------------------------------------------- */
/* v4l device was opened in Radio mode */