4 * Copyright (C) 2001 Ralph Metzler for convergence integrated media GmbH
5 * overhauled by Holger Waechtler for Convergence GmbH
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation; either version 2.1
11 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #ifndef _DVB_FRONTEND_H_
26 #define _DVB_FRONTEND_H_
28 #include <linux/types.h>
29 #include <linux/sched.h>
30 #include <linux/ioctl.h>
31 #include <linux/i2c.h>
32 #include <linux/module.h>
33 #include <linux/errno.h>
35 #include <linux/dvb/frontend.h>
44 * when before_ioctl is registered and returns value 0, ioctl and after_ioctl
49 int (*before_ioctl) (struct dvb_frontend *frontend, unsigned int cmd, void *arg);
50 int (*ioctl) (struct dvb_frontend *frontend, unsigned int cmd, void *arg);
51 int (*after_ioctl) (struct dvb_frontend *frontend, unsigned int cmd, void *arg);
52 void (*notifier_callback) (fe_status_t s, void *data);
53 struct dvb_i2c_bus *i2c;
54 void *before_after_data; /* can be used by hardware module... */
55 void *notifier_data; /* can be used by hardware module... */
56 void *data; /* can be used by hardware module... */
59 struct dvb_frontend_tune_settings {
63 struct dvb_frontend_parameters parameters;
68 * private frontend command ioctl's.
69 * keep them in sync with the public ones defined in linux/dvb/frontend.h
71 * FE_SLEEP. Ioctl used to put frontend into a low power mode.
72 * FE_INIT. Ioctl used to initialise the frontend.
73 * FE_GET_TUNE_SETTINGS. Get the frontend-specific tuning loop settings for the supplied set of parameters.
75 #define FE_SLEEP _IO('v', 80)
76 #define FE_INIT _IO('v', 81)
77 #define FE_GET_TUNE_SETTINGS _IOWR('v', 83, struct dvb_frontend_tune_settings)
81 dvb_register_frontend (int (*ioctl) (struct dvb_frontend *frontend,
82 unsigned int cmd, void *arg),
83 struct dvb_i2c_bus *i2c,
85 struct dvb_frontend_info *info);
88 dvb_unregister_frontend (int (*ioctl) (struct dvb_frontend *frontend,
89 unsigned int cmd, void *arg),
90 struct dvb_i2c_bus *i2c);
94 * Add special ioctl code performed before and after the main ioctl
95 * to all frontend devices on the specified DVB adapter.
96 * This is necessairy because the 22kHz/13V-18V/DiSEqC stuff depends
97 * heavily on the hardware around the frontend, the same tuner can create
98 * these signals on about a million different ways...
100 * Return value: number of frontends where the ioctl's were applied.
103 dvb_add_frontend_ioctls (struct dvb_adapter *adapter,
104 int (*before_ioctl) (struct dvb_frontend *frontend,
105 unsigned int cmd, void *arg),
106 int (*after_ioctl) (struct dvb_frontend *frontend,
107 unsigned int cmd, void *arg),
108 void *before_after_data);
112 dvb_remove_frontend_ioctls (struct dvb_adapter *adapter,
113 int (*before_ioctl) (struct dvb_frontend *frontend,
114 unsigned int cmd, void *arg),
115 int (*after_ioctl) (struct dvb_frontend *frontend,
116 unsigned int cmd, void *arg));
119 dvb_add_frontend_notifier (struct dvb_adapter *adapter,
120 void (*callback) (fe_status_t s, void *data),
123 dvb_remove_frontend_notifier (struct dvb_adapter *adapter,
124 void (*callback) (fe_status_t s, void *data));