blob: bb862387080f7f0607493050c06372b5e0bc2cf1 [file] [log] [blame]
David T.L. Wongec27b6a2009-10-26 07:08:17 -03001/*
2 * Support for AltoBeam GB20600 (a.k.a DMB-TH) demodulator
3 * ATBM8830, ATBM8831
4 *
5 * Copyright (C) 2009 David T.L. Wong <davidtlwong@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22#ifndef __ATBM8830_H__
23#define __ATBM8830_H__
24
25#include <linux/dvb/frontend.h>
26#include <linux/i2c.h>
27
28#define ATBM8830_PROD_8830 0
29#define ATBM8830_PROD_8831 1
30
31struct atbm8830_config {
32
33 /* product type */
34 u8 prod;
35
36 /* the demodulator's i2c address */
37 u8 demod_address;
38
39 /* parallel or serial transport stream */
40 u8 serial_ts;
41
Lucas De Marchi25985ed2011-03-30 22:57:33 -030042 /* transport stream clock output only when receiving valid stream */
David T.L. Wongec27b6a2009-10-26 07:08:17 -030043 u8 ts_clk_gated;
44
45 /* Decoder sample TS data at rising edge of clock */
46 u8 ts_sampling_edge;
47
48 /* Oscillator clock frequency */
49 u32 osc_clk_freq; /* in kHz */
50
51 /* IF frequency */
52 u32 if_freq; /* in kHz */
53
54 /* Swap I/Q for zero IF */
55 u8 zif_swap_iq;
56
57 /* Tuner AGC settings */
58 u8 agc_min;
59 u8 agc_max;
60 u8 agc_hold_loop;
61};
62
Arnd Bergmann9b174522015-02-18 14:12:42 -030063#if IS_REACHABLE(CONFIG_DVB_ATBM8830)
David T.L. Wongec27b6a2009-10-26 07:08:17 -030064extern struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
65 struct i2c_adapter *i2c);
66#else
67static inline
68struct dvb_frontend *atbm8830_attach(const struct atbm8830_config *config,
69 struct i2c_adapter *i2c) {
70 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
71 return NULL;
72}
73#endif /* CONFIG_DVB_ATBM8830 */
74
75#endif /* __ATBM8830_H__ */