Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Samsung S5H1409 VSB/QAM demodulator driver
0004 
0005     Copyright (C) 2006 Steven Toth <stoth@linuxtv.org>
0006 
0007 
0008 */
0009 
0010 #ifndef __S5H1409_H__
0011 #define __S5H1409_H__
0012 
0013 #include <linux/dvb/frontend.h>
0014 
0015 struct s5h1409_config {
0016     /* the demodulator's i2c address */
0017     u8 demod_address;
0018 
0019     /* serial/parallel output */
0020 #define S5H1409_PARALLEL_OUTPUT 0
0021 #define S5H1409_SERIAL_OUTPUT   1
0022     u8 output_mode;
0023 
0024     /* GPIO Setting */
0025 #define S5H1409_GPIO_OFF 0
0026 #define S5H1409_GPIO_ON  1
0027     u8 gpio;
0028 
0029     /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */
0030     u16 qam_if;
0031 
0032     /* Spectral Inversion */
0033 #define S5H1409_INVERSION_OFF 0
0034 #define S5H1409_INVERSION_ON  1
0035     u8 inversion;
0036 
0037     /* Return lock status based on tuner lock, or demod lock */
0038 #define S5H1409_TUNERLOCKING 0
0039 #define S5H1409_DEMODLOCKING 1
0040     u8 status_mode;
0041 
0042     /* MPEG signal timing */
0043 #define S5H1409_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK       0
0044 #define S5H1409_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK    1
0045 #define S5H1409_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK    2
0046 #define S5H1409_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
0047     u16 mpeg_timing;
0048 
0049     /* HVR-1600 optimizations (to better work with MXL5005s)
0050        Note: some of these are likely to be folded into the generic driver
0051        after being regression tested with other boards */
0052 #define S5H1409_HVR1600_NOOPTIMIZE 0
0053 #define S5H1409_HVR1600_OPTIMIZE   1
0054     u8 hvr1600_opt;
0055 };
0056 
0057 #if IS_REACHABLE(CONFIG_DVB_S5H1409)
0058 extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
0059                        struct i2c_adapter *i2c);
0060 #else
0061 static inline struct dvb_frontend *s5h1409_attach(
0062     const struct s5h1409_config *config,
0063     struct i2c_adapter *i2c)
0064 {
0065     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0066     return NULL;
0067 }
0068 #endif /* CONFIG_DVB_S5H1409 */
0069 
0070 #endif /* __S5H1409_H__ */