Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 1 | /* |
| 2 | Samsung S5H1409 VSB/QAM demodulator driver |
| 3 | |
Steven Toth | 6d89761 | 2008-09-03 17:12:12 -0300 | [diff] [blame] | 4 | Copyright (C) 2006 Steven Toth <stoth@linuxtv.org> |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 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 |
| 17 | along with this program; if not, write to the Free Software |
| 18 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 19 | |
| 20 | */ |
| 21 | |
Michael Krufky | 3873dd0 | 2007-07-28 20:02:55 -0300 | [diff] [blame] | 22 | #ifndef __S5H1409_H__ |
| 23 | #define __S5H1409_H__ |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 24 | |
Mauro Carvalho Chehab | 782d8b7 | 2013-03-21 16:11:54 -0300 | [diff] [blame] | 25 | #include <linux/kconfig.h> |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 26 | #include <linux/dvb/frontend.h> |
| 27 | |
Steven Toth | b7709c0d | 2008-10-16 20:27:11 -0300 | [diff] [blame] | 28 | struct s5h1409_config { |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 29 | /* the demodulator's i2c address */ |
| 30 | u8 demod_address; |
| 31 | |
| 32 | /* serial/parallel output */ |
| 33 | #define S5H1409_PARALLEL_OUTPUT 0 |
| 34 | #define S5H1409_SERIAL_OUTPUT 1 |
| 35 | u8 output_mode; |
| 36 | |
| 37 | /* GPIO Setting */ |
| 38 | #define S5H1409_GPIO_OFF 0 |
| 39 | #define S5H1409_GPIO_ON 1 |
| 40 | u8 gpio; |
| 41 | |
Michael Krufky | 2b03238 | 2007-12-13 10:04:10 -0300 | [diff] [blame] | 42 | /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */ |
| 43 | u16 qam_if; |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 44 | |
| 45 | /* Spectral Inversion */ |
| 46 | #define S5H1409_INVERSION_OFF 0 |
| 47 | #define S5H1409_INVERSION_ON 1 |
| 48 | u8 inversion; |
| 49 | |
| 50 | /* Return lock status based on tuner lock, or demod lock */ |
| 51 | #define S5H1409_TUNERLOCKING 0 |
| 52 | #define S5H1409_DEMODLOCKING 1 |
| 53 | u8 status_mode; |
Steven Toth | dfc1c08 | 2008-01-15 21:35:22 -0300 | [diff] [blame] | 54 | |
| 55 | /* MPEG signal timing */ |
| 56 | #define S5H1409_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0 |
| 57 | #define S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1 |
| 58 | #define S5H1409_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2 |
| 59 | #define S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3 |
| 60 | u16 mpeg_timing; |
Devin Heitmueller | af5c8e1 | 2009-10-27 23:33:21 -0300 | [diff] [blame] | 61 | |
| 62 | /* HVR-1600 optimizations (to better work with MXL5005s) |
| 63 | Note: some of these are likely to be folded into the generic driver |
| 64 | after being regression tested with other boards */ |
| 65 | #define S5H1409_HVR1600_NOOPTIMIZE 0 |
| 66 | #define S5H1409_HVR1600_OPTIMIZE 1 |
| 67 | u8 hvr1600_opt; |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 68 | }; |
| 69 | |
Mauro Carvalho Chehab | 782d8b7 | 2013-03-21 16:11:54 -0300 | [diff] [blame] | 70 | #if IS_ENABLED(CONFIG_DVB_S5H1409) |
Steven Toth | b7709c0d | 2008-10-16 20:27:11 -0300 | [diff] [blame] | 71 | extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config, |
| 72 | struct i2c_adapter *i2c); |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 73 | #else |
Steven Toth | b7709c0d | 2008-10-16 20:27:11 -0300 | [diff] [blame] | 74 | static inline struct dvb_frontend *s5h1409_attach( |
| 75 | const struct s5h1409_config *config, |
| 76 | struct i2c_adapter *i2c) |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 77 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 78 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 79 | return NULL; |
| 80 | } |
Michael Krufky | 3873dd0 | 2007-07-28 20:02:55 -0300 | [diff] [blame] | 81 | #endif /* CONFIG_DVB_S5H1409 */ |
Steven Toth | 8988555 | 2007-07-28 19:34:52 -0300 | [diff] [blame] | 82 | |
Michael Krufky | 3873dd0 | 2007-07-28 20:02:55 -0300 | [diff] [blame] | 83 | #endif /* __S5H1409_H__ */ |
| 84 | |
| 85 | /* |
| 86 | * Local variables: |
| 87 | * c-basic-offset: 8 |
| 88 | */ |