Merge tag 'io_uring-5.11-2021-01-16' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / tuners / xc5000.h
blob1e4f7144d21e8031a43c3305d4e0c8dcd9dd0188
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Driver for Xceive XC5000 "QAM/8VSB single chip tuner"
5 * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
6 */
8 #ifndef __XC5000_H__
9 #define __XC5000_H__
11 #include <linux/firmware.h>
13 struct dvb_frontend;
14 struct i2c_adapter;
16 #define XC5000A 1
17 #define XC5000C 2
19 struct xc5000_config {
20 u8 i2c_address;
21 u32 if_khz;
22 u8 radio_input;
23 u16 xtal_khz;
24 u16 output_amp;
26 int chip_id;
29 /* xc5000 callback command */
30 #define XC5000_TUNER_RESET 0
32 /* Possible Radio inputs */
33 #define XC5000_RADIO_NOT_CONFIGURED 0
34 #define XC5000_RADIO_FM1 1
35 #define XC5000_RADIO_FM2 2
36 #define XC5000_RADIO_FM1_MONO 3
38 /* For each bridge framework, when it attaches either analog or digital,
39 * it has to store a reference back to its _core equivalent structure,
40 * so that it can service the hardware by steering gpio's etc.
41 * Each bridge implementation is different so cast devptr accordingly.
42 * The xc5000 driver cares not for this value, other than ensuring
43 * it's passed back to a bridge during tuner_callback().
46 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC5000)
47 extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
48 struct i2c_adapter *i2c,
49 const struct xc5000_config *cfg);
50 #else
51 static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
52 struct i2c_adapter *i2c,
53 const struct xc5000_config *cfg)
55 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
56 return NULL;
58 #endif
60 #endif