blob: c29a4c2bf71ab1debcce9d71f0fee93d82627442 [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>
Antti Palosaari75c24002014-12-16 13:54:23 -03005 * Copyright (C) 2012-2014 Antti Palosaari <crope@iki.fi>
Thomas Mair82041c02012-05-18 14:47:40 -03006 *
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 along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22#ifndef RTL2832_H
23#define RTL2832_H
24
25#include <linux/dvb/frontend.h>
Antti Palosaaricd559e02014-12-16 13:37:18 -030026#include <linux/i2c-mux.h>
Thomas Mair82041c02012-05-18 14:47:40 -030027
Antti Palosaari2f74b7c2015-02-02 14:20:01 -030028/**
29 * struct rtl2832_platform_data - Platform data for the rtl2832 driver
30 * @clk: Clock frequency (4000000, 16000000, 25000000, 28800000).
31 * @tuner: Used tuner model.
32 * @get_dvb_frontend: Get DVB frontend.
33 * @get_i2c_adapter: Get I2C adapter.
34 * @enable_slave_ts: Enable slave TS IF.
35 * @pid_filter: Set PID to PID filter.
36 * @pid_filter_ctrl: Control PID filter.
37 */
Antti Palosaarie1174d72014-12-13 05:26:27 -030038
Antti Palosaari2f74b7c2015-02-02 14:20:01 -030039struct rtl2832_platform_data {
40 u32 clk;
Antti Palosaarie1174d72014-12-13 05:26:27 -030041 /*
Antti Palosaaricd559e02014-12-16 13:37:18 -030042 * XXX: This list must be kept sync with dvb_usb_rtl28xxu USB IF driver.
Antti Palosaarie1174d72014-12-13 05:26:27 -030043 */
Antti Palosaarif88aae92015-04-23 22:52:07 -030044#define RTL2832_TUNER_FC2580 0x21
Antti Palosaarie1174d72014-12-13 05:26:27 -030045#define RTL2832_TUNER_TUA9001 0x24
46#define RTL2832_TUNER_FC0012 0x26
47#define RTL2832_TUNER_E4000 0x27
48#define RTL2832_TUNER_FC0013 0x29
49#define RTL2832_TUNER_R820T 0x2a
50#define RTL2832_TUNER_R828D 0x2b
Olli Salonen699dcff2015-05-05 13:54:19 -030051#define RTL2832_TUNER_SI2157 0x2c
Antti Palosaarie1174d72014-12-13 05:26:27 -030052 u8 tuner;
53
Antti Palosaari6f5f6ee2014-12-12 23:16:19 -030054 struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
55 struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *);
Antti Palosaari6f5f6ee2014-12-12 23:16:19 -030056 int (*enable_slave_ts)(struct i2c_client *);
Antti Palosaari4b01e012014-12-14 14:07:35 -030057 int (*pid_filter)(struct dvb_frontend *, u8, u16, int);
58 int (*pid_filter_ctrl)(struct dvb_frontend *, int);
Antti Palosaari2f74b7c2015-02-02 14:20:01 -030059/* private: Register access for SDR module use only */
Antti Palosaari0aa32ef92014-12-15 13:34:13 -030060 int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t);
61 int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t);
62 int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int);
Antti Palosaaric2c83862014-12-02 10:55:17 -030063};
64
Thomas Mair82041c02012-05-18 14:47:40 -030065#endif /* RTL2832_H */