Path: blob/master/drivers/media/dvb/dvb-usb/ce6230.h
15112 views
/*1* DVB USB Linux driver for Intel CE6230 DVB-T USB2.0 receiver2*3* Copyright (C) 2009 Antti Palosaari <[email protected]>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18*19*/2021#ifndef _DVB_USB_CE6230_H_22#define _DVB_USB_CE6230_H_2324#define DVB_USB_LOG_PREFIX "ce6230"25#include "dvb-usb.h"2627#define deb_info(args...) dprintk(dvb_usb_ce6230_debug, 0x01, args)28#define deb_rc(args...) dprintk(dvb_usb_ce6230_debug, 0x02, args)29#define deb_xfer(args...) dprintk(dvb_usb_ce6230_debug, 0x04, args)30#define deb_reg(args...) dprintk(dvb_usb_ce6230_debug, 0x08, args)31#define deb_i2c(args...) dprintk(dvb_usb_ce6230_debug, 0x10, args)32#define deb_fw(args...) dprintk(dvb_usb_ce6230_debug, 0x20, args)3334#define ce6230_debug_dump(r, t, v, i, b, l, func) { \35int loop_; \36func("%02x %02x %02x %02x %02x %02x %02x %02x", \37t, r, v & 0xff, v >> 8, i & 0xff, i >> 8, l & 0xff, l >> 8); \38if (t == (USB_TYPE_VENDOR | USB_DIR_OUT)) \39func(" >>> "); \40else \41func(" <<< "); \42for (loop_ = 0; loop_ < l; loop_++) \43func("%02x ", b[loop_]); \44func("\n");\45}4647#define CE6230_USB_TIMEOUT 10004849struct req_t {50u8 cmd; /* [1] */51u16 value; /* [2|3] */52u16 index; /* [4|5] */53u16 data_len; /* [6|7] */54u8 *data;55};5657enum ce6230_cmd {58CONFIG_READ = 0xd0, /* rd 0 (unclear) */59UNKNOWN_WRITE = 0xc7, /* wr 7 (unclear) */60I2C_READ = 0xd9, /* rd 9 (unclear) */61I2C_WRITE = 0xca, /* wr a */62DEMOD_READ = 0xdb, /* rd b */63DEMOD_WRITE = 0xcc, /* wr c */64REG_READ = 0xde, /* rd e */65REG_WRITE = 0xcf, /* wr f */66};6768#endif697071