1*74ba9207SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
29a0bf528SMauro Carvalho Chehab /*
39a0bf528SMauro Carvalho Chehab Driver for ST STV0288 demodulator
49a0bf528SMauro Carvalho Chehab
59a0bf528SMauro Carvalho Chehab Copyright (C) 2006 Georg Acher, BayCom GmbH, acher (at) baycom (dot) de
69a0bf528SMauro Carvalho Chehab for Reel Multimedia
79a0bf528SMauro Carvalho Chehab Copyright (C) 2008 TurboSight.com, <bob@turbosight.com>
89a0bf528SMauro Carvalho Chehab Copyright (C) 2008 Igor M. Liplianin <liplianin@me.by>
99a0bf528SMauro Carvalho Chehab Removed stb6000 specific tuner code and revised some
109a0bf528SMauro Carvalho Chehab procedures.
119a0bf528SMauro Carvalho Chehab
129a0bf528SMauro Carvalho Chehab
139a0bf528SMauro Carvalho Chehab */
149a0bf528SMauro Carvalho Chehab
159a0bf528SMauro Carvalho Chehab #ifndef STV0288_H
169a0bf528SMauro Carvalho Chehab #define STV0288_H
179a0bf528SMauro Carvalho Chehab
189a0bf528SMauro Carvalho Chehab #include <linux/dvb/frontend.h>
19fada1935SMauro Carvalho Chehab #include <media/dvb_frontend.h>
209a0bf528SMauro Carvalho Chehab
219a0bf528SMauro Carvalho Chehab struct stv0288_config {
229a0bf528SMauro Carvalho Chehab /* the demodulator's i2c address */
239a0bf528SMauro Carvalho Chehab u8 demod_address;
249a0bf528SMauro Carvalho Chehab
259a0bf528SMauro Carvalho Chehab u8* inittab;
269a0bf528SMauro Carvalho Chehab
279a0bf528SMauro Carvalho Chehab /* minimum delay before retuning */
289a0bf528SMauro Carvalho Chehab int min_delay_ms;
299a0bf528SMauro Carvalho Chehab
309a0bf528SMauro Carvalho Chehab int (*set_ts_params)(struct dvb_frontend *fe, int is_punctured);
319a0bf528SMauro Carvalho Chehab };
329a0bf528SMauro Carvalho Chehab
339b174527SArnd Bergmann #if IS_REACHABLE(CONFIG_DVB_STV0288)
349a0bf528SMauro Carvalho Chehab extern struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
359a0bf528SMauro Carvalho Chehab struct i2c_adapter *i2c);
369a0bf528SMauro Carvalho Chehab #else
stv0288_attach(const struct stv0288_config * config,struct i2c_adapter * i2c)379a0bf528SMauro Carvalho Chehab static inline struct dvb_frontend *stv0288_attach(const struct stv0288_config *config,
389a0bf528SMauro Carvalho Chehab struct i2c_adapter *i2c)
399a0bf528SMauro Carvalho Chehab {
409a0bf528SMauro Carvalho Chehab printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
419a0bf528SMauro Carvalho Chehab return NULL;
429a0bf528SMauro Carvalho Chehab }
439a0bf528SMauro Carvalho Chehab #endif /* CONFIG_DVB_STV0288 */
449a0bf528SMauro Carvalho Chehab
stv0288_writereg(struct dvb_frontend * fe,u8 reg,u8 val)459a0bf528SMauro Carvalho Chehab static inline int stv0288_writereg(struct dvb_frontend *fe, u8 reg, u8 val)
469a0bf528SMauro Carvalho Chehab {
479a0bf528SMauro Carvalho Chehab int r = 0;
489a0bf528SMauro Carvalho Chehab u8 buf[] = { reg, val };
499a0bf528SMauro Carvalho Chehab if (fe->ops.write)
509a0bf528SMauro Carvalho Chehab r = fe->ops.write(fe, buf, 2);
519a0bf528SMauro Carvalho Chehab return r;
529a0bf528SMauro Carvalho Chehab }
539a0bf528SMauro Carvalho Chehab
549a0bf528SMauro Carvalho Chehab #endif /* STV0288_H */
55