^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) DVB Driver for Philips tda827x / tda827xa Silicon tuners
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) (c) 2005 Hartmut Hackmann
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) (c) 2007 Michael Krufky
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^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 __DVB_TDA827X_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #define __DVB_TDA827X_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <media/dvb_frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include "tda8290.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) struct tda827x_config
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) /* saa7134 - provided callbacks */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) int (*init) (struct dvb_frontend *fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) int (*sleep) (struct dvb_frontend *fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) /* interface to tda829x driver */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) enum tda8290_lna config;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int switch_addr;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) void (*agcf)(struct dvb_frontend *fe);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) };
^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) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) * Attach a tda827x tuner to the supplied frontend structure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) * @param fe Frontend to attach to.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * @param addr i2c address of the tuner.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) * @param i2c i2c adapter to use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * @param cfg optional callback function pointers.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * @return FE pointer on success, NULL on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA827X)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) struct tda827x_config *cfg);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) int addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) struct tda827x_config *cfg)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #endif // CONFIG_MEDIA_TUNER_TDA827X
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif // __DVB_TDA827X_H__