Path: blob/master/drivers/media/dvb/dvb-usb/dibusb.h
15112 views
/* Header file for all dibusb-based-receivers.1*2* Copyright (C) 2004-5 Patrick Boettcher ([email protected])3*4* This program is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License as published by the Free6* Software Foundation, version 2.7*8* see Documentation/dvb/README.dvb-usb for more information9*/10#ifndef _DVB_USB_DIBUSB_H_11#define _DVB_USB_DIBUSB_H_1213#ifndef DVB_USB_LOG_PREFIX14#define DVB_USB_LOG_PREFIX "dibusb"15#endif16#include "dvb-usb.h"1718#include "dib3000.h"19#include "dib3000mc.h"20#include "mt2060.h"2122/*23* protocol of all dibusb related devices24*/2526/*27* bulk msg to/from endpoint 0x0128*29* general structure:30* request_byte parameter_bytes31*/3233#define DIBUSB_REQ_START_READ 0x0034#define DIBUSB_REQ_START_DEMOD 0x013536/*37* i2c read38* bulk write: 0x02 ((7bit i2c_addr << 1) & 0x01) register_bytes length_word39* bulk read: byte_buffer (length_word bytes)40*/41#define DIBUSB_REQ_I2C_READ 0x024243/*44* i2c write45* bulk write: 0x03 (7bit i2c_addr << 1) register_bytes value_bytes46*/47#define DIBUSB_REQ_I2C_WRITE 0x034849/*50* polling the value of the remote control51* bulk write: 0x0452* bulk read: byte_buffer (5 bytes)53*/54#define DIBUSB_REQ_POLL_REMOTE 0x045556/* additional status values for Hauppauge Remote Control Protocol */57#define DIBUSB_RC_HAUPPAUGE_KEY_PRESSED 0x0158#define DIBUSB_RC_HAUPPAUGE_KEY_EMPTY 0x035960/* streaming mode:61* bulk write: 0x05 mode_byte62*63* mode_byte is mostly 0x0064*/65#define DIBUSB_REQ_SET_STREAMING_MODE 0x056667/* interrupt the internal read loop, when blocking */68#define DIBUSB_REQ_INTR_READ 0x066970/* io control71* 0x07 cmd_byte param_bytes72*73* param_bytes can be up to 32 bytes74*75* cmd_byte function parameter name76* 0x00 power mode77* 0x00 sleep78* 0x01 wakeup79*80* 0x01 enable streaming81* 0x02 disable streaming82*83*84*/85#define DIBUSB_REQ_SET_IOCTL 0x078687/* IOCTL commands */8889/* change the power mode in firmware */90#define DIBUSB_IOCTL_CMD_POWER_MODE 0x0091#define DIBUSB_IOCTL_POWER_SLEEP 0x0092#define DIBUSB_IOCTL_POWER_WAKEUP 0x019394/* modify streaming of the FX2 */95#define DIBUSB_IOCTL_CMD_ENABLE_STREAM 0x0196#define DIBUSB_IOCTL_CMD_DISABLE_STREAM 0x029798struct dibusb_state {99struct dib_fe_xfer_ops ops;100int mt2060_present;101u8 tuner_addr;102};103104struct dibusb_device_state {105/* for RC5 remote control */106int old_toggle;107int last_repeat_count;108};109110extern struct i2c_algorithm dibusb_i2c_algo;111112extern int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *);113extern int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *);114115extern int dibusb_streaming_ctrl(struct dvb_usb_adapter *, int);116extern int dibusb_pid_filter(struct dvb_usb_adapter *, int, u16, int);117extern int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *, int);118extern int dibusb2_0_streaming_ctrl(struct dvb_usb_adapter *, int);119120extern int dibusb_power_ctrl(struct dvb_usb_device *, int);121extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int);122123#define DEFAULT_RC_INTERVAL 150124//#define DEFAULT_RC_INTERVAL 100000125126extern struct rc_map_table rc_map_dibusb_table[];127extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *);128extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *);129130#endif131132133