18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  mxl5007t.h - driver for the MaxLinear MxL5007T silicon tuner
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (C) 2008 Michael Krufky <mkrufky@linuxtv.org>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __MXL5007T_H__
98c2ecf20Sopenharmony_ci#define __MXL5007T_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci/* ------------------------------------------------------------------------- */
148c2ecf20Sopenharmony_ci
158c2ecf20Sopenharmony_cienum mxl5007t_if_freq {
168c2ecf20Sopenharmony_ci	MxL_IF_4_MHZ,      /*  4000000 */
178c2ecf20Sopenharmony_ci	MxL_IF_4_5_MHZ,    /*  4500000 */
188c2ecf20Sopenharmony_ci	MxL_IF_4_57_MHZ,   /*  4570000 */
198c2ecf20Sopenharmony_ci	MxL_IF_5_MHZ,      /*  5000000 */
208c2ecf20Sopenharmony_ci	MxL_IF_5_38_MHZ,   /*  5380000 */
218c2ecf20Sopenharmony_ci	MxL_IF_6_MHZ,      /*  6000000 */
228c2ecf20Sopenharmony_ci	MxL_IF_6_28_MHZ,   /*  6280000 */
238c2ecf20Sopenharmony_ci	MxL_IF_9_1915_MHZ, /*  9191500 */
248c2ecf20Sopenharmony_ci	MxL_IF_35_25_MHZ,  /* 35250000 */
258c2ecf20Sopenharmony_ci	MxL_IF_36_15_MHZ,  /* 36150000 */
268c2ecf20Sopenharmony_ci	MxL_IF_44_MHZ,     /* 44000000 */
278c2ecf20Sopenharmony_ci};
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_cienum mxl5007t_xtal_freq {
308c2ecf20Sopenharmony_ci	MxL_XTAL_16_MHZ,      /* 16000000 */
318c2ecf20Sopenharmony_ci	MxL_XTAL_20_MHZ,      /* 20000000 */
328c2ecf20Sopenharmony_ci	MxL_XTAL_20_25_MHZ,   /* 20250000 */
338c2ecf20Sopenharmony_ci	MxL_XTAL_20_48_MHZ,   /* 20480000 */
348c2ecf20Sopenharmony_ci	MxL_XTAL_24_MHZ,      /* 24000000 */
358c2ecf20Sopenharmony_ci	MxL_XTAL_25_MHZ,      /* 25000000 */
368c2ecf20Sopenharmony_ci	MxL_XTAL_25_14_MHZ,   /* 25140000 */
378c2ecf20Sopenharmony_ci	MxL_XTAL_27_MHZ,      /* 27000000 */
388c2ecf20Sopenharmony_ci	MxL_XTAL_28_8_MHZ,    /* 28800000 */
398c2ecf20Sopenharmony_ci	MxL_XTAL_32_MHZ,      /* 32000000 */
408c2ecf20Sopenharmony_ci	MxL_XTAL_40_MHZ,      /* 40000000 */
418c2ecf20Sopenharmony_ci	MxL_XTAL_44_MHZ,      /* 44000000 */
428c2ecf20Sopenharmony_ci	MxL_XTAL_48_MHZ,      /* 48000000 */
438c2ecf20Sopenharmony_ci	MxL_XTAL_49_3811_MHZ, /* 49381100 */
448c2ecf20Sopenharmony_ci};
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_cienum mxl5007t_clkout_amp {
478c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_94V = 0,
488c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_53V = 1,
498c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_37V = 2,
508c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_28V = 3,
518c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_23V = 4,
528c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_20V = 5,
538c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_17V = 6,
548c2ecf20Sopenharmony_ci	MxL_CLKOUT_AMP_0_15V = 7,
558c2ecf20Sopenharmony_ci};
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_cistruct mxl5007t_config {
588c2ecf20Sopenharmony_ci	s32 if_diff_out_level;
598c2ecf20Sopenharmony_ci	enum mxl5007t_clkout_amp clk_out_amp;
608c2ecf20Sopenharmony_ci	enum mxl5007t_xtal_freq xtal_freq_hz;
618c2ecf20Sopenharmony_ci	enum mxl5007t_if_freq if_freq_hz;
628c2ecf20Sopenharmony_ci	unsigned int invert_if:1;
638c2ecf20Sopenharmony_ci	unsigned int loop_thru_enable:1;
648c2ecf20Sopenharmony_ci	unsigned int clk_out_enable:1;
658c2ecf20Sopenharmony_ci};
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_MEDIA_TUNER_MXL5007T)
688c2ecf20Sopenharmony_ciextern struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
698c2ecf20Sopenharmony_ci					    struct i2c_adapter *i2c, u8 addr,
708c2ecf20Sopenharmony_ci					    struct mxl5007t_config *cfg);
718c2ecf20Sopenharmony_ci#else
728c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *mxl5007t_attach(struct dvb_frontend *fe,
738c2ecf20Sopenharmony_ci						   struct i2c_adapter *i2c,
748c2ecf20Sopenharmony_ci						   u8 addr,
758c2ecf20Sopenharmony_ci						   struct mxl5007t_config *cfg)
768c2ecf20Sopenharmony_ci{
778c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
788c2ecf20Sopenharmony_ci	return NULL;
798c2ecf20Sopenharmony_ci}
808c2ecf20Sopenharmony_ci#endif
818c2ecf20Sopenharmony_ci
828c2ecf20Sopenharmony_ci#endif /* __MXL5007T_H__ */
83