Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 1 | /** |
| 2 | * Driver for Sharp IX2505V (marked B0017) DVB-S silicon tuner |
| 3 | * |
| 4 | * Copyright (C) 2010 Malcolm Priestley |
| 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 Version 2, as |
| 8 | * published by the Free Software Foundation. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 13 | * GNU General Public License for more details. |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 14 | */ |
| 15 | |
| 16 | #ifndef DVB_IX2505V_H |
| 17 | #define DVB_IX2505V_H |
| 18 | |
| 19 | #include <linux/i2c.h> |
| 20 | #include "dvb_frontend.h" |
| 21 | |
Mauro Carvalho Chehab | be9b53c | 2017-11-29 14:02:22 -0500 | [diff] [blame] | 22 | /** |
| 23 | * struct ix2505v_config - ix2505 attachment configuration |
| 24 | * |
| 25 | * @tuner_address: tuner address |
| 26 | * @tuner_gain: Baseband AMP gain control 0/1=0dB(default) 2=-2bB 3=-4dB |
| 27 | * @tuner_chargepump: Charge pump output +/- 0=120 1=260 2=555 3=1200(default) |
| 28 | * @min_delay_ms: delay after tune |
| 29 | * @tuner_write_only: disables reads |
| 30 | */ |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 31 | struct ix2505v_config { |
| 32 | u8 tuner_address; |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 33 | u8 tuner_gain; |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 34 | u8 tuner_chargepump; |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 35 | int min_delay_ms; |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 36 | u8 tuner_write_only; |
| 37 | |
| 38 | }; |
| 39 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 40 | #if IS_REACHABLE(CONFIG_DVB_IX2505V) |
Mauro Carvalho Chehab | b95b0c9 | 2017-11-29 12:39:19 -0500 | [diff] [blame] | 41 | /** |
| 42 | * Attach a ix2505v tuner to the supplied frontend structure. |
| 43 | * |
| 44 | * @fe: Frontend to attach to. |
| 45 | * @config: pointer to &struct ix2505v_config |
| 46 | * @i2c: pointer to &struct i2c_adapter. |
| 47 | * |
| 48 | * return: FE pointer on success, NULL on failure. |
| 49 | */ |
Malcolm Priestley | 1ae2c58 | 2010-08-28 18:07:37 -0300 | [diff] [blame] | 50 | extern struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe, |
| 51 | const struct ix2505v_config *config, struct i2c_adapter *i2c); |
| 52 | #else |
| 53 | static inline struct dvb_frontend *ix2505v_attach(struct dvb_frontend *fe, |
| 54 | const struct ix2505v_config *config, struct i2c_adapter *i2c) |
| 55 | { |
| 56 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 57 | return NULL; |
| 58 | } |
| 59 | #endif |
| 60 | |
| 61 | #endif /* DVB_IX2505V_H */ |