^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-or-later */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #ifndef __TEA5761_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) #define __TEA5761_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #include <media/dvb_frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TEA5761)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) extern int tea5761_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) extern struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) struct i2c_adapter* i2c_adap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) u8 i2c_addr);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) static inline int tea5761_autodetection(struct i2c_adapter* i2c_adap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) u8 i2c_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) return -EINVAL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) static inline struct dvb_frontend *tea5761_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct i2c_adapter* i2c_adap,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u8 i2c_addr)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) #endif /* __TEA5761_H__ */