Commit | Line | Data |
---|---|---|
4de2730a PB |
1 | /* |
2 | * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner" | |
3 | * | |
4 | * Copyright (c) 2006 Olivier DANET <odanet@caramail.com> | |
5 | * | |
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 | * | |
15 | * GNU General Public License for more details. | |
4de2730a PB |
16 | */ |
17 | ||
18 | #ifndef MT2060_H | |
19 | #define MT2060_H | |
20 | ||
46f73f93 OD |
21 | struct dvb_frontend; |
22 | struct i2c_adapter; | |
4de2730a | 23 | |
59e8b7aa AP |
24 | /* |
25 | * I2C address | |
26 | * 0x60, ... | |
27 | */ | |
28 | ||
29 | /** | |
30 | * struct mt2060_platform_data - Platform data for the mt2060 driver | |
31 | * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1. | |
32 | * @if1: First IF used [MHz]. 0 defaults to 1220. | |
433c4864 AP |
33 | * @i2c_write_max: Maximum number of bytes I2C adapter can write at once. |
34 | * 0 defaults to maximum. | |
59e8b7aa AP |
35 | * @dvb_frontend: DVB frontend. |
36 | */ | |
37 | ||
38 | struct mt2060_platform_data { | |
39 | u8 clock_out; | |
40 | u16 if1; | |
433c4864 | 41 | unsigned int i2c_write_max:5; |
59e8b7aa AP |
42 | struct dvb_frontend *dvb_frontend; |
43 | }; | |
44 | ||
45 | ||
46 | /* configuration struct for mt2060_attach() */ | |
4de2730a PB |
47 | struct mt2060_config { |
48 | u8 i2c_address; | |
303cbeaa | 49 | u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */ |
4de2730a PB |
50 | }; |
51 | ||
9b174527 | 52 | #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060) |
6958effe | 53 | extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1); |
6c8c21b9 TP |
54 | #else |
55 | static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1) | |
56 | { | |
271ddbf7 | 57 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
6c8c21b9 TP |
58 | return NULL; |
59 | } | |
149ef72d | 60 | #endif // CONFIG_MEDIA_TUNER_MT2060 |
4de2730a PB |
61 | |
62 | #endif |