brintos

brintos / linux-shallow public Read only

0
0
Text · 3.2 KiB · f61de07 Raw
132 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/* Header file for all dibusb-based-receivers.3 *4 * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de)5 *6 * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information7 */8#ifndef _DVB_USB_DIBUSB_H_9#define _DVB_USB_DIBUSB_H_10 11#ifndef DVB_USB_LOG_PREFIX12 #define DVB_USB_LOG_PREFIX "dibusb"13#endif14#include "dvb-usb.h"15 16#include "dib3000.h"17#include "dib3000mc.h"18#include "mt2060.h"19 20/*21 * protocol of all dibusb related devices22 */23 24/*25 * bulk msg to/from endpoint 0x0126 *27 * general structure:28 * request_byte parameter_bytes29 */30 31#define DIBUSB_REQ_START_READ			0x0032#define DIBUSB_REQ_START_DEMOD			0x0133 34/*35 * i2c read36 * bulk write: 0x02 ((7bit i2c_addr << 1) | 0x01) register_bytes length_word37 * bulk read:  byte_buffer (length_word bytes)38 */39#define DIBUSB_REQ_I2C_READ			0x0240 41/*42 * i2c write43 * bulk write: 0x03 (7bit i2c_addr << 1) register_bytes value_bytes44 */45#define DIBUSB_REQ_I2C_WRITE			0x0346 47/*48 * polling the value of the remote control49 * bulk write: 0x0450 * bulk read:  byte_buffer (5 bytes)51 */52#define DIBUSB_REQ_POLL_REMOTE       0x0453 54/* additional status values for Hauppauge Remote Control Protocol */55#define DIBUSB_RC_HAUPPAUGE_KEY_PRESSED	0x0156#define DIBUSB_RC_HAUPPAUGE_KEY_EMPTY	0x0357 58/* streaming mode:59 * bulk write: 0x05 mode_byte60 *61 * mode_byte is mostly 0x0062 */63#define DIBUSB_REQ_SET_STREAMING_MODE	0x0564 65/* interrupt the internal read loop, when blocking */66#define DIBUSB_REQ_INTR_READ			0x0667 68/* io control69 * 0x07 cmd_byte param_bytes70 *71 * param_bytes can be up to 32 bytes72 *73 * cmd_byte function    parameter name74 * 0x00     power mode75 *                      0x00      sleep76 *                      0x01      wakeup77 *78 * 0x01     enable streaming79 * 0x02     disable streaming80 *81 *82 */83#define DIBUSB_REQ_SET_IOCTL			0x0784 85/* IOCTL commands */86 87/* change the power mode in firmware */88#define DIBUSB_IOCTL_CMD_POWER_MODE		0x0089#define DIBUSB_IOCTL_POWER_SLEEP			0x0090#define DIBUSB_IOCTL_POWER_WAKEUP			0x0191 92/* modify streaming of the FX2 */93#define DIBUSB_IOCTL_CMD_ENABLE_STREAM	0x0194#define DIBUSB_IOCTL_CMD_DISABLE_STREAM	0x0295 96/* Max transfer size done by I2C transfer functions */97#define MAX_XFER_SIZE  6498 99struct dibusb_state {100	struct dib_fe_xfer_ops ops;101	int mt2060_present;102	u8 tuner_addr;103};104 105struct dibusb_device_state {106	/* for RC5 remote control */107	int old_toggle;108	int last_repeat_count;109};110 111extern struct i2c_algorithm dibusb_i2c_algo;112 113extern int dibusb_dib3000mc_frontend_attach(struct dvb_usb_adapter *);114extern int dibusb_dib3000mc_tuner_attach (struct dvb_usb_adapter *);115 116extern int dibusb_streaming_ctrl(struct dvb_usb_adapter *, int);117extern int dibusb_pid_filter(struct dvb_usb_adapter *, int, u16, int);118extern int dibusb_pid_filter_ctrl(struct dvb_usb_adapter *, int);119extern int dibusb2_0_streaming_ctrl(struct dvb_usb_adapter *, int);120 121extern int dibusb_power_ctrl(struct dvb_usb_device *, int);122extern int dibusb2_0_power_ctrl(struct dvb_usb_device *, int);123 124#define DEFAULT_RC_INTERVAL 150125//#define DEFAULT_RC_INTERVAL 100000126 127extern struct rc_map_table rc_map_dibusb_table[];128extern int dibusb_rc_query(struct dvb_usb_device *, u32 *, int *);129extern int dibusb_read_eeprom_byte(struct dvb_usb_device *, u8, u8 *);130 131#endif132