18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Driver for
48c2ecf20Sopenharmony_ci *    Samsung S5H1420 and
58c2ecf20Sopenharmony_ci *    PnpNetwork PN1010 QPSK Demodulator
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2005 Andrew de Quincey <adq_dvb@lidskialf.net>
88c2ecf20Sopenharmony_ci * Copyright (C) 2005-8 Patrick Boettcher <pb@linuxtv.org>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci#ifndef S5H1420_H
118c2ecf20Sopenharmony_ci#define S5H1420_H
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#include <linux/dvb/frontend.h>
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cistruct s5h1420_config
168c2ecf20Sopenharmony_ci{
178c2ecf20Sopenharmony_ci	/* the demodulator's i2c address */
188c2ecf20Sopenharmony_ci	u8 demod_address;
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci	/* does the inversion require inversion? */
218c2ecf20Sopenharmony_ci	u8 invert:1;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci	u8 repeated_start_workaround:1;
248c2ecf20Sopenharmony_ci	u8 cdclk_polarity:1; /* 1 == falling edge, 0 == raising edge */
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci	u8 serial_mpeg:1;
278c2ecf20Sopenharmony_ci};
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_S5H1420)
308c2ecf20Sopenharmony_ciextern struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config,
318c2ecf20Sopenharmony_ci	     struct i2c_adapter *i2c);
328c2ecf20Sopenharmony_ciextern struct i2c_adapter *s5h1420_get_tuner_i2c_adapter(struct dvb_frontend *fe);
338c2ecf20Sopenharmony_ci#else
348c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *s5h1420_attach(const struct s5h1420_config *config,
358c2ecf20Sopenharmony_ci					   struct i2c_adapter *i2c)
368c2ecf20Sopenharmony_ci{
378c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
388c2ecf20Sopenharmony_ci	return NULL;
398c2ecf20Sopenharmony_ci}
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_cistatic inline struct i2c_adapter *s5h1420_get_tuner_i2c_adapter(struct dvb_frontend *fe)
428c2ecf20Sopenharmony_ci{
438c2ecf20Sopenharmony_ci	return NULL;
448c2ecf20Sopenharmony_ci}
458c2ecf20Sopenharmony_ci#endif // CONFIG_DVB_S5H1420
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci#endif // S5H1420_H
48