Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003  * FireDTV driver (formerly known as FireSAT)
0004  *
0005  * Copyright (C) 2004 Andreas Monitzer <andy@monitzer.com>
0006  * Copyright (C) 2008 Henrik Kurelid <henrik@kurelid.se>
0007  */
0008 
0009 #ifndef _FIREDTV_H
0010 #define _FIREDTV_H
0011 
0012 #include <linux/time.h>
0013 #include <linux/dvb/dmx.h>
0014 #include <linux/dvb/frontend.h>
0015 #include <linux/list.h>
0016 #include <linux/mod_devicetable.h>
0017 #include <linux/mutex.h>
0018 #include <linux/spinlock_types.h>
0019 #include <linux/types.h>
0020 #include <linux/wait.h>
0021 #include <linux/workqueue.h>
0022 
0023 #include <media/demux.h>
0024 #include <media/dmxdev.h>
0025 #include <media/dvb_demux.h>
0026 #include <media/dvb_frontend.h>
0027 #include <media/dvb_net.h>
0028 #include <media/dvbdev.h>
0029 
0030 struct firedtv_tuner_status {
0031     unsigned active_system:8;
0032     unsigned searching:1;
0033     unsigned moving:1;
0034     unsigned no_rf:1;
0035     unsigned input:1;
0036     unsigned selected_antenna:7;
0037     unsigned ber:32;
0038     unsigned signal_strength:8;
0039     unsigned raster_frequency:2;
0040     unsigned rf_frequency:22;
0041     unsigned man_dep_info_length:8;
0042     unsigned front_end_error:1;
0043     unsigned antenna_error:1;
0044     unsigned front_end_power_status:1;
0045     unsigned power_supply:1;
0046     unsigned carrier_noise_ratio:16;
0047     unsigned power_supply_voltage:8;
0048     unsigned antenna_voltage:8;
0049     unsigned firewire_bus_voltage:8;
0050     unsigned ca_mmi:1;
0051     unsigned ca_pmt_reply:1;
0052     unsigned ca_date_time_request:1;
0053     unsigned ca_application_info:1;
0054     unsigned ca_module_present_status:1;
0055     unsigned ca_dvb_flag:1;
0056     unsigned ca_error_flag:1;
0057     unsigned ca_initialization_status:1;
0058 };
0059 
0060 enum model_type {
0061     FIREDTV_UNKNOWN = 0,
0062     FIREDTV_DVB_S   = 1,
0063     FIREDTV_DVB_C   = 2,
0064     FIREDTV_DVB_T   = 3,
0065     FIREDTV_DVB_S2  = 4,
0066 };
0067 
0068 struct device;
0069 struct input_dev;
0070 struct fdtv_ir_context;
0071 
0072 struct firedtv {
0073     struct device *device;
0074     struct list_head list;
0075 
0076     struct dvb_adapter  adapter;
0077     struct dmxdev       dmxdev;
0078     struct dvb_demux    demux;
0079     struct dmx_frontend frontend;
0080     struct dvb_net      dvbnet;
0081     struct dvb_frontend fe;
0082 
0083     struct dvb_device   *cadev;
0084     int         ca_last_command;
0085     int         ca_time_interval;
0086 
0087     struct mutex        avc_mutex;
0088     wait_queue_head_t   avc_wait;
0089     bool            avc_reply_received;
0090     struct work_struct  remote_ctrl_work;
0091     struct input_dev    *remote_ctrl_dev;
0092 
0093     enum model_type     type;
0094     char            subunit;
0095     s8          isochannel;
0096     struct fdtv_ir_context  *ir_context;
0097 
0098     enum fe_sec_voltage voltage;
0099     enum fe_sec_tone_mode   tone;
0100 
0101     struct mutex        demux_mutex;
0102     unsigned long       channel_active;
0103     u16         channel_pid[16];
0104 
0105     int         avc_data_length;
0106     u8          avc_data[512];
0107 };
0108 
0109 /* firedtv-avc.c */
0110 int avc_recv(struct firedtv *fdtv, void *data, size_t length);
0111 int avc_tuner_status(struct firedtv *fdtv, struct firedtv_tuner_status *stat);
0112 struct dtv_frontend_properties;
0113 int avc_tuner_dsd(struct firedtv *fdtv, struct dtv_frontend_properties *params);
0114 int avc_tuner_set_pids(struct firedtv *fdtv, unsigned char pidc, u16 pid[]);
0115 int avc_tuner_get_ts(struct firedtv *fdtv);
0116 int avc_identify_subunit(struct firedtv *fdtv);
0117 struct dvb_diseqc_master_cmd;
0118 int avc_lnb_control(struct firedtv *fdtv, char voltage, char burst,
0119             char conttone, char nrdiseq,
0120             struct dvb_diseqc_master_cmd *diseqcmd);
0121 void avc_remote_ctrl_work(struct work_struct *work);
0122 int avc_register_remote_control(struct firedtv *fdtv);
0123 int avc_ca_app_info(struct firedtv *fdtv, unsigned char *app_info,
0124             unsigned int *len);
0125 int avc_ca_info(struct firedtv *fdtv, unsigned char *app_info,
0126         unsigned int *len);
0127 int avc_ca_reset(struct firedtv *fdtv);
0128 int avc_ca_pmt(struct firedtv *fdtv, char *app_info, int length);
0129 int avc_ca_get_time_date(struct firedtv *fdtv, int *interval);
0130 int avc_ca_enter_menu(struct firedtv *fdtv);
0131 int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len);
0132 int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel);
0133 void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel);
0134 
0135 /* firedtv-ci.c */
0136 int fdtv_ca_register(struct firedtv *fdtv);
0137 void fdtv_ca_release(struct firedtv *fdtv);
0138 
0139 /* firedtv-dvb.c */
0140 int fdtv_start_feed(struct dvb_demux_feed *dvbdmxfeed);
0141 int fdtv_stop_feed(struct dvb_demux_feed *dvbdmxfeed);
0142 int fdtv_dvb_register(struct firedtv *fdtv, const char *name);
0143 void fdtv_dvb_unregister(struct firedtv *fdtv);
0144 
0145 /* firedtv-fe.c */
0146 void fdtv_frontend_init(struct firedtv *fdtv, const char *name);
0147 
0148 /* firedtv-fw.c */
0149 int fdtv_lock(struct firedtv *fdtv, u64 addr, void *data);
0150 int fdtv_read(struct firedtv *fdtv, u64 addr, void *data);
0151 int fdtv_write(struct firedtv *fdtv, u64 addr, void *data, size_t len);
0152 int fdtv_start_iso(struct firedtv *fdtv);
0153 void fdtv_stop_iso(struct firedtv *fdtv);
0154 
0155 /* firedtv-rc.c */
0156 #ifdef CONFIG_DVB_FIREDTV_INPUT
0157 int fdtv_register_rc(struct firedtv *fdtv, struct device *dev);
0158 void fdtv_unregister_rc(struct firedtv *fdtv);
0159 void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code);
0160 #else
0161 static inline int fdtv_register_rc(struct firedtv *fdtv,
0162                    struct device *dev) { return 0; }
0163 static inline void fdtv_unregister_rc(struct firedtv *fdtv) {}
0164 static inline void fdtv_handle_rc(struct firedtv *fdtv, unsigned int code) {}
0165 #endif
0166 
0167 #endif /* _FIREDTV_H */