^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) * horus3a.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Sony Horus3A DVB-S/S2 tuner driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Copyright 2012 Sony Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) * Copyright (C) 2014 NetUP Inc.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) * Copyright (C) 2014 Sergey Kozlov <serjk@netup.ru>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #ifndef __DVB_HORUS3A_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) #define __DVB_HORUS3A_H__
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #include <linux/dvb/frontend.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) #include <linux/i2c.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) * struct horus3a_config - the configuration of Horus3A tuner driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) * @i2c_address: I2C address of the tuner
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) * @xtal_freq_mhz: Oscillator frequency, MHz
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) * @set_tuner_priv: Callback function private context
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) * @set_tuner_callback: Callback function that notifies the parent driver
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) * which tuner is active now
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct horus3a_config {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) u8 i2c_address;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) u8 xtal_freq_mhz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) void *set_tuner_priv;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) int (*set_tuner_callback)(void *, int);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) #if IS_REACHABLE(CONFIG_DVB_HORUS3A)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) * Attach a horus3a tuner
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) * @fe: frontend to be attached
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) * @config: pointer to &struct helene_config with tuner configuration.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) * @i2c: i2c adapter to use.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) * return: FE pointer on success, NULL on failure.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) extern struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) const struct horus3a_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) struct i2c_adapter *i2c);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) #else
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) static inline struct dvb_frontend *horus3a_attach(struct dvb_frontend *fe,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) const struct horus3a_config *config,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) struct i2c_adapter *i2c)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) return NULL;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) #endif