Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block
[linux/fpc-iii.git] / drivers / media / dvb-frontends / helene.h
blob32e0b1fb268c42cf18ac3d2be2b28c9d824cbc9c
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * helene.h
5 * Sony HELENE DVB-S/S2/T/T2/C/C2/ISDB-T/S tuner driver (CXD2858ER)
7 * Copyright 2012 Sony Corporation
8 * Copyright (C) 2014 NetUP Inc.
9 * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru>
12 #ifndef __DVB_HELENE_H__
13 #define __DVB_HELENE_H__
15 #include <linux/dvb/frontend.h>
16 #include <linux/i2c.h>
18 enum helene_xtal {
19 SONY_HELENE_XTAL_16000, /* 16 MHz */
20 SONY_HELENE_XTAL_20500, /* 20.5 MHz */
21 SONY_HELENE_XTAL_24000, /* 24 MHz */
22 SONY_HELENE_XTAL_41000 /* 41 MHz */
25 /**
26 * struct helene_config - the configuration of 'Helene' tuner driver
27 * @i2c_address: I2C address of the tuner
28 * @xtal_freq_mhz: Oscillator frequency, MHz
29 * @set_tuner_priv: Callback function private context
30 * @set_tuner_callback: Callback function that notifies the parent driver
31 * which tuner is active now
32 * @xtal: Cristal frequency as described by &enum helene_xtal
33 * @fe: Frontend for which connects this tuner
35 struct helene_config {
36 u8 i2c_address;
37 u8 xtal_freq_mhz;
38 void *set_tuner_priv;
39 int (*set_tuner_callback)(void *, int);
40 enum helene_xtal xtal;
42 struct dvb_frontend *fe;
45 #if IS_REACHABLE(CONFIG_DVB_HELENE)
46 /**
47 * helene_attach - Attach a helene tuner (terrestrial and cable standards)
49 * @fe: frontend to be attached
50 * @config: pointer to &struct helene_config with tuner configuration.
51 * @i2c: i2c adapter to use.
53 * return: FE pointer on success, NULL on failure.
55 extern struct dvb_frontend *helene_attach(struct dvb_frontend *fe,
56 const struct helene_config *config,
57 struct i2c_adapter *i2c);
59 /**
60 * helene_attach_s - Attach a helene tuner (satellite standards)
62 * @fe: frontend to be attached
63 * @config: pointer to &struct helene_config with tuner configuration.
64 * @i2c: i2c adapter to use.
66 * return: FE pointer on success, NULL on failure.
68 extern struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe,
69 const struct helene_config *config,
70 struct i2c_adapter *i2c);
71 #else
72 static inline struct dvb_frontend *helene_attach(struct dvb_frontend *fe,
73 const struct helene_config *config,
74 struct i2c_adapter *i2c)
76 pr_warn("%s: driver disabled by Kconfig\n", __func__);
77 return NULL;
79 static inline struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe,
80 const struct helene_config *config,
81 struct i2c_adapter *i2c)
83 pr_warn("%s: driver disabled by Kconfig\n", __func__);
84 return NULL;
86 #endif
88 #endif