Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 1 | /* |
| 2 | DVB Driver for Philips tda827x / tda827xa Silicon tuners |
| 3 | |
| 4 | (c) 2005 Hartmut Hackmann |
| 5 | (c) 2007 Michael Krufky |
| 6 | |
| 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 | |
| 16 | GNU General Public License for more details. |
| 17 | |
| 18 | You should have received a copy of the GNU General Public License |
| 19 | along with this program; if not, write to the Free Software |
| 20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | |
| 22 | */ |
| 23 | |
| 24 | #ifndef __DVB_TDA827X_H__ |
| 25 | #define __DVB_TDA827X_H__ |
| 26 | |
| 27 | #include <linux/i2c.h> |
| 28 | #include "dvb_frontend.h" |
Ondrej Zary | 1bacb2d | 2013-04-06 14:29:29 -0300 | [diff] [blame] | 29 | #include "tda8290.h" |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 30 | |
| 31 | struct tda827x_config |
| 32 | { |
Michael Krufky | 746d9732 | 2007-08-25 19:08:45 -0300 | [diff] [blame] | 33 | /* saa7134 - provided callbacks */ |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 34 | int (*init) (struct dvb_frontend *fe); |
| 35 | int (*sleep) (struct dvb_frontend *fe); |
Michael Krufky | 746d9732 | 2007-08-25 19:08:45 -0300 | [diff] [blame] | 36 | |
| 37 | /* interface to tda829x driver */ |
Ondrej Zary | 1bacb2d | 2013-04-06 14:29:29 -0300 | [diff] [blame] | 38 | enum tda8290_lna config; |
Hartmut Hackmann | 7bff4b4 | 2008-04-22 14:46:08 -0300 | [diff] [blame] | 39 | int switch_addr; |
Michael Krufky | 746d9732 | 2007-08-25 19:08:45 -0300 | [diff] [blame] | 40 | |
| 41 | void (*agcf)(struct dvb_frontend *fe); |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 42 | }; |
| 43 | |
| 44 | |
| 45 | /** |
| 46 | * Attach a tda827x tuner to the supplied frontend structure. |
| 47 | * |
| 48 | * @param fe Frontend to attach to. |
| 49 | * @param addr i2c address of the tuner. |
| 50 | * @param i2c i2c adapter to use. |
| 51 | * @param cfg optional callback function pointers. |
| 52 | * @return FE pointer on success, NULL on failure. |
| 53 | */ |
Peter Senna Tschudin | 7b34be7 | 2013-01-20 01:32:56 -0300 | [diff] [blame] | 54 | #if IS_ENABLED(CONFIG_MEDIA_TUNER_TDA827X) |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 55 | extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr, |
| 56 | struct i2c_adapter *i2c, |
| 57 | struct tda827x_config *cfg); |
| 58 | #else |
| 59 | static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, |
| 60 | int addr, |
| 61 | struct i2c_adapter *i2c, |
| 62 | struct tda827x_config *cfg) |
| 63 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 64 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 65 | return NULL; |
| 66 | } |
Mauro Carvalho Chehab | 149ef72 | 2008-04-29 21:38:46 -0300 | [diff] [blame] | 67 | #endif // CONFIG_MEDIA_TUNER_TDA827X |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 68 | |
| 69 | #endif // __DVB_TDA827X_H__ |