blob: bdfdcc754cfbfe8d64e0962da014240f78cfb27b [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Davide Ferri8d009a02009-06-23 22:34:06 -03002/*
3 * Driver for Xceive XC4000 "QAM/8VSB single chip tuner"
4 *
5 * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
Davide Ferri8d009a02009-06-23 22:34:06 -03006 */
7
8#ifndef __XC4000_H__
9#define __XC4000_H__
10
11#include <linux/firmware.h>
12
13struct dvb_frontend;
14struct i2c_adapter;
15
16struct xc4000_config {
istvan_v@mailbox.hu8edeb6e2011-06-06 13:03:44 -030017 u8 i2c_address;
18 /* if non-zero, power management is enabled by default */
19 u8 default_pm;
20 /* value to be written to XREG_AMPLITUDE in DVB-T mode (0: no write) */
21 u8 dvb_amplitude;
22 /* if non-zero, register 0x0E is set to filter analog TV video output */
23 u8 set_smoothedcvbs;
24 /* IF for DVB-T */
Istvan Vargafbe4a292011-06-03 10:11:48 -030025 u32 if_khz;
Davide Ferri8d009a02009-06-23 22:34:06 -030026};
27
28/* xc4000 callback command */
29#define XC4000_TUNER_RESET 0
30
31/* For each bridge framework, when it attaches either analog or digital,
32 * it has to store a reference back to its _core equivalent structure,
33 * so that it can service the hardware by steering gpio's etc.
34 * Each bridge implementation is different so cast devptr accordingly.
35 * The xc4000 driver cares not for this value, other than ensuring
36 * it's passed back to a bridge during tuner_callback().
37 */
38
Arnd Bergmann9b174522015-02-18 14:12:42 -030039#if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC4000)
Davide Ferri8d009a02009-06-23 22:34:06 -030040extern struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
41 struct i2c_adapter *i2c,
42 struct xc4000_config *cfg);
43#else
44static inline struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
45 struct i2c_adapter *i2c,
46 struct xc4000_config *cfg)
47{
48 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
49 return NULL;
50}
51#endif
52
53#endif