Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  *  Driver for Xceive XC4000 "QAM/8VSB single chip tuner"
0004  *
0005  *  Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
0006  */
0007 
0008 #ifndef __XC4000_H__
0009 #define __XC4000_H__
0010 
0011 #include <linux/firmware.h>
0012 
0013 struct dvb_frontend;
0014 struct i2c_adapter;
0015 
0016 struct xc4000_config {
0017     u8  i2c_address;
0018     /* if non-zero, power management is enabled by default */
0019     u8  default_pm;
0020     /* value to be written to XREG_AMPLITUDE in DVB-T mode (0: no write) */
0021     u8  dvb_amplitude;
0022     /* if non-zero, register 0x0E is set to filter analog TV video output */
0023     u8  set_smoothedcvbs;
0024     /* IF for DVB-T */
0025     u32 if_khz;
0026 };
0027 
0028 /* xc4000 callback command */
0029 #define XC4000_TUNER_RESET      0
0030 
0031 /* For each bridge framework, when it attaches either analog or digital,
0032  * it has to store a reference back to its _core equivalent structure,
0033  * so that it can service the hardware by steering gpio's etc.
0034  * Each bridge implementation is different so cast devptr accordingly.
0035  * The xc4000 driver cares not for this value, other than ensuring
0036  * it's passed back to a bridge during tuner_callback().
0037  */
0038 
0039 #if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC4000)
0040 extern struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
0041                       struct i2c_adapter *i2c,
0042                       struct xc4000_config *cfg);
0043 #else
0044 static inline struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
0045                          struct i2c_adapter *i2c,
0046                          struct xc4000_config *cfg)
0047 {
0048     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0049     return NULL;
0050 }
0051 #endif
0052 
0053 #endif