blob: 5da0cc4a04463975c234e3d3e148da252d300d28 [file] [log] [blame]
Thomas Mair82041c02012-05-18 14:47:40 -03001/*
2 * Realtek RTL2832 DVB-T demodulator driver
3 *
4 * Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
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 along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 */
20
21#ifndef RTL2832_H
22#define RTL2832_H
23
24#include <linux/dvb/frontend.h>
25
26struct rtl2832_config {
27 /*
28 * Demodulator I2C address.
29 */
30 u8 i2c_addr;
31
32 /*
33 * Xtal frequency.
34 * Hz
35 * 4000000, 16000000, 25000000, 28800000
36 */
37 u32 xtal;
38
39 /*
40 * IFs for all used modes.
41 * Hz
42 * 4570000, 4571429, 36000000, 36125000, 36166667, 44000000
43 */
44 u32 if_dvbt;
45
46 /*
Antti Palosaari832cc7c2012-09-11 22:27:04 -030047 * tuner
48 * XXX: This must be keep sync with dvb_usb_rtl28xxu demod driver.
Thomas Mair82041c02012-05-18 14:47:40 -030049 */
Antti Palosaari832cc7c2012-09-11 22:27:04 -030050#define RTL2832_TUNER_FC0012 0x26
51#define RTL2832_TUNER_FC0013 0x29
Thomas Mair82041c02012-05-18 14:47:40 -030052 u8 tuner;
53};
54
Thomas Mair82041c02012-05-18 14:47:40 -030055#if defined(CONFIG_DVB_RTL2832) || \
56 (defined(CONFIG_DVB_RTL2832_MODULE) && defined(MODULE))
57extern struct dvb_frontend *rtl2832_attach(
58 const struct rtl2832_config *cfg,
59 struct i2c_adapter *i2c
60);
61
62extern struct i2c_adapter *rtl2832_get_tuner_i2c_adapter(
63 struct dvb_frontend *fe
64);
65#else
66static inline struct dvb_frontend *rtl2832_attach(
67 const struct rtl2832_config *config,
68 struct i2c_adapter *i2c
69)
70{
71 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
72 return NULL;
73}
74#endif
75
76
77#endif /* RTL2832_H */