^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * drxd.h: DRXD DVB-T demodulator driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2005-2007 Micronas
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef _DRXD_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define _DRXD_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) struct drxd_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) u8 index;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) u8 pll_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) u8 pll_type;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) #define DRXD_PLL_NONE 0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) #define DRXD_PLL_DTT7520X 1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) #define DRXD_PLL_MT3X0823 2
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) u32 clock;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) u8 insert_rs_byte;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) u8 demod_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) u8 demoda_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u8 demod_revision;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) /* If the tuner is not behind an i2c gate, be sure to flip this bit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) or else the i2c bus could get wedged */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) u8 disable_i2c_gate_ctrl;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) u32 IF;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) s16(*osc_deviation) (void *priv, s16 dev, int flag);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) #if IS_REACHABLE(CONFIG_DVB_DRXD)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) extern
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) struct dvb_frontend *drxd_attach(const struct drxd_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) void *priv, struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) struct device *dev);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) static inline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) struct dvb_frontend *drxd_attach(const struct drxd_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) void *priv, struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) struct device *dev)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #endif