1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23#ifndef __STV6110x_H
24#define __STV6110x_H
25
26struct stv6110x_config {
27 u8 addr;
28 u32 refclk;
29 u8 clk_div;
30};
31
32enum tuner_mode {
33 TUNER_SLEEP = 1,
34 TUNER_WAKE,
35};
36
37enum tuner_status {
38 TUNER_PHASELOCKED = 1,
39};
40
41struct stv6110x_devctl {
42 int (*tuner_init) (struct dvb_frontend *fe);
43 int (*tuner_sleep) (struct dvb_frontend *fe);
44 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
45 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
46 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
47 int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
48 int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
49 int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
50 int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
51 int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
52 int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
53};
54
55
56#if IS_REACHABLE(CONFIG_DVB_STV6110x)
57
58extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
59 const struct stv6110x_config *config,
60 struct i2c_adapter *i2c);
61
62#else
63static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
64 const struct stv6110x_config *config,
65 struct i2c_adapter *i2c)
66{
67 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
68 return NULL;
69}
70
71#endif
72
73#endif
74