Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 2 | /* |
| 3 | * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner" |
| 4 | * |
| 5 | * Copyright (c) 2006 Olivier DANET <odanet@caramail.com> |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef MT2060_H |
| 9 | #define MT2060_H |
| 10 | |
Olivier DANET | 46f73f9 | 2006-08-08 15:48:10 -0300 | [diff] [blame] | 11 | struct dvb_frontend; |
| 12 | struct i2c_adapter; |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 13 | |
Antti Palosaari | 59e8b7a | 2015-07-26 18:45:05 -0300 | [diff] [blame] | 14 | /* |
| 15 | * I2C address |
| 16 | * 0x60, ... |
| 17 | */ |
| 18 | |
| 19 | /** |
| 20 | * struct mt2060_platform_data - Platform data for the mt2060 driver |
| 21 | * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1. |
| 22 | * @if1: First IF used [MHz]. 0 defaults to 1220. |
Antti Palosaari | 433c486 | 2015-07-26 17:30:07 -0300 | [diff] [blame] | 23 | * @i2c_write_max: Maximum number of bytes I2C adapter can write at once. |
| 24 | * 0 defaults to maximum. |
Antti Palosaari | 59e8b7a | 2015-07-26 18:45:05 -0300 | [diff] [blame] | 25 | * @dvb_frontend: DVB frontend. |
| 26 | */ |
| 27 | |
| 28 | struct mt2060_platform_data { |
| 29 | u8 clock_out; |
| 30 | u16 if1; |
Antti Palosaari | 433c486 | 2015-07-26 17:30:07 -0300 | [diff] [blame] | 31 | unsigned int i2c_write_max:5; |
Antti Palosaari | 59e8b7a | 2015-07-26 18:45:05 -0300 | [diff] [blame] | 32 | struct dvb_frontend *dvb_frontend; |
| 33 | }; |
| 34 | |
| 35 | |
| 36 | /* configuration struct for mt2060_attach() */ |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 37 | struct mt2060_config { |
| 38 | u8 i2c_address; |
Patrick Boettcher | 303cbea | 2006-09-19 12:51:56 -0300 | [diff] [blame] | 39 | u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */ |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 40 | }; |
| 41 | |
Arnd Bergmann | 9b17452 | 2015-02-18 14:12:42 -0300 | [diff] [blame] | 42 | #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060) |
Patrick Boettcher | 6958eff | 2006-09-19 12:51:40 -0300 | [diff] [blame] | 43 | extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1); |
Trent Piepho | 6c8c21b | 2006-10-14 16:21:02 -0300 | [diff] [blame] | 44 | #else |
| 45 | static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1) |
| 46 | { |
Harvey Harrison | 271ddbf | 2008-04-08 23:20:00 -0300 | [diff] [blame] | 47 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
Trent Piepho | 6c8c21b | 2006-10-14 16:21:02 -0300 | [diff] [blame] | 48 | return NULL; |
| 49 | } |
Mauro Carvalho Chehab | 149ef72 | 2008-04-29 21:38:46 -0300 | [diff] [blame] | 50 | #endif // CONFIG_MEDIA_TUNER_MT2060 |
Patrick Boettcher | 4de2730 | 2006-04-17 13:22:15 -0300 | [diff] [blame] | 51 | |
| 52 | #endif |