blob: 7658401f3cdd07f0ac9a56d480f2ebef0bb3fe50 [file] [log] [blame]
Steven Toth52c99bd2008-05-01 04:57:01 -03001/*
Steven Toth7f5c3af2008-05-01 06:51:36 -03002 MaxLinear MXL5005S VSB/QAM/DVBT tuner driver
Steven Toth52c99bd2008-05-01 04:57:01 -03003
Steven Toth7f5c3af2008-05-01 06:51:36 -03004 Copyright (C) 2008 MaxLinear
5 Copyright (C) 2008 Steven Toth <stoth@hauppauge.com>
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20
21*/
Steven Toth52c99bd2008-05-01 04:57:01 -030022
Steven Toth2637d5b2008-05-01 05:01:31 -030023#ifndef __MXL5005S_H
24#define __MXL5005S_H
Steven Toth52c99bd2008-05-01 04:57:01 -030025
Steven Toth85d220d2008-05-01 05:48:14 -030026struct mxl5005s_config
27{
Steven Toth8c66a192008-05-01 06:35:48 -030028 /* 7 bit i2c address */
Steven Toth85d220d2008-05-01 05:48:14 -030029 u8 i2c_address;
Steven Toth2637d5b2008-05-01 05:01:31 -030030
Steven Toth8c66a192008-05-01 06:35:48 -030031#define IF_FREQ_4570000HZ 4570000
32#define IF_FREQ_4571429HZ 4571429
33#define IF_FREQ_5380000HZ 5380000
34#define IF_FREQ_36000000HZ 36000000
35#define IF_FREQ_36125000HZ 36125000
36#define IF_FREQ_36166667HZ 36166667
37#define IF_FREQ_44000000HZ 44000000
38 u32 if_freq;
39
40#define CRYSTAL_FREQ_4000000HZ 4000000
41#define CRYSTAL_FREQ_16000000HZ 16000000
42#define CRYSTAL_FREQ_25000000HZ 25000000
43#define CRYSTAL_FREQ_28800000HZ 28800000
44 u32 xtal_freq;
45
46#define MXL_DUAL_AGC 0
47#define MXL_SINGLE_AGC 1
48 u8 agc_mode;
49
50#define MXL_TF_DEFAULT 0
51#define MXL_TF_OFF 1
52#define MXL_TF_C 2
53#define MXL_TF_C_H 3
54#define MXL_TF_D 4
55#define MXL_TF_D_L 5
56#define MXL_TF_E 6
57#define MXL_TF_F 7
58#define MXL_TF_E_2 8
59#define MXL_TF_E_NA 9
60#define MXL_TF_G 10
61 u8 tracking_filter;
62
63#define MXL_RSSI_DISABLE 0
64#define MXL_RSSI_ENABLE 1
65 u8 rssi_enable;
66
67#define MXL_CAP_SEL_DISABLE 0
68#define MXL_CAP_SEL_ENABLE 1
69 u8 cap_select;
70
71#define MXL_DIV_OUT_1 0
72#define MXL_DIV_OUT_4 1
73 u8 div_out;
74
75#define MXL_CLOCK_OUT_DISABLE 0
76#define MXL_CLOCK_OUT_ENABLE 1
77 u8 clock_out;
78
79#define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200
80#define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300
81 u32 output_load;
82
83#define MXL5005S_TOP_5P5 55
84#define MXL5005S_TOP_7P2 72
85#define MXL5005S_TOP_9P2 92
86#define MXL5005S_TOP_11P0 110
87#define MXL5005S_TOP_12P9 129
88#define MXL5005S_TOP_14P7 147
89#define MXL5005S_TOP_16P8 168
90#define MXL5005S_TOP_19P4 194
91#define MXL5005S_TOP_21P2 212
92#define MXL5005S_TOP_23P2 232
93#define MXL5005S_TOP_25P2 252
94#define MXL5005S_TOP_27P1 271
95#define MXL5005S_TOP_29P2 292
96#define MXL5005S_TOP_31P7 317
97#define MXL5005S_TOP_34P9 349
98 u32 top;
99
100#define MXL_ANALOG_MODE 0
101#define MXL_DIGITAL_MODE 1
102 u8 mod_mode;
103
104#define MXL_ZERO_IF 0
105#define MXL_LOW_IF 1
106 u8 if_mode;
107
Steven Toth85d220d2008-05-01 05:48:14 -0300108 /* Stuff I don't know what to do with */
109 u8 AgcMasterByte;
110};
111
Steven Toth7f5c3af2008-05-01 06:51:36 -0300112#if defined(CONFIG_DVB_TUNER_MXL5005S) || \
113 (defined(CONFIG_DVB_TUNER_MXL5005S_MODULE) && defined(MODULE))
Steven Toth85d220d2008-05-01 05:48:14 -0300114extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
115 struct i2c_adapter *i2c,
Steven Toth7f5c3af2008-05-01 06:51:36 -0300116 struct mxl5005s_config *config)
Steven Toth52c99bd2008-05-01 04:57:01 -0300117#else
Steven Toth85d220d2008-05-01 05:48:14 -0300118static inline struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
119 struct i2c_adapter *i2c,
Steven Toth7f5c3af2008-05-01 06:51:36 -0300120 struct mxl5005s_config *config)
Steven Toth52c99bd2008-05-01 04:57:01 -0300121{
Steven Toth85d220d2008-05-01 05:48:14 -0300122 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
123 return NULL;
124}
125#endif /* CONFIG_DVB_TUNER_MXL5005S */
Steven Toth52c99bd2008-05-01 04:57:01 -0300126
Steven Toth2637d5b2008-05-01 05:01:31 -0300127#endif /* __MXL5005S_H */
Steven Toth52c99bd2008-05-01 04:57:01 -0300128