/* SPDX-License-Identifier: GPL-2.0-or-later */1/*2msp3400.h - definition for msp3400 inputs and outputs34Copyright (C) 2006 Hans Verkuil ([email protected])56*/78#ifndef _MSP3400_H_9#define _MSP3400_H_1011/* msp3400 routing12===============1314The msp3400 has a complicated routing scheme with many possible15combinations. The details are all in the datasheets but I will try16to give a short description here.1718Inputs19======2021There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have22to select which tuner input to use and which SCART input to use. The23selected tuner input, the selected SCART input and all I2S inputs go to24the DSP (the tuner input first goes through the demodulator).2526The DSP handles things like volume, bass/treble, balance, and some chips27have support for surround sound. It has several outputs: MAIN, AUX, I2S28and SCART1/2. Each output can select which DSP input to use. So the MAIN29output can select the tuner input while at the same time the SCART1 output30uses the I2S input.3132Outputs33=======3435Most DSP outputs are also the outputs of the msp3400. However, the SCART36outputs of the msp3400 can select which input to use: either the SCART1 or37SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely38bypassing the DSP.3940Summary41=======4243So to specify a complete routing scheme for the msp3400 you will have to44specify in the 'input' arg of the s_routing function:45461) which tuner input to use472) which SCART input to use483) which DSP input to use for each DSP output4950And in the 'output' arg of the s_routing function you specify:51521) which SCART input to use for each SCART output5354Depending on how the msp is wired to the other components you can55ignore or mute certain inputs or outputs.5657Also, depending on the msp version only a subset of the inputs or58outputs may be present. At the end of this header some tables are59added containing a list of what is available for each msp version.60*/6162/* Inputs to the DSP unit: two independent selections have to be made:631) the tuner (SIF) input642) the SCART input65Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner66input, bits 4-7 are reserved.67*/6869/* SCART input to DSP selection */70#define MSP_IN_SCART1 0 /* Pin SC1_IN */71#define MSP_IN_SCART2 1 /* Pin SC2_IN */72#define MSP_IN_SCART3 2 /* Pin SC3_IN */73#define MSP_IN_SCART4 3 /* Pin SC4_IN */74#define MSP_IN_MONO 6 /* Pin MONO_IN */75#define MSP_IN_MUTE 7 /* Mute DSP input */76#define MSP_SCART_TO_DSP(in) (in)77/* Tuner input to demodulator and DSP selection */78#define MSP_IN_TUNER1 0 /* Analog Sound IF input pin ANA_IN1 */79#define MSP_IN_TUNER2 1 /* Analog Sound IF input pin ANA_IN2 */80#define MSP_TUNER_TO_DSP(in) ((in) << 3)8182/* The msp has up to 5 DSP outputs, each output can independently select83a DSP input.8485The DSP outputs are: loudspeaker output (aka MAIN), headphones output86(aka AUX), SCART1 DA output, SCART2 DA output and an I2S output.87There also is a quasi-peak detector output, but that is not used by88this driver and is set to the same input as the loudspeaker output.89Not all outputs are supported by all msp models. Setting the input90of an unsupported output will be ignored by the driver.9192There are up to 16 DSP inputs to choose from, so each output is93assigned 4 bits.9495Note: the 44x8G can mix two inputs and feed the result back to the96DSP. This is currently not implemented. Also not implemented is the97multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate98a need for one of those features then additional support can be added. */99#define MSP_DSP_IN_TUNER 0 /* Tuner DSP input */100#define MSP_DSP_IN_SCART 2 /* SCART DSP input */101#define MSP_DSP_IN_I2S1 5 /* I2S1 DSP input */102#define MSP_DSP_IN_I2S2 6 /* I2S2 DSP input */103#define MSP_DSP_IN_I2S3 7 /* I2S3 DSP input */104#define MSP_DSP_IN_MAIN_AVC 11 /* MAIN AVC processed DSP input */105#define MSP_DSP_IN_MAIN 12 /* MAIN DSP input */106#define MSP_DSP_IN_AUX 13 /* AUX DSP input */107#define MSP_DSP_TO_MAIN(in) ((in) << 4)108#define MSP_DSP_TO_AUX(in) ((in) << 8)109#define MSP_DSP_TO_SCART1(in) ((in) << 12)110#define MSP_DSP_TO_SCART2(in) ((in) << 16)111#define MSP_DSP_TO_I2S(in) ((in) << 20)112113/* Output SCART select: the SCART outputs can select which input114to use. */115#define MSP_SC_IN_SCART1 0 /* SCART1 input, bypassing the DSP */116#define MSP_SC_IN_SCART2 1 /* SCART2 input, bypassing the DSP */117#define MSP_SC_IN_SCART3 2 /* SCART3 input, bypassing the DSP */118#define MSP_SC_IN_SCART4 3 /* SCART4 input, bypassing the DSP */119#define MSP_SC_IN_DSP_SCART1 4 /* DSP SCART1 input */120#define MSP_SC_IN_DSP_SCART2 5 /* DSP SCART2 input */121#define MSP_SC_IN_MONO 6 /* MONO input, bypassing the DSP */122#define MSP_SC_IN_MUTE 7 /* MUTE output */123#define MSP_SC_TO_SCART1(in) (in)124#define MSP_SC_TO_SCART2(in) ((in) << 4)125126/* Shortcut macros */127#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \128(MSP_SCART_TO_DSP(sc) | \129MSP_TUNER_TO_DSP(t) | \130MSP_DSP_TO_MAIN(main_aux_src) | \131MSP_DSP_TO_AUX(main_aux_src) | \132MSP_DSP_TO_SCART1(sc_i2s_src) | \133MSP_DSP_TO_SCART2(sc_i2s_src) | \134MSP_DSP_TO_I2S(sc_i2s_src))135#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \136MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)137#define MSP_OUTPUT(sc) \138(MSP_SC_TO_SCART1(sc) | \139MSP_SC_TO_SCART2(sc))140/* This equals the RESET position of the msp3400 ACB register */141#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \142MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))143144/* Tuner inputs vs. msp version */145/* Chip TUNER_1 TUNER_2146-------------------------147msp34x0b y y148msp34x0c y y149msp34x0d y y150msp34x5d y n151msp34x7d y n152msp34x0g y y153msp34x1g y y154msp34x2g y y155msp34x5g y n156msp34x7g y n157msp44x0g y y158msp44x8g y y159*/160161/* SCART inputs vs. msp version */162/* Chip SC1 SC2 SC3 SC4163-------------------------164msp34x0b y y y n165msp34x0c y y y n166msp34x0d y y y y167msp34x5d y y n n168msp34x7d y n n n169msp34x0g y y y y170msp34x1g y y y y171msp34x2g y y y y172msp34x5g y y n n173msp34x7g y n n n174msp44x0g y y y y175msp44x8g y y y y176*/177178/* DSP inputs vs. msp version (tuner and SCART inputs are always available) */179/* Chip I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX180------------------------------------------181msp34x0b y n n n n n182msp34x0c y y n n n n183msp34x0d y y n n n n184msp34x5d y y n n n n185msp34x7d n n n n n n186msp34x0g y y n n n n187msp34x1g y y n n n n188msp34x2g y y n y y y189msp34x5g y y n n n n190msp34x7g n n n n n n191msp44x0g y y y y y y192msp44x8g y y y n n n193*/194195/* DSP outputs vs. msp version */196/* Chip MAIN AUX SCART1 SCART2 I2S197------------------------------------198msp34x0b y y y n y199msp34x0c y y y n y200msp34x0d y y y y y201msp34x5d y n y n y202msp34x7d y n y n n203msp34x0g y y y y y204msp34x1g y y y y y205msp34x2g y y y y y206msp34x5g y n y n y207msp34x7g y n y n n208msp44x0g y y y y y209msp44x8g y y y y y210*/211212#endif /* MSP3400_H */213214215