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