/*1msp3400.h - definition for msp3400 inputs and outputs23Copyright (C) 2006 Hans Verkuil ([email protected])45This program is free software; you can redistribute it and/or modify6it under the terms of the GNU General Public License as published by7the Free Software Foundation; either version 2 of the License, or8(at your option) any later version.910This program is distributed in the hope that it will be useful,11but WITHOUT ANY WARRANTY; without even the implied warranty of12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13GNU General Public License for more details.1415You should have received a copy of the GNU General Public License16along with this program; if not, write to the Free Software17Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*/1920#ifndef _MSP3400_H_21#define _MSP3400_H_2223/* msp3400 routing24===============2526The msp3400 has a complicated routing scheme with many possible27combinations. The details are all in the datasheets but I will try28to give a short description here.2930Inputs31======3233There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have34to select which tuner input to use and which SCART input to use. The35selected tuner input, the selected SCART input and all I2S inputs go to36the DSP (the tuner input first goes through the demodulator).3738The DSP handles things like volume, bass/treble, balance, and some chips39have support for surround sound. It has several outputs: MAIN, AUX, I2S40and SCART1/2. Each output can select which DSP input to use. So the MAIN41output can select the tuner input while at the same time the SCART1 output42uses the I2S input.4344Outputs45=======4647Most DSP outputs are also the outputs of the msp3400. However, the SCART48outputs of the msp3400 can select which input to use: either the SCART1 or49SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely50bypassing the DSP.5152Summary53=======5455So to specify a complete routing scheme for the msp3400 you will have to56specify in the 'input' arg of the s_routing function:57581) which tuner input to use592) which SCART input to use603) which DSP input to use for each DSP output6162And in the 'output' arg of the s_routing function you specify:63641) which SCART input to use for each SCART output6566Depending on how the msp is wired to the other components you can67ignore or mute certain inputs or outputs.6869Also, depending on the msp version only a subset of the inputs or70outputs may be present. At the end of this header some tables are71added containing a list of what is available for each msp version.72*/7374/* Inputs to the DSP unit: two independent selections have to be made:751) the tuner (SIF) input762) the SCART input77Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner78input, bits 4-7 are reserved.79*/8081/* SCART input to DSP selection */82#define MSP_IN_SCART1 0 /* Pin SC1_IN */83#define MSP_IN_SCART2 1 /* Pin SC2_IN */84#define MSP_IN_SCART3 2 /* Pin SC3_IN */85#define MSP_IN_SCART4 3 /* Pin SC4_IN */86#define MSP_IN_MONO 6 /* Pin MONO_IN */87#define MSP_IN_MUTE 7 /* Mute DSP input */88#define MSP_SCART_TO_DSP(in) (in)89/* Tuner input to demodulator and DSP selection */90#define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */91#define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */92#define MSP_TUNER_TO_DSP(in) ((in) << 3)9394/* The msp has up to 5 DSP outputs, each output can independently select95a DSP input.9697The DSP outputs are: loudspeaker output (aka MAIN), headphones output98(aka AUX), SCART1 DA output, SCART2 DA output and an I2S output.99There also is a quasi-peak detector output, but that is not used by100this driver and is set to the same input as the loudspeaker output.101Not all outputs are supported by all msp models. Setting the input102of an unsupported output will be ignored by the driver.103104There are up to 16 DSP inputs to choose from, so each output is105assigned 4 bits.106107Note: the 44x8G can mix two inputs and feed the result back to the108DSP. This is currently not implemented. Also not implemented is the109multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate110a need for one of those features then additional support can be added. */111#define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */112#define MSP_DSP_IN_SCART 2 /* SCART DSP input */113#define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */114#define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */115#define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */116#define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */117#define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */118#define MSP_DSP_IN_AUX 13 /* AUX DSP input */119#define MSP_DSP_TO_MAIN(in) ((in) << 4)120#define MSP_DSP_TO_AUX(in) ((in) << 8)121#define MSP_DSP_TO_SCART1(in) ((in) << 12)122#define MSP_DSP_TO_SCART2(in) ((in) << 16)123#define MSP_DSP_TO_I2S(in) ((in) << 20)124125/* Output SCART select: the SCART outputs can select which input126to use. */127#define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */128#define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */129#define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */130#define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */131#define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */132#define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */133#define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */134#define MSP_SC_IN_MUTE 7 /* MUTE output */135#define MSP_SC_TO_SCART1(in) (in)136#define MSP_SC_TO_SCART2(in) ((in) << 4)137138/* Shortcut macros */139#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \140(MSP_SCART_TO_DSP(sc) | \141MSP_TUNER_TO_DSP(t) | \142MSP_DSP_TO_MAIN(main_aux_src) | \143MSP_DSP_TO_AUX(main_aux_src) | \144MSP_DSP_TO_SCART1(sc_i2s_src) | \145MSP_DSP_TO_SCART2(sc_i2s_src) | \146MSP_DSP_TO_I2S(sc_i2s_src))147#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \148MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)149#define MSP_OUTPUT(sc) \150(MSP_SC_TO_SCART1(sc) | \151MSP_SC_TO_SCART2(sc))152/* This equals the RESET position of the msp3400 ACB register */153#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \154MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))155156/* Tuner inputs vs. msp version */157/* Chip TUNER_1 TUNER_2158-------------------------159msp34x0b y y160msp34x0c y y161msp34x0d y y162msp34x5d y n163msp34x7d y n164msp34x0g y y165msp34x1g y y166msp34x2g y y167msp34x5g y n168msp34x7g y n169msp44x0g y y170msp44x8g y y171*/172173/* SCART inputs vs. msp version */174/* Chip SC1 SC2 SC3 SC4175-------------------------176msp34x0b y y y n177msp34x0c y y y n178msp34x0d y y y y179msp34x5d y y n n180msp34x7d y n n n181msp34x0g y y y y182msp34x1g y y y y183msp34x2g y y y y184msp34x5g y y n n185msp34x7g y n n n186msp44x0g y y y y187msp44x8g y y y y188*/189190/* DSP inputs vs. msp version (tuner and SCART inputs are always available) */191/* Chip I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX192------------------------------------------193msp34x0b y n n n n n194msp34x0c y y n n n n195msp34x0d y y n n n n196msp34x5d y y n n n n197msp34x7d n n n n n n198msp34x0g y y n n n n199msp34x1g y y n n n n200msp34x2g y y n y y y201msp34x5g y y n n n n202msp34x7g n n n n n n203msp44x0g y y y y y y204msp44x8g y y y n n n205*/206207/* DSP outputs vs. msp version */208/* Chip MAIN AUX SCART1 SCART2 I2S209------------------------------------210msp34x0b y y y n y211msp34x0c y y y n y212msp34x0d y y y y y213msp34x5d y n y n y214msp34x7d y n y n n215msp34x0g y y y y y216msp34x1g y y y y y217msp34x2g y y y y y218msp34x5g y n y n y219msp34x7g y n y n n220msp44x0g y y y y y221msp44x8g y y y y y222*/223224#endif /* MSP3400_H */225226227228