18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci    VES1820  - Single Chip Cable Channel Receiver driver module
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci    Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci*/
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef VES1820_H
108c2ecf20Sopenharmony_ci#define VES1820_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/dvb/frontend.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#define VES1820_SELAGC_PWM 0
158c2ecf20Sopenharmony_ci#define VES1820_SELAGC_SIGNAMPERR 1
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_cistruct ves1820_config
188c2ecf20Sopenharmony_ci{
198c2ecf20Sopenharmony_ci	/* the demodulator's i2c address */
208c2ecf20Sopenharmony_ci	u8 demod_address;
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci	/* value of XIN to use */
238c2ecf20Sopenharmony_ci	u32 xin;
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci	/* does inversion need inverted? */
268c2ecf20Sopenharmony_ci	u8 invert:1;
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci	/* SELAGC control */
298c2ecf20Sopenharmony_ci	u8 selagc:1;
308c2ecf20Sopenharmony_ci};
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_VES1820)
338c2ecf20Sopenharmony_ciextern struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
348c2ecf20Sopenharmony_ci					   struct i2c_adapter* i2c, u8 pwm);
358c2ecf20Sopenharmony_ci#else
368c2ecf20Sopenharmony_cistatic inline struct dvb_frontend* ves1820_attach(const struct ves1820_config* config,
378c2ecf20Sopenharmony_ci					   struct i2c_adapter* i2c, u8 pwm)
388c2ecf20Sopenharmony_ci{
398c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
408c2ecf20Sopenharmony_ci	return NULL;
418c2ecf20Sopenharmony_ci}
428c2ecf20Sopenharmony_ci#endif // CONFIG_DVB_VES1820
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci#endif // VES1820_H
45