^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) STV6110(A) Silicon tuner driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) Copyright (C) Manu Abraham <abraham.manu@gmail.com>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) Copyright (C) ST Microelectronics
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #ifndef __STV6110x_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define __STV6110x_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct stv6110x_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) u8 addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) u32 refclk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u8 clk_div; /* divisor value for the output clock */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct dvb_frontend *frontend;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) struct stv6110x_devctl* (*get_devctl)(struct i2c_client *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) enum tuner_mode {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) TUNER_SLEEP = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) TUNER_WAKE,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) enum tuner_status {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) TUNER_PHASELOCKED = 1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct stv6110x_devctl {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) int (*tuner_init) (struct dvb_frontend *fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) int (*tuner_sleep) (struct dvb_frontend *fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #if IS_REACHABLE(CONFIG_DVB_STV6110x)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) const struct stv6110x_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) const struct stv6110x_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #endif /* CONFIG_DVB_STV6110x */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #endif /* __STV6110x_H */