2 * FireDTV driver (formerly known as FireSAT)
4 * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
5 * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
16 #include <linux/dvb/dmx.h>
17 #include <linux/dvb/frontend.h>
18 #include <linux/list.h>
19 #include <linux/mod_devicetable.h>
20 #include <linux/mutex.h>
21 #include <linux/spinlock_types.h>
22 #include <linux/types.h>
23 #include <linux/wait.h>
24 #include <linux/workqueue.h>
28 #include <dvb_demux.h>
29 #include <dvb_frontend.h>
33 struct firedtv_tuner_status {
34 unsigned active_system:8;
39 unsigned selected_antenna:7;
41 unsigned signal_strength:8;
42 unsigned raster_frequency:2;
43 unsigned rf_frequency:22;
44 unsigned man_dep_info_length:8;
45 unsigned front_end_error:1;
46 unsigned antenna_error:1;
47 unsigned front_end_power_status:1;
48 unsigned power_supply:1;
49 unsigned carrier_noise_ratio:16;
50 unsigned power_supply_voltage:8;
51 unsigned antenna_voltage:8;
52 unsigned firewire_bus_voltage:8;
54 unsigned ca_pmt_reply:1;
55 unsigned ca_date_time_request:1;
56 unsigned ca_application_info:1;
57 unsigned ca_module_present_status:1;
58 unsigned ca_dvb_flag:1;
59 unsigned ca_error_flag:1;
60 unsigned ca_initialization_status:1;
75 struct firedtv_backend {
76 int (*lock)(struct firedtv *fdtv, u64 addr, void *data);
77 int (*read)(struct firedtv *fdtv, u64 addr, void *data);
78 int (*write)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
79 int (*start_iso)(struct firedtv *fdtv);
80 void (*stop_iso)(struct firedtv *fdtv);
84 struct device *device;
85 struct list_head list;
87 struct dvb_adapter adapter;
89 struct dvb_demux demux;
90 struct dmx_frontend frontend;
91 struct dvb_net dvbnet;
92 struct dvb_frontend fe;
94 struct dvb_device *cadev;
98 struct mutex avc_mutex;
99 wait_queue_head_t avc_wait;
100 bool avc_reply_received;
101 struct work_struct remote_ctrl_work;
102 struct input_dev *remote_ctrl_dev;
104 enum model_type type;
107 fe_sec_voltage_t voltage;
108 fe_sec_tone_mode_t tone;
110 const struct firedtv_backend *backend;
113 struct mutex demux_mutex;
114 unsigned long channel_active;
122 int avc_recv(struct firedtv *fdtv, void *data, size_t length);
123 int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
124 struct dvb_frontend_parameters;
125 int avc_tuner_dsd(struct firedtv *fdtv, struct dvb_frontend_parameters *params);
126 int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
127 int avc_tuner_get_ts(struct firedtv *fdtv);
128 int avc_identify_subunit(struct firedtv *fdtv);
129 struct dvb_diseqc_master_cmd;
130 int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
131 char conttone, char nrdiseq,
132 struct dvb_diseqc_master_cmd *diseqcmd);
133 void avc_remote_ctrl_work(struct work_struct *work);
134 int avc_register_remote_control(struct firedtv *fdtv);
135 int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
136 int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
137 int avc_ca_reset(struct firedtv *fdtv);
138 int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
139 int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
140 int avc_ca_enter_menu(struct firedtv *fdtv);
141 int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
142 int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
143 void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
146 int fdtv_ca_register(struct firedtv *fdtv);
147 void fdtv_ca_release(struct firedtv *fdtv);
150 int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
151 int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
152 int fdtv_dvb_register(struct firedtv *fdtv);
153 void fdtv_dvb_unregister(struct firedtv *fdtv);
154 struct firedtv *fdtv_alloc(struct device *dev,
155 const struct firedtv_backend *backend,
156 const char *name, size_t name_len);
157 extern const char *fdtv_model_names[];
158 extern const struct ieee1394_device_id fdtv_id_table[];
161 void fdtv_frontend_init(struct firedtv *fdtv);
164 int fdtv_fw_init(void);
165 void fdtv_fw_exit(void);
168 #ifdef CONFIG_DVB_FIREDTV_INPUT
169 int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
170 void fdtv_unregister_rc(struct firedtv *fdtv);
171 void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
173 static inline int fdtv_register_rc(struct firedtv *fdtv,
174 struct device *dev) { return 0; }
175 static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
176 static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
179 #endif /* _FIREDTV_H */