Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Samsung s5h1432 VSB/QAM demodulator driver
0004  *
0005  *  Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>
0006  */
0007 
0008 #ifndef __S5H1432_H__
0009 #define __S5H1432_H__
0010 
0011 #include <linux/dvb/frontend.h>
0012 
0013 #define S5H1432_I2C_TOP_ADDR (0x02 >> 1)
0014 
0015 #define TAIWAN_HI_IF_FREQ_44_MHZ 44000000
0016 #define EUROPE_HI_IF_FREQ_36_MHZ 36000000
0017 #define IF_FREQ_6_MHZ             6000000
0018 #define IF_FREQ_3point3_MHZ       3300000
0019 #define IF_FREQ_3point5_MHZ       3500000
0020 #define IF_FREQ_4_MHZ             4000000
0021 
0022 struct s5h1432_config {
0023 
0024     /* serial/parallel output */
0025 #define S5H1432_PARALLEL_OUTPUT 0
0026 #define S5H1432_SERIAL_OUTPUT   1
0027     u8 output_mode;
0028 
0029     /* GPIO Setting */
0030 #define S5H1432_GPIO_OFF 0
0031 #define S5H1432_GPIO_ON  1
0032     u8 gpio;
0033 
0034     /* MPEG signal timing */
0035 #define S5H1432_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK       0
0036 #define S5H1432_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK    1
0037 #define S5H1432_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK    2
0038 #define S5H1432_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3
0039     u16 mpeg_timing;
0040 
0041     /* IF Freq for QAM and VSB in KHz */
0042 #define S5H1432_IF_3250  3250
0043 #define S5H1432_IF_3500  3500
0044 #define S5H1432_IF_4000  4000
0045 #define S5H1432_IF_5380  5380
0046 #define S5H1432_IF_44000 44000
0047 #define S5H1432_VSB_IF_DEFAULT s5h1432_IF_44000
0048 #define S5H1432_QAM_IF_DEFAULT s5h1432_IF_44000
0049     u16 qam_if;
0050     u16 vsb_if;
0051 
0052     /* Spectral Inversion */
0053 #define S5H1432_INVERSION_OFF 0
0054 #define S5H1432_INVERSION_ON  1
0055     u8 inversion;
0056 
0057     /* Return lock status based on tuner lock, or demod lock */
0058 #define S5H1432_TUNERLOCKING 0
0059 #define S5H1432_DEMODLOCKING 1
0060     u8 status_mode;
0061 };
0062 
0063 #if IS_REACHABLE(CONFIG_DVB_S5H1432)
0064 extern struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,
0065                        struct i2c_adapter *i2c);
0066 #else
0067 static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config
0068                           *config,
0069                           struct i2c_adapter *i2c)
0070 {
0071     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0072     return NULL;
0073 }
0074 #endif /* CONFIG_DVB_s5h1432 */
0075 
0076 #endif /* __s5h1432_H__ */