18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * stv0367.h
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Driver for ST STV0367 DVB-T & DVB-C demodulator IC.
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Copyright (C) ST Microelectronics.
88c2ecf20Sopenharmony_ci * Copyright (C) 2010,2011 NetUP Inc.
98c2ecf20Sopenharmony_ci * Copyright (C) 2010,2011 Igor M. Liplianin <liplianin@netup.ru>
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#ifndef STV0367_H
138c2ecf20Sopenharmony_ci#define STV0367_H
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_ci#include <linux/dvb/frontend.h>
168c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
178c2ecf20Sopenharmony_ci
188c2ecf20Sopenharmony_ci#define STV0367_ICSPEED_53125	53125000
198c2ecf20Sopenharmony_ci#define STV0367_ICSPEED_58000	58000000
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_cistruct stv0367_config {
228c2ecf20Sopenharmony_ci	u8 demod_address;
238c2ecf20Sopenharmony_ci	u32 xtal;
248c2ecf20Sopenharmony_ci	u32 if_khz;/*4500*/
258c2ecf20Sopenharmony_ci	int if_iq_mode;
268c2ecf20Sopenharmony_ci	int ts_mode;
278c2ecf20Sopenharmony_ci	int clk_pol;
288c2ecf20Sopenharmony_ci};
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_DVB_STV0367)
318c2ecf20Sopenharmony_ciextern struct
328c2ecf20Sopenharmony_cidvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
338c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c);
348c2ecf20Sopenharmony_ciextern struct
358c2ecf20Sopenharmony_cidvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
368c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c);
378c2ecf20Sopenharmony_ciextern struct
388c2ecf20Sopenharmony_cidvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
398c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c);
408c2ecf20Sopenharmony_ci#else
418c2ecf20Sopenharmony_cistatic inline struct
428c2ecf20Sopenharmony_cidvb_frontend *stv0367ter_attach(const struct stv0367_config *config,
438c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c)
448c2ecf20Sopenharmony_ci{
458c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
468c2ecf20Sopenharmony_ci	return NULL;
478c2ecf20Sopenharmony_ci}
488c2ecf20Sopenharmony_cistatic inline struct
498c2ecf20Sopenharmony_cidvb_frontend *stv0367cab_attach(const struct stv0367_config *config,
508c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c)
518c2ecf20Sopenharmony_ci{
528c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
538c2ecf20Sopenharmony_ci	return NULL;
548c2ecf20Sopenharmony_ci}
558c2ecf20Sopenharmony_cistatic inline struct
568c2ecf20Sopenharmony_cidvb_frontend *stv0367ddb_attach(const struct stv0367_config *config,
578c2ecf20Sopenharmony_ci					struct i2c_adapter *i2c)
588c2ecf20Sopenharmony_ci{
598c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
608c2ecf20Sopenharmony_ci	return NULL;
618c2ecf20Sopenharmony_ci}
628c2ecf20Sopenharmony_ci#endif
638c2ecf20Sopenharmony_ci
648c2ecf20Sopenharmony_ci#endif
65