blob: 696b6e5b9e7be1969fc51d1fb482ad52f52b02e7 [file] [log] [blame]
Manu Abrahame415c682009-04-06 15:45:20 -03001/*
2 STV6110(A) Silicon tuner driver
3
4 Copyright (C) Manu Abraham <abraham.manu@gmail.com>
5
6 Copyright (C) ST Microelectronics
7
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21*/
22
23#ifndef __STV6110x_H
24#define __STV6110x_H
25
26struct stv6110x_config {
27 u8 addr;
28 u32 refclk;
Andreas Regelca108b32010-01-05 19:24:10 -030029 u8 clk_div; /* divisor value for the output clock */
Manu Abrahame415c682009-04-06 15:45:20 -030030};
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);
Manu Abrahamc5b74b02010-01-23 05:49:08 -030043 int (*tuner_sleep) (struct dvb_frontend *fe);
Manu Abrahame415c682009-04-06 15:45:20 -030044 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
Arnd Bergmann9b174522015-02-18 14:12:42 -030056#if IS_REACHABLE(CONFIG_DVB_STV6110x)
Manu Abrahame415c682009-04-06 15:45:20 -030057
Julia Lawall242c5032015-12-06 13:34:26 -020058extern const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
Manu Abrahame415c682009-04-06 15:45:20 -030059 const struct stv6110x_config *config,
60 struct i2c_adapter *i2c);
61
62#else
Julia Lawall242c5032015-12-06 13:34:26 -020063static inline const struct stv6110x_devctl *stv6110x_attach(struct dvb_frontend *fe,
Manu Abrahame415c682009-04-06 15:45:20 -030064 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 /* CONFIG_DVB_STV6110x */
72
73#endif /* __STV6110x_H */