blob: b58603c00c80a24b6853588d951b38c355ee5222 [file] [log] [blame]
Igor M. Liplianine4aab642008-09-23 15:43:57 -03001/*
2 Driver for ST STV0288 demodulator
3
4 Copyright (C) 2006 Georg Acher, BayCom GmbH, acher (at) baycom (dot) de
5 for Reel Multimedia
6 Copyright (C) 2008 TurboSight.com, <bob@turbosight.com>
7 Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
8 Removed stb6000 specific tuner code and revised some
9 procedures.
10
11 This program is free software; you can redistribute it and/or modify
12 it under the terms of the GNU General Public License as published by
13 the Free Software Foundation; either version 2 of the License, or
14 (at your option) any later version.
15
16 This program is distributed in the hope that it will be useful,
17 but WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 GNU General Public License for more details.
20
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24
25*/
26
27#ifndef STV0288_H
28#define STV0288_H
29
Mauro Carvalho Chehab782d8b72013-03-21 16:11:54 -030030#include <linux/kconfig.h>
Igor M. Liplianine4aab642008-09-23 15:43:57 -030031#include <linux/dvb/frontend.h>
32#include "dvb_frontend.h"
33
34struct stv0288_config {
35 /* the demodulator's i2c address */
36 u8 demod_address;
37
Igor M. Liplianinde9be0e2008-10-05 08:52:18 -030038 u8* inittab;
39
Igor M. Liplianine4aab642008-09-23 15:43:57 -030040 /* minimum delay before retuning */
41 int min_delay_ms;
42
43 int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
44};
45
Arnd Bergmann9b174522015-02-18 14:12:42 -030046#if IS_REACHABLE(CONFIG_DVB_STV0288)
Igor M. Liplianine4aab642008-09-23 15:43:57 -030047extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
48 struct i2c_adapter *i2c);
49#else
50static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
51 struct i2c_adapter *i2c)
52{
53 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
54 return NULL;
55}
56#endif /* CONFIG_DVB_STV0288 */
57
58static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
59{
60 int r = 0;
61 u8 buf[] = { reg, val };
62 if (fe->ops.write)
63 r = fe->ops.write(fe, buf, 2);
64 return r;
65}
66
67#endif /* STV0288_H */