Commit | Line | Data |
---|---|---|
74ba9207 | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
e415c689 MA |
2 | /* |
3 | STV6110(A) Silicon tuner driver | |
4 | ||
5 | Copyright (C) Manu Abraham <abraham.manu@gmail.com> | |
6 | ||
7 | Copyright (C) ST Microelectronics | |
8 | ||
e415c689 MA |
9 | */ |
10 | ||
11 | #ifndef __STV6110x_H | |
12 | #define __STV6110x_H | |
13 | ||
14 | struct stv6110x_config { | |
15 | u8 addr; | |
16 | u32 refclk; | |
ca108b39 | 17 | u8 clk_div; /* divisor value for the output clock */ |
e415c689 MA |
18 | }; |
19 | ||
20 | enum tuner_mode { | |
21 | TUNER_SLEEP = 1, | |
22 | TUNER_WAKE, | |
23 | }; | |
24 | ||
25 | enum tuner_status { | |
26 | TUNER_PHASELOCKED = 1, | |
27 | }; | |
28 | ||
29 | struct stv6110x_devctl { | |
30 | int (*tuner_init) (struct dvb_frontend *fe); | |
c5b74b0f | 31 | int (*tuner_sleep) (struct dvb_frontend *fe); |
e415c689 MA |
32 | int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); |
33 | int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); | |
34 | int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency); | |
35 | int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth); | |
36 | int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth); | |
37 | int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain); | |
38 | int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain); | |
39 | int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk); | |
40 | int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status); | |
41 | }; | |
42 | ||
43 | ||
9b174527 | 44 | #if IS_REACHABLE(CONFIG_DVB_STV6110x) |
e415c689 | 45 | |
242c5033 | 46 | extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, |
e415c689 MA |
47 | const struct stv6110x_config *config, |
48 | struct i2c_adapter *i2c); | |
49 | ||
50 | #else | |
242c5033 | 51 | static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe, |
e415c689 MA |
52 | const struct stv6110x_config *config, |
53 | struct i2c_adapter *i2c) | |
54 | { | |
55 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); | |
56 | return NULL; | |
57 | } | |
58 | ||
59 | #endif /* CONFIG_DVB_STV6110x */ | |
60 | ||
61 | #endif /* __STV6110x_H */ |