18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci*/
48c2ecf20Sopenharmony_ci
58c2ecf20Sopenharmony_ci#ifndef __TEA5761_H__
68c2ecf20Sopenharmony_ci#define __TEA5761_H__
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci#include <linux/i2c.h>
98c2ecf20Sopenharmony_ci#include <media/dvb_frontend.h>
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#if IS_REACHABLE(CONFIG_MEDIA_TUNER_TEA5761)
128c2ecf20Sopenharmony_ciextern int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ciextern struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
158c2ecf20Sopenharmony_ci					   struct i2c_adapter* i2c_adap,
168c2ecf20Sopenharmony_ci					   u8 i2c_addr);
178c2ecf20Sopenharmony_ci#else
188c2ecf20Sopenharmony_cistatic inline int tea5761_autodetection(struct i2c_adapter* i2c_adap,
198c2ecf20Sopenharmony_ci					u8 i2c_addr)
208c2ecf20Sopenharmony_ci{
218c2ecf20Sopenharmony_ci	printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
228c2ecf20Sopenharmony_ci	       __func__);
238c2ecf20Sopenharmony_ci	return -EINVAL;
248c2ecf20Sopenharmony_ci}
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cistatic inline struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
278c2ecf20Sopenharmony_ci						   struct i2c_adapter* i2c_adap,
288c2ecf20Sopenharmony_ci						   u8 i2c_addr)
298c2ecf20Sopenharmony_ci{
308c2ecf20Sopenharmony_ci	printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
318c2ecf20Sopenharmony_ci	return NULL;
328c2ecf20Sopenharmony_ci}
338c2ecf20Sopenharmony_ci#endif
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#endif /* __TEA5761_H__ */
36