]>
Commit | Line | Data |
---|---|---|
c942fddf | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
2dc1ed4e AO |
2 | /* |
3 | * helene.h | |
4 | * | |
5 | * Sony HELENE DVB-S/S2/T/T2/C/C2/ISDB-T/S tuner driver (CXD2858ER) | |
6 | * | |
7 | * Copyright 2012 Sony Corporation | |
8 | * Copyright (C) 2014 NetUP Inc. | |
9 | * Copyright (C) 2014 Abylay Ospan <aospan@netup.ru> | |
2dc1ed4e AO |
10 | */ |
11 | ||
12 | #ifndef __DVB_HELENE_H__ | |
13 | #define __DVB_HELENE_H__ | |
14 | ||
2dc1ed4e AO |
15 | #include <linux/dvb/frontend.h> |
16 | #include <linux/i2c.h> | |
17 | ||
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 */ | |
23 | }; | |
24 | ||
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 | |
b95b0c98 | 32 | * @xtal: Cristal frequency as described by &enum helene_xtal |
817dc4b5 | 33 | * @fe: Frontend for which connects this tuner |
2dc1ed4e AO |
34 | */ |
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; | |
817dc4b5 KS |
41 | |
42 | struct dvb_frontend *fe; | |
2dc1ed4e AO |
43 | }; |
44 | ||
45 | #if IS_REACHABLE(CONFIG_DVB_HELENE) | |
be9b53c8 | 46 | /** |
b0649455 | 47 | * helene_attach - Attach a helene tuner (terrestrial and cable standards) |
be9b53c8 MCC |
48 | * |
49 | * @fe: frontend to be attached | |
50 | * @config: pointer to &struct helene_config with tuner configuration. | |
51 | * @i2c: i2c adapter to use. | |
52 | * | |
53 | * return: FE pointer on success, NULL on failure. | |
54 | */ | |
2dc1ed4e AO |
55 | extern struct dvb_frontend *helene_attach(struct dvb_frontend *fe, |
56 | const struct helene_config *config, | |
57 | struct i2c_adapter *i2c); | |
be9b53c8 MCC |
58 | |
59 | /** | |
b0649455 | 60 | * helene_attach_s - Attach a helene tuner (satellite standards) |
be9b53c8 MCC |
61 | * |
62 | * @fe: frontend to be attached | |
63 | * @config: pointer to &struct helene_config with tuner configuration. | |
64 | * @i2c: i2c adapter to use. | |
65 | * | |
66 | * return: FE pointer on success, NULL on failure. | |
67 | */ | |
68 | extern struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe, | |
69 | const struct helene_config *config, | |
70 | struct i2c_adapter *i2c); | |
2dc1ed4e AO |
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) | |
75 | { | |
76 | pr_warn("%s: driver disabled by Kconfig\n", __func__); | |
77 | return NULL; | |
78 | } | |
2dc1ed4e AO |
79 | static inline struct dvb_frontend *helene_attach_s(struct dvb_frontend *fe, |
80 | const struct helene_config *config, | |
81 | struct i2c_adapter *i2c) | |
82 | { | |
83 | pr_warn("%s: driver disabled by Kconfig\n", __func__); | |
84 | return NULL; | |
85 | } | |
86 | #endif | |
87 | ||
88 | #endif |