18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Driver for Maxim MAX2165 silicon tuner
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Copyright (c) 2009 David T. L. Wong <davidtlwong@gmail.com>
68c2ecf20Sopenharmony_ci */
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#ifndef __MAX2165_H__
98c2ecf20Sopenharmony_ci#define __MAX2165_H__
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_cistruct dvb_frontend;
128c2ecf20Sopenharmony_cistruct i2c_adapter;
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_cistruct max2165_config {
158c2ecf20Sopenharmony_ci	u8 i2c_address;
168c2ecf20Sopenharmony_ci	u8 osc_clk; /* in MHz, selectable values: 4,16,18,20,22,24,26,28 */
178c2ecf20Sopenharmony_ci};
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_MEDIA_TUNER_MAX2165)
208c2ecf20Sopenharmony_ciextern struct dvb_frontend *max2165_attach(struct dvb_frontend *fe,
218c2ecf20Sopenharmony_ci	struct i2c_adapter *i2c,
228c2ecf20Sopenharmony_ci	struct max2165_config *cfg);
238c2ecf20Sopenharmony_ci#else
248c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *max2165_attach(struct dvb_frontend *fe,
258c2ecf20Sopenharmony_ci	struct i2c_adapter *i2c,
268c2ecf20Sopenharmony_ci	struct max2165_config *cfg)
278c2ecf20Sopenharmony_ci{
288c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
298c2ecf20Sopenharmony_ci	return NULL;
308c2ecf20Sopenharmony_ci}
318c2ecf20Sopenharmony_ci#endif
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_ci#endif
34