0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef __STV6110x_H
0012 #define __STV6110x_H
0013
0014 struct stv6110x_config {
0015 u8 addr;
0016 u32 refclk;
0017 u8 clk_div;
0018 struct dvb_frontend *frontend;
0019
0020 struct stv6110x_devctl* (*get_devctl)(struct i2c_client *i2c);
0021 };
0022
0023 enum tuner_mode {
0024 TUNER_SLEEP = 1,
0025 TUNER_WAKE,
0026 };
0027
0028 enum tuner_status {
0029 TUNER_PHASELOCKED = 1,
0030 };
0031
0032 struct stv6110x_devctl {
0033 int (*tuner_init) (struct dvb_frontend *fe);
0034 int (*tuner_sleep) (struct dvb_frontend *fe);
0035 int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
0036 int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
0037 int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
0038 int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
0039 int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
0040 int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
0041 int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
0042 int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
0043 int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
0044 };
0045
0046
0047 #if IS_REACHABLE(CONFIG_DVB_STV6110x)
0048
0049 extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
0050 const struct stv6110x_config *config,
0051 struct i2c_adapter *i2c);
0052
0053 #else
0054 static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
0055 const struct stv6110x_config *config,
0056 struct i2c_adapter *i2c)
0057 {
0058 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0059 return NULL;
0060 }
0061
0062 #endif
0063
0064 #endif