Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Samsung S5H1411 VSB/QAM demodulator driver
0004 
0005     Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
0006 
0007 
0008 */
0009 
0010 #ifndef __S5H1411_H__
0011 #define __S5H1411_H__
0012 
0013 #include <linux/dvb/frontend.h>
0014 
0015 #define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
0016 #define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
0017 
0018 struct s5h1411_config {
0019 
0020     /* serial/parallel output */
0021 #define S5H1411_PARALLEL_OUTPUT 0
0022 #define S5H1411_SERIAL_OUTPUT   1
0023     u8 output_mode;
0024 
0025     /* GPIO Setting */
0026 #define S5H1411_GPIO_OFF 0
0027 #define S5H1411_GPIO_ON  1
0028     u8 gpio;
0029 
0030     /* MPEG signal timing */
0031 #define S5H1411_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK       0
0032 #define S5H1411_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK    1
0033 #define S5H1411_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK    2
0034 #define S5H1411_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
0035     u16 mpeg_timing;
0036 
0037     /* IF Freq for QAM and VSB in KHz */
0038 #define S5H1411_IF_3250  3250
0039 #define S5H1411_IF_3500  3500
0040 #define S5H1411_IF_4000  4000
0041 #define S5H1411_IF_5380  5380
0042 #define S5H1411_IF_44000 44000
0043 #define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
0044 #define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
0045     u16 qam_if;
0046     u16 vsb_if;
0047 
0048     /* Spectral Inversion */
0049 #define S5H1411_INVERSION_OFF 0
0050 #define S5H1411_INVERSION_ON  1
0051     u8 inversion;
0052 
0053     /* Return lock status based on tuner lock, or demod lock */
0054 #define S5H1411_TUNERLOCKING 0
0055 #define S5H1411_DEMODLOCKING 1
0056     u8 status_mode;
0057 };
0058 
0059 #if IS_REACHABLE(CONFIG_DVB_S5H1411)
0060 extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
0061                        struct i2c_adapter *i2c);
0062 #else
0063 static inline struct dvb_frontend *s5h1411_attach(
0064     const struct s5h1411_config *config,
0065     struct i2c_adapter *i2c)
0066 {
0067     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0068     return NULL;
0069 }
0070 #endif /* CONFIG_DVB_S5H1411 */
0071 
0072 #endif /* __S5H1411_H__ */