]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - drivers/media/firewire/firedtv.h
Merge remote-tracking branches 'asoc/fix/rt5659', 'asoc/fix/sigmadsp', 'asoc/fix...
[mirror_ubuntu-artful-kernel.git] / drivers / media / firewire / firedtv.h
CommitLineData
df4846c3 1/*
612262a5 2 * FireDTV driver (formerly known as FireSAT)
df4846c3 3 *
612262a5
SR
4 * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
5 * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
df4846c3
HK
6 *
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.
11 */
12
612262a5
SR
13#ifndef _FIREDTV_H
14#define _FIREDTV_H
c81c8b68 15
b2409b65 16#include <linux/time.h>
c81c8b68 17#include <linux/dvb/dmx.h>
612262a5
SR
18#include <linux/dvb/frontend.h>
19#include <linux/list.h>
87918334 20#include <linux/mod_devicetable.h>
612262a5
SR
21#include <linux/mutex.h>
22#include <linux/spinlock_types.h>
23#include <linux/types.h>
24#include <linux/wait.h>
25#include <linux/workqueue.h>
612262a5
SR
26
27#include <demux.h>
28#include <dmxdev.h>
29#include <dvb_demux.h>
8ae83cdf 30#include <dvb_frontend.h>
612262a5
SR
31#include <dvb_net.h>
32#include <dvbdev.h>
df4846c3 33
15490795
SR
34struct firedtv_tuner_status {
35 unsigned active_system:8;
36 unsigned searching:1;
37 unsigned moving:1;
38 unsigned no_rf:1;
39 unsigned input:1;
40 unsigned selected_antenna:7;
41 unsigned ber:32;
42 unsigned signal_strength:8;
43 unsigned raster_frequency:2;
44 unsigned rf_frequency:22;
45 unsigned man_dep_info_length:8;
46 unsigned front_end_error:1;
47 unsigned antenna_error:1;
48 unsigned front_end_power_status:1;
49 unsigned power_supply:1;
50 unsigned carrier_noise_ratio:16;
51 unsigned power_supply_voltage:8;
52 unsigned antenna_voltage:8;
53 unsigned firewire_bus_voltage:8;
54 unsigned ca_mmi:1;
55 unsigned ca_pmt_reply:1;
56 unsigned ca_date_time_request:1;
57 unsigned ca_application_info:1;
58 unsigned ca_module_present_status:1;
59 unsigned ca_dvb_flag:1;
60 unsigned ca_error_flag:1;
61 unsigned ca_initialization_status:1;
62};
c81c8b68
GKH
63
64enum model_type {
a70f81c1
R
65 FIREDTV_UNKNOWN = 0,
66 FIREDTV_DVB_S = 1,
67 FIREDTV_DVB_C = 2,
68 FIREDTV_DVB_T = 3,
69 FIREDTV_DVB_S2 = 4,
c81c8b68
GKH
70};
71
15490795 72struct device;
8ae83cdf 73struct input_dev;
92374e88 74struct fdtv_ir_context;
612262a5 75
a70f81c1 76struct firedtv {
15490795
SR
77 struct device *device;
78 struct list_head list;
79
8ae83cdf
SR
80 struct dvb_adapter adapter;
81 struct dmxdev dmxdev;
82 struct dvb_demux demux;
83 struct dmx_frontend frontend;
84 struct dvb_net dvbnet;
85 struct dvb_frontend fe;
86
87 struct dvb_device *cadev;
88 int ca_last_command;
89 int ca_time_interval;
90
91 struct mutex avc_mutex;
92 wait_queue_head_t avc_wait;
93 bool avc_reply_received;
94 struct work_struct remote_ctrl_work;
95 struct input_dev *remote_ctrl_dev;
c81c8b68 96
15490795
SR
97 enum model_type type;
98 char subunit;
f2dd851f 99 s8 isochannel;
92374e88
SR
100 struct fdtv_ir_context *ir_context;
101
0df289a2
MCC
102 enum fe_sec_voltage voltage;
103 enum fe_sec_tone_mode tone;
c81c8b68 104
15490795
SR
105 struct mutex demux_mutex;
106 unsigned long channel_active;
107 u16 channel_pid[16];
8ae83cdf 108
3fb80ef3
SR
109 int avc_data_length;
110 u8 avc_data[512];
df4846c3
HK
111};
112
15490795
SR
113/* firedtv-avc.c */
114int avc_recv(struct firedtv *fdtv, void *data, size_t length);
115int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
e11eb288
MCC
116struct dtv_frontend_properties;
117int avc_tuner_dsd(struct firedtv *fdtv, struct dtv_frontend_properties *params);
15490795
SR
118int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
119int avc_tuner_get_ts(struct firedtv *fdtv);
120int avc_identify_subunit(struct firedtv *fdtv);
121struct dvb_diseqc_master_cmd;
122int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
123 char conttone, char nrdiseq,
124 struct dvb_diseqc_master_cmd *diseqcmd);
125void avc_remote_ctrl_work(struct work_struct *work);
126int avc_register_remote_control(struct firedtv *fdtv);
127int avc_ca_app_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
128int avc_ca_info(struct firedtv *fdtv, char *app_info, unsigned int *len);
129int avc_ca_reset(struct firedtv *fdtv);
130int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
131int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
132int avc_ca_enter_menu(struct firedtv *fdtv);
133int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
134int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
135void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
136
137/* firedtv-ci.c */
138int fdtv_ca_register(struct firedtv *fdtv);
139void fdtv_ca_release(struct firedtv *fdtv);
612262a5 140
a70f81c1
R
141/* firedtv-dvb.c */
142int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
143int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
92374e88 144int fdtv_dvb_register(struct firedtv *fdtv, const char *name);
15490795 145void fdtv_dvb_unregister(struct firedtv *fdtv);
c81c8b68 146
a70f81c1 147/* firedtv-fe.c */
92374e88 148void fdtv_frontend_init(struct firedtv *fdtv, const char *name);
c81c8b68 149
87918334 150/* firedtv-fw.c */
92374e88
SR
151int fdtv_lock(struct firedtv *fdtv, u64 addr, void *data);
152int fdtv_read(struct firedtv *fdtv, u64 addr, void *data);
153int fdtv_write(struct firedtv *fdtv, u64 addr, void *data, size_t len);
154int fdtv_start_iso(struct firedtv *fdtv);
155void fdtv_stop_iso(struct firedtv *fdtv);
87918334 156
15490795
SR
157/* firedtv-rc.c */
158#ifdef CONFIG_DVB_FIREDTV_INPUT
159int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
160void fdtv_unregister_rc(struct firedtv *fdtv);
161void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
162#else
163static inline int fdtv_register_rc(struct firedtv *fdtv,
164 struct device *dev) { return 0; }
165static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
166static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
167#endif
c81c8b68 168
612262a5 169#endif /* _FIREDTV_H */