blob: 2cfbb6a97061b166bac354c964a64a0e5a227eaa [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
Mauro Carvalho Chehab782d8b72013-03-21 16:11:54 -030024#include <linux/kconfig.h>
Thomas Mair82041c02012-05-18 14:47:40 -030025#include <linux/dvb/frontend.h>
26
27struct rtl2832_config {
28 /*
29 * Demodulator I2C address.
30 */
31 u8 i2c_addr;
32
33 /*
34 * Xtal frequency.
35 * Hz
36 * 4000000, 16000000, 25000000, 28800000
37 */
38 u32 xtal;
39
40 /*
41 * IFs for all used modes.
42 * Hz
43 * 4570000, 4571429, 36000000, 36125000, 36166667, 44000000
44 */
45 u32 if_dvbt;
46
47 /*
Antti Palosaari832cc7c2012-09-11 22:27:04 -030048 * tuner
49 * XXX: This must be keep sync with dvb_usb_rtl28xxu demod driver.
Thomas Mair82041c02012-05-18 14:47:40 -030050 */
Antti Palosaari5db41872012-09-11 22:27:08 -030051#define RTL2832_TUNER_TUA9001 0x24
Antti Palosaari832cc7c2012-09-11 22:27:04 -030052#define RTL2832_TUNER_FC0012 0x26
Antti Palosaari7e688de2012-09-17 17:53:04 -030053#define RTL2832_TUNER_E4000 0x27
Antti Palosaari832cc7c2012-09-11 22:27:04 -030054#define RTL2832_TUNER_FC0013 0x29
Mauro Carvalho Chehabfa4bfd22013-04-09 18:19:50 -030055#define RTL2832_TUNER_R820T 0x2a
Antti Palosaaria26758e2013-10-30 00:36:38 -030056#define RTL2832_TUNER_R828D 0x2b
Thomas Mair82041c02012-05-18 14:47:40 -030057 u8 tuner;
58};
59
Mauro Carvalho Chehab782d8b72013-03-21 16:11:54 -030060#if IS_ENABLED(CONFIG_DVB_RTL2832)
Thomas Mair82041c02012-05-18 14:47:40 -030061extern struct dvb_frontend *rtl2832_attach(
62 const struct rtl2832_config *cfg,
63 struct i2c_adapter *i2c
64);
Thomas Mair82041c02012-05-18 14:47:40 -030065#else
66static inline struct dvb_frontend *rtl2832_attach(
67 const struct rtl2832_config *config,
68 struct i2c_adapter *i2c
69)
70{
Antti Palosaari298efdd2012-09-11 22:27:11 -030071 pr_warn("%s: driver disabled by Kconfig\n", __func__);
Thomas Mair82041c02012-05-18 14:47:40 -030072 return NULL;
73}
74#endif
75
76
77#endif /* RTL2832_H */