Commit | Line | Data |
---|---|---|
825b9670 | 1 | /* |
c89f66f6 | 2 | * Afatech AF9013 demodulator driver |
825b9670 AP |
3 | * |
4 | * Copyright (C) 2007 Antti Palosaari <crope@iki.fi> | |
f571e004 | 5 | * Copyright (C) 2011 Antti Palosaari <crope@iki.fi> |
825b9670 AP |
6 | * |
7 | * Thanks to Afatech who kindly provided information. | |
8 | * | |
9 | * This program is free software; you can redistribute it and/or modify | |
10 | * it under the terms of the GNU General Public License as published by | |
11 | * the Free Software Foundation; either version 2 of the License, or | |
12 | * (at your option) any later version. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
825b9670 AP |
19 | */ |
20 | ||
f571e004 AP |
21 | #ifndef AF9013_H |
22 | #define AF9013_H | |
825b9670 AP |
23 | |
24 | #include <linux/dvb/frontend.h> | |
25 | ||
82d1ce3e AP |
26 | /* |
27 | * I2C address: 0x1c, 0x1d | |
28 | */ | |
f571e004 | 29 | |
82d1ce3e AP |
30 | /** |
31 | * struct af9013_platform_data - Platform data for the af9013 driver | |
32 | * @clk: Clock frequency. | |
33 | * @tuner: Used tuner model. | |
34 | * @if_frequency: IF frequency. | |
35 | * @ts_mode: TS mode. | |
eaa455f0 | 36 | * @ts_output_pin: TS output pin. |
82d1ce3e AP |
37 | * @spec_inv: Input spectrum inverted. |
38 | * @api_version: Firmware API version. | |
39 | * @gpio: GPIOs. | |
40 | * @get_dvb_frontend: Get DVB frontend callback. | |
83d6b7c3 AP |
41 | * @get_i2c_adapter: Get I2C adapter. |
42 | * @pid_filter_ctrl: Control PID filter. | |
43 | * @pid_filter: Set PID to PID filter. | |
82d1ce3e AP |
44 | */ |
45 | struct af9013_platform_data { | |
f571e004 | 46 | /* |
f571e004 AP |
47 | * 20480000, 25000000, 28000000, 28800000 |
48 | */ | |
82d1ce3e | 49 | u32 clk; |
f571e004 AP |
50 | #define AF9013_TUNER_MXL5003D 3 /* MaxLinear */ |
51 | #define AF9013_TUNER_MXL5005D 13 /* MaxLinear */ | |
52 | #define AF9013_TUNER_MXL5005R 30 /* MaxLinear */ | |
53 | #define AF9013_TUNER_ENV77H11D5 129 /* Panasonic */ | |
54 | #define AF9013_TUNER_MT2060 130 /* Microtune */ | |
55 | #define AF9013_TUNER_MC44S803 133 /* Freescale */ | |
56 | #define AF9013_TUNER_QT1010 134 /* Quantek */ | |
57 | #define AF9013_TUNER_UNKNOWN 140 /* for can tuners ? */ | |
58 | #define AF9013_TUNER_MT2060_2 147 /* Microtune */ | |
59 | #define AF9013_TUNER_TDA18271 156 /* NXP */ | |
60 | #define AF9013_TUNER_QT1010A 162 /* Quantek */ | |
61 | #define AF9013_TUNER_MXL5007T 177 /* MaxLinear */ | |
62 | #define AF9013_TUNER_TDA18218 179 /* NXP */ | |
63 | u8 tuner; | |
f571e004 | 64 | u32 if_frequency; |
82d1ce3e AP |
65 | #define AF9013_TS_MODE_USB 0 |
66 | #define AF9013_TS_MODE_PARALLEL 1 | |
67 | #define AF9013_TS_MODE_SERIAL 2 | |
68 | u8 ts_mode; | |
eaa455f0 | 69 | u8 ts_output_pin; |
f571e004 | 70 | bool spec_inv; |
f571e004 | 71 | u8 api_version[4]; |
825b9670 AP |
72 | #define AF9013_GPIO_ON (1 << 0) |
73 | #define AF9013_GPIO_EN (1 << 1) | |
74 | #define AF9013_GPIO_O (1 << 2) | |
75 | #define AF9013_GPIO_I (1 << 3) | |
825b9670 AP |
76 | #define AF9013_GPIO_LO (AF9013_GPIO_ON|AF9013_GPIO_EN) |
77 | #define AF9013_GPIO_HI (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O) | |
825b9670 AP |
78 | #define AF9013_GPIO_TUNER_ON (AF9013_GPIO_ON|AF9013_GPIO_EN) |
79 | #define AF9013_GPIO_TUNER_OFF (AF9013_GPIO_ON|AF9013_GPIO_EN|AF9013_GPIO_O) | |
825b9670 | 80 | u8 gpio[4]; |
82d1ce3e AP |
81 | |
82 | struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *); | |
22e59e72 | 83 | struct i2c_adapter* (*get_i2c_adapter)(struct i2c_client *); |
83d6b7c3 AP |
84 | int (*pid_filter_ctrl)(struct dvb_frontend *, int); |
85 | int (*pid_filter)(struct dvb_frontend *, u8, u16, int); | |
825b9670 AP |
86 | }; |
87 | ||
12c6b22f AP |
88 | /* |
89 | * AF9013/5 GPIOs (mostly guessed) | |
90 | * demod#1-gpio#0 - set demod#2 i2c-addr for dual devices | |
91 | * demod#1-gpio#1 - xtal setting (?) | |
92 | * demod#1-gpio#3 - tuner#1 | |
93 | * demod#2-gpio#0 - tuner#2 | |
94 | * demod#2-gpio#1 - xtal setting (?) | |
be9b53c8 | 95 | */ |
825b9670 | 96 | |
f571e004 | 97 | #endif /* AF9013_H */ |