blob: cda3adea24fb2fdf121cbc3053f7aaaf1f720a63 [file] [log] [blame]
Patrick Boettcherb7f54912006-09-19 12:51:37 -03001/* Linux driver for devices based on the DiBcom DiB0700 USB bridge
2 *
3 * This program is free software; you can redistribute it and/or modify it
4 * under the terms of the GNU General Public License as published by the Free
5 * Software Foundation, version 2.
6 *
7 * Copyright (C) 2005-6 DiBcom, SA
8 */
9#ifndef _DIB0700_H_
10#define _DIB0700_H_
11
12#define DVB_USB_LOG_PREFIX "dib0700"
13#include "dvb-usb.h"
14
15#include "dib07x0.h"
16
17extern int dvb_usb_dib0700_debug;
18#define deb_info(args...) dprintk(dvb_usb_dib0700_debug,0x01,args)
19#define deb_fw(args...) dprintk(dvb_usb_dib0700_debug,0x02,args)
20#define deb_fwdata(args...) dprintk(dvb_usb_dib0700_debug,0x04,args)
21#define deb_data(args...) dprintk(dvb_usb_dib0700_debug,0x08,args)
22
23#define REQUEST_I2C_READ 0x2
24#define REQUEST_I2C_WRITE 0x3
25#define REQUEST_POLL_RC 0x4
26#define REQUEST_JUMPRAM 0x8
Patrick Boettchera75763f2006-10-18 08:34:16 -030027#define REQUEST_SET_CLOCK 0xB
Patrick Boettcherb7f54912006-09-19 12:51:37 -030028#define REQUEST_SET_GPIO 0xC
29#define REQUEST_ENABLE_VIDEO 0xF
30 // 1 Byte: 4MSB(1 = enable streaming, 0 = disable streaming) 4LSB(Video Mode: 0 = MPEG2 188Bytes, 1 = Analog)
31 // 2 Byte: MPEG2 mode: 4MSB(1 = Master Mode, 0 = Slave Mode) 4LSB(Channel 1 = bit0, Channel 2 = bit1)
32 // 2 Byte: Analog mode: 4MSB(0 = 625 lines, 1 = 525 lines) 4LSB( " " )
Patrick Boettchera75763f2006-10-18 08:34:16 -030033#define REQUEST_GET_VERSION 0x15
Patrick Boettcherb7f54912006-09-19 12:51:37 -030034
35struct dib0700_state {
36 u8 channel_state;
Patrick Boettcher6958eff2006-09-19 12:51:40 -030037 u16 mt2060_if1[2];
Patrick Boettchera75763f2006-10-18 08:34:16 -030038
39 u8 is_dib7000pc;
Patrick Boettcherb7f54912006-09-19 12:51:37 -030040};
41
42extern int dib0700_set_gpio(struct dvb_usb_device *, enum dib07x0_gpios gpio, u8 gpio_dir, u8 gpio_val);
Patrick Boettchera75763f2006-10-18 08:34:16 -030043extern int dib0700_ctrl_clock(struct dvb_usb_device *d, u32 clk_MHz, u8 clock_out_gp3);
Patrick Boettcherb7f54912006-09-19 12:51:37 -030044extern int dib0700_download_firmware(struct usb_device *udev, const struct firmware *fw);
45extern int dib0700_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff);
46extern struct i2c_algorithm dib0700_i2c_algo;
Patrick Boettcher6958eff2006-09-19 12:51:40 -030047extern int dib0700_identify_state(struct usb_device *udev, struct dvb_usb_device_properties *props,
48 struct dvb_usb_device_description **desc, int *cold);
Patrick Boettcherb7f54912006-09-19 12:51:37 -030049
50extern int dib0700_device_count;
51extern struct dvb_usb_device_properties dib0700_devices[];
52extern struct usb_device_id dib0700_usb_id_table[];
53
54#endif