Thomas Mair | 82041c0 | 2012-05-18 14:47:40 -0300 | [diff] [blame] | 1 | /* |
| 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 | |
| 26 | struct 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 | /* |
Antti Palosaari | 832cc7c | 2012-09-11 22:27:04 -0300 | [diff] [blame] | 40 | * tuner |
| 41 | * XXX: This must be keep sync with dvb_usb_rtl28xxu demod driver. |
Thomas Mair | 82041c0 | 2012-05-18 14:47:40 -0300 | [diff] [blame] | 42 | */ |
Antti Palosaari | 5db4187 | 2012-09-11 22:27:08 -0300 | [diff] [blame] | 43 | #define RTL2832_TUNER_TUA9001 0x24 |
Antti Palosaari | 832cc7c | 2012-09-11 22:27:04 -0300 | [diff] [blame] | 44 | #define RTL2832_TUNER_FC0012 0x26 |
Antti Palosaari | 7e688de | 2012-09-17 17:53:04 -0300 | [diff] [blame] | 45 | #define RTL2832_TUNER_E4000 0x27 |
Antti Palosaari | 832cc7c | 2012-09-11 22:27:04 -0300 | [diff] [blame] | 46 | #define RTL2832_TUNER_FC0013 0x29 |
Mauro Carvalho Chehab | fa4bfd2 | 2013-04-09 18:19:50 -0300 | [diff] [blame] | 47 | #define RTL2832_TUNER_R820T 0x2a |
Antti Palosaari | a26758e | 2013-10-30 00:36:38 -0300 | [diff] [blame] | 48 | #define RTL2832_TUNER_R828D 0x2b |
Thomas Mair | 82041c0 | 2012-05-18 14:47:40 -0300 | [diff] [blame] | 49 | u8 tuner; |
| 50 | }; |
| 51 | |
Antti Palosaari | c2c8386 | 2014-12-02 10:55:17 -0300 | [diff] [blame] | 52 | struct rtl2832_platform_data { |
| 53 | const struct rtl2832_config *config; |
| 54 | |
| 55 | /* |
Antti Palosaari | e1174d7 | 2014-12-13 05:26:27 -0300 | [diff] [blame] | 56 | * Clock frequency. |
| 57 | * Hz |
| 58 | * 4000000, 16000000, 25000000, 28800000 |
| 59 | */ |
| 60 | u32 clk; |
| 61 | |
| 62 | /* |
| 63 | * Tuner. |
| 64 | * XXX: This must be keep sync with dvb_usb_rtl28xxu USB IF driver. |
| 65 | */ |
| 66 | #define RTL2832_TUNER_TUA9001 0x24 |
| 67 | #define RTL2832_TUNER_FC0012 0x26 |
| 68 | #define RTL2832_TUNER_E4000 0x27 |
| 69 | #define RTL2832_TUNER_FC0013 0x29 |
| 70 | #define RTL2832_TUNER_R820T 0x2a |
| 71 | #define RTL2832_TUNER_R828D 0x2b |
| 72 | u8 tuner; |
| 73 | |
| 74 | /* |
| 75 | * Callbacks. |
Antti Palosaari | 6f5f6ee | 2014-12-12 23:16:19 -0300 | [diff] [blame] | 76 | */ |
| 77 | struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *); |
| 78 | struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *); |
| 79 | struct i2c_adapter* (*get_private_i2c_adapter)(struct i2c_client *); |
| 80 | int (*enable_slave_ts)(struct i2c_client *); |
Antti Palosaari | 4b01e01 | 2014-12-14 14:07:35 -0300 | [diff] [blame] | 81 | int (*pid_filter)(struct dvb_frontend *, u8, u16, int); |
| 82 | int (*pid_filter_ctrl)(struct dvb_frontend *, int); |
Antti Palosaari | 0aa32ef9 | 2014-12-15 13:34:13 -0300 | [diff] [blame] | 83 | /* Register access for SDR module */ |
| 84 | int (*bulk_read)(struct i2c_client *, unsigned int, void *, size_t); |
| 85 | int (*bulk_write)(struct i2c_client *, unsigned int, const void *, size_t); |
| 86 | int (*update_bits)(struct i2c_client *, unsigned int, unsigned int, unsigned int); |
Antti Palosaari | c2c8386 | 2014-12-02 10:55:17 -0300 | [diff] [blame] | 87 | }; |
| 88 | |
Thomas Mair | 82041c0 | 2012-05-18 14:47:40 -0300 | [diff] [blame] | 89 | #endif /* RTL2832_H */ |