xref: /linux/drivers/media/tuners/tda18218_priv.h (revision 9edd6987c4d2af548f032c4c8dd96b561ac3d6fb)
1ccae7af2SMauro Carvalho Chehab /*
2ccae7af2SMauro Carvalho Chehab  * NXP TDA18218HN silicon tuner driver
3ccae7af2SMauro Carvalho Chehab  *
4ccae7af2SMauro Carvalho Chehab  * Copyright (C) 2010 Antti Palosaari <crope@iki.fi>
5ccae7af2SMauro Carvalho Chehab  *
6ccae7af2SMauro Carvalho Chehab  *    This program is free software; you can redistribute it and/or modify
7ccae7af2SMauro Carvalho Chehab  *    it under the terms of the GNU General Public License as published by
8ccae7af2SMauro Carvalho Chehab  *    the Free Software Foundation; either version 2 of the License, or
9ccae7af2SMauro Carvalho Chehab  *    (at your option) any later version.
10ccae7af2SMauro Carvalho Chehab  *
11ccae7af2SMauro Carvalho Chehab  *    This program is distributed in the hope that it will be useful,
12ccae7af2SMauro Carvalho Chehab  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
13ccae7af2SMauro Carvalho Chehab  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14ccae7af2SMauro Carvalho Chehab  *    GNU General Public License for more details.
15ccae7af2SMauro Carvalho Chehab  *
16ccae7af2SMauro Carvalho Chehab  *    You should have received a copy of the GNU General Public License
17ccae7af2SMauro Carvalho Chehab  *    along with this program; if not, write to the Free Software
18ccae7af2SMauro Carvalho Chehab  *    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19ccae7af2SMauro Carvalho Chehab  */
20ccae7af2SMauro Carvalho Chehab 
21ccae7af2SMauro Carvalho Chehab #ifndef TDA18218_PRIV_H
22ccae7af2SMauro Carvalho Chehab #define TDA18218_PRIV_H
23ccae7af2SMauro Carvalho Chehab 
24*9edd6987SAntti Palosaari #include "tda18218.h"
25ccae7af2SMauro Carvalho Chehab 
26ccae7af2SMauro Carvalho Chehab #define R00_ID         0x00	/* ID byte */
27ccae7af2SMauro Carvalho Chehab #define R01_R1         0x01	/* Read byte 1 */
28ccae7af2SMauro Carvalho Chehab #define R02_R2         0x02	/* Read byte 2 */
29ccae7af2SMauro Carvalho Chehab #define R03_R3         0x03	/* Read byte 3 */
30ccae7af2SMauro Carvalho Chehab #define R04_R4         0x04	/* Read byte 4 */
31ccae7af2SMauro Carvalho Chehab #define R05_R5         0x05	/* Read byte 5 */
32ccae7af2SMauro Carvalho Chehab #define R06_R6         0x06	/* Read byte 6 */
33ccae7af2SMauro Carvalho Chehab #define R07_MD1        0x07	/* Main divider byte 1 */
34ccae7af2SMauro Carvalho Chehab #define R08_PSM1       0x08	/* PSM byte 1 */
35ccae7af2SMauro Carvalho Chehab #define R09_MD2        0x09	/* Main divider byte 2 */
36ccae7af2SMauro Carvalho Chehab #define R0A_MD3        0x0a	/* Main divider byte 1 */
37ccae7af2SMauro Carvalho Chehab #define R0B_MD4        0x0b	/* Main divider byte 4 */
38ccae7af2SMauro Carvalho Chehab #define R0C_MD5        0x0c	/* Main divider byte 5 */
39ccae7af2SMauro Carvalho Chehab #define R0D_MD6        0x0d	/* Main divider byte 6 */
40ccae7af2SMauro Carvalho Chehab #define R0E_MD7        0x0e	/* Main divider byte 7 */
41ccae7af2SMauro Carvalho Chehab #define R0F_MD8        0x0f	/* Main divider byte 8 */
42ccae7af2SMauro Carvalho Chehab #define R10_CD1        0x10	/* Call divider byte 1 */
43ccae7af2SMauro Carvalho Chehab #define R11_CD2        0x11	/* Call divider byte 2 */
44ccae7af2SMauro Carvalho Chehab #define R12_CD3        0x12	/* Call divider byte 3 */
45ccae7af2SMauro Carvalho Chehab #define R13_CD4        0x13	/* Call divider byte 4 */
46ccae7af2SMauro Carvalho Chehab #define R14_CD5        0x14	/* Call divider byte 5 */
47ccae7af2SMauro Carvalho Chehab #define R15_CD6        0x15	/* Call divider byte 6 */
48ccae7af2SMauro Carvalho Chehab #define R16_CD7        0x16	/* Call divider byte 7 */
49ccae7af2SMauro Carvalho Chehab #define R17_PD1        0x17	/* Power-down byte 1 */
50ccae7af2SMauro Carvalho Chehab #define R18_PD2        0x18	/* Power-down byte 2 */
51ccae7af2SMauro Carvalho Chehab #define R19_XTOUT      0x19	/* XTOUT byte */
52ccae7af2SMauro Carvalho Chehab #define R1A_IF1        0x1a	/* IF byte 1 */
53ccae7af2SMauro Carvalho Chehab #define R1B_IF2        0x1b	/* IF byte 2 */
54ccae7af2SMauro Carvalho Chehab #define R1C_AGC2B      0x1c	/* AGC2b byte */
55ccae7af2SMauro Carvalho Chehab #define R1D_PSM2       0x1d	/* PSM byte 2 */
56ccae7af2SMauro Carvalho Chehab #define R1E_PSM3       0x1e	/* PSM byte 3 */
57ccae7af2SMauro Carvalho Chehab #define R1F_PSM4       0x1f	/* PSM byte 4 */
58ccae7af2SMauro Carvalho Chehab #define R20_AGC11      0x20	/* AGC1 byte 1 */
59ccae7af2SMauro Carvalho Chehab #define R21_AGC12      0x21	/* AGC1 byte 2 */
60ccae7af2SMauro Carvalho Chehab #define R22_AGC13      0x22	/* AGC1 byte 3 */
61ccae7af2SMauro Carvalho Chehab #define R23_AGC21      0x23	/* AGC2 byte 1 */
62ccae7af2SMauro Carvalho Chehab #define R24_AGC22      0x24	/* AGC2 byte 2 */
63ccae7af2SMauro Carvalho Chehab #define R25_AAGC       0x25	/* Analog AGC byte */
64ccae7af2SMauro Carvalho Chehab #define R26_RC         0x26	/* RC byte */
65ccae7af2SMauro Carvalho Chehab #define R27_RSSI       0x27	/* RSSI byte */
66ccae7af2SMauro Carvalho Chehab #define R28_IRCAL1     0x28	/* IR CAL byte 1 */
67ccae7af2SMauro Carvalho Chehab #define R29_IRCAL2     0x29	/* IR CAL byte 2 */
68ccae7af2SMauro Carvalho Chehab #define R2A_IRCAL3     0x2a	/* IR CAL byte 3 */
69ccae7af2SMauro Carvalho Chehab #define R2B_IRCAL4     0x2b	/* IR CAL byte 4 */
70ccae7af2SMauro Carvalho Chehab #define R2C_RFCAL1     0x2c	/* RF CAL byte 1 */
71ccae7af2SMauro Carvalho Chehab #define R2D_RFCAL2     0x2d	/* RF CAL byte 2 */
72ccae7af2SMauro Carvalho Chehab #define R2E_RFCAL3     0x2e	/* RF CAL byte 3 */
73ccae7af2SMauro Carvalho Chehab #define R2F_RFCAL4     0x2f	/* RF CAL byte 4 */
74ccae7af2SMauro Carvalho Chehab #define R30_RFCAL5     0x30	/* RF CAL byte 5 */
75ccae7af2SMauro Carvalho Chehab #define R31_RFCAL6     0x31	/* RF CAL byte 6 */
76ccae7af2SMauro Carvalho Chehab #define R32_RFCAL7     0x32	/* RF CAL byte 7 */
77ccae7af2SMauro Carvalho Chehab #define R33_RFCAL8     0x33	/* RF CAL byte 8 */
78ccae7af2SMauro Carvalho Chehab #define R34_RFCAL9     0x34	/* RF CAL byte 9 */
79ccae7af2SMauro Carvalho Chehab #define R35_RFCAL10    0x35	/* RF CAL byte 10 */
80ccae7af2SMauro Carvalho Chehab #define R36_RFCALRAM1  0x36	/* RF CAL RAM byte 1 */
81ccae7af2SMauro Carvalho Chehab #define R37_RFCALRAM2  0x37	/* RF CAL RAM byte 2 */
82ccae7af2SMauro Carvalho Chehab #define R38_MARGIN     0x38	/* Margin byte */
83ccae7af2SMauro Carvalho Chehab #define R39_FMAX1      0x39	/* Fmax byte 1 */
84ccae7af2SMauro Carvalho Chehab #define R3A_FMAX2      0x3a	/* Fmax byte 2 */
85ccae7af2SMauro Carvalho Chehab 
86ccae7af2SMauro Carvalho Chehab #define TDA18218_NUM_REGS 59
87ccae7af2SMauro Carvalho Chehab 
88ccae7af2SMauro Carvalho Chehab struct tda18218_priv {
89ccae7af2SMauro Carvalho Chehab 	struct tda18218_config *cfg;
90ccae7af2SMauro Carvalho Chehab 	struct i2c_adapter *i2c;
91ccae7af2SMauro Carvalho Chehab 
92ccae7af2SMauro Carvalho Chehab 	u32 if_frequency;
93ccae7af2SMauro Carvalho Chehab 
94ccae7af2SMauro Carvalho Chehab 	u8 regs[TDA18218_NUM_REGS];
95ccae7af2SMauro Carvalho Chehab };
96ccae7af2SMauro Carvalho Chehab 
97ccae7af2SMauro Carvalho Chehab #endif
98