Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 2 | /* |
| 3 | * Conexant CX24120/CX24118 - DVB-S/S2 demod/tuner driver |
| 4 | * |
| 5 | * Copyright (C) 2008 Patrick Boettcher <pb@linuxtv.org> |
| 6 | * Copyright (C) 2009 Sergey Tyurin <forum.free-x.de> |
| 7 | * Updated 2012 by Jannis Achstetter <jannis_achstetter@web.de> |
| 8 | * Copyright (C) 2015 Jemma Denson <jdenson@gmail.com> |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 9 | */ |
| 10 | |
| 11 | #ifndef CX24120_H |
| 12 | #define CX24120_H |
| 13 | |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 14 | #include <linux/dvb/frontend.h> |
| 15 | #include <linux/firmware.h> |
| 16 | |
| 17 | struct cx24120_initial_mpeg_config { |
| 18 | u8 x1; |
| 19 | u8 x2; |
| 20 | u8 x3; |
| 21 | }; |
| 22 | |
| 23 | struct cx24120_config { |
| 24 | u8 i2c_addr; |
| 25 | u32 xtal_khz; |
| 26 | struct cx24120_initial_mpeg_config initial_mpeg_config; |
| 27 | |
| 28 | int (*request_firmware)(struct dvb_frontend *fe, |
| 29 | const struct firmware **fw, char *name); |
Patrick Boettcher | f7a77eb | 2015-04-28 02:47:42 -0300 | [diff] [blame] | 30 | |
| 31 | /* max bytes I2C provider can write at once */ |
| 32 | u16 i2c_wr_max; |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | #if IS_REACHABLE(CONFIG_DVB_CX24120) |
Patrick Boettcher | 1ff2e8e | 2015-04-28 13:39:20 -0300 | [diff] [blame] | 36 | struct dvb_frontend *cx24120_attach(const struct cx24120_config *config, |
| 37 | struct i2c_adapter *i2c); |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 38 | #else |
Patrick Boettcher | 1ff2e8e | 2015-04-28 13:39:20 -0300 | [diff] [blame] | 39 | static inline |
| 40 | struct dvb_frontend *cx24120_attach(const struct cx24120_config *config, |
| 41 | struct i2c_adapter *i2c) |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 42 | { |
Patrick Boettcher | c5fb0f5 | 2015-04-17 06:04:53 -0300 | [diff] [blame] | 43 | pr_warn("%s: driver disabled by Kconfig\n", __func__); |
Jemma Denson | 5afc9a2 | 2015-04-14 09:04:50 -0300 | [diff] [blame] | 44 | return NULL; |
| 45 | } |
| 46 | #endif |
| 47 | |
| 48 | #endif /* CX24120_H */ |