blob: 1e4f7144d21e8031a43c3305d4e0c8dcd9dd0188 [file] [log] [blame]
Thomas Gleixnerc942fdd2019-05-27 08:55:06 +02001/* SPDX-License-Identifier: GPL-2.0-or-later */
Steven Tothaacb9d32007-12-18 01:55:51 -03002/*
3 * Driver for Xceive XC5000 "QAM/8VSB single chip tuner"
4 *
Steven Toth6d897612008-09-03 17:12:12 -03005 * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
Steven Tothaacb9d32007-12-18 01:55:51 -03006 */
7
8#ifndef __XC5000_H__
9#define __XC5000_H__
10
11#include <linux/firmware.h>
12
13struct dvb_frontend;
14struct i2c_adapter;
15
Michael Krufky6fab81d2012-02-08 14:57:39 -030016#define XC5000A 1
17#define XC5000C 2
Michael Krufky76efb0ba2012-02-06 19:40:32 -030018
Steven Tothaacb9d32007-12-18 01:55:51 -030019struct xc5000_config {
Steven Toth27c685a2008-01-05 16:50:14 -030020 u8 i2c_address;
21 u32 if_khz;
Devin Heitmueller496e9052009-09-24 13:27:24 -030022 u8 radio_input;
Michael Krufky409328a42012-04-16 15:21:51 -030023 u16 xtal_khz;
Richard Vollkommer52e269b2014-10-25 17:17:22 -030024 u16 output_amp;
Michael Krufky76efb0ba2012-02-06 19:40:32 -030025
Michael Krufky6fab81d2012-02-08 14:57:39 -030026 int chip_id;
Steven Tothaacb9d32007-12-18 01:55:51 -030027};
28
Steven Toth27c685a2008-01-05 16:50:14 -030029/* xc5000 callback command */
30#define XC5000_TUNER_RESET 0
31
Devin Heitmueller496e9052009-09-24 13:27:24 -030032/* Possible Radio inputs */
33#define XC5000_RADIO_NOT_CONFIGURED 0
34#define XC5000_RADIO_FM1 1
35#define XC5000_RADIO_FM2 2
Dmitri Belimov724dcbf2011-02-01 05:25:19 -030036#define XC5000_RADIO_FM1_MONO 3
Devin Heitmueller496e9052009-09-24 13:27:24 -030037
Michael Krufky48723542008-05-10 14:34:09 -030038/* 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().
44 */
45
Arnd Bergmann9b174522015-02-18 14:12:42 -030046#if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC5000)
Steven Toth8f3cd532008-10-16 20:29:38 -030047extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
Steven Tothaacb9d32007-12-18 01:55:51 -030048 struct i2c_adapter *i2c,
lawrence rust2e4e98e2010-08-25 09:50:20 -030049 const struct xc5000_config *cfg);
Steven Tothaacb9d32007-12-18 01:55:51 -030050#else
Steven Toth8f3cd532008-10-16 20:29:38 -030051static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
Steven Tothaacb9d32007-12-18 01:55:51 -030052 struct i2c_adapter *i2c,
lawrence rust2e4e98e2010-08-25 09:50:20 -030053 const struct xc5000_config *cfg)
Steven Tothaacb9d32007-12-18 01:55:51 -030054{
Harvey Harrison271ddbf2008-04-08 23:20:00 -030055 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
Steven Tothaacb9d32007-12-18 01:55:51 -030056 return NULL;
57}
Steven Toth8f3cd532008-10-16 20:29:38 -030058#endif
Steven Tothaacb9d32007-12-18 01:55:51 -030059
Steven Toth8f3cd532008-10-16 20:29:38 -030060#endif