^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0 */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) #ifndef LINUX_FC0011_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) #define LINUX_FC0011_H_
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) #include <media/dvb_frontend.h>
^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) /** struct fc0011_config - fc0011 hardware config
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * @i2c_address: I2C bus address.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) struct fc0011_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) u8 i2c_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) /** enum fc0011_fe_callback_commands - Frontend callbacks
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) * @FC0011_FE_CALLBACK_POWER: Power on tuner hardware.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) * @FC0011_FE_CALLBACK_RESET: Request a tuner reset.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) enum fc0011_fe_callback_commands {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) FC0011_FE_CALLBACK_POWER,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) FC0011_FE_CALLBACK_RESET,
^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) #if IS_REACHABLE(CONFIG_MEDIA_TUNER_FC0011)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) const struct fc0011_config *config);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) static inline
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) struct dvb_frontend *fc0011_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) struct i2c_adapter *i2c,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) const struct fc0011_config *config)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) dev_err(&i2c->dev, "fc0011 driver disabled in Kconfig\n");
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) #endif /* LINUX_FC0011_H_ */