1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 STV0900/0903 Multistandard Broadcast Frontend driver
4 Copyright (C) Manu Abraham <abraham.manu@gmail.com>
6 Copyright (C) ST Microelectronics
13 enum stv090x_demodulator
{
14 STV090x_DEMODULATOR_0
= 1,
29 STV090x_TSMODE_SERIAL_PUNCTURED
= 1,
30 STV090x_TSMODE_SERIAL_CONTINUOUS
,
31 STV090x_TSMODE_PARALLEL_PUNCTURED
,
35 enum stv090x_clkmode
{
36 STV090x_CLK_INT
= 0, /* Clk i/p = CLKI */
37 STV090x_CLK_EXT
= 2 /* Clk i/p = XTALI */
41 STV090x_RPTLEVEL_256
= 0,
42 STV090x_RPTLEVEL_128
= 1,
43 STV090x_RPTLEVEL_64
= 2,
44 STV090x_RPTLEVEL_32
= 3,
45 STV090x_RPTLEVEL_16
= 4,
46 STV090x_RPTLEVEL_8
= 5,
47 STV090x_RPTLEVEL_4
= 6,
48 STV090x_RPTLEVEL_2
= 7,
51 enum stv090x_adc_range
{
56 struct stv090x_config
{
57 enum stv090x_device device
;
58 enum stv090x_mode demod_mode
;
59 enum stv090x_clkmode clk_mode
;
60 enum stv090x_demodulator demod
;
62 u32 xtal
; /* default: 8000000 */
63 u8 address
; /* default: 0x68 */
73 enum stv090x_i2crpt repeater_level
;
75 u8 tuner_bbgain
; /* default: 10db */
76 enum stv090x_adc_range adc1_range
; /* default: 2Vpp */
77 enum stv090x_adc_range adc2_range
; /* default: 2Vpp */
79 bool diseqc_envelope_mode
;
81 int (*tuner_init
)(struct dvb_frontend
*fe
);
82 int (*tuner_sleep
)(struct dvb_frontend
*fe
);
83 int (*tuner_set_mode
)(struct dvb_frontend
*fe
, enum tuner_mode mode
);
84 int (*tuner_set_frequency
)(struct dvb_frontend
*fe
, u32 frequency
);
85 int (*tuner_get_frequency
)(struct dvb_frontend
*fe
, u32
*frequency
);
86 int (*tuner_set_bandwidth
)(struct dvb_frontend
*fe
, u32 bandwidth
);
87 int (*tuner_get_bandwidth
)(struct dvb_frontend
*fe
, u32
*bandwidth
);
88 int (*tuner_set_bbgain
)(struct dvb_frontend
*fe
, u32 gain
);
89 int (*tuner_get_bbgain
)(struct dvb_frontend
*fe
, u32
*gain
);
90 int (*tuner_set_refclk
)(struct dvb_frontend
*fe
, u32 refclk
);
91 int (*tuner_get_status
)(struct dvb_frontend
*fe
, u32
*status
);
92 void (*tuner_i2c_lock
)(struct dvb_frontend
*fe
, int lock
);
94 /* dir = 0 -> output, dir = 1 -> input/open-drain */
95 int (*set_gpio
)(struct dvb_frontend
*fe
, u8 gpio
, u8 dir
, u8 value
,
98 struct dvb_frontend
* (*get_dvb_frontend
)(struct i2c_client
*i2c
);
101 #if IS_REACHABLE(CONFIG_DVB_STV090x)
103 struct dvb_frontend
*stv090x_attach(struct stv090x_config
*config
,
104 struct i2c_adapter
*i2c
,
105 enum stv090x_demodulator demod
);
109 static inline struct dvb_frontend
*stv090x_attach(const struct stv090x_config
*config
,
110 struct i2c_adapter
*i2c
,
111 enum stv090x_demodulator demod
)
113 printk(KERN_WARNING
"%s: driver disabled by Kconfig\n", __func__
);
117 #endif /* CONFIG_DVB_STV090x */
119 #endif /* __STV090x_H */