18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * stv0900.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Driver for ST STV0900 satellite demodulator IC.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) ST Microelectronics.
88c2ecf20Sopenharmony_ci * Copyright (C) 2009 NetUP Inc.
98c2ecf20Sopenharmony_ci * Copyright (C) 2009 Igor M. Liplianin <liplianin@netup.ru>
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef STV0900_H
138c2ecf20Sopenharmony_ci#define STV0900_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/dvb/frontend.h>
168c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_cistruct stv0900_reg {
198c2ecf20Sopenharmony_ci	u16 addr;
208c2ecf20Sopenharmony_ci	u8  val;
218c2ecf20Sopenharmony_ci};
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistruct stv0900_config {
248c2ecf20Sopenharmony_ci	u8 demod_address;
258c2ecf20Sopenharmony_ci	u8 demod_mode;
268c2ecf20Sopenharmony_ci	u32 xtal;
278c2ecf20Sopenharmony_ci	u8 clkmode;/* 0 for CLKI,  2 for XTALI */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci	u8 diseqc_mode;
308c2ecf20Sopenharmony_ci
318c2ecf20Sopenharmony_ci	u8 path1_mode;
328c2ecf20Sopenharmony_ci	u8 path2_mode;
338c2ecf20Sopenharmony_ci	struct stv0900_reg *ts_config_regs;
348c2ecf20Sopenharmony_ci	u8 tun1_maddress;/* 0, 1, 2, 3 for 0xc0, 0xc2, 0xc4, 0xc6 */
358c2ecf20Sopenharmony_ci	u8 tun2_maddress;
368c2ecf20Sopenharmony_ci	u8 tun1_adc;/* 1 for stv6110, 2 for stb6100 */
378c2ecf20Sopenharmony_ci	u8 tun2_adc;
388c2ecf20Sopenharmony_ci	u8 tun1_type;/* for now 3 for stb6100 auto, else - software */
398c2ecf20Sopenharmony_ci	u8 tun2_type;
408c2ecf20Sopenharmony_ci	/* Set device param to start dma */
418c2ecf20Sopenharmony_ci	int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
428c2ecf20Sopenharmony_ci	/* Hook for Lock LED */
438c2ecf20Sopenharmony_ci	void (*set_lock_led)(struct dvb_frontend *fe, int offon);
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_STV0900)
478c2ecf20Sopenharmony_ciextern struct dvb_frontend *stv0900_attach(const struct stv0900_config *config,
488c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c, int demod);
498c2ecf20Sopenharmony_ci#else
508c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *stv0900_attach(const struct stv0900_config *config,
518c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c, int demod)
528c2ecf20Sopenharmony_ci{
538c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
548c2ecf20Sopenharmony_ci	return NULL;
558c2ecf20Sopenharmony_ci}
568c2ecf20Sopenharmony_ci#endif
578c2ecf20Sopenharmony_ci
588c2ecf20Sopenharmony_ci#endif
598c2ecf20Sopenharmony_ci
60