]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
V4L/DVB (3581): Add new media/msp3400.h header containing the routing macros
authorHans Verkuil <hverkuil@xs4all.nl>
Sun, 19 Mar 2006 11:45:38 +0000 (08:45 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Fri, 24 Mar 2006 19:26:57 +0000 (16:26 -0300)
Moved msp3400.h to msp3400-driver.h.
Created media/msp3400.h with the new routing defines and lots of comments.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/em28xx/em28xx-cards.c
drivers/media/video/msp3400-driver.c
drivers/media/video/msp3400-driver.h [moved from drivers/media/video/msp3400.h with 97% similarity]
drivers/media/video/msp3400-kthreads.c
include/media/msp3400.h [new file with mode: 0644]

index 4e22fc4889e14d3117f8aa2daf00cddf84309e23..2d68a27417ebdfaa7675f104119737c3239221f3 100644 (file)
@@ -31,7 +31,6 @@
 #include <media/audiochip.h>
 #include <media/tveeprom.h>
 #include <media/v4l2-common.h>
-#include "msp3400.h"
 
 #include "em28xx.h"
 
index 9a47ba22c133894ed7e61549e3b4ca76020b83f0..04250284ff1ef551ca4fb89ca2d211e76202bc9b 100644 (file)
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
 #include <media/tvaudio.h>
+#include <media/msp3400.h>
 #include <linux/kthread.h>
 #include <linux/suspend.h>
-#include "msp3400.h"
+#include "msp3400-driver.h"
 
 /* ---------------------------------------------------------------------- */
 
similarity index 97%
rename from drivers/media/video/msp3400.h
rename to drivers/media/video/msp3400-driver.h
index 25482046fc68f4ea509ea0d50598803ed9df4e8f..04821ebfe04a1aa80a4416c1202b74677b10968a 100644 (file)
@@ -1,8 +1,8 @@
 /*
  */
 
-#ifndef MSP3400_H
-#define MSP3400_H
+#ifndef MSP3400_DRIVER_H
+#define MSP3400_DRIVER_H
 
 /* ---------------------------------------------------------------------- */
 
@@ -110,4 +110,4 @@ int msp34xxg_thread(void *data);
 void msp3400c_set_mode(struct i2c_client *client, int mode);
 void msp3400c_set_carrier(struct i2c_client *client, int cdo1, int cdo2);
 
-#endif /* MSP3400_H */
+#endif /* MSP3400_DRIVER_H */
index 88b216cc49d774d73e8f0b175eee78ca50185cb6..9ee8dc216d7faf3b45f3d1be66a39c7446f84d48 100644 (file)
 #include <linux/videodev.h>
 #include <linux/videodev2.h>
 #include <media/v4l2-common.h>
+#include <media/msp3400.h>
 #include <linux/kthread.h>
 #include <linux/suspend.h>
-#include "msp3400.h"
+#include "msp3400-driver.h"
 
 /* this one uses the automatic sound standard detection of newer msp34xx
    chip versions */
diff --git a/include/media/msp3400.h b/include/media/msp3400.h
new file mode 100644 (file)
index 0000000..26e2658
--- /dev/null
@@ -0,0 +1,221 @@
+/*
+    msp3400.h - definition for msp3400 inputs and outputs
+
+    Copyright (C) 2006 Hans Verkuil (hverkuil@xs4all.nl)
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+*/
+
+#ifndef _MSP3400_H_
+#define _MSP3400_H_
+
+/* msp3400 routing
+   ===============
+
+   The msp3400 has a complicated routing scheme with many possible
+   combinations. The details are all in the datasheets but I will try
+   to give a short description here.
+
+   Inputs
+   ======
+
+   There are 1) tuner inputs, 2) I2S inputs, 3) SCART inputs. You will have
+   to select which tuner input to use and which SCART input to use. The
+   selected tuner input, the selected SCART input and all I2S inputs go to
+   the DSP (the tuner input first goes through the demodulator).
+
+   The DSP handles things like volume, bass/treble, balance, and some chips
+   have support for surround sound. It has several outputs: MAIN, AUX, I2S
+   and SCART1/2. Each output can select which DSP input to use. So the MAIN
+   output can select the tuner input while at the same time the SCART1 output
+   uses the I2S input.
+
+   Outputs
+   =======
+
+   Most DSP outputs are also the outputs of the msp3400. However, the SCART
+   outputs of the msp3400 can select which input to use: either the SCART1 or
+   SCART2 output from the DSP, or the msp3400 SCART inputs, thus completely
+   bypassing the DSP.
+
+   Summary
+   =======
+
+   So to specify a complete routing scheme for the msp3400 you will have to
+   specify in the 'input' field of the v4l2_routing struct:
+
+   1) which tuner input to use
+   2) which SCART input to use
+   3) which DSP input to use for each DSP output
+
+   And in the 'output' field of the v4l2_routing struct you specify:
+
+   1) which SCART input to use for each SCART output
+
+   Depending on how the msp is wired to the other components you can
+   ignore or mute certain inputs or outputs.
+
+   Also, depending on the msp version only a subset of the inputs or
+   outputs may be present. At the end of this header some tables are
+   added containing a list of what is available for each msp version.
+ */
+
+/* Inputs to the DSP unit: two independent selections have to be made:
+   1) the tuner (SIF) input
+   2) the SCART input
+   Bits 0-2 are used for the SCART input select, bit 3 is used for the tuner
+   input, bits 4-7 are reserved.
+ */
+
+/* SCART input to DSP selection */
+#define MSP_IN_SCART_1         0  /* Pin SC1_IN */
+#define MSP_IN_SCART_2         1  /* Pin SC2_IN */
+#define MSP_IN_SCART_3         2  /* Pin SC3_IN */
+#define MSP_IN_SCART_4         3  /* Pin SC4_IN */
+#define MSP_IN_MONO            6  /* Pin MONO_IN */
+#define MSP_IN_MUTE            7  /* Mute DSP input */
+#define MSP_SCART_TO_DSP(in)   (in)
+/* Tuner input to demodulator and DSP selection */
+#define MSP_IN_TUNER_1                 0  /* Analog Sound IF input pin ANA_IN1 */
+#define MSP_IN_TUNER_2         1  /* Analog Sound IF input pin ANA_IN2 */
+#define MSP_TUNER_TO_DSP(in)   ((in) << 3)
+
+/* The msp has up to 5 DSP outputs, each output can independently select
+   a DSP input.
+
+   The DSP outputs are: loudspeaker output (aka MAIN), headphones output
+   (aka AUX), SCART1 DA output, SCART2 DA output and an I2S output.
+   There also is a quasi-peak detector output, but that is not used by
+   this driver and is set to the same input as the loudspeaker output.
+   Not all outputs are supported by all msp models. Setting the input
+   of an unsupported output will be ignored by the driver.
+
+   There are up to 16 DSP inputs to choose from, so each output is
+   assigned 4 bits.
+
+   Note: the 44x8G can mix two inputs and feed the result back to the
+   DSP. This is currently not implemented. Also not implemented is the
+   multi-channel capable I2S3 input of the 44x0G. If someone can demonstrate
+   a need for one of those features then additional support can be added. */
+#define MSP_DSP_OUT_TUNER      0  /* Tuner output */
+#define MSP_DSP_OUT_SCART      2  /* SCART output */
+#define MSP_DSP_OUT_I2S1       5  /* I2S1 output */
+#define MSP_DSP_OUT_I2S2       6  /* I2S2 output */
+#define MSP_DSP_OUT_I2S3       7  /* I2S3 output */
+#define MSP_DSP_OUT_MAIN_AVC   11 /* MAIN AVC processed output */
+#define MSP_DSP_OUT_MAIN       12 /* MAIN output */
+#define MSP_DSP_OUT_AUX        13 /* AUX output */
+#define MSP_DSP_TO_MAIN(in)    ((in) << 4)
+#define MSP_DSP_TO_AUX(in)     ((in) << 8)
+#define MSP_DSP_TO_SCART1(in)  ((in) << 12)
+#define MSP_DSP_TO_SCART2(in)  ((in) << 16)
+#define MSP_DSP_TO_I2S(in)     ((in) << 20)
+
+/* Output SCART select: the SCART outputs can select which input
+   to use. */
+#define MSP_OUT_SCART1                 0  /* SCART1 input, bypassing the DSP */
+#define MSP_OUT_SCART2                 1  /* SCART2 input, bypassing the DSP */
+#define MSP_OUT_SCART3                 2  /* SCART3 input, bypassing the DSP */
+#define MSP_OUT_SCART4                 3  /* SCART4 input, bypassing the DSP */
+#define MSP_OUT_SCART1_DA      4  /* DSP SCART1 output */
+#define MSP_OUT_SCART2_DA      5  /* DSP SCART2 output */
+#define MSP_OUT_MONO           6  /* MONO input, bypassing the DSP */
+#define MSP_OUT_MUTE           7  /* MUTE output */
+#define MSP_OUT_TO_SCART1(in)          (in)
+#define MSP_OUT_TO_SCART2(in)          ((in) << 4)
+
+/* Shortcut macros */
+#define MSP_INPUT(sc, t, main_aux_src, sc_i2s_src) \
+       (MSP_SCART_TO_DSP(sc) | \
+        MSP_TUNER_TO_DSP(t) | \
+        MSP_DSP_TO_MAIN(main_aux_src) | \
+        MSP_DSP_TO_AUX(main_aux_src) | \
+        MSP_DSP_TO_SCART1(sc_i2s_src) | \
+        MSP_DSP_TO_SCART2(sc_i2s_src) | \
+        MSP_DSP_TO_I2S(sc_i2s_src))
+#define MSP_OUTPUT(sc) \
+       (MSP_OUT_TO_SCART1(sc) | \
+        MSP_OUT_TO_SCART2(sc))
+
+/* Tuner inputs vs. msp version */
+/* Chip      TUNER_1   TUNER_2
+   -------------------------
+   msp34x0b  y         y
+   msp34x0c  y         y
+   msp34x0d  y         y
+   msp34x5d  y         n
+   msp34x7d  y         n
+   msp34x0g  y         y
+   msp34x1g  y         y
+   msp34x2g  y         y
+   msp34x5g  y         n
+   msp34x7g  y         n
+   msp44x0g  y         y
+   msp44x8g  y         y
+ */
+
+/* SCART inputs vs. msp version */
+/* Chip      SC1 SC2 SC3 SC4
+   -------------------------
+   msp34x0b  y   y   y   n
+   msp34x0c  y   y   y   n
+   msp34x0d  y   y   y   y
+   msp34x5d  y   y   n   n
+   msp34x7d  y   n   n   n
+   msp34x0g  y   y   y   y
+   msp34x1g  y   y   y   y
+   msp34x2g  y   y   y   y
+   msp34x5g  y   y   n   n
+   msp34x7g  y   n   n   n
+   msp44x0g  y   y   y   y
+   msp44x8g  y   y   y   y
+ */
+
+/* DSP inputs vs. msp version (tuner and SCART inputs are always available) */
+/* Chip      I2S1 I2S2 I2S3 MAIN_AVC MAIN AUX
+   ------------------------------------------
+   msp34x0b  y    n    n    n        n    n
+   msp34x0c  y    y    n    n        n    n
+   msp34x0d  y    y    n    n        n    n
+   msp34x5d  y    y    n    n        n    n
+   msp34x7d  n    n    n    n        n    n
+   msp34x0g  y    y    n    n        n    n
+   msp34x1g  y    y    n    n        n    n
+   msp34x2g  y    y    n    y        y    y
+   msp34x5g  y    y    n    n        n    n
+   msp34x7g  n    n    n    n        n    n
+   msp44x0g  y    y    y    y        y    y
+   msp44x8g  y    y    y    n        n    n
+ */
+
+/* DSP outputs vs. msp version */
+/* Chip      MAIN AUX SCART1 SCART2 I2S
+   ------------------------------------
+   msp34x0b  y    y   y      n      y
+   msp34x0c  y    y   y      n      y
+   msp34x0d  y    y   y      y      y
+   msp34x5d  y    n   y      n      y
+   msp34x7d  y    n   y      n      n
+   msp34x0g  y    y   y      y      y
+   msp34x1g  y    y   y      y      y
+   msp34x2g  y    y   y      y      y
+   msp34x5g  y    n   y      n      y
+   msp34x7g  y    n   y      n      n
+   msp44x0g  y    y   y      y      y
+   msp44x8g  y    y   y      y      y
+ */
+
+#endif /* MSP3400_H */
+