77 lines · c
1/* SPDX-License-Identifier: GPL-2.0-or-later */2/*3 * Samsung s5h1432 VSB/QAM demodulator driver4 *5 * Copyright (C) 2009 Bill Liu <Bill.Liu@Conexant.com>6 */7 8#ifndef __S5H1432_H__9#define __S5H1432_H__10 11#include <linux/dvb/frontend.h>12 13#define S5H1432_I2C_TOP_ADDR (0x02 >> 1)14 15#define TAIWAN_HI_IF_FREQ_44_MHZ 4400000016#define EUROPE_HI_IF_FREQ_36_MHZ 3600000017#define IF_FREQ_6_MHZ 600000018#define IF_FREQ_3point3_MHZ 330000019#define IF_FREQ_3point5_MHZ 350000020#define IF_FREQ_4_MHZ 400000021 22struct s5h1432_config {23 24 /* serial/parallel output */25#define S5H1432_PARALLEL_OUTPUT 026#define S5H1432_SERIAL_OUTPUT 127 u8 output_mode;28 29 /* GPIO Setting */30#define S5H1432_GPIO_OFF 031#define S5H1432_GPIO_ON 132 u8 gpio;33 34 /* MPEG signal timing */35#define S5H1432_MPEGTIMING_CONTINUOUS_INVERTING_CLOCK 036#define S5H1432_MPEGTIMING_CONTINUOUS_NONINVERTING_CLOCK 137#define S5H1432_MPEGTIMING_NONCONTINUOUS_INVERTING_CLOCK 238#define S5H1432_MPEGTIMING_NONCONTINUOUS_NONINVERTING_CLOCK 339 u16 mpeg_timing;40 41 /* IF Freq for QAM and VSB in KHz */42#define S5H1432_IF_3250 325043#define S5H1432_IF_3500 350044#define S5H1432_IF_4000 400045#define S5H1432_IF_5380 538046#define S5H1432_IF_44000 4400047#define S5H1432_VSB_IF_DEFAULT s5h1432_IF_4400048#define S5H1432_QAM_IF_DEFAULT s5h1432_IF_4400049 u16 qam_if;50 u16 vsb_if;51 52 /* Spectral Inversion */53#define S5H1432_INVERSION_OFF 054#define S5H1432_INVERSION_ON 155 u8 inversion;56 57 /* Return lock status based on tuner lock, or demod lock */58#define S5H1432_TUNERLOCKING 059#define S5H1432_DEMODLOCKING 160 u8 status_mode;61};62 63#if IS_REACHABLE(CONFIG_DVB_S5H1432)64extern struct dvb_frontend *s5h1432_attach(const struct s5h1432_config *config,65 struct i2c_adapter *i2c);66#else67static inline struct dvb_frontend *s5h1432_attach(const struct s5h1432_config68 *config,69 struct i2c_adapter *i2c)70{71 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);72 return NULL;73}74#endif /* CONFIG_DVB_s5h1432 */75 76#endif /* __s5h1432_H__ */77