xref: /linux/drivers/media/dvb-frontends/s5h1409.h (revision 24168c5e6dfbdd5b414f048f47f75d64533296ca)
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3     Samsung S5H1409 VSB/QAM demodulator driver
4 
5     Copyright (C) 2006 Steven Toth <stoth@linuxtv.org>
6 
7 
8 */
9 
10 #ifndef __S5H1409_H__
11 #define __S5H1409_H__
12 
13 #include <linux/dvb/frontend.h>
14 
15 struct s5h1409_config {
16 	/* the demodulator's i2c address */
17 	u8 demod_address;
18 
19 	/* serial/parallel output */
20 #define S5H1409_PARALLEL_OUTPUT 0
21 #define S5H1409_SERIAL_OUTPUT   1
22 	u8 output_mode;
23 
24 	/* GPIO Setting */
25 #define S5H1409_GPIO_OFF 0
26 #define S5H1409_GPIO_ON  1
27 	u8 gpio;
28 
29 	/* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */
30 	u16 qam_if;
31 
32 	/* Spectral Inversion */
33 #define S5H1409_INVERSION_OFF 0
34 #define S5H1409_INVERSION_ON  1
35 	u8 inversion;
36 
37 	/* Return lock status based on tuner lock, or demod lock */
38 #define S5H1409_TUNERLOCKING 0
39 #define S5H1409_DEMODLOCKING 1
40 	u8 status_mode;
41 
42 	/* MPEG signal timing */
43 #define S5H1409_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK       0
44 #define S5H1409_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK    1
45 #define S5H1409_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK    2
46 #define S5H1409_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
47 	u16 mpeg_timing;
48 
49 	/* HVR-1600 optimizations (to better work with MXL5005s)
50 	   Note: some of these are likely to be folded into the generic driver
51 	   after being regression tested with other boards */
52 #define S5H1409_HVR1600_NOOPTIMIZE 0
53 #define S5H1409_HVR1600_OPTIMIZE   1
54 	u8 hvr1600_opt;
55 };
56 
57 #if IS_REACHABLE(CONFIG_DVB_S5H1409)
58 extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
59 					   struct i2c_adapter *i2c);
60 #else
61 static inline struct dvb_frontend *s5h1409_attach(
62 	const struct s5h1409_config *config,
63 	struct i2c_adapter *i2c)
64 {
65 	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
66 	return NULL;
67 }
68 #endif /* CONFIG_DVB_S5H1409 */
69 
70 #endif /* __S5H1409_H__ */
71