18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */ 28c2ecf20Sopenharmony_ci/* Common header-file of the Linux driver for the TwinhanDTV Alpha/MagicBoxII 38c2ecf20Sopenharmony_ci * USB2.0 DVB-T receiver. 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (C) 2004-5 Patrick Boettcher (patrick.boettcher@posteo.de) 68c2ecf20Sopenharmony_ci * 78c2ecf20Sopenharmony_ci * Thanks to Twinhan who kindly provided hardware and information. 88c2ecf20Sopenharmony_ci * 98c2ecf20Sopenharmony_ci * see Documentation/driver-api/media/drivers/dvb-usb.rst for more information 108c2ecf20Sopenharmony_ci */ 118c2ecf20Sopenharmony_ci#ifndef _DVB_USB_VP7045_H_ 128c2ecf20Sopenharmony_ci#define _DVB_USB_VP7045_H_ 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#define DVB_USB_LOG_PREFIX "vp7045" 158c2ecf20Sopenharmony_ci#include "dvb-usb.h" 168c2ecf20Sopenharmony_ci 178c2ecf20Sopenharmony_ci/* vp7045 commands */ 188c2ecf20Sopenharmony_ci 198c2ecf20Sopenharmony_ci/* Twinhan Vendor requests */ 208c2ecf20Sopenharmony_ci#define TH_COMMAND_IN 0xC0 218c2ecf20Sopenharmony_ci#define TH_COMMAND_OUT 0xC1 228c2ecf20Sopenharmony_ci 238c2ecf20Sopenharmony_ci/* command bytes */ 248c2ecf20Sopenharmony_ci#define TUNER_REG_READ 0x03 258c2ecf20Sopenharmony_ci#define TUNER_REG_WRITE 0x04 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci#define RC_VAL_READ 0x05 288c2ecf20Sopenharmony_ci #define RC_NO_KEY 0x44 298c2ecf20Sopenharmony_ci 308c2ecf20Sopenharmony_ci#define SET_TUNER_POWER 0x06 318c2ecf20Sopenharmony_ci#define CHECK_TUNER_POWER 0x12 328c2ecf20Sopenharmony_ci #define Tuner_Power_ON 1 338c2ecf20Sopenharmony_ci #define Tuner_Power_OFF 0 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci#define GET_USB_SPEED 0x07 368c2ecf20Sopenharmony_ci 378c2ecf20Sopenharmony_ci#define LOCK_TUNER_COMMAND 0x09 388c2ecf20Sopenharmony_ci 398c2ecf20Sopenharmony_ci#define TUNER_SIGNAL_READ 0x0A 408c2ecf20Sopenharmony_ci 418c2ecf20Sopenharmony_ci/* FX2 eeprom */ 428c2ecf20Sopenharmony_ci#define SET_EE_VALUE 0x10 438c2ecf20Sopenharmony_ci#define GET_EE_VALUE 0x11 448c2ecf20Sopenharmony_ci #define FX2_ID_ADDR 0x00 458c2ecf20Sopenharmony_ci #define VID_MSB_ADDR 0x02 468c2ecf20Sopenharmony_ci #define VID_LSB_ADDR 0x01 478c2ecf20Sopenharmony_ci #define PID_MSB_ADDR 0x04 488c2ecf20Sopenharmony_ci #define PID_LSB_ADDR 0x03 498c2ecf20Sopenharmony_ci #define MAC_0_ADDR 0x07 508c2ecf20Sopenharmony_ci #define MAC_1_ADDR 0x08 518c2ecf20Sopenharmony_ci #define MAC_2_ADDR 0x09 528c2ecf20Sopenharmony_ci #define MAC_3_ADDR 0x0a 538c2ecf20Sopenharmony_ci #define MAC_4_ADDR 0x0b 548c2ecf20Sopenharmony_ci #define MAC_5_ADDR 0x0c 558c2ecf20Sopenharmony_ci 568c2ecf20Sopenharmony_ci#define RESET_FX2 0x13 578c2ecf20Sopenharmony_ci 588c2ecf20Sopenharmony_ci#define FW_VERSION_READ 0x0B 598c2ecf20Sopenharmony_ci#define VENDOR_STRING_READ 0x0C 608c2ecf20Sopenharmony_ci#define PRODUCT_STRING_READ 0x0D 618c2ecf20Sopenharmony_ci#define FW_BCD_VERSION_READ 0x14 628c2ecf20Sopenharmony_ci 638c2ecf20Sopenharmony_ciextern struct dvb_frontend * vp7045_fe_attach(struct dvb_usb_device *d); 648c2ecf20Sopenharmony_ciextern int vp7045_usb_op(struct dvb_usb_device *d, u8 cmd, u8 *out, int outlen, u8 *in, int inlen,int msec); 658c2ecf20Sopenharmony_ciextern u8 vp7045_read_reg(struct dvb_usb_device *d, u8 reg); 668c2ecf20Sopenharmony_ci 678c2ecf20Sopenharmony_ci#endif 68