Thomas Gleixner | 74ba920 | 2019-05-20 09:19:02 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 2 | /* |
| 3 | Samsung S5H1411 VSB/QAM demodulator driver |
| 4 | |
Steven Toth | 6d89761 | 2008-09-03 17:12:12 -0300 | [diff] [blame] | 5 | Copyright (C) 2008 Steven Toth <stoth@linuxtv.org> |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 6 | |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 7 | |
| 8 | */ |
| 9 | |
| 10 | #ifndef __S5H1411_H__ |
| 11 | #define __S5H1411_H__ |
| 12 | |
| 13 | #include <linux/dvb/frontend.h> |
| 14 | |
| 15 | #define S5H1411_I2C_TOP_ADDR (0x32 >> 1) |
| 16 | #define S5H1411_I2C_QAM_ADDR (0x34 >> 1) |
| 17 | |
| 18 | struct s5h1411_config { |
| 19 | |
| 20 | /* serial/parallel output */ |
| 21 | #define S5H1411_PARALLEL_OUTPUT 0 |
| 22 | #define S5H1411_SERIAL_OUTPUT 1 |
| 23 | u8 output_mode; |
| 24 | |
| 25 | /* GPIO Setting */ |
| 26 | #define S5H1411_GPIO_OFF 0 |
| 27 | #define S5H1411_GPIO_ON 1 |
| 28 | u8 gpio; |
| 29 | |
| 30 | /* MPEG signal timing */ |
Mauro Carvalho Chehab | ad05ff0 | 2018-03-03 09:53:32 -0500 | [diff] [blame] | 31 | #define S5H1411_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0 |
| 32 | #define S5H1411_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1 |
| 33 | #define S5H1411_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2 |
| 34 | #define S5H1411_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3 |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 35 | u16 mpeg_timing; |
| 36 | |
| 37 | /* IF Freq for QAM and VSB in KHz */ |
Steven Toth | 1874c44 | 2008-10-18 11:19:31 -0300 | [diff] [blame] | 38 | #define S5H1411_IF_3250 3250 |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 39 | #define S5H1411_IF_3500 3500 |
| 40 | #define S5H1411_IF_4000 4000 |
| 41 | #define S5H1411_IF_5380 5380 |
| 42 | #define S5H1411_IF_44000 44000 |
| 43 | #define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000 |
| 44 | #define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000 |
| 45 | u16 qam_if; |
| 46 | u16 vsb_if; |
| 47 | |
| 48 | /* Spectral Inversion */ |
| 49 | #define S5H1411_INVERSION_OFF 0 |
| 50 | #define S5H1411_INVERSION_ON 1 |
| 51 | u8 inversion; |
| 52 | |
| 53 | /* Return lock status based on tuner lock, or demod lock */ |
| 54 | #define S5H1411_TUNERLOCKING 0 |
| 55 | #define S5H1411_DEMODLOCKING 1 |
| 56 | u8 status_mode; |
| 57 | }; |
| 58 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 59 | #if IS_REACHABLE(CONFIG_DVB_S5H1411) |
Steven Toth | 8b4f1d0 | 2008-04-25 03:44:36 -0300 | [diff] [blame] | 60 | extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config, |
| 61 | struct i2c_adapter *i2c); |
| 62 | #else |
| 63 | static inline struct dvb_frontend *s5h1411_attach( |
| 64 | const struct s5h1411_config *config, |
| 65 | struct i2c_adapter *i2c) |
| 66 | { |
| 67 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 68 | return NULL; |
| 69 | } |
| 70 | #endif /* CONFIG_DVB_S5H1411 */ |
| 71 | |
| 72 | #endif /* __S5H1411_H__ */ |