treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / drivers / media / dvb-frontends / stv6110x.h
blob1feade3158c2ca5263b3df9d880c3158ccef8030
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 STV6110(A) Silicon tuner driver
5 Copyright (C) Manu Abraham <abraham.manu@gmail.com>
7 Copyright (C) ST Microelectronics
9 */
11 #ifndef __STV6110x_H
12 #define __STV6110x_H
14 struct stv6110x_config {
15 u8 addr;
16 u32 refclk;
17 u8 clk_div; /* divisor value for the output clock */
18 struct dvb_frontend *frontend;
20 struct stv6110x_devctl* (*get_devctl)(struct i2c_client *i2c);
23 enum tuner_mode {
24 TUNER_SLEEP = 1,
25 TUNER_WAKE,
28 enum tuner_status {
29 TUNER_PHASELOCKED = 1,
32 struct stv6110x_devctl {
33 int (*tuner_init) (struct dvb_frontend *fe);
34 int (*tuner_sleep) (struct dvb_frontend *fe);
35 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
36 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
37 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
38 int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
39 int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
40 int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
41 int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
42 int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
43 int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
47 #if IS_REACHABLE(CONFIG_DVB_STV6110x)
49 extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
50 const struct stv6110x_config *config,
51 struct i2c_adapter *i2c);
53 #else
54 static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
55 const struct stv6110x_config *config,
56 struct i2c_adapter *i2c)
58 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
59 return NULL;
62 #endif /* CONFIG_DVB_STV6110x */
64 #endif /* __STV6110x_H */