blob: fdcceee91f3ac44cc1000201f3ebca32f7e46c0e [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 cx24110 - Single Chip Satellite Channel Receiver driver module
3
Johannes Stezenbacha8d995c2005-09-09 13:02:19 -07004 Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de> based on
Linus Torvalds1da177e2005-04-16 15:20:36 -07005 work
6 Copyright (C) 1999 Convergence Integrated Media GmbH <ralph@convergence.de>
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
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22
23*/
24
25#ifndef CX24110_H
26#define CX24110_H
27
28#include <linux/dvb/frontend.h>
29
30struct cx24110_config
31{
32 /* the demodulator's i2c address */
33 u8 demod_address;
Linus Torvalds1da177e2005-04-16 15:20:36 -070034};
35
Hans Verkuild45b9b82008-09-04 03:33:43 -030036static inline int cx24110_pll_write(struct dvb_frontend *fe, u32 val)
37{
38 u8 buf[] = {
39 (u8)((val >> 24) & 0xff),
40 (u8)((val >> 16) & 0xff),
41 (u8)((val >> 8) & 0xff)
42 };
43
Andrew de Quinceyc10d14d2006-08-08 09:10:08 -030044 if (fe->ops.write)
Hans Verkuild45b9b82008-09-04 03:33:43 -030045 return fe->ops.write(fe, buf, 3);
46 return 0;
Andrew de Quinceyc10d14d2006-08-08 09:10:08 -030047}
Linus Torvalds1da177e2005-04-16 15:20:36 -070048
Trent Piephoc5dec9f2006-10-14 15:44:44 -030049#if defined(CONFIG_DVB_CX24110) || (defined(CONFIG_DVB_CX24110_MODULE) && defined(MODULE))
Andrew de Quincey102a3422006-08-08 09:10:08 -030050extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
51 struct i2c_adapter* i2c);
52#else
53static inline struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
54 struct i2c_adapter* i2c)
55{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030056 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Andrew de Quincey102a3422006-08-08 09:10:08 -030057 return NULL;
58}
59#endif // CONFIG_DVB_CX24110
60
Linus Torvalds1da177e2005-04-16 15:20:36 -070061#endif // CX24110_H