blob: 458bcce20e3847e106b7af3ba2592764cef5f9bf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * dvb_frontend.h
3 *
4 * Copyright (C) 2001 convergence integrated media GmbH
5 * Copyright (C) 2004 convergence GmbH
6 *
7 * Written by Ralph Metzler
8 * Overhauled by Holger Waechtler
9 * Kernel I2C stuff by Michael Hunold <hunold@convergence.de>
10 *
11 * This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Lesser General Public License
13 * as published by the Free Software Foundation; either version 2.1
14 * of the License, or (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 *
26 */
27
28#ifndef _DVB_FRONTEND_H_
29#define _DVB_FRONTEND_H_
30
31#include <linux/types.h>
32#include <linux/sched.h>
33#include <linux/ioctl.h>
34#include <linux/i2c.h>
35#include <linux/module.h>
36#include <linux/errno.h>
37#include <linux/delay.h>
Matthias Kaehlcke03b76122007-07-30 14:58:10 -030038#include <linux/mutex.h>
Tejun Heo5a0e3ad2010-03-24 17:04:11 +090039#include <linux/slab.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070040
41#include <linux/dvb/frontend.h>
42
43#include "dvbdev.h"
44
Mauro Carvalho Chehab02f028c2015-11-10 11:12:30 -020045/**
46 * DOC: Digital TV Frontend
47 *
48 * The Digital TV Frontend kABI defines a driver-internal interface for
49 * registering low-level, hardware specific driver to a hardware independent
50 * frontend layer. It is only of interest for Digital TV device driver writers.
51 * The header file for this API is named dvb_frontend.h and located in
52 * drivers/media/dvb-core.
53 *
54 * Before using the Digital TV frontend core, the bridge driver should attach
55 * the frontend demod, tuner and SEC devices and call dvb_register_frontend(),
56 * in order to register the new frontend at the subsystem. At device
57 * detach/removal, the bridge driver should call dvb_unregister_frontend() to
58 * remove the frontend from the core and then dvb_frontend_detach() to free the
59 * memory allocated by the frontend drivers.
60 *
61 * The drivers should also call dvb_frontend_suspend() as part of their
62 * handler for the &device_driver.suspend(), and dvb_frontend_resume() as
63 * part of their handler for &device_driver.resume().
64 *
65 * A few other optional functions are provided to handle some special cases.
66 */
67
Mauro Carvalho Chehabeeacf142011-12-22 08:56:48 -030068/*
69 * Maximum number of Delivery systems per frontend. It
70 * should be smaller or equal to 32
71 */
72#define MAX_DELSYS 8
73
Mauro Carvalho Chehabb9de1722015-08-22 09:47:04 -030074/**
75 * struct dvb_frontend_tune_settings - parameters to adjust frontend tuning
76 *
77 * @min_delay_ms: minimum delay for tuning, in ms
78 * @step_size: step size between two consecutive frequencies
79 * @max_drift: maximum drift
80 *
81 * NOTE: step_size is in Hz, for terrestrial/cable or kHz for satellite
82 */
Linus Torvalds1da177e2005-04-16 15:20:36 -070083struct dvb_frontend_tune_settings {
Mauro Carvalho Chehabafd1a0c2005-12-12 00:37:27 -080084 int min_delay_ms;
85 int step_size;
86 int max_drift;
Linus Torvalds1da177e2005-04-16 15:20:36 -070087};
88
89struct dvb_frontend;
90
Mauro Carvalho Chehab8bcbc2f2015-08-22 09:48:05 -030091/**
92 * struct dvb_tuner_info - Frontend name and min/max ranges/bandwidths
93 *
94 * @name: name of the Frontend
95 * @frequency_min: minimal frequency supported
96 * @frequency_max: maximum frequency supported
97 * @frequency_step: frequency step
98 * @bandwidth_min: minimal frontend bandwidth supported
99 * @bandwidth_max: maximum frontend bandwidth supported
100 * @bandwidth_step: frontend bandwidth step
101 *
102 * NOTE: frequency parameters are in Hz, for terrestrial/cable or kHz for
103 * satellite.
104 */
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300105struct dvb_tuner_info {
106 char name[128];
107
108 u32 frequency_min;
109 u32 frequency_max;
110 u32 frequency_step;
111
112 u32 bandwidth_min;
113 u32 bandwidth_max;
114 u32 bandwidth_step;
115};
116
Mauro Carvalho Chehab1a777632015-08-22 09:58:26 -0300117/**
118 * struct analog_parameters - Parameters to tune into an analog/radio channel
119 *
120 * @frequency: Frequency used by analog TV tuner (either in 62.5 kHz step,
121 * for TV, or 62.5 Hz for radio)
122 * @mode: Tuner mode, as defined on enum v4l2_tuner_type
123 * @audmode: Audio mode as defined for the rxsubchans field at videodev2.h,
124 * e. g. V4L2_TUNER_MODE_*
125 * @std: TV standard bitmap as defined at videodev2.h, e. g. V4L2_STD_*
126 *
127 * Hybrid tuners should be supported by both V4L2 and DVB APIs. This
128 * struct contains the data that are used by the V4L2 side. To avoid
129 * dependencies from V4L2 headers, all enums here are declared as integers.
130 */
Michael Krufkye18f9442007-08-21 01:25:48 -0300131struct analog_parameters {
132 unsigned int frequency;
133 unsigned int mode;
134 unsigned int audmode;
135 u64 std;
136};
137
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300138/**
139 * enum dvbfe_algo - defines the algorithm used to tune into a channel
Manu Abrahamc59e7872008-10-14 16:34:07 -0300140 *
Mauro Carvalho Chehab1a777632015-08-22 09:58:26 -0300141 * @DVBFE_ALGO_HW: Hardware Algorithm -
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300142 * Devices that support this algorithm do everything in hardware
143 * and no software support is needed to handle them.
144 * Requesting these devices to LOCK is the only thing required,
145 * device is supposed to do everything in the hardware.
146 *
Mauro Carvalho Chehab1a777632015-08-22 09:58:26 -0300147 * @DVBFE_ALGO_SW: Software Algorithm -
Manu Abrahamc59e7872008-10-14 16:34:07 -0300148 * These are dumb devices, that require software to do everything
149 *
Mauro Carvalho Chehab1a777632015-08-22 09:58:26 -0300150 * @DVBFE_ALGO_CUSTOM: Customizable Agorithm -
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300151 * Devices having this algorithm can be customized to have specific
152 * algorithms in the frontend driver, rather than simply doing a
153 * software zig-zag. In this case the zigzag maybe hardware assisted
154 * or it maybe completely done in hardware. In all cases, usage of
155 * this algorithm, in conjunction with the search and track
156 * callbacks, utilizes the driver specific algorithm.
Manu Abrahamc59e7872008-10-14 16:34:07 -0300157 *
Mauro Carvalho Chehab1a777632015-08-22 09:58:26 -0300158 * @DVBFE_ALGO_RECOVERY: Recovery Algorithm -
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300159 * These devices have AUTO recovery capabilities from LOCK failure
Manu Abrahamc59e7872008-10-14 16:34:07 -0300160 */
161enum dvbfe_algo {
162 DVBFE_ALGO_HW = (1 << 0),
163 DVBFE_ALGO_SW = (1 << 1),
164 DVBFE_ALGO_CUSTOM = (1 << 2),
165 DVBFE_ALGO_RECOVERY = (1 << 31)
166};
167
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300168/**
169 * enum dvbfe_search - search callback possible return status
Manu Abrahamc59e7872008-10-14 16:34:07 -0300170 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300171 * @DVBFE_ALGO_SEARCH_SUCCESS:
172 * The frontend search algorithm completed and returned successfully
Manu Abrahamc59e7872008-10-14 16:34:07 -0300173 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300174 * @DVBFE_ALGO_SEARCH_ASLEEP:
175 * The frontend search algorithm is sleeping
Manu Abrahamc59e7872008-10-14 16:34:07 -0300176 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300177 * @DVBFE_ALGO_SEARCH_FAILED:
178 * The frontend search for a signal failed
Manu Abrahamc59e7872008-10-14 16:34:07 -0300179 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300180 * @DVBFE_ALGO_SEARCH_INVALID:
181 * The frontend search algorith was probably supplied with invalid
182 * parameters and the search is an invalid one
Manu Abrahamc59e7872008-10-14 16:34:07 -0300183 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300184 * @DVBFE_ALGO_SEARCH_ERROR:
185 * The frontend search algorithm failed due to some error
Manu Abrahamc59e7872008-10-14 16:34:07 -0300186 *
Mauro Carvalho Chehab4f1c1862015-08-22 07:19:20 -0300187 * @DVBFE_ALGO_SEARCH_AGAIN:
188 * The frontend search algorithm was requested to search again
Manu Abrahamc59e7872008-10-14 16:34:07 -0300189 */
190enum dvbfe_search {
191 DVBFE_ALGO_SEARCH_SUCCESS = (1 << 0),
192 DVBFE_ALGO_SEARCH_ASLEEP = (1 << 1),
193 DVBFE_ALGO_SEARCH_FAILED = (1 << 2),
194 DVBFE_ALGO_SEARCH_INVALID = (1 << 3),
195 DVBFE_ALGO_SEARCH_AGAIN = (1 << 4),
196 DVBFE_ALGO_SEARCH_ERROR = (1 << 31),
197};
198
Mauro Carvalho Chehab465291a2015-08-22 11:13:37 -0300199/**
200 * struct dvb_tuner_ops - Tuner information and callbacks
201 *
202 * @info: embedded struct dvb_tuner_info with tuner properties
203 * @release: callback function called when frontend is dettached.
204 * drivers should free any allocated memory.
205 * @init: callback function used to initialize the tuner device.
206 * @sleep: callback function used to put the tuner to sleep.
207 * @suspend: callback function used to inform that the Kernel will
208 * suspend.
209 * @resume: callback function used to inform that the Kernel is
210 * resuming from suspend.
211 * @set_params: callback function used to inform the tuner to tune
212 * into a digital TV channel. The properties to be used
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300213 * are stored at @dvb_frontend.dtv_property_cache;. The
214 * tuner demod can change the parameters to reflect the
215 * changes needed for the channel to be tuned, and
Mauro Carvalho Chehabbef0e542015-11-11 19:14:44 -0200216 * update statistics. This is the recommended way to set
217 * the tuner parameters and should be used on newer
218 * drivers.
Mauro Carvalho Chehab465291a2015-08-22 11:13:37 -0300219 * @set_analog_params: callback function used to tune into an analog TV
220 * channel on hybrid tuners. It passes @analog_parameters;
221 * to the driver.
Mauro Carvalho Chehab465291a2015-08-22 11:13:37 -0300222 * @set_config: callback function used to send some tuner-specific
223 * parameters.
224 * @get_frequency: get the actual tuned frequency
225 * @get_bandwidth: get the bandwitdh used by the low pass filters
226 * @get_if_frequency: get the Intermediate Frequency, in Hz. For baseband,
227 * should return 0.
228 * @get_status: returns the frontend lock status
229 * @get_rf_strength: returns the RF signal strengh. Used mostly to support
230 * analog TV and radio. Digital TV should report, instead,
231 * via DVBv5 API (@dvb_frontend.dtv_property_cache;).
232 * @get_afc: Used only by analog TV core. Reports the frequency
233 * drift due to AFC.
Mauro Carvalho Chehabbef0e542015-11-11 19:14:44 -0200234 * @calc_regs: callback function used to pass register data settings
235 * for simple tuners. Shouldn't be used on newer drivers.
236 * @set_frequency: Set a new frequency. Shouldn't be used on newer drivers.
237 * @set_bandwidth: Set a new frequency. Shouldn't be used on newer drivers.
Mauro Carvalho Chehab465291a2015-08-22 11:13:37 -0300238 *
239 * NOTE: frequencies used on get_frequency and set_frequency are in Hz for
240 * terrestrial/cable or kHz for satellite.
241 *
242 */
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300243struct dvb_tuner_ops {
Andrew de Quinceyf6adb912006-04-18 21:37:20 -0300244
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300245 struct dvb_tuner_info info;
246
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300247 int (*release)(struct dvb_frontend *fe);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300248 int (*init)(struct dvb_frontend *fe);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300249 int (*sleep)(struct dvb_frontend *fe);
Mauro Carvalho Chehab59d78892014-08-09 21:47:19 -0300250 int (*suspend)(struct dvb_frontend *fe);
251 int (*resume)(struct dvb_frontend *fe);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300252
Mauro Carvalho Chehabbef0e542015-11-11 19:14:44 -0200253 /* This is the recomended way to set the tuner */
Mauro Carvalho Chehab14d24d12011-12-24 12:24:33 -0300254 int (*set_params)(struct dvb_frontend *fe);
Michael Krufkye18f9442007-08-21 01:25:48 -0300255 int (*set_analog_params)(struct dvb_frontend *fe, struct analog_parameters *p);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300256
Mauro Carvalho Chehab7f171122007-10-18 19:56:47 -0300257 int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
258
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300259 int (*get_frequency)(struct dvb_frontend *fe, u32 *frequency);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300260 int (*get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
Mauro Carvalho Chehab8513e142011-09-03 11:40:02 -0300261 int (*get_if_frequency)(struct dvb_frontend *fe, u32 *frequency);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300262
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300263#define TUNER_STATUS_LOCKED 1
Michael Krufkye18f9442007-08-21 01:25:48 -0300264#define TUNER_STATUS_STEREO 2
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300265 int (*get_status)(struct dvb_frontend *fe, u32 *status);
Michael Krufky8fb3b9f2007-08-30 23:00:43 -0300266 int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
Mauro Carvalho Chehab1d432a32012-07-04 02:33:55 -0300267 int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300268
Mauro Carvalho Chehabbef0e542015-11-11 19:14:44 -0200269 /*
270 * This is support for demods like the mt352 - fills out the supplied
271 * buffer with what to write.
272 *
273 * Don't use on newer drivers.
274 */
275 int (*calc_regs)(struct dvb_frontend *fe, u8 *buf, int buf_len);
276
277 /*
278 * These are provided separately from set_params in order to
279 * facilitate silicon tuners which require sophisticated tuning loops,
280 * controlling each parameter separately.
281 *
282 * Don't use on newer drivers.
283 */
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300284 int (*set_frequency)(struct dvb_frontend *fe, u32 frequency);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300285 int (*set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
286};
287
Mauro Carvalho Chehab0bf6cd72015-08-22 11:35:50 -0300288/**
289 * struct analog_demod_info - Information struct for analog TV part of the demod
290 *
291 * @name: Name of the analog TV demodulator
292 */
Michael Krufky807ffe82007-12-21 02:55:43 -0300293struct analog_demod_info {
294 char *name;
295};
296
Mauro Carvalho Chehab0bf6cd72015-08-22 11:35:50 -0300297/**
298 * struct analog_demod_ops - Demodulation information and callbacks for
299 * analog TV and radio
300 *
301 * @info: pointer to struct analog_demod_info
302 * @set_params: callback function used to inform the demod to set the
303 * demodulator parameters needed to decode an analog or
304 * radio channel. The properties are passed via
305 * struct @analog_params;.
306 * @has_signal: returns 0xffff if has signal, or 0 if it doesn't.
307 * @get_afc: Used only by analog TV core. Reports the frequency
308 * drift due to AFC.
309 * @tuner_status: callback function that returns tuner status bits, e. g.
310 * TUNER_STATUS_LOCKED and TUNER_STATUS_STEREO.
311 * @standby: set the tuner to standby mode.
312 * @release: callback function called when frontend is dettached.
313 * drivers should free any allocated memory.
314 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C
315 * mux support instead.
316 * @set_config: callback function used to send some tuner-specific
317 * parameters.
318 */
Michael Krufkybc3e5c72007-12-21 11:18:32 -0300319struct analog_demod_ops {
Michael Krufky807ffe82007-12-21 02:55:43 -0300320
321 struct analog_demod_info info;
322
323 void (*set_params)(struct dvb_frontend *fe,
324 struct analog_parameters *params);
Hans Verkuildfc2e122013-04-06 04:41:29 -0300325 int (*has_signal)(struct dvb_frontend *fe, u16 *signal);
Hans Verkuila2192cf2013-04-06 04:35:27 -0300326 int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
Michael Krufky807ffe82007-12-21 02:55:43 -0300327 void (*tuner_status)(struct dvb_frontend *fe);
328 void (*standby)(struct dvb_frontend *fe);
329 void (*release)(struct dvb_frontend *fe);
330 int (*i2c_gate_ctrl)(struct dvb_frontend *fe, int enable);
331
332 /** This is to allow setting tuner-specific configuration */
333 int (*set_config)(struct dvb_frontend *fe, void *priv_cfg);
334};
335
Mauro Carvalho Chehaba689e362011-12-22 14:47:48 -0300336struct dtv_frontend_properties;
337
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300338
339/**
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300340 * struct dvb_frontend_ops - Demodulation information and callbacks for
341 * ditialt TV
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300342 *
343 * @info: embedded struct dvb_tuner_info with tuner properties
344 * @delsys: Delivery systems supported by the frontend
345 * @release: callback function called when frontend is dettached.
346 * drivers should free any allocated memory.
347 * @release_sec: callback function requesting that the Satelite Equipment
348 * Control (SEC) driver to release and free any memory
349 * allocated by the driver.
350 * @init: callback function used to initialize the tuner device.
351 * @sleep: callback function used to put the tuner to sleep.
352 * @write: callback function used by some demod legacy drivers to
353 * allow other drivers to write data into their registers.
354 * Should not be used on new drivers.
355 * @tune: callback function used by demod drivers that use
356 * @DVBFE_ALGO_HW; to tune into a frequency.
357 * @get_frontend_algo: returns the desired hardware algorithm.
358 * @set_frontend: callback function used to inform the demod to set the
359 * parameters for demodulating a digital TV channel.
360 * The properties to be used are stored at
361 * @dvb_frontend.dtv_property_cache;. The demod can change
362 * the parameters to reflect the changes needed for the
363 * channel to be decoded, and update statistics.
364 * @get_tune_settings: callback function
365 * @get_frontend: callback function used to inform the parameters
366 * actuall in use. The properties to be used are stored at
367 * @dvb_frontend.dtv_property_cache; and update
368 * statistics. Please notice that it should not return
369 * an error code if the statistics are not available
370 * because the demog is not locked.
371 * @read_status: returns the locking status of the frontend.
372 * @read_ber: legacy callback function to return the bit error rate.
373 * Newer drivers should provide such info via DVBv5 API,
374 * e. g. @set_frontend;/@get_frontend;, implementing this
375 * callback only if DVBv3 API compatibility is wanted.
376 * @read_signal_strength: legacy callback function to return the signal
377 * strength. Newer drivers should provide such info via
378 * DVBv5 API, e. g. @set_frontend;/@get_frontend;,
379 * implementing this callback only if DVBv3 API
380 * compatibility is wanted.
381 * @read_snr: legacy callback function to return the Signal/Noise
382 * rate. Newer drivers should provide such info via
383 * DVBv5 API, e. g. @set_frontend;/@get_frontend;,
384 * implementing this callback only if DVBv3 API
385 * compatibility is wanted.
386 * @read_ucblocks: legacy callback function to return the Uncorrected Error
387 * Blocks. Newer drivers should provide such info via
388 * DVBv5 API, e. g. @set_frontend;/@get_frontend;,
389 * implementing this callback only if DVBv3 API
390 * compatibility is wanted.
391 * @diseqc_reset_overload: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300392 * FE_DISEQC_RESET_OVERLOAD ioctl (only Satellite)
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300393 * @diseqc_send_master_cmd: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300394 * FE_DISEQC_SEND_MASTER_CMD ioctl (only Satellite).
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300395 * @diseqc_recv_slave_reply: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300396 * FE_DISEQC_RECV_SLAVE_REPLY ioctl (only Satellite)
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300397 * @diseqc_send_burst: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300398 * FE_DISEQC_SEND_BURST ioctl (only Satellite).
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300399 * @set_tone: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300400 * FE_SET_TONE ioctl (only Satellite).
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300401 * @set_voltage: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300402 * FE_SET_VOLTAGE ioctl (only Satellite).
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300403 * @enable_high_lnb_voltage: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300404 * FE_ENABLE_HIGH_LNB_VOLTAGE ioctl (only Satellite).
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300405 * @dishnetwork_send_legacy_command: callback function to implement the
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300406 * FE_DISHNETWORK_SEND_LEGACY_CMD ioctl (only Satellite).
Mauro Carvalho Chehab4deea4c2015-11-09 23:24:10 -0200407 * Drivers should not use this, except when the DVB
408 * core emulation fails to provide proper support (e.g.
409 * if set_voltage() takes more than 8ms to work), and
410 * when backward compatibility with this legacy API is
411 * required.
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300412 * @i2c_gate_ctrl: controls the I2C gate. Newer drivers should use I2C
413 * mux support instead.
414 * @ts_bus_ctrl: callback function used to take control of the TS bus.
415 * @set_lna: callback function to power on/off/auto the LNA.
416 * @search: callback function used on some custom algo search algos.
417 * @tuner_ops: pointer to struct dvb_tuner_ops
418 * @analog_ops: pointer to struct analog_demod_ops
419 * @set_property: callback function to allow the frontend to validade
420 * incoming properties. Should not be used on new drivers.
421 * @get_property: callback function to allow the frontend to override
422 * outcoming properties. Should not be used on new drivers.
423 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700424struct dvb_frontend_ops {
425
426 struct dvb_frontend_info info;
427
Mauro Carvalho Chehabeeacf142011-12-22 08:56:48 -0300428 u8 delsys[MAX_DELSYS];
429
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430 void (*release)(struct dvb_frontend* fe);
Andrew de Quincey94cbae52006-08-08 09:10:07 -0300431 void (*release_sec)(struct dvb_frontend* fe);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700432
433 int (*init)(struct dvb_frontend* fe);
434 int (*sleep)(struct dvb_frontend* fe);
435
lawrence rust2e4e98e2010-08-25 09:50:20 -0300436 int (*write)(struct dvb_frontend* fe, const u8 buf[], int len);
Andrew de Quincey94cbae52006-08-08 09:10:07 -0300437
Andrew de Quincey36cb5572006-01-09 15:25:07 -0200438 /* if this is set, it overrides the default swzigzag */
439 int (*tune)(struct dvb_frontend* fe,
Mauro Carvalho Chehab7e072222011-12-26 17:48:33 -0300440 bool re_tune,
Andrew de Quincey36cb5572006-01-09 15:25:07 -0200441 unsigned int mode_flags,
Oliver Endriss260f8d72007-07-13 11:54:35 -0300442 unsigned int *delay,
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300443 enum fe_status *status);
Mauro Carvalho Chehab0cfcc492015-08-22 13:28:02 -0300444
Manu Abraham0249ef12006-06-21 10:27:31 -0300445 /* get frontend tuning algorithm from the module */
Manu Abrahamc59e7872008-10-14 16:34:07 -0300446 enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
Andrew de Quincey36cb5572006-01-09 15:25:07 -0200447
448 /* these two are only used for the swzigzag code */
Mauro Carvalho Chehabbc9cd272011-12-20 15:31:54 -0300449 int (*set_frontend)(struct dvb_frontend *fe);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700450 int (*get_tune_settings)(struct dvb_frontend* fe, struct dvb_frontend_tune_settings* settings);
451
Mauro Carvalho Chehab7c61d802011-12-30 11:30:21 -0300452 int (*get_frontend)(struct dvb_frontend *fe);
Andrew de Quincey36cb5572006-01-09 15:25:07 -0200453
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300454 int (*read_status)(struct dvb_frontend *fe, enum fe_status *status);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700455 int (*read_ber)(struct dvb_frontend* fe, u32* ber);
456 int (*read_signal_strength)(struct dvb_frontend* fe, u16* strength);
457 int (*read_snr)(struct dvb_frontend* fe, u16* snr);
458 int (*read_ucblocks)(struct dvb_frontend* fe, u32* ucblocks);
459
460 int (*diseqc_reset_overload)(struct dvb_frontend* fe);
461 int (*diseqc_send_master_cmd)(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd);
462 int (*diseqc_recv_slave_reply)(struct dvb_frontend* fe, struct dvb_diseqc_slave_reply* reply);
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300463 int (*diseqc_send_burst)(struct dvb_frontend *fe,
464 enum fe_sec_mini_cmd minicmd);
465 int (*set_tone)(struct dvb_frontend *fe, enum fe_sec_tone_mode tone);
466 int (*set_voltage)(struct dvb_frontend *fe,
467 enum fe_sec_voltage voltage);
Peter Beutner400b7082006-01-09 15:32:43 -0200468 int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, long arg);
469 int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
Steven Toth611900c2006-01-09 15:25:12 -0200470 int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable);
Steven Tothba7e6f32006-09-25 12:41:53 -0300471 int (*ts_bus_ctrl)(struct dvb_frontend* fe, int acquire);
Antti Palosaari33eebec2012-10-03 04:28:56 -0300472 int (*set_lna)(struct dvb_frontend *);
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300473
Mauro Carvalho Chehabbef0e542015-11-11 19:14:44 -0200474 /*
475 * These callbacks are for devices that implement their own
Manu Abrahamc59e7872008-10-14 16:34:07 -0300476 * tuning algorithms, rather than a simple swzigzag
477 */
Mauro Carvalho Chehab41da5322011-12-26 18:03:12 -0300478 enum dvbfe_search (*search)(struct dvb_frontend *fe);
Manu Abrahamc59e7872008-10-14 16:34:07 -0300479
Andrew de Quincey7eef5dd2006-04-18 17:47:09 -0300480 struct dvb_tuner_ops tuner_ops;
Michael Krufkybc3e5c72007-12-21 11:18:32 -0300481 struct analog_demod_ops analog_ops;
Steven Toth6b73eea2008-09-04 01:12:25 -0300482
Steven Tothe7fee0f32008-09-11 10:23:01 -0300483 int (*set_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
484 int (*get_property)(struct dvb_frontend* fe, struct dtv_property* tvp);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700485};
486
Mauro Carvalho Chehab8de85942011-12-26 20:22:50 -0300487#ifdef __DVB_CORE__
Linus Torvalds1da177e2005-04-16 15:20:36 -0700488#define MAX_EVENT 8
489
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300490/* Used only internally at dvb_frontend.c */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700491struct dvb_fe_events {
492 struct dvb_frontend_event events[MAX_EVENT];
493 int eventw;
494 int eventr;
495 int overflow;
496 wait_queue_head_t wait_queue;
Matthias Kaehlcke03b76122007-07-30 14:58:10 -0300497 struct mutex mtx;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700498};
Mauro Carvalho Chehab8de85942011-12-26 20:22:50 -0300499#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700500
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300501/**
502 * struct dtv_frontend_properties - contains a list of properties that are
503 * specific to a digital TV standard.
504 *
505 * @frequency: frequency in Hz for terrestrial/cable or in kHz for
506 * Satellite
507 * @modulation: Frontend modulation type
508 * @voltage: SEC voltage (only Satellite)
509 * @sectone: SEC tone mode (only Satellite)
510 * @inversion: Spectral inversion
511 * @fec_inner: Forward error correction inner Code Rate
512 * @transmission_mode: Transmission Mode
513 * @bandwidth_hz: Bandwidth, in Hz. A zero value means that userspace
514 * wants to autodetect.
515 * @guard_interval: Guard Interval
516 * @hierarchy: Hierarchy
517 * @symbol_rate: Symbol Rate
518 * @code_rate_HP: high priority stream code rate
519 * @code_rate_LP: low priority stream code rate
520 * @pilot: Enable/disable/autodetect pilot tones
521 * @rolloff: Rolloff factor (alpha)
522 * @delivery_system: FE delivery system (e. g. digital TV standard)
523 * @interleaving: interleaving
524 * @isdbt_partial_reception: ISDB-T partial reception (only ISDB standard)
525 * @isdbt_sb_mode: ISDB-T Sound Broadcast (SB) mode (only ISDB standard)
526 * @isdbt_sb_subchannel: ISDB-T SB subchannel (only ISDB standard)
527 * @isdbt_sb_segment_idx: ISDB-T SB segment index (only ISDB standard)
528 * @isdbt_sb_segment_count: ISDB-T SB segment count (only ISDB standard)
529 * @isdbt_layer_enabled: ISDB Layer enabled (only ISDB standard)
530 * @layer: ISDB per-layer data (only ISDB standard)
531 * @layer.segment_count: Segment Count;
532 * @layer.fec: per layer code rate;
533 * @layer.modulation: per layer modulation;
534 * @layer.interleaving: per layer interleaving.
535 * @stream_id: If different than zero, enable substream filtering, if
536 * hardware supports (DVB-S2 and DVB-T2).
537 * @atscmh_fic_ver: Version number of the FIC (Fast Information Channel)
538 * signaling data (only ATSC-M/H)
539 * @atscmh_parade_id: Parade identification number (only ATSC-M/H)
540 * @atscmh_nog: Number of MH groups per MH subframe for a designated
541 * parade (only ATSC-M/H)
542 * @atscmh_tnog: Total number of MH groups including all MH groups
543 * belonging to all MH parades in one MH subframe
544 * (only ATSC-M/H)
545 * @atscmh_sgn: Start group number (only ATSC-M/H)
546 * @atscmh_prc: Parade repetition cycle (only ATSC-M/H)
547 * @atscmh_rs_frame_mode: Reed Solomon (RS) frame mode (only ATSC-M/H)
548 * @atscmh_rs_frame_ensemble: RS frame ensemble (only ATSC-M/H)
549 * @atscmh_rs_code_mode_pri: RS code mode pri (only ATSC-M/H)
550 * @atscmh_rs_code_mode_sec: RS code mode sec (only ATSC-M/H)
551 * @atscmh_sccc_block_mode: Series Concatenated Convolutional Code (SCCC)
552 * Block Mode (only ATSC-M/H)
553 * @atscmh_sccc_code_mode_a: SCCC code mode A (only ATSC-M/H)
554 * @atscmh_sccc_code_mode_b: SCCC code mode B (only ATSC-M/H)
555 * @atscmh_sccc_code_mode_c: SCCC code mode C (only ATSC-M/H)
556 * @atscmh_sccc_code_mode_d: SCCC code mode D (only ATSC-M/H)
557 * @lna: Power ON/OFF/AUTO the Linear Now-noise Amplifier (LNA)
558 * @strength: DVBv5 API statistics: Signal Strength
559 * @cnr: DVBv5 API statistics: Signal to Noise ratio of the
560 * (main) carrier
561 * @pre_bit_error: DVBv5 API statistics: pre-Viterbi bit error count
562 * @pre_bit_count: DVBv5 API statistics: pre-Viterbi bit count
563 * @post_bit_error: DVBv5 API statistics: post-Viterbi bit error count
564 * @post_bit_count: DVBv5 API statistics: post-Viterbi bit count
565 * @block_error: DVBv5 API statistics: block error count
566 * @block_count: DVBv5 API statistics: block count
567 *
568 * NOTE: derivated statistics like Uncorrected Error blocks (UCE) are
569 * calculated on userspace.
570 *
571 * Only a subset of the properties are needed for a given delivery system.
572 * For more info, consult the media_api.html with the documentation of the
573 * Userspace API.
574 */
Steven Toth56f06802008-09-11 10:19:27 -0300575struct dtv_frontend_properties {
Steven Toth6b73eea2008-09-04 01:12:25 -0300576 u32 frequency;
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300577 enum fe_modulation modulation;
Steven Toth6b73eea2008-09-04 01:12:25 -0300578
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300579 enum fe_sec_voltage voltage;
580 enum fe_sec_tone_mode sectone;
581 enum fe_spectral_inversion inversion;
582 enum fe_code_rate fec_inner;
583 enum fe_transmit_mode transmission_mode;
Steven Toth75b7f942008-09-13 16:56:34 -0300584 u32 bandwidth_hz; /* 0 = AUTO */
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300585 enum fe_guard_interval guard_interval;
586 enum fe_hierarchy hierarchy;
Steven Toth6b73eea2008-09-04 01:12:25 -0300587 u32 symbol_rate;
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300588 enum fe_code_rate code_rate_HP;
589 enum fe_code_rate code_rate_LP;
Steven Toth6b73eea2008-09-04 01:12:25 -0300590
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300591 enum fe_pilot pilot;
592 enum fe_rolloff rolloff;
Steven Toth6b73eea2008-09-04 01:12:25 -0300593
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300594 enum fe_delivery_system delivery_system;
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300595
Antti Palosaari224b6642012-08-12 22:33:21 -0300596 enum fe_interleaving interleaving;
597
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300598 /* ISDB-T specifics */
599 u8 isdbt_partial_reception;
600 u8 isdbt_sb_mode;
601 u8 isdbt_sb_subchannel;
602 u32 isdbt_sb_segment_idx;
603 u32 isdbt_sb_segment_count;
604 u8 isdbt_layer_enabled;
605 struct {
606 u8 segment_count;
Mauro Carvalho Chehab0df289a2015-06-07 14:53:52 -0300607 enum fe_code_rate fec;
608 enum fe_modulation modulation;
Patrick Boettcherb6e760f2009-08-03 14:39:15 -0300609 u8 interleaving;
610 } layer[3];
HIRANO Takahito98293ef2009-09-18 11:17:54 -0300611
Evgeny Plehov287cefd2012-09-13 10:13:30 -0300612 /* Multistream specifics */
613 u32 stream_id;
Michael Krufkyca689482012-01-29 15:44:58 -0300614
615 /* ATSC-MH specifics */
616 u8 atscmh_fic_ver;
617 u8 atscmh_parade_id;
618 u8 atscmh_nog;
619 u8 atscmh_tnog;
620 u8 atscmh_sgn;
621 u8 atscmh_prc;
622
623 u8 atscmh_rs_frame_mode;
624 u8 atscmh_rs_frame_ensemble;
625 u8 atscmh_rs_code_mode_pri;
626 u8 atscmh_rs_code_mode_sec;
627 u8 atscmh_sccc_block_mode;
628 u8 atscmh_sccc_code_mode_a;
629 u8 atscmh_sccc_code_mode_b;
630 u8 atscmh_sccc_code_mode_c;
631 u8 atscmh_sccc_code_mode_d;
Antti Palosaari33eebec2012-10-03 04:28:56 -0300632
633 u32 lna;
Mauro Carvalho Chehab7cd4ece2013-01-07 15:41:35 -0300634
635 /* statistics data */
636 struct dtv_fe_stats strength;
637 struct dtv_fe_stats cnr;
638 struct dtv_fe_stats pre_bit_error;
639 struct dtv_fe_stats pre_bit_count;
640 struct dtv_fe_stats post_bit_error;
641 struct dtv_fe_stats post_bit_count;
642 struct dtv_fe_stats block_error;
643 struct dtv_fe_stats block_count;
Mauro Carvalho Chehaba3cccb22015-08-22 14:10:31 -0300644
645 /* private: */
646 /* Cache State */
647 u32 state;
648
Steven Toth6b73eea2008-09-04 01:12:25 -0300649};
650
Shuah Khan18ed2862014-07-12 13:44:12 -0300651#define DVB_FE_NO_EXIT 0
652#define DVB_FE_NORMAL_EXIT 1
653#define DVB_FE_DEVICE_REMOVED 2
Shuah Khan87cd0fa2014-07-24 13:02:14 -0300654#define DVB_FE_DEVICE_RESUME 3
Shuah Khan18ed2862014-07-12 13:44:12 -0300655
Mauro Carvalho Chehab35848bf2015-08-22 14:20:25 -0300656/**
657 * struct dvb_frontend - Frontend structure to be used on drivers.
658 *
659 * @ops: embedded struct dvb_frontend_ops
660 * @dvb: pointer to struct dvb_adapter
661 * @demodulator_priv: demod private data
662 * @tuner_priv: tuner private data
663 * @frontend_priv: frontend private data
664 * @sec_priv: SEC private data
665 * @analog_demod_priv: Analog demod private data
666 * @dtv_property_cache: embedded struct dtv_frontend_properties
667 * @callback: callback function used on some drivers to call
668 * either the tuner or the demodulator.
669 * @id: Frontend ID
670 * @exit: Used to inform the DVB core that the frontend
671 * thread should exit (usually, means that the hardware
672 * got disconnected.
673 */
674
Linus Torvalds1da177e2005-04-16 15:20:36 -0700675struct dvb_frontend {
Patrick Boettcherdea74862006-05-14 05:01:31 -0300676 struct dvb_frontend_ops ops;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700677 struct dvb_adapter *dvb;
Michael Krufky482b4982007-10-22 00:12:16 -0300678 void *demodulator_priv;
679 void *tuner_priv;
680 void *frontend_priv;
681 void *sec_priv;
682 void *analog_demod_priv;
Steven Toth56f06802008-09-11 10:19:27 -0300683 struct dtv_frontend_properties dtv_property_cache;
Michael Krufkyebb8d682008-09-10 01:39:20 -0300684#define DVB_FRONTEND_COMPONENT_TUNER 0
Antti Palosaarib748e6a2012-01-10 20:33:43 -0300685#define DVB_FRONTEND_COMPONENT_DEMOD 1
Michael Krufkyebb8d682008-09-10 01:39:20 -0300686 int (*callback)(void *adapter_priv, int component, int cmd, int arg);
Steven Toth363c35f2008-10-11 11:05:50 -0300687 int id;
Shuah Khan18ed2862014-07-12 13:44:12 -0300688 unsigned int exit;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700689};
690
Mauro Carvalho Chehab66f4b3c2015-11-10 10:46:25 -0200691/**
692 * dvb_register_frontend() - Registers a DVB frontend at the adapter
693 *
694 * @dvb: pointer to the dvb adapter
695 * @fe: pointer to the frontend struct
696 *
697 * Allocate and initialize the private data needed by the frontend core to
698 * manage the frontend and calls dvb_register_device() to register a new
699 * frontend. It also cleans the property cache that stores the frontend
700 * parameters and selects the first available delivery system.
701 */
702int dvb_register_frontend(struct dvb_adapter *dvb,
Michael Krufky482b4982007-10-22 00:12:16 -0300703 struct dvb_frontend *fe);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700704
Mauro Carvalho Chehab66f4b3c2015-11-10 10:46:25 -0200705/**
706 * dvb_unregister_frontend() - Unregisters a DVB frontend
707 *
708 * @fe: pointer to the frontend struct
709 *
710 * Stops the frontend kthread, calls dvb_unregister_device() and frees the
711 * private frontend data allocated by dvb_register_frontend().
712 *
713 * NOTE: This function doesn't frees the memory allocated by the demod,
714 * by the SEC driver and by the tuner. In order to free it, an explicit call to
715 * dvb_frontend_detach() is needed, after calling this function.
716 */
717int dvb_unregister_frontend(struct dvb_frontend *fe);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700718
Mauro Carvalho Chehab66f4b3c2015-11-10 10:46:25 -0200719/**
720 * dvb_frontend_detach() - Detaches and frees frontend specific data
721 *
722 * @fe: pointer to the frontend struct
723 *
724 * This function should be called after dvb_unregister_frontend(). It
725 * calls the SEC, tuner and demod release functions:
726 * &dvb_frontend_ops.release_sec, &dvb_frontend_ops.tuner_ops.release,
727 * &dvb_frontend_ops.analog_ops.release and &dvb_frontend_ops.release.
728 *
729 * If the driver is compiled with CONFIG_MEDIA_ATTACH, it also decreases
730 * the module reference count, needed to allow userspace to remove the
731 * previously used DVB frontend modules.
732 */
733void dvb_frontend_detach(struct dvb_frontend *fe);
Andrew de Quinceyf52a8382006-08-08 09:10:09 -0300734
Mauro Carvalho Chehab41c0b782015-11-10 11:54:15 -0200735/**
736 * dvb_frontend_suspend() - Suspends a Digital TV frontend
737 *
738 * @fe: pointer to the frontend struct
739 *
740 * This function prepares a Digital TV frontend to suspend.
741 *
742 * In order to prepare the tuner to suspend, if
743 * &dvb_frontend_ops.tuner_ops.suspend() is available, it calls it. Otherwise,
744 * it will call &dvb_frontend_ops.tuner_ops.sleep(), if available.
745 *
746 * It will also call &dvb_frontend_ops.sleep() to put the demod to suspend.
747 *
748 * The drivers should also call dvb_frontend_suspend() as part of their
749 * handler for the &device_driver.suspend().
750 */
751int dvb_frontend_suspend(struct dvb_frontend *fe);
752
753/**
754 * dvb_frontend_resume() - Resumes a Digital TV frontend
755 *
756 * @fe: pointer to the frontend struct
757 *
758 * This function resumes the usual operation of the tuner after resume.
759 *
760 * In order to resume the frontend, it calls the demod &dvb_frontend_ops.init().
761 *
762 * If &dvb_frontend_ops.tuner_ops.resume() is available, It, it calls it.
763 * Otherwise,t will call &dvb_frontend_ops.tuner_ops.init(), if available.
764 *
765 * Once tuner and demods are resumed, it will enforce that the SEC voltage and
766 * tone are restored to their previous values and wake up the frontend's
767 * kthread in order to retune the frontend.
768 *
769 * The drivers should also call dvb_frontend_resume() as part of their
770 * handler for the &device_driver.resume().
771 */
772int dvb_frontend_resume(struct dvb_frontend *fe);
Andrew de Quincey86f40cc2006-03-30 15:53:35 -0300773
Mauro Carvalho Chehab4deea4c2015-11-09 23:24:10 -0200774/**
Mauro Carvalho Chehab75f400b2015-11-10 10:26:39 -0200775 * dvb_frontend_reinitialise() - forces a reinitialisation at the frontend
776 *
777 * @fe: pointer to the frontend struct
778 *
779 * Calls &dvb_frontend_ops.init() and &dvb_frontend_ops.tuner_ops.init(),
780 * and resets SEC tone and voltage (for Satellite systems).
781 *
782 * NOTE: Currently, this function is used only by one driver (budget-av).
783 * It seems to be due to address some special issue with that specific
784 * frontend.
785 */
786void dvb_frontend_reinitialise(struct dvb_frontend *fe);
787
788/**
Mauro Carvalho Chehab4deea4c2015-11-09 23:24:10 -0200789 * dvb_frontend_sleep_until() - Sleep for the amount of time given by
790 * add_usec parameter
791 *
792 * @waketime: pointer to a struct ktime_t
793 * @add_usec: time to sleep, in microseconds
794 *
795 * This function is used to measure the time required for the
796 * %FE_DISHNETWORK_SEND_LEGACY_CMD ioctl to work. It needs to be as precise
797 * as possible, as it affects the detection of the dish tone command at the
798 * satellite subsystem.
799 *
800 * Its used internally by the DVB frontend core, in order to emulate
801 * %FE_DISHNETWORK_SEND_LEGACY_CMD using the &dvb_frontend_ops.set_voltage()
802 * callback.
803 *
804 * NOTE: it should not be used at the drivers, as the emulation for the
805 * legacy callback is provided by the Kernel. The only situation where this
806 * should be at the drivers is when there are some bugs at the hardware that
807 * would prevent the core emulation to work. On such cases, the driver would
808 * be writing a &dvb_frontend_ops.dishnetwork_send_legacy_command() and
809 * calling this function directly.
810 */
811void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);
NooneImportant83b75b02005-11-08 21:35:27 -0800812
Linus Torvalds1da177e2005-04-16 15:20:36 -0700813#endif