^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) * stv0367.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Driver for ST STV0367 DVB-T & DVB-C demodulator IC.
^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) * Copyright (C) 2010,2011 NetUP Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Copyright (C) 2010,2011 Igor M. Liplianin <liplianin@netup.ru>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #ifndef STV0367_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define STV0367_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #include <linux/dvb/frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <media/dvb_frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #define STV0367_ICSPEED_53125 53125000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define STV0367_ICSPEED_58000 58000000
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct stv0367_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) u8 demod_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) u32 xtal;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u32 if_khz;/*4500*/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) int if_iq_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) int ts_mode;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) int clk_pol;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #if IS_REACHABLE(CONFIG_DVB_STV0367)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) extern struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) extern struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) extern struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) static inline struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) dvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static inline struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) dvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) static inline struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) dvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #endif