Linux Audio

Check our new training course

Loading...
v5.9
  1/* SPDX-License-Identifier: GPL-2.0-or-later */
  2/*
  3    msp3400.h - definition for msp3400 inputs and outputs
  4
  5    Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
  6
 
 
 
 
 
 
 
 
 
 
 
 
 
  7*/
  8
  9#ifndef _MSP3400_H_
 10#define _MSP3400_H_
 11
 12/* msp3400 routing
 13   ===============
 14
 15   The msp3400 has a complicated routing scheme with many possible
 16   combinations. The details are all in the datasheets but I will try
 17   to give a short description here.
 18
 19   Inputs
 20   ======
 21
 22   There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have
 23   to select which tuner input to use and which SCART input to use. The
 24   selected tuner input, the selected SCART input and all I2S inputs go to
 25   the DSP (the tuner input first goes through the demodulator).
 26
 27   The DSP handles things like volume, bass/treble, balance, and some chips
 28   have support for surround sound. It has several outputs: MAIN, AUX, I2S
 29   and SCART1/2. Each output can select which DSP input to use. So the MAIN
 30   output can select the tuner input while at the same time the SCART1 output
 31   uses the I2S input.
 32
 33   Outputs
 34   =======
 35
 36   Most DSP outputs are also the outputs of the msp3400. However, the SCART
 37   outputs of the msp3400 can select which input to use: either the SCART1 or
 38   SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely
 39   bypassing the DSP.
 40
 41   Summary
 42   =======
 43
 44   So to specify a complete routing scheme for the msp3400 you will have to
 45   specify in the 'input' arg of the s_routing function:
 46
 47   1) which tuner input to use
 48   2) which SCART input to use
 49   3) which DSP input to use for each DSP output
 50
 51   And in the 'output' arg of the s_routing function you specify:
 52
 53   1) which SCART input to use for each SCART output
 54
 55   Depending on how the msp is wired to the other components you can
 56   ignore or mute certain inputs or outputs.
 57
 58   Also, depending on the msp version only a subset of the inputs or
 59   outputs may be present. At the end of this header some tables are
 60   added containing a list of what is available for each msp version.
 61 */
 62
 63/* Inputs to the DSP unit: two independent selections have to be made:
 64   1) the tuner (SIF) input
 65   2) the SCART input
 66   Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner
 67   input, bits 4-7 are reserved.
 68 */
 69
 70/* SCART input to DSP selection */
 71#define MSP_IN_SCART1		0  /* Pin SC1_IN */
 72#define MSP_IN_SCART2		1  /* Pin SC2_IN */
 73#define MSP_IN_SCART3		2  /* Pin SC3_IN */
 74#define MSP_IN_SCART4		3  /* Pin SC4_IN */
 75#define MSP_IN_MONO		6  /* Pin MONO_IN */
 76#define MSP_IN_MUTE		7  /* Mute DSP input */
 77#define MSP_SCART_TO_DSP(in)	(in)
 78/* Tuner input to demodulator and DSP selection */
 79#define MSP_IN_TUNER1		0  /* Analog Sound IF input pin ANA_IN1 */
 80#define MSP_IN_TUNER2		1  /* Analog Sound IF input pin ANA_IN2 */
 81#define MSP_TUNER_TO_DSP(in)	((in) << 3)
 82
 83/* The msp has up to 5 DSP outputs, each output can independently select
 84   a DSP input.
 85
 86   The DSP outputs are: loudspeaker output (aka MAIN), headphones output
 87   (aka AUX), SCART1 DA output, SCART2 DA output and an I2S output.
 88   There also is a quasi-peak detector output, but that is not used by
 89   this driver and is set to the same input as the loudspeaker output.
 90   Not all outputs are supported by all msp models. Setting the input
 91   of an unsupported output will be ignored by the driver.
 92
 93   There are up to 16 DSP inputs to choose from, so each output is
 94   assigned 4 bits.
 95
 96   Note: the 44x8G can mix two inputs and feed the result back to the
 97   DSP. This is currently not implemented. Also not implemented is the
 98   multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate
 99   a need for one of those features then additional support can be added. */
100#define MSP_DSP_IN_TUNER	0  /* Tuner DSP input */
101#define MSP_DSP_IN_SCART	2  /* SCART DSP input */
102#define MSP_DSP_IN_I2S1		5  /* I2S1 DSP input */
103#define MSP_DSP_IN_I2S2		6  /* I2S2 DSP input */
104#define MSP_DSP_IN_I2S3		7  /* I2S3 DSP input */
105#define MSP_DSP_IN_MAIN_AVC	11 /* MAIN AVC processed DSP input */
106#define MSP_DSP_IN_MAIN		12 /* MAIN DSP input */
107#define MSP_DSP_IN_AUX		13 /* AUX DSP input */
108#define MSP_DSP_TO_MAIN(in)	((in) << 4)
109#define MSP_DSP_TO_AUX(in)	((in) << 8)
110#define MSP_DSP_TO_SCART1(in)	((in) << 12)
111#define MSP_DSP_TO_SCART2(in)	((in) << 16)
112#define MSP_DSP_TO_I2S(in)	((in) << 20)
113
114/* Output SCART select: the SCART outputs can select which input
115   to use. */
116#define MSP_SC_IN_SCART1	0  /* SCART1 input, bypassing the DSP */
117#define MSP_SC_IN_SCART2	1  /* SCART2 input, bypassing the DSP */
118#define MSP_SC_IN_SCART3	2  /* SCART3 input, bypassing the DSP */
119#define MSP_SC_IN_SCART4	3  /* SCART4 input, bypassing the DSP */
120#define MSP_SC_IN_DSP_SCART1	4  /* DSP SCART1 input */
121#define MSP_SC_IN_DSP_SCART2	5  /* DSP SCART2 input */
122#define MSP_SC_IN_MONO		6  /* MONO input, bypassing the DSP */
123#define MSP_SC_IN_MUTE		7  /* MUTE output */
124#define MSP_SC_TO_SCART1(in)	(in)
125#define MSP_SC_TO_SCART2(in)	((in) << 4)
126
127/* Shortcut macros */
128#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \
129	(MSP_SCART_TO_DSP(sc) | \
130	 MSP_TUNER_TO_DSP(t) | \
131	 MSP_DSP_TO_MAIN(main_aux_src) | \
132	 MSP_DSP_TO_AUX(main_aux_src) | \
133	 MSP_DSP_TO_SCART1(sc_i2s_src) | \
134	 MSP_DSP_TO_SCART2(sc_i2s_src) | \
135	 MSP_DSP_TO_I2S(sc_i2s_src))
136#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
137				    MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
138#define MSP_OUTPUT(sc) \
139	(MSP_SC_TO_SCART1(sc) | \
140	 MSP_SC_TO_SCART2(sc))
141/* This equals the RESET position of the msp3400 ACB register */
142#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \
143			    MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))
144
145/* Tuner inputs vs. msp version */
146/* Chip      TUNER_1   TUNER_2
147   -------------------------
148   msp34x0b  y         y
149   msp34x0c  y         y
150   msp34x0d  y         y
151   msp34x5d  y         n
152   msp34x7d  y         n
153   msp34x0g  y         y
154   msp34x1g  y         y
155   msp34x2g  y         y
156   msp34x5g  y         n
157   msp34x7g  y         n
158   msp44x0g  y         y
159   msp44x8g  y         y
160 */
161
162/* SCART inputs vs. msp version */
163/* Chip      SC1 SC2 SC3 SC4
164   -------------------------
165   msp34x0b  y   y   y   n
166   msp34x0c  y   y   y   n
167   msp34x0d  y   y   y   y
168   msp34x5d  y   y   n   n
169   msp34x7d  y   n   n   n
170   msp34x0g  y   y   y   y
171   msp34x1g  y   y   y   y
172   msp34x2g  y   y   y   y
173   msp34x5g  y   y   n   n
174   msp34x7g  y   n   n   n
175   msp44x0g  y   y   y   y
176   msp44x8g  y   y   y   y
177 */
178
179/* DSP inputs vs. msp version (tuner and SCART inputs are always available) */
180/* Chip      I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX
181   ------------------------------------------
182   msp34x0b  y    n    n    n        n    n
183   msp34x0c  y    y    n    n        n    n
184   msp34x0d  y    y    n    n        n    n
185   msp34x5d  y    y    n    n        n    n
186   msp34x7d  n    n    n    n        n    n
187   msp34x0g  y    y    n    n        n    n
188   msp34x1g  y    y    n    n        n    n
189   msp34x2g  y    y    n    y        y    y
190   msp34x5g  y    y    n    n        n    n
191   msp34x7g  n    n    n    n        n    n
192   msp44x0g  y    y    y    y        y    y
193   msp44x8g  y    y    y    n        n    n
194 */
195
196/* DSP outputs vs. msp version */
197/* Chip      MAIN AUX SCART1 SCART2 I2S
198   ------------------------------------
199   msp34x0b  y    y   y      n      y
200   msp34x0c  y    y   y      n      y
201   msp34x0d  y    y   y      y      y
202   msp34x5d  y    n   y      n      y
203   msp34x7d  y    n   y      n      n
204   msp34x0g  y    y   y      y      y
205   msp34x1g  y    y   y      y      y
206   msp34x2g  y    y   y      y      y
207   msp34x5g  y    n   y      n      y
208   msp34x7g  y    n   y      n      n
209   msp44x0g  y    y   y      y      y
210   msp44x8g  y    y   y      y      y
211 */
212
213#endif /* MSP3400_H */
v4.6
 
  1/*
  2    msp3400.h - definition for msp3400 inputs and outputs
  3
  4    Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
  5
  6    This program is free software; you can redistribute it and/or modify
  7    it under the terms of the GNU General Public License as published by
  8    the Free Software Foundation; either version 2 of the License, or
  9    (at your option) any later version.
 10
 11    This program is distributed in the hope that it will be useful,
 12    but WITHOUT ANY WARRANTY; without even the implied warranty of
 13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14    GNU General Public License for more details.
 15
 16    You should have received a copy of the GNU General Public License
 17    along with this program; if not, write to the Free Software
 18    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 19*/
 20
 21#ifndef _MSP3400_H_
 22#define _MSP3400_H_
 23
 24/* msp3400 routing
 25   ===============
 26
 27   The msp3400 has a complicated routing scheme with many possible
 28   combinations. The details are all in the datasheets but I will try
 29   to give a short description here.
 30
 31   Inputs
 32   ======
 33
 34   There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have
 35   to select which tuner input to use and which SCART input to use. The
 36   selected tuner input, the selected SCART input and all I2S inputs go to
 37   the DSP (the tuner input first goes through the demodulator).
 38
 39   The DSP handles things like volume, bass/treble, balance, and some chips
 40   have support for surround sound. It has several outputs: MAIN, AUX, I2S
 41   and SCART1/2. Each output can select which DSP input to use. So the MAIN
 42   output can select the tuner input while at the same time the SCART1 output
 43   uses the I2S input.
 44
 45   Outputs
 46   =======
 47
 48   Most DSP outputs are also the outputs of the msp3400. However, the SCART
 49   outputs of the msp3400 can select which input to use: either the SCART1 or
 50   SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely
 51   bypassing the DSP.
 52
 53   Summary
 54   =======
 55
 56   So to specify a complete routing scheme for the msp3400 you will have to
 57   specify in the 'input' arg of the s_routing function:
 58
 59   1) which tuner input to use
 60   2) which SCART input to use
 61   3) which DSP input to use for each DSP output
 62
 63   And in the 'output' arg of the s_routing function you specify:
 64
 65   1) which SCART input to use for each SCART output
 66
 67   Depending on how the msp is wired to the other components you can
 68   ignore or mute certain inputs or outputs.
 69
 70   Also, depending on the msp version only a subset of the inputs or
 71   outputs may be present. At the end of this header some tables are
 72   added containing a list of what is available for each msp version.
 73 */
 74
 75/* Inputs to the DSP unit: two independent selections have to be made:
 76   1) the tuner (SIF) input
 77   2) the SCART input
 78   Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner
 79   input, bits 4-7 are reserved.
 80 */
 81
 82/* SCART input to DSP selection */
 83#define MSP_IN_SCART1  		0  /* Pin SC1_IN */
 84#define MSP_IN_SCART2  		1  /* Pin SC2_IN */
 85#define MSP_IN_SCART3  		2  /* Pin SC3_IN */
 86#define MSP_IN_SCART4  		3  /* Pin SC4_IN */
 87#define MSP_IN_MONO     	6  /* Pin MONO_IN */
 88#define MSP_IN_MUTE     	7  /* Mute DSP input */
 89#define MSP_SCART_TO_DSP(in) 	(in)
 90/* Tuner input to demodulator and DSP selection */
 91#define MSP_IN_TUNER1 		0  /* Analog Sound IF input pin ANA_IN1 */
 92#define MSP_IN_TUNER2 		1  /* Analog Sound IF input pin ANA_IN2 */
 93#define MSP_TUNER_TO_DSP(in) 	((in) << 3)
 94
 95/* The msp has up to 5 DSP outputs, each output can independently select
 96   a DSP input.
 97
 98   The DSP outputs are: loudspeaker output (aka MAIN), headphones output
 99   (aka AUX), SCART1 DA output, SCART2 DA output and an I2S output.
100   There also is a quasi-peak detector output, but that is not used by
101   this driver and is set to the same input as the loudspeaker output.
102   Not all outputs are supported by all msp models. Setting the input
103   of an unsupported output will be ignored by the driver.
104
105   There are up to 16 DSP inputs to choose from, so each output is
106   assigned 4 bits.
107
108   Note: the 44x8G can mix two inputs and feed the result back to the
109   DSP. This is currently not implemented. Also not implemented is the
110   multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate
111   a need for one of those features then additional support can be added. */
112#define MSP_DSP_IN_TUNER 	0  /* Tuner DSP input */
113#define MSP_DSP_IN_SCART 	2  /* SCART DSP input */
114#define MSP_DSP_IN_I2S1 	5  /* I2S1 DSP input */
115#define MSP_DSP_IN_I2S2 	6  /* I2S2 DSP input */
116#define MSP_DSP_IN_I2S3    	7  /* I2S3 DSP input */
117#define MSP_DSP_IN_MAIN_AVC 	11 /* MAIN AVC processed DSP input */
118#define MSP_DSP_IN_MAIN 	12 /* MAIN DSP input */
119#define MSP_DSP_IN_AUX 		13 /* AUX DSP input */
120#define MSP_DSP_TO_MAIN(in)   	((in) << 4)
121#define MSP_DSP_TO_AUX(in)    	((in) << 8)
122#define MSP_DSP_TO_SCART1(in) 	((in) << 12)
123#define MSP_DSP_TO_SCART2(in) 	((in) << 16)
124#define MSP_DSP_TO_I2S(in)    	((in) << 20)
125
126/* Output SCART select: the SCART outputs can select which input
127   to use. */
128#define MSP_SC_IN_SCART1 	0  /* SCART1 input, bypassing the DSP */
129#define MSP_SC_IN_SCART2 	1  /* SCART2 input, bypassing the DSP */
130#define MSP_SC_IN_SCART3 	2  /* SCART3 input, bypassing the DSP */
131#define MSP_SC_IN_SCART4 	3  /* SCART4 input, bypassing the DSP */
132#define MSP_SC_IN_DSP_SCART1 	4  /* DSP SCART1 input */
133#define MSP_SC_IN_DSP_SCART2 	5  /* DSP SCART2 input */
134#define MSP_SC_IN_MONO 		6  /* MONO input, bypassing the DSP */
135#define MSP_SC_IN_MUTE 		7  /* MUTE output */
136#define MSP_SC_TO_SCART1(in)	(in)
137#define MSP_SC_TO_SCART2(in)	((in) << 4)
138
139/* Shortcut macros */
140#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \
141	(MSP_SCART_TO_DSP(sc) | \
142	 MSP_TUNER_TO_DSP(t) | \
143	 MSP_DSP_TO_MAIN(main_aux_src) | \
144	 MSP_DSP_TO_AUX(main_aux_src) | \
145	 MSP_DSP_TO_SCART1(sc_i2s_src) | \
146	 MSP_DSP_TO_SCART2(sc_i2s_src) | \
147	 MSP_DSP_TO_I2S(sc_i2s_src))
148#define MSP_INPUT_DEFAULT MSP_INPUT(MSP_IN_SCART1, MSP_IN_TUNER1, \
149				    MSP_DSP_IN_TUNER, MSP_DSP_IN_TUNER)
150#define MSP_OUTPUT(sc) \
151	(MSP_SC_TO_SCART1(sc) | \
152	 MSP_SC_TO_SCART2(sc))
153/* This equals the RESET position of the msp3400 ACB register */
154#define MSP_OUTPUT_DEFAULT (MSP_SC_TO_SCART1(MSP_SC_IN_SCART3) | \
155			    MSP_SC_TO_SCART2(MSP_SC_IN_DSP_SCART1))
156
157/* Tuner inputs vs. msp version */
158/* Chip      TUNER_1   TUNER_2
159   -------------------------
160   msp34x0b  y         y
161   msp34x0c  y         y
162   msp34x0d  y         y
163   msp34x5d  y         n
164   msp34x7d  y         n
165   msp34x0g  y         y
166   msp34x1g  y         y
167   msp34x2g  y         y
168   msp34x5g  y         n
169   msp34x7g  y         n
170   msp44x0g  y         y
171   msp44x8g  y         y
172 */
173
174/* SCART inputs vs. msp version */
175/* Chip      SC1 SC2 SC3 SC4
176   -------------------------
177   msp34x0b  y   y   y   n
178   msp34x0c  y   y   y   n
179   msp34x0d  y   y   y   y
180   msp34x5d  y   y   n   n
181   msp34x7d  y   n   n   n
182   msp34x0g  y   y   y   y
183   msp34x1g  y   y   y   y
184   msp34x2g  y   y   y   y
185   msp34x5g  y   y   n   n
186   msp34x7g  y   n   n   n
187   msp44x0g  y   y   y   y
188   msp44x8g  y   y   y   y
189 */
190
191/* DSP inputs vs. msp version (tuner and SCART inputs are always available) */
192/* Chip      I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX
193   ------------------------------------------
194   msp34x0b  y    n    n    n        n    n
195   msp34x0c  y    y    n    n        n    n
196   msp34x0d  y    y    n    n        n    n
197   msp34x5d  y    y    n    n        n    n
198   msp34x7d  n    n    n    n        n    n
199   msp34x0g  y    y    n    n        n    n
200   msp34x1g  y    y    n    n        n    n
201   msp34x2g  y    y    n    y        y    y
202   msp34x5g  y    y    n    n        n    n
203   msp34x7g  n    n    n    n        n    n
204   msp44x0g  y    y    y    y        y    y
205   msp44x8g  y    y    y    n        n    n
206 */
207
208/* DSP outputs vs. msp version */
209/* Chip      MAIN AUX SCART1 SCART2 I2S
210   ------------------------------------
211   msp34x0b  y    y   y      n      y
212   msp34x0c  y    y   y      n      y
213   msp34x0d  y    y   y      y      y
214   msp34x5d  y    n   y      n      y
215   msp34x7d  y    n   y      n      n
216   msp34x0g  y    y   y      y      y
217   msp34x1g  y    y   y      y      y
218   msp34x2g  y    y   y      y      y
219   msp34x5g  y    n   y      n      y
220   msp34x7g  y    n   y      n      n
221   msp44x0g  y    y   y      y      y
222   msp44x8g  y    y   y      y      y
223 */
224
225#endif /* MSP3400_H */