blob: de4ca9aa09233b1b542effc952c9f14db700534a [file] [log] [blame]
Jemma Denson5afc9a22015-04-14 09:04:50 -03001/*
2 * Conexant CX24120/CX24118 - DVB-S/S2 demod/tuner driver
3 *
4 * Copyright (C) 2008 Patrick Boettcher <pb@linuxtv.org>
5 * Copyright (C) 2009 Sergey Tyurin <forum.free-x.de>
6 * Updated 2012 by Jannis Achstetter <jannis_achstetter@web.de>
7 * Copyright (C) 2015 Jemma Denson <jdenson@gmail.com>
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 */
19
20#ifndef CX24120_H
21#define CX24120_H
22
Jemma Denson5afc9a22015-04-14 09:04:50 -030023#include <linux/dvb/frontend.h>
24#include <linux/firmware.h>
25
26struct cx24120_initial_mpeg_config {
27 u8 x1;
28 u8 x2;
29 u8 x3;
30};
31
32struct cx24120_config {
33 u8 i2c_addr;
34 u32 xtal_khz;
35 struct cx24120_initial_mpeg_config initial_mpeg_config;
36
37 int (*request_firmware)(struct dvb_frontend *fe,
38 const struct firmware **fw, char *name);
Patrick Boettcherf7a77eb2015-04-28 02:47:42 -030039
40 /* max bytes I2C provider can write at once */
41 u16 i2c_wr_max;
Jemma Denson5afc9a22015-04-14 09:04:50 -030042};
43
44#if IS_REACHABLE(CONFIG_DVB_CX24120)
Patrick Boettcher1ff2e8e2015-04-28 13:39:20 -030045struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
46 struct i2c_adapter *i2c);
Jemma Denson5afc9a22015-04-14 09:04:50 -030047#else
Patrick Boettcher1ff2e8e2015-04-28 13:39:20 -030048static inline
49struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
50 struct i2c_adapter *i2c)
Jemma Denson5afc9a22015-04-14 09:04:50 -030051{
Patrick Boettcherc5fb0f52015-04-17 06:04:53 -030052 pr_warn("%s: driver disabled by Kconfig\n", __func__);
Jemma Denson5afc9a22015-04-14 09:04:50 -030053 return NULL;
54}
55#endif
56
57#endif /* CX24120_H */