| xj | b04a402 | 2021-11-25 15:01:52 +0800 | [diff] [blame] | 1 | /* |
| 2 | * Fujitsu mb86a20s driver |
| 3 | * |
| 4 | * Copyright (C) 2010 Mauro Carvalho Chehab |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation version 2. |
| 9 | * |
| 10 | * This program is distributed in the hope that it will be useful, |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | */ |
| 15 | |
| 16 | #ifndef MB86A20S_H |
| 17 | #define MB86A20S_H |
| 18 | |
| 19 | #include <linux/dvb/frontend.h> |
| 20 | |
| 21 | /** |
| 22 | * struct mb86a20s_config - Define the per-device attributes of the frontend |
| 23 | * |
| 24 | * @fclk: Clock frequency. If zero, assumes the default |
| 25 | * (32.57142 Mhz) |
| 26 | * @demod_address: the demodulator's i2c address |
| 27 | * @is_serial: if true, TS is serial. Otherwise, TS is parallel |
| 28 | */ |
| 29 | struct mb86a20s_config { |
| 30 | u32 fclk; |
| 31 | u8 demod_address; |
| 32 | bool is_serial; |
| 33 | }; |
| 34 | |
| 35 | #if IS_REACHABLE(CONFIG_DVB_MB86A20S) |
| 36 | /** |
| 37 | * Attach a mb86a20s demod |
| 38 | * |
| 39 | * @config: pointer to &struct mb86a20s_config with demod configuration. |
| 40 | * @i2c: i2c adapter to use. |
| 41 | * |
| 42 | * return: FE pointer on success, NULL on failure. |
| 43 | */ |
| 44 | extern struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config, |
| 45 | struct i2c_adapter *i2c); |
| 46 | |
| 47 | #else |
| 48 | static inline struct dvb_frontend *mb86a20s_attach( |
| 49 | const struct mb86a20s_config *config, struct i2c_adapter *i2c) |
| 50 | { |
| 51 | printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__); |
| 52 | return NULL; |
| 53 | } |
| 54 | #endif |
| 55 | |
| 56 | #endif /* MB86A20S */ |