blob: 070d9743e330ca3da4d99a5e843a592a5e7e6a53 [file] [log] [blame]
Steven Toth89885552007-07-28 19:34:52 -03001/*
2 Samsung S5H1409 VSB/QAM demodulator driver
3
Steven Toth6d897612008-09-03 17:12:12 -03004 Copyright (C) 2006 Steven Toth <stoth@linuxtv.org>
Steven Toth89885552007-07-28 19:34:52 -03005
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19
20*/
21
Michael Krufky3873dd02007-07-28 20:02:55 -030022#ifndef __S5H1409_H__
23#define __S5H1409_H__
Steven Toth89885552007-07-28 19:34:52 -030024
25#include <linux/dvb/frontend.h>
26
Steven Tothb7709c02008-10-16 20:27:11 -030027struct s5h1409_config {
Steven Toth89885552007-07-28 19:34:52 -030028 /* the demodulator's i2c address */
29 u8 demod_address;
30
31 /* serial/parallel output */
32#define S5H1409_PARALLEL_OUTPUT 0
33#define S5H1409_SERIAL_OUTPUT 1
34 u8 output_mode;
35
36 /* GPIO Setting */
37#define S5H1409_GPIO_OFF 0
38#define S5H1409_GPIO_ON 1
39 u8 gpio;
40
Michael Krufky2b032382007-12-13 10:04:10 -030041 /* IF Freq for QAM in KHz, VSB is hardcoded to 5380 */
42 u16 qam_if;
Steven Toth89885552007-07-28 19:34:52 -030043
44 /* Spectral Inversion */
45#define S5H1409_INVERSION_OFF 0
46#define S5H1409_INVERSION_ON 1
47 u8 inversion;
48
49 /* Return lock status based on tuner lock, or demod lock */
50#define S5H1409_TUNERLOCKING 0
51#define S5H1409_DEMODLOCKING 1
52 u8 status_mode;
Steven Tothdfc1c082008-01-15 21:35:22 -030053
54 /* MPEG signal timing */
55#define S5H1409_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
56#define S5H1409_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
57#define S5H1409_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
58#define S5H1409_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
59 u16 mpeg_timing;
Steven Toth89885552007-07-28 19:34:52 -030060};
61
Steven Tothb7709c02008-10-16 20:27:11 -030062#if defined(CONFIG_DVB_S5H1409) || (defined(CONFIG_DVB_S5H1409_MODULE) \
63 && defined(MODULE))
64extern struct dvb_frontend *s5h1409_attach(const struct s5h1409_config *config,
65 struct i2c_adapter *i2c);
Steven Toth89885552007-07-28 19:34:52 -030066#else
Steven Tothb7709c02008-10-16 20:27:11 -030067static inline struct dvb_frontend *s5h1409_attach(
68 const struct s5h1409_config *config,
69 struct i2c_adapter *i2c)
Steven Toth89885552007-07-28 19:34:52 -030070{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030071 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Steven Toth89885552007-07-28 19:34:52 -030072 return NULL;
73}
Michael Krufky3873dd02007-07-28 20:02:55 -030074#endif /* CONFIG_DVB_S5H1409 */
Steven Toth89885552007-07-28 19:34:52 -030075
Michael Krufky3873dd02007-07-28 20:02:55 -030076#endif /* __S5H1409_H__ */
77
78/*
79 * Local variables:
80 * c-basic-offset: 8
81 */