^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * Fujitsu mb86a20s driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2010 Mauro Carvalho Chehab
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) #ifndef MB86A20S_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) #define MB86A20S_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include <linux/dvb/frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) * struct mb86a20s_config - Define the per-device attributes of the frontend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) * @fclk: Clock frequency. If zero, assumes the default
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) * (32.57142 Mhz)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * @demod_address: the demodulator's i2c address
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * @is_serial: if true, TS is serial. Otherwise, TS is parallel
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) struct mb86a20s_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) u32 fclk;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) u8 demod_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) bool is_serial;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) #if IS_REACHABLE(CONFIG_DVB_MB86A20S)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) * Attach a mb86a20s demod
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) * @config: pointer to &struct mb86a20s_config with demod configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) * @i2c: i2c adapter to use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) * return: FE pointer on success, NULL on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) extern struct dvb_frontend *mb86a20s_attach(const struct mb86a20s_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) static inline struct dvb_frontend *mb86a20s_attach(
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) const struct mb86a20s_config *config, struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) #endif /* MB86A20S */