Antti Palosaari | 27cfc85 | 2011-04-07 16:27:43 -0300 | [diff] [blame] | 1 | /* |
| 2 | * Sony CXD2820R demodulator driver |
| 3 | * |
| 4 | * Copyright (C) 2010 Antti Palosaari <crope@iki.fi> |
| 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 | |
| 22 | #ifndef CXD2820R_PRIV_H |
| 23 | #define CXD2820R_PRIV_H |
| 24 | |
| 25 | #include "dvb_frontend.h" |
| 26 | #include "dvb_math.h" |
| 27 | #include "cxd2820r.h" |
| 28 | |
| 29 | #define LOG_PREFIX "cxd2820r" |
| 30 | |
| 31 | #undef dbg |
| 32 | #define dbg(f, arg...) \ |
| 33 | if (cxd2820r_debug) \ |
| 34 | printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) |
| 35 | #undef err |
| 36 | #define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg) |
| 37 | #undef info |
| 38 | #define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg) |
| 39 | #undef warn |
| 40 | #define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg) |
| 41 | |
| 42 | /* |
| 43 | * FIXME: These are totally wrong and must be added properly to the API. |
| 44 | * Only temporary solution in order to get driver compile. |
| 45 | */ |
| 46 | #define SYS_DVBT2 SYS_DAB |
| 47 | #define TRANSMISSION_MODE_1K 0 |
| 48 | #define TRANSMISSION_MODE_16K 0 |
| 49 | #define TRANSMISSION_MODE_32K 0 |
| 50 | #define GUARD_INTERVAL_1_128 0 |
| 51 | #define GUARD_INTERVAL_19_128 0 |
| 52 | #define GUARD_INTERVAL_19_256 0 |
| 53 | |
| 54 | struct reg_val_mask { |
| 55 | u32 reg; |
| 56 | u8 val; |
| 57 | u8 mask; |
| 58 | }; |
| 59 | |
| 60 | struct cxd2820r_priv { |
| 61 | struct i2c_adapter *i2c; |
| 62 | struct dvb_frontend fe[2]; |
| 63 | struct cxd2820r_config cfg; |
| 64 | struct i2c_adapter tuner_i2c_adapter; |
| 65 | |
| 66 | struct mutex fe_lock; /* FE lock */ |
| 67 | int active_fe:2; /* FE lock, -1=NONE, 0=DVB-T/T2, 1=DVB-C */ |
| 68 | |
| 69 | int ber_running:1; |
| 70 | |
| 71 | u8 bank[2]; |
| 72 | u8 gpio[3]; |
| 73 | |
| 74 | fe_delivery_system_t delivery_system; |
| 75 | }; |
| 76 | |
| 77 | #endif /* CXD2820R_PRIV_H */ |