1*74ba9207SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */ 289885558SSteven Toth /* 389885558SSteven Toth Samsung S5H1409 VSB/QAM demodulator driver 489885558SSteven Toth 56d897616SSteven Toth Copyright (C) 2006 Steven Toth <stoth@linuxtv.org> 689885558SSteven Toth 789885558SSteven Toth 889885558SSteven Toth */ 989885558SSteven Toth 103873dd04SMichael Krufky #ifndef __S5H1409_H__ 113873dd04SMichael Krufky #define __S5H1409_H__ 1289885558SSteven Toth 1389885558SSteven Toth #include <linux/dvb/frontend.h> 1489885558SSteven Toth 15b7709c0dSSteven Toth struct s5h1409_config { 1689885558SSteven Toth /* the demodulator's i2c address */ 1789885558SSteven Toth u8 demod_address; 1889885558SSteven Toth 1989885558SSteven Toth /* serial/parallel output */ 2089885558SSteven Toth #define S5H1409_PARALLEL_OUTPUT 0 2189885558SSteven Toth #define S5H1409_SERIAL_OUTPUT 1 2289885558SSteven Toth u8 output_mode; 2389885558SSteven Toth 2489885558SSteven Toth /* GPIO Setting */ 2589885558SSteven Toth #define S5H1409_GPIO_OFF 0 2689885558SSteven Toth #define S5H1409_GPIO_ON 1 2789885558SSteven Toth u8 gpio; 2889885558SSteven Toth 292b03238aSMichael Krufky /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */ 302b03238aSMichael Krufky u16 qam_if; 3189885558SSteven Toth 3289885558SSteven Toth /* Spectral Inversion */ 3389885558SSteven Toth #define S5H1409_INVERSION_OFF 0 3489885558SSteven Toth #define S5H1409_INVERSION_ON 1 3589885558SSteven Toth u8 inversion; 3689885558SSteven Toth 3789885558SSteven Toth /* Return lock status based on tuner lock, or demod lock */ 3889885558SSteven Toth #define S5H1409_TUNERLOCKING 0 3989885558SSteven Toth #define S5H1409_DEMODLOCKING 1 4089885558SSteven Toth u8 status_mode; 41dfc1c08aSSteven Toth 42dfc1c08aSSteven Toth /* MPEG signal timing */ 43ad05ff09SMauro Carvalho Chehab #define S5H1409_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 0 44ad05ff09SMauro Carvalho Chehab #define S5H1409_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 1 45ad05ff09SMauro Carvalho Chehab #define S5H1409_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 2 46ad05ff09SMauro Carvalho Chehab #define S5H1409_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 3 47dfc1c08aSSteven Toth u16 mpeg_timing; 48af5c8e15SDevin Heitmueller 49af5c8e15SDevin Heitmueller /* HVR-1600 optimizations (to better work with MXL5005s) 50af5c8e15SDevin Heitmueller Note: some of these are likely to be folded into the generic driver 51af5c8e15SDevin Heitmueller after being regression tested with other boards */ 52af5c8e15SDevin Heitmueller #define S5H1409_HVR1600_NOOPTIMIZE 0 53af5c8e15SDevin Heitmueller #define S5H1409_HVR1600_OPTIMIZE 1 54af5c8e15SDevin Heitmueller u8 hvr1600_opt; 5589885558SSteven Toth }; 5689885558SSteven Toth 579b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_S5H1409) 5889885558SSteven Toth extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config, 5989885558SSteven Toth struct i2c_adapter *i2c); 6089885558SSteven Toth #else 61b7709c0dSSteven Toth static inline struct dvb_frontend *s5h1409_attach( 62b7709c0dSSteven Toth const struct s5h1409_config *config, 6389885558SSteven Toth struct i2c_adapter *i2c) 6489885558SSteven Toth { 65271ddbf7SHarvey Harrison printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); 6689885558SSteven Toth return NULL; 6789885558SSteven Toth } 683873dd04SMichael Krufky #endif /* CONFIG_DVB_S5H1409 */ 6989885558SSteven Toth 703873dd04SMichael Krufky #endif /* __S5H1409_H__ */ 71