xref: /openbmc/linux/include/media/i2c/m52790.h (revision 8730046c)
1 /*
2     m52790.h - definition for m52790 inputs and outputs
3 
4     Copyright (C) 2007 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 _M52790_H_
22 #define _M52790_H_
23 
24 /* Input routing switch 1 */
25 
26 #define M52790_SW1_IN_MASK 	0x0003
27 #define M52790_SW1_IN_TUNER 	0x0000
28 #define M52790_SW1_IN_V2    	0x0001
29 #define M52790_SW1_IN_V3    	0x0002
30 #define M52790_SW1_IN_V4    	0x0003
31 
32 /* Selects component input instead of composite */
33 #define M52790_SW1_YCMIX    	0x0004
34 
35 
36 /* Input routing switch 2 */
37 
38 #define M52790_SW2_IN_MASK 	0x0300
39 #define M52790_SW2_IN_TUNER 	0x0000
40 #define M52790_SW2_IN_V2    	0x0100
41 #define M52790_SW2_IN_V3    	0x0200
42 #define M52790_SW2_IN_V4    	0x0300
43 
44 /* Selects component input instead of composite */
45 #define M52790_SW2_YCMIX    	0x0400
46 
47 
48 /* Output routing switch 1 */
49 
50 /* Enable 6dB amplifier for composite out */
51 #define M52790_SW1_V_AMP    	0x0008
52 
53 /* Enable 6dB amplifier for component out */
54 #define M52790_SW1_YC_AMP   	0x0010
55 
56 /* Audio output mode */
57 #define M52790_SW1_AUDIO_MASK 	0x00c0
58 #define M52790_SW1_AUDIO_MUTE 	0x0000
59 #define M52790_SW1_AUDIO_R 	0x0040
60 #define M52790_SW1_AUDIO_L 	0x0080
61 #define M52790_SW1_AUDIO_STEREO 0x00c0
62 
63 
64 /* Output routing switch 2 */
65 
66 /* Enable 6dB amplifier for composite out */
67 #define M52790_SW2_V_AMP    	0x0800
68 
69 /* Enable 6dB amplifier for component out */
70 #define M52790_SW2_YC_AMP   	0x1000
71 
72 /* Audio output mode */
73 #define M52790_SW2_AUDIO_MASK 	0xc000
74 #define M52790_SW2_AUDIO_MUTE 	0x0000
75 #define M52790_SW2_AUDIO_R 	0x4000
76 #define M52790_SW2_AUDIO_L 	0x8000
77 #define M52790_SW2_AUDIO_STEREO 0xc000
78 
79 
80 /* Common values */
81 #define M52790_IN_TUNER (M52790_SW1_IN_TUNER | M52790_SW2_IN_TUNER)
82 #define M52790_IN_V2    (M52790_SW1_IN_V2 | M52790_SW2_IN_V2)
83 #define M52790_IN_V3    (M52790_SW1_IN_V3 | M52790_SW2_IN_V3)
84 #define M52790_IN_V4    (M52790_SW1_IN_V4 | M52790_SW2_IN_V4)
85 
86 #define M52790_OUT_STEREO 	(M52790_SW1_AUDIO_STEREO | \
87 				 M52790_SW2_AUDIO_STEREO)
88 #define M52790_OUT_AMP_STEREO 	(M52790_SW1_AUDIO_STEREO | \
89 				 M52790_SW1_V_AMP | \
90 				 M52790_SW2_AUDIO_STEREO | \
91 				 M52790_SW2_V_AMP)
92 
93 #endif
94