Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     Driver for ST STV0288 demodulator
0004 
0005     Copyright (C) 2006 Georg Acher, BayCom GmbH, acher (at) baycom (dot) de
0006         for Reel Multimedia
0007     Copyright (C) 2008 TurboSight.com, <bob@turbosight.com>
0008     Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
0009         Removed stb6000 specific tuner code and revised some
0010         procedures.
0011 
0012 
0013 */
0014 
0015 #ifndef STV0288_H
0016 #define STV0288_H
0017 
0018 #include <linux/dvb/frontend.h>
0019 #include <media/dvb_frontend.h>
0020 
0021 struct stv0288_config {
0022     /* the demodulator's i2c address */
0023     u8 demod_address;
0024 
0025     u8* inittab;
0026 
0027     /* minimum delay before retuning */
0028     int min_delay_ms;
0029 
0030     int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
0031 };
0032 
0033 #if IS_REACHABLE(CONFIG_DVB_STV0288)
0034 extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
0035                        struct i2c_adapter *i2c);
0036 #else
0037 static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
0038                        struct i2c_adapter *i2c)
0039 {
0040     printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
0041     return NULL;
0042 }
0043 #endif /* CONFIG_DVB_STV0288 */
0044 
0045 static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
0046 {
0047     int r = 0;
0048     u8 buf[] = { reg, val };
0049     if (fe->ops.write)
0050         r = fe->ops.write(fe, buf, 2);
0051     return r;
0052 }
0053 
0054 #endif /* STV0288_H */