18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * stv6110.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Driver for ST STV6110 satellite tuner IC.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) 2009 NetUP Inc.
88c2ecf20Sopenharmony_ci * Copyright (C) 2009 Igor M. Liplianin <liplianin@netup.ru>
98c2ecf20Sopenharmony_ci */
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifndef __DVB_STV6110_H__
128c2ecf20Sopenharmony_ci#define __DVB_STV6110_H__
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include <linux/i2c.h>
158c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci/* registers */
188c2ecf20Sopenharmony_ci#define RSTV6110_CTRL1		0
198c2ecf20Sopenharmony_ci#define RSTV6110_CTRL2		1
208c2ecf20Sopenharmony_ci#define RSTV6110_TUNING1	2
218c2ecf20Sopenharmony_ci#define RSTV6110_TUNING2	3
228c2ecf20Sopenharmony_ci#define RSTV6110_CTRL3		4
238c2ecf20Sopenharmony_ci#define RSTV6110_STAT1		5
248c2ecf20Sopenharmony_ci#define RSTV6110_STAT2		6
258c2ecf20Sopenharmony_ci#define RSTV6110_STAT3		7
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_cistruct stv6110_config {
288c2ecf20Sopenharmony_ci	u8 i2c_address;
298c2ecf20Sopenharmony_ci	u32 mclk;
308c2ecf20Sopenharmony_ci	u8 gain;
318c2ecf20Sopenharmony_ci	u8 clk_div;	/* divisor value for the output clock */
328c2ecf20Sopenharmony_ci};
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_STV6110)
358c2ecf20Sopenharmony_ciextern struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
368c2ecf20Sopenharmony_ci					const struct stv6110_config *config,
378c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c);
388c2ecf20Sopenharmony_ci#else
398c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
408c2ecf20Sopenharmony_ci					const struct stv6110_config *config,
418c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c)
428c2ecf20Sopenharmony_ci{
438c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
448c2ecf20Sopenharmony_ci	return NULL;
458c2ecf20Sopenharmony_ci}
468c2ecf20Sopenharmony_ci#endif
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#endif
49