2005-07-08 08:58:10 +08:00
|
|
|
/* DVB USB compliant linux driver for Conexant USB reference design.
|
|
|
|
*
|
|
|
|
* The Conexant reference design I saw on their website was only for analogue
|
|
|
|
* capturing (using the cx25842). The box I took to write this driver (reverse
|
|
|
|
* engineered) is the one labeled Medion MD95700. In addition to the cx25842
|
|
|
|
* for analogue capturing it also has a cx22702 DVB-T demodulator on the main
|
|
|
|
* board. Besides it has a atiremote (X10) and a USB2.0 hub onboard.
|
|
|
|
*
|
|
|
|
* Maybe it is a little bit premature to call this driver cxusb, but I assume
|
|
|
|
* the USB protocol is identical or at least inherited from the reference
|
|
|
|
* design, so it can be reused for the "analogue-only" device (if it will
|
|
|
|
* appear at all).
|
|
|
|
*
|
2006-01-10 04:21:38 +08:00
|
|
|
* TODO: Use the cx25840-driver for the analogue part
|
2005-07-08 08:58:10 +08:00
|
|
|
*
|
|
|
|
* Copyright (C) 2005 Patrick Boettcher (patrick.boettcher@desy.de)
|
2006-10-16 01:51:08 +08:00
|
|
|
* Copyright (C) 2006 Michael Krufky (mkrufky@linuxtv.org)
|
2007-11-20 08:57:10 +08:00
|
|
|
* Copyright (C) 2006, 2007 Chris Pascoe (c.pascoe@itee.uq.edu.au)
|
2005-07-08 08:58:10 +08:00
|
|
|
*
|
2006-12-06 01:53:39 +08:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms of the GNU General Public License as published by the Free
|
|
|
|
* Software Foundation, version 2.
|
2005-07-08 08:58:10 +08:00
|
|
|
*
|
|
|
|
* see Documentation/dvb/README.dvb-usb for more information
|
|
|
|
*/
|
|
|
|
#include "cxusb.h"
|
|
|
|
|
|
|
|
#include "cx22702.h"
|
2006-01-10 01:25:47 +08:00
|
|
|
#include "lgdt330x.h"
|
2006-01-10 04:21:28 +08:00
|
|
|
#include "mt352.h"
|
|
|
|
#include "mt352_priv.h"
|
2006-06-11 15:24:31 +08:00
|
|
|
#include "zl10353.h"
|
2007-11-20 08:57:10 +08:00
|
|
|
#include "tuner-xc2028.h"
|
|
|
|
#include "tuner-xc2028-types.h"
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
/* debug */
|
2007-11-06 01:07:06 +08:00
|
|
|
static int dvb_usb_cxusb_debug;
|
2006-12-06 01:53:39 +08:00
|
|
|
module_param_named(debug, dvb_usb_cxusb_debug, int, 0644);
|
2005-07-08 08:58:10 +08:00
|
|
|
MODULE_PARM_DESC(debug, "set debugging level (1=rc (or-able))." DVB_USB_DEBUG_STATUS);
|
2007-11-06 01:07:06 +08:00
|
|
|
#define deb_info(args...) dprintk(dvb_usb_cxusb_debug,0x01,args)
|
|
|
|
#define deb_i2c(args...) if (d->udev->descriptor.idVendor == USB_VID_MEDION) \
|
|
|
|
dprintk(dvb_usb_cxusb_debug,0x01,args)
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
static int cxusb_ctrl_msg(struct dvb_usb_device *d,
|
2006-12-06 01:53:39 +08:00
|
|
|
u8 cmd, u8 *wbuf, int wlen, u8 *rbuf, int rlen)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
|
|
|
int wo = (rbuf == NULL || rlen == 0); /* write-only */
|
|
|
|
u8 sndbuf[1+wlen];
|
2006-12-06 01:53:39 +08:00
|
|
|
memset(sndbuf, 0, 1+wlen);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
sndbuf[0] = cmd;
|
2006-12-06 01:53:39 +08:00
|
|
|
memcpy(&sndbuf[1], wbuf, wlen);
|
2005-07-08 08:58:10 +08:00
|
|
|
if (wo)
|
2007-11-19 13:42:44 +08:00
|
|
|
return dvb_usb_generic_write(d, sndbuf, 1+wlen);
|
2005-07-08 08:58:10 +08:00
|
|
|
else
|
2007-11-19 13:42:44 +08:00
|
|
|
return dvb_usb_generic_rw(d, sndbuf, 1+wlen, rbuf, rlen, 0);
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
|
2005-09-10 04:02:51 +08:00
|
|
|
/* GPIO */
|
|
|
|
static void cxusb_gpio_tuner(struct dvb_usb_device *d, int onoff)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
|
|
|
struct cxusb_state *st = d->priv;
|
2006-12-06 01:53:39 +08:00
|
|
|
u8 o[2], i;
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2005-09-10 04:02:51 +08:00
|
|
|
if (st->gpio_write_state[GPIO_TUNER] == onoff)
|
2005-07-08 08:58:10 +08:00
|
|
|
return;
|
|
|
|
|
2005-09-10 04:02:51 +08:00
|
|
|
o[0] = GPIO_TUNER;
|
|
|
|
o[1] = onoff;
|
2006-12-06 01:53:39 +08:00
|
|
|
cxusb_ctrl_msg(d, CMD_GPIO_WRITE, o, 2, &i, 1);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
if (i != 0x01)
|
2005-09-10 04:02:51 +08:00
|
|
|
deb_info("gpio_write failed.\n");
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2005-09-10 04:02:51 +08:00
|
|
|
st->gpio_write_state[GPIO_TUNER] = onoff;
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static int cxusb_bluebird_gpio_rw(struct dvb_usb_device *d, u8 changemask,
|
|
|
|
u8 newval)
|
|
|
|
{
|
|
|
|
u8 o[2], gpio_state;
|
|
|
|
int rc;
|
|
|
|
|
|
|
|
o[0] = 0xff & ~changemask; /* mask of bits to keep */
|
|
|
|
o[1] = newval & changemask; /* new values for bits */
|
|
|
|
|
|
|
|
rc = cxusb_ctrl_msg(d, CMD_BLUEBIRD_GPIO_RW, o, 2, &gpio_state, 1);
|
|
|
|
if (rc < 0 || (gpio_state & changemask) != (newval & changemask))
|
|
|
|
deb_info("bluebird_gpio_write failed.\n");
|
|
|
|
|
|
|
|
return rc < 0 ? rc : gpio_state;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void cxusb_bluebird_gpio_pulse(struct dvb_usb_device *d, u8 pin, int low)
|
|
|
|
{
|
|
|
|
cxusb_bluebird_gpio_rw(d, pin, low ? 0 : pin);
|
|
|
|
msleep(5);
|
|
|
|
cxusb_bluebird_gpio_rw(d, pin, low ? pin : 0);
|
|
|
|
}
|
|
|
|
|
2005-09-10 04:02:51 +08:00
|
|
|
/* I2C */
|
2006-12-06 01:53:39 +08:00
|
|
|
static int cxusb_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
|
|
|
int num)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
int i;
|
|
|
|
|
2006-02-07 16:49:14 +08:00
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
2005-07-08 08:58:10 +08:00
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
|
2006-03-23 11:01:34 +08:00
|
|
|
if (d->udev->descriptor.idVendor == USB_VID_MEDION)
|
|
|
|
switch (msg[i].addr) {
|
2006-12-06 01:53:39 +08:00
|
|
|
case 0x63:
|
|
|
|
cxusb_gpio_tuner(d, 0);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
cxusb_gpio_tuner(d, 1);
|
|
|
|
break;
|
2006-03-23 11:01:34 +08:00
|
|
|
}
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2007-11-19 14:01:22 +08:00
|
|
|
if (msg[i].flags & I2C_M_RD) {
|
|
|
|
/* read only */
|
|
|
|
u8 obuf[3], ibuf[1+msg[i].len];
|
|
|
|
obuf[0] = 0;
|
|
|
|
obuf[1] = msg[i].len;
|
|
|
|
obuf[2] = msg[i].addr;
|
|
|
|
if (cxusb_ctrl_msg(d, CMD_I2C_READ,
|
|
|
|
obuf, 3,
|
|
|
|
ibuf, 1+msg[i].len) < 0) {
|
|
|
|
warn("i2c read failed");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
memcpy(msg[i].buf, &ibuf[1], msg[i].len);
|
2007-11-19 14:05:09 +08:00
|
|
|
} else if (i+1 < num && (msg[i+1].flags & I2C_M_RD) &&
|
|
|
|
msg[i].addr == msg[i+1].addr) {
|
|
|
|
/* write to then read from same address */
|
2005-07-08 08:58:10 +08:00
|
|
|
u8 obuf[3+msg[i].len], ibuf[1+msg[i+1].len];
|
|
|
|
obuf[0] = msg[i].len;
|
|
|
|
obuf[1] = msg[i+1].len;
|
|
|
|
obuf[2] = msg[i].addr;
|
2006-12-06 01:53:39 +08:00
|
|
|
memcpy(&obuf[3], msg[i].buf, msg[i].len);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
if (cxusb_ctrl_msg(d, CMD_I2C_READ,
|
2006-12-06 01:53:39 +08:00
|
|
|
obuf, 3+msg[i].len,
|
|
|
|
ibuf, 1+msg[i+1].len) < 0)
|
2005-07-08 08:58:10 +08:00
|
|
|
break;
|
|
|
|
|
|
|
|
if (ibuf[0] != 0x08)
|
2006-03-23 12:11:18 +08:00
|
|
|
deb_i2c("i2c read may have failed\n");
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
memcpy(msg[i+1].buf, &ibuf[1], msg[i+1].len);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
i++;
|
2007-11-19 14:01:22 +08:00
|
|
|
} else {
|
|
|
|
/* write only */
|
2005-07-08 08:58:10 +08:00
|
|
|
u8 obuf[2+msg[i].len], ibuf;
|
|
|
|
obuf[0] = msg[i].addr;
|
|
|
|
obuf[1] = msg[i].len;
|
2006-12-06 01:53:39 +08:00
|
|
|
memcpy(&obuf[2], msg[i].buf, msg[i].len);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
if (cxusb_ctrl_msg(d, CMD_I2C_WRITE, obuf,
|
|
|
|
2+msg[i].len, &ibuf,1) < 0)
|
2005-07-08 08:58:10 +08:00
|
|
|
break;
|
|
|
|
if (ibuf != 0x08)
|
2006-03-23 12:11:18 +08:00
|
|
|
deb_i2c("i2c write may have failed\n");
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2006-02-07 16:49:14 +08:00
|
|
|
mutex_unlock(&d->i2c_mutex);
|
2007-11-19 13:48:27 +08:00
|
|
|
return i == num ? num : -EREMOTEIO;
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static u32 cxusb_i2c_func(struct i2c_adapter *adapter)
|
|
|
|
{
|
|
|
|
return I2C_FUNC_I2C;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct i2c_algorithm cxusb_i2c_algo = {
|
|
|
|
.master_xfer = cxusb_i2c_xfer,
|
|
|
|
.functionality = cxusb_i2c_func,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int cxusb_power_ctrl(struct dvb_usb_device *d, int onoff)
|
|
|
|
{
|
2005-09-10 04:02:51 +08:00
|
|
|
u8 b = 0;
|
|
|
|
if (onoff)
|
|
|
|
return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
|
|
|
|
else
|
|
|
|
return cxusb_ctrl_msg(d, CMD_POWER_OFF, &b, 1, NULL, 0);
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
|
2006-04-20 07:40:01 +08:00
|
|
|
static int cxusb_bluebird_power_ctrl(struct dvb_usb_device *d, int onoff)
|
|
|
|
{
|
|
|
|
u8 b = 0;
|
|
|
|
if (onoff)
|
|
|
|
return cxusb_ctrl_msg(d, CMD_POWER_ON, &b, 1, NULL, 0);
|
|
|
|
else
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
2005-07-08 08:58:15 +08:00
|
|
|
u8 buf[2] = { 0x03, 0x00 };
|
|
|
|
if (onoff)
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_STREAMING_ON, buf, 2, NULL, 0);
|
2005-07-08 08:58:15 +08:00
|
|
|
else
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_STREAMING_OFF, NULL, 0, NULL, 0);
|
2005-07-08 08:58:15 +08:00
|
|
|
|
2005-07-08 08:58:10 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-10 04:21:29 +08:00
|
|
|
static int cxusb_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
|
|
|
|
{
|
|
|
|
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
|
2006-01-10 04:21:31 +08:00
|
|
|
u8 ircode[4];
|
2006-01-10 04:21:29 +08:00
|
|
|
int i;
|
|
|
|
|
2006-01-10 04:21:31 +08:00
|
|
|
cxusb_ctrl_msg(d, CMD_GET_IR_CODE, NULL, 0, ircode, 4);
|
2006-01-10 04:21:29 +08:00
|
|
|
|
|
|
|
*event = 0;
|
|
|
|
*state = REMOTE_NO_KEY_PRESSED;
|
|
|
|
|
|
|
|
for (i = 0; i < d->props.rc_key_map_size; i++) {
|
2006-01-10 04:21:31 +08:00
|
|
|
if (keymap[i].custom == ircode[2] &&
|
|
|
|
keymap[i].data == ircode[3]) {
|
2006-01-10 04:21:29 +08:00
|
|
|
*event = keymap[i].event;
|
|
|
|
*state = REMOTE_KEY_PRESSED;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static int cxusb_bluebird2_rc_query(struct dvb_usb_device *d, u32 *event,
|
|
|
|
int *state)
|
|
|
|
{
|
|
|
|
struct dvb_usb_rc_key *keymap = d->props.rc_key_map;
|
|
|
|
u8 ircode[4];
|
|
|
|
int i;
|
|
|
|
struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
|
|
|
|
.buf = ircode, .len = 4 };
|
|
|
|
|
|
|
|
*event = 0;
|
|
|
|
*state = REMOTE_NO_KEY_PRESSED;
|
|
|
|
|
|
|
|
if (cxusb_i2c_xfer(&d->i2c_adap, &msg, 1) != 1)
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
for (i = 0; i < d->props.rc_key_map_size; i++) {
|
|
|
|
if (keymap[i].custom == ircode[1] &&
|
|
|
|
keymap[i].data == ircode[2]) {
|
|
|
|
*event = keymap[i].event;
|
|
|
|
*state = REMOTE_KEY_PRESSED;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-24 03:11:09 +08:00
|
|
|
static struct dvb_usb_rc_key dvico_mce_rc_keys[] = {
|
2006-01-10 04:21:31 +08:00
|
|
|
{ 0xfe, 0x02, KEY_TV },
|
|
|
|
{ 0xfe, 0x0e, KEY_MP3 },
|
|
|
|
{ 0xfe, 0x1a, KEY_DVD },
|
|
|
|
{ 0xfe, 0x1e, KEY_FAVORITES },
|
|
|
|
{ 0xfe, 0x16, KEY_SETUP },
|
|
|
|
{ 0xfe, 0x46, KEY_POWER2 },
|
|
|
|
{ 0xfe, 0x0a, KEY_EPG },
|
|
|
|
{ 0xfe, 0x49, KEY_BACK },
|
|
|
|
{ 0xfe, 0x4d, KEY_MENU },
|
|
|
|
{ 0xfe, 0x51, KEY_UP },
|
|
|
|
{ 0xfe, 0x5b, KEY_LEFT },
|
|
|
|
{ 0xfe, 0x5f, KEY_RIGHT },
|
|
|
|
{ 0xfe, 0x53, KEY_DOWN },
|
|
|
|
{ 0xfe, 0x5e, KEY_OK },
|
|
|
|
{ 0xfe, 0x59, KEY_INFO },
|
|
|
|
{ 0xfe, 0x55, KEY_TAB },
|
|
|
|
{ 0xfe, 0x0f, KEY_PREVIOUSSONG },/* Replay */
|
|
|
|
{ 0xfe, 0x12, KEY_NEXTSONG }, /* Skip */
|
|
|
|
{ 0xfe, 0x42, KEY_ENTER }, /* Windows/Start */
|
|
|
|
{ 0xfe, 0x15, KEY_VOLUMEUP },
|
|
|
|
{ 0xfe, 0x05, KEY_VOLUMEDOWN },
|
|
|
|
{ 0xfe, 0x11, KEY_CHANNELUP },
|
|
|
|
{ 0xfe, 0x09, KEY_CHANNELDOWN },
|
|
|
|
{ 0xfe, 0x52, KEY_CAMERA },
|
|
|
|
{ 0xfe, 0x5a, KEY_TUNER }, /* Live */
|
|
|
|
{ 0xfe, 0x19, KEY_OPEN },
|
|
|
|
{ 0xfe, 0x0b, KEY_1 },
|
|
|
|
{ 0xfe, 0x17, KEY_2 },
|
|
|
|
{ 0xfe, 0x1b, KEY_3 },
|
|
|
|
{ 0xfe, 0x07, KEY_4 },
|
|
|
|
{ 0xfe, 0x50, KEY_5 },
|
|
|
|
{ 0xfe, 0x54, KEY_6 },
|
|
|
|
{ 0xfe, 0x48, KEY_7 },
|
|
|
|
{ 0xfe, 0x4c, KEY_8 },
|
|
|
|
{ 0xfe, 0x58, KEY_9 },
|
|
|
|
{ 0xfe, 0x13, KEY_ANGLE }, /* Aspect */
|
|
|
|
{ 0xfe, 0x03, KEY_0 },
|
|
|
|
{ 0xfe, 0x1f, KEY_ZOOM },
|
|
|
|
{ 0xfe, 0x43, KEY_REWIND },
|
|
|
|
{ 0xfe, 0x47, KEY_PLAYPAUSE },
|
|
|
|
{ 0xfe, 0x4f, KEY_FASTFORWARD },
|
|
|
|
{ 0xfe, 0x57, KEY_MUTE },
|
|
|
|
{ 0xfe, 0x0d, KEY_STOP },
|
|
|
|
{ 0xfe, 0x01, KEY_RECORD },
|
|
|
|
{ 0xfe, 0x4e, KEY_POWER },
|
|
|
|
};
|
|
|
|
|
2006-03-26 16:43:36 +08:00
|
|
|
static struct dvb_usb_rc_key dvico_portable_rc_keys[] = {
|
|
|
|
{ 0xfc, 0x02, KEY_SETUP }, /* Profile */
|
|
|
|
{ 0xfc, 0x43, KEY_POWER2 },
|
|
|
|
{ 0xfc, 0x06, KEY_EPG },
|
|
|
|
{ 0xfc, 0x5a, KEY_BACK },
|
|
|
|
{ 0xfc, 0x05, KEY_MENU },
|
|
|
|
{ 0xfc, 0x47, KEY_INFO },
|
|
|
|
{ 0xfc, 0x01, KEY_TAB },
|
|
|
|
{ 0xfc, 0x42, KEY_PREVIOUSSONG },/* Replay */
|
|
|
|
{ 0xfc, 0x49, KEY_VOLUMEUP },
|
|
|
|
{ 0xfc, 0x09, KEY_VOLUMEDOWN },
|
|
|
|
{ 0xfc, 0x54, KEY_CHANNELUP },
|
|
|
|
{ 0xfc, 0x0b, KEY_CHANNELDOWN },
|
2006-03-27 05:59:45 +08:00
|
|
|
{ 0xfc, 0x16, KEY_CAMERA },
|
2006-03-26 16:43:36 +08:00
|
|
|
{ 0xfc, 0x40, KEY_TUNER }, /* ATV/DTV */
|
|
|
|
{ 0xfc, 0x45, KEY_OPEN },
|
|
|
|
{ 0xfc, 0x19, KEY_1 },
|
|
|
|
{ 0xfc, 0x18, KEY_2 },
|
|
|
|
{ 0xfc, 0x1b, KEY_3 },
|
|
|
|
{ 0xfc, 0x1a, KEY_4 },
|
|
|
|
{ 0xfc, 0x58, KEY_5 },
|
|
|
|
{ 0xfc, 0x59, KEY_6 },
|
|
|
|
{ 0xfc, 0x15, KEY_7 },
|
|
|
|
{ 0xfc, 0x14, KEY_8 },
|
|
|
|
{ 0xfc, 0x17, KEY_9 },
|
|
|
|
{ 0xfc, 0x44, KEY_ANGLE }, /* Aspect */
|
|
|
|
{ 0xfc, 0x55, KEY_0 },
|
|
|
|
{ 0xfc, 0x07, KEY_ZOOM },
|
|
|
|
{ 0xfc, 0x0a, KEY_REWIND },
|
|
|
|
{ 0xfc, 0x08, KEY_PLAYPAUSE },
|
|
|
|
{ 0xfc, 0x4b, KEY_FASTFORWARD },
|
|
|
|
{ 0xfc, 0x5b, KEY_MUTE },
|
|
|
|
{ 0xfc, 0x04, KEY_STOP },
|
|
|
|
{ 0xfc, 0x56, KEY_RECORD },
|
|
|
|
{ 0xfc, 0x57, KEY_POWER },
|
|
|
|
{ 0xfc, 0x41, KEY_UNKNOWN }, /* INPUT */
|
|
|
|
{ 0xfc, 0x00, KEY_UNKNOWN }, /* HD */
|
|
|
|
};
|
|
|
|
|
2006-01-10 04:21:28 +08:00
|
|
|
static int cxusb_dee1601_demod_init(struct dvb_frontend* fe)
|
|
|
|
{
|
2006-02-07 16:49:11 +08:00
|
|
|
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x28 };
|
2006-01-10 04:21:28 +08:00
|
|
|
static u8 reset [] = { RESET, 0x80 };
|
|
|
|
static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
|
|
|
|
static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 };
|
|
|
|
static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
|
|
|
|
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
|
|
|
|
|
|
|
|
mt352_write(fe, clock_config, sizeof(clock_config));
|
|
|
|
udelay(200);
|
|
|
|
mt352_write(fe, reset, sizeof(reset));
|
|
|
|
mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
|
|
|
|
|
|
|
|
mt352_write(fe, agc_cfg, sizeof(agc_cfg));
|
|
|
|
mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
|
|
|
|
mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-12 05:40:33 +08:00
|
|
|
static int cxusb_mt352_demod_init(struct dvb_frontend* fe)
|
|
|
|
{ /* used in both lgz201 and th7579 */
|
2006-02-07 16:49:12 +08:00
|
|
|
static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x29 };
|
2006-01-12 05:40:33 +08:00
|
|
|
static u8 reset [] = { RESET, 0x80 };
|
|
|
|
static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 };
|
|
|
|
static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 };
|
|
|
|
static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 };
|
|
|
|
static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
|
|
|
|
|
|
|
|
mt352_write(fe, clock_config, sizeof(clock_config));
|
|
|
|
udelay(200);
|
|
|
|
mt352_write(fe, reset, sizeof(reset));
|
|
|
|
mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg));
|
|
|
|
|
|
|
|
mt352_write(fe, agc_cfg, sizeof(agc_cfg));
|
|
|
|
mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg));
|
|
|
|
mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-24 03:11:09 +08:00
|
|
|
static struct cx22702_config cxusb_cx22702_config = {
|
2005-07-08 08:58:10 +08:00
|
|
|
.demod_address = 0x63,
|
2005-07-08 08:58:15 +08:00
|
|
|
.output_mode = CX22702_PARALLEL_OUTPUT,
|
2005-07-08 08:58:10 +08:00
|
|
|
};
|
|
|
|
|
2006-02-27 11:08:17 +08:00
|
|
|
static struct lgdt330x_config cxusb_lgdt3303_config = {
|
2006-01-10 01:25:47 +08:00
|
|
|
.demod_address = 0x0e,
|
|
|
|
.demod_chip = LGDT3303,
|
|
|
|
};
|
|
|
|
|
2006-01-24 03:11:09 +08:00
|
|
|
static struct mt352_config cxusb_dee1601_config = {
|
2006-01-10 04:21:28 +08:00
|
|
|
.demod_address = 0x0f,
|
|
|
|
.demod_init = cxusb_dee1601_demod_init,
|
|
|
|
};
|
|
|
|
|
2006-06-11 15:24:31 +08:00
|
|
|
static struct zl10353_config cxusb_zl10353_dee1601_config = {
|
|
|
|
.demod_address = 0x0f,
|
2006-08-10 14:17:16 +08:00
|
|
|
.parallel_ts = 1,
|
2006-06-11 15:24:31 +08:00
|
|
|
};
|
|
|
|
|
2006-04-20 07:49:28 +08:00
|
|
|
static struct mt352_config cxusb_mt352_config = {
|
2006-01-12 05:40:33 +08:00
|
|
|
/* used in both lgz201 and th7579 */
|
|
|
|
.demod_address = 0x0f,
|
|
|
|
.demod_init = cxusb_mt352_demod_init,
|
|
|
|
};
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static struct zl10353_config cxusb_zl10353_xc3028_config = {
|
|
|
|
.demod_address = 0x0f,
|
|
|
|
.if2 = 4560,
|
|
|
|
.no_tuner = 1,
|
|
|
|
.parallel_ts = 1,
|
|
|
|
};
|
|
|
|
|
2005-07-08 08:58:10 +08:00
|
|
|
/* Callbacks for DVB USB */
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
V4L/DVB (5636): Integrate all users of the fmd1216 tuner with dvb-pll
Enhance the dvb-pll definition of the fmd1216 tuner by adding an init sequence
and a sleep sequence.
The init sequence sets the AGC control register to 0xa0, selecting the fast
time constant and 112 dBuV take-over point. This the recommended value for
DVB-T operation.
The sleep sequence sets bit P4 (which is believed to turn the analog
demodulator on), turns off the tuning voltage, and sets the AGC control
register to 0x60 (external AGC voltage, the recommended value for analog
operation).
The existing dvb-pll users in the cx88 driver, listed below, will gain these
init and sleep sequences.
CX88_BOARD_HAUPPAUGE_HVR1100 Hauppauge WinTV-HVR1100 DVB-T/Hybrid
CX88_BOARD_HAUPPAUGE_HVR1100LP Hauppauge WinTV-HVR1100 DVB-T/Hybrid (Low Profi
CX88_BOARD_WINFAST_DTV2000H WinFast DTV2000 H
CX88_BOARD_HAUPPAUGE_HVR3000 Hauppauge WinTV-HVR3000 TriMode Analog/DVB-S/DV
CX88_BOARD_HAUPPAUGE_HVR1300 Hauppauge WinTV-HVR1300 DVB-T/Hybrid MPEG Encod
This non-dvb-pll user in the cx88 driver should only gain the sleep sequence,
as it already had an equivalent init sequence. The non-dvb-pll code for this
user is removed.
X88_BOARD_DNTV_LIVE_DVB_T_PRO digitalnow DNTV Live! DVB-T Pro
In these saa7134 driver, these non-dvb-pll users are converted to use dvb-pll:
SAA7134_BOARD_MD7134 Medion 7134
SAA7134_BOARD_ASUS_EUROPA2_HYBRID Asus Europa2 OEM
The saa7134 functions philips_fmd1216_tuner_init(),
philips_fmd1216_tuner_sleep(), and philips_fmd1216_tuner_set_params() are
deleted and the dvb-pll versions are used.
This should result in equivalent sleep, init, and tuning sequences being sent
to the tuner.
For the cxusb driver, only one board is effected:
USB_PID_MEDION_MD95700 Medion MD95700
This board used dvb_usb_tuner_init_i2c() and dvb_usb_tuner_set_params_i2c()
for init and tuning, respectively. These functions are effectively the same
as the dvb-pll versions. They call a tuner pass control function defined at
the dvb-usb level, but this does not matter, as this card does not have a
tuner pass control function (only the dib3000mb does). This board will gain
the sleep sequence, while init and tuning should be unchanged.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
2007-05-09 05:05:16 +08:00
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
|
2007-06-13 03:10:51 +08:00
|
|
|
DVB_PLL_FMD1216ME);
|
2005-07-08 08:58:10 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap)
|
2006-01-10 04:21:28 +08:00
|
|
|
{
|
2006-12-06 01:20:06 +08:00
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x61,
|
2007-06-13 03:10:51 +08:00
|
|
|
NULL, DVB_PLL_THOMSON_DTT7579);
|
2006-01-10 04:21:28 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
|
2006-01-12 05:40:33 +08:00
|
|
|
{
|
2007-06-13 03:10:51 +08:00
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201);
|
2006-01-12 05:40:33 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap)
|
2006-01-12 05:40:33 +08:00
|
|
|
{
|
2006-12-06 01:20:06 +08:00
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
|
2007-06-13 03:10:51 +08:00
|
|
|
NULL, DVB_PLL_THOMSON_DTT7579);
|
2006-05-14 15:49:00 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-10-14 08:55:57 +08:00
|
|
|
static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap)
|
2006-05-14 15:49:00 +08:00
|
|
|
{
|
2007-04-27 23:31:30 +08:00
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x61, &adap->dev->i2c_adap,
|
2007-06-13 03:10:51 +08:00
|
|
|
DVB_PLL_LG_TDVS_H06XF);
|
2006-01-12 05:40:33 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static int dvico_bluebird_xc2028_callback(void *ptr, int command, int arg)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = ptr;
|
|
|
|
|
|
|
|
switch (command) {
|
|
|
|
case XC2028_TUNER_RESET:
|
|
|
|
deb_info("%s: XC2028_TUNER_RESET %d\n", __FUNCTION__, arg);
|
|
|
|
cxusb_bluebird_gpio_pulse(d, 0x01, 1);
|
|
|
|
break;
|
|
|
|
case XC2028_RESET_CLK:
|
|
|
|
deb_info("%s: XC2028_RESET_CLK %d\n", __FUNCTION__, arg);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
deb_info("%s: unknown command %d, arg %d\n", __FUNCTION__,
|
|
|
|
command, arg);
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap)
|
|
|
|
{
|
|
|
|
struct dvb_frontend *fe;
|
|
|
|
struct xc2028_config cfg = {
|
|
|
|
.i2c_adap = &adap->dev->i2c_adap,
|
|
|
|
.i2c_addr = 0x61,
|
|
|
|
.video_dev = adap->dev,
|
|
|
|
.callback = dvico_bluebird_xc2028_callback,
|
|
|
|
};
|
|
|
|
static struct xc2028_ctrl ctl = {
|
|
|
|
.type = XC2028_FIRM_NORMAL,
|
|
|
|
.fname = "xc3028-dvico-au-01.fw",
|
|
|
|
.max_len = 64,
|
|
|
|
.scode_table = ZARLINK456,
|
|
|
|
};
|
|
|
|
|
|
|
|
fe = dvb_attach(xc2028_attach, adap->fe, &cfg);
|
|
|
|
if (fe == NULL || fe->ops.tuner_ops.set_config == NULL)
|
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
fe->ops.tuner_ops.set_config(fe, &ctl);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
2005-09-10 04:02:51 +08:00
|
|
|
u8 b;
|
2006-09-30 17:53:48 +08:00
|
|
|
if (usb_set_interface(adap->dev->udev, 0, 6) < 0)
|
2005-07-08 08:58:15 +08:00
|
|
|
err("set interface failed");
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1);
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config,
|
|
|
|
&adap->dev->i2c_adap)) != NULL)
|
2005-07-08 08:58:10 +08:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap)
|
2006-01-10 01:25:47 +08:00
|
|
|
{
|
2006-09-30 17:53:48 +08:00
|
|
|
if (usb_set_interface(adap->dev->udev, 0, 7) < 0)
|
2006-01-10 01:25:47 +08:00
|
|
|
err("set interface failed");
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
|
2006-01-10 01:25:47 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config,
|
|
|
|
&adap->dev->i2c_adap)) != NULL)
|
2006-01-10 01:25:47 +08:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap)
|
|
|
|
{
|
|
|
|
/* used in both lgz201 and th7579 */
|
|
|
|
if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
|
2006-01-12 05:40:33 +08:00
|
|
|
err("set interface failed");
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
|
2006-01-12 05:40:33 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config,
|
|
|
|
&adap->dev->i2c_adap)) != NULL)
|
2006-01-12 05:40:33 +08:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap)
|
2006-01-10 04:21:28 +08:00
|
|
|
{
|
2006-09-30 17:53:48 +08:00
|
|
|
if (usb_set_interface(adap->dev->udev, 0, 0) < 0)
|
2006-01-10 04:21:28 +08:00
|
|
|
err("set interface failed");
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
|
2006-01-10 04:21:28 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config,
|
|
|
|
&adap->dev->i2c_adap)) != NULL) ||
|
|
|
|
((adap->fe = dvb_attach(zl10353_attach,
|
|
|
|
&cxusb_zl10353_dee1601_config,
|
|
|
|
&adap->dev->i2c_adap)) != NULL))
|
2006-01-10 04:21:28 +08:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap)
|
|
|
|
{
|
|
|
|
u8 ircode[4];
|
|
|
|
int i;
|
|
|
|
struct i2c_msg msg = { .addr = 0x6b, .flags = I2C_M_RD,
|
|
|
|
.buf = ircode, .len = 4 };
|
|
|
|
|
|
|
|
if (usb_set_interface(adap->dev->udev, 0, 1) < 0)
|
|
|
|
err("set interface failed");
|
|
|
|
|
|
|
|
cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0);
|
|
|
|
|
|
|
|
/* reset the tuner and demodulator */
|
|
|
|
cxusb_bluebird_gpio_rw(adap->dev, 0x04, 0);
|
|
|
|
cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1);
|
|
|
|
cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1);
|
|
|
|
|
|
|
|
if ((adap->fe = dvb_attach(zl10353_attach,
|
|
|
|
&cxusb_zl10353_xc3028_config,
|
|
|
|
&adap->dev->i2c_adap)) == NULL)
|
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
/* try to determine if there is no IR decoder on the I2C bus */
|
|
|
|
for (i = 0; adap->dev->props.rc_key_map != NULL && i < 5; i++) {
|
|
|
|
msleep(20);
|
|
|
|
if (cxusb_i2c_xfer(&adap->dev->i2c_adap, &msg, 1) != 1)
|
|
|
|
goto no_IR;
|
|
|
|
if (ircode[0] == 0 && ircode[1] == 0)
|
|
|
|
continue;
|
|
|
|
if (ircode[2] + ircode[3] != 0xff) {
|
|
|
|
no_IR:
|
|
|
|
adap->dev->props.rc_key_map = NULL;
|
|
|
|
info("No IR receiver detected on this device.");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2006-01-10 04:21:38 +08:00
|
|
|
/*
|
|
|
|
* DViCO bluebird firmware needs the "warm" product ID to be patched into the
|
|
|
|
* firmware file before download.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define BLUEBIRD_01_ID_OFFSET 6638
|
2006-12-06 01:53:39 +08:00
|
|
|
static int bluebird_patch_dvico_firmware_download(struct usb_device *udev,
|
|
|
|
const struct firmware *fw)
|
2006-01-10 04:21:38 +08:00
|
|
|
{
|
|
|
|
if (fw->size < BLUEBIRD_01_ID_OFFSET + 4)
|
|
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
if (fw->data[BLUEBIRD_01_ID_OFFSET] == (USB_VID_DVICO & 0xff) &&
|
|
|
|
fw->data[BLUEBIRD_01_ID_OFFSET + 1] == USB_VID_DVICO >> 8) {
|
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
fw->data[BLUEBIRD_01_ID_OFFSET + 2] =
|
2007-02-21 10:10:34 +08:00
|
|
|
le16_to_cpu(udev->descriptor.idProduct) + 1;
|
2006-12-06 01:53:39 +08:00
|
|
|
fw->data[BLUEBIRD_01_ID_OFFSET + 3] =
|
2007-02-21 10:10:34 +08:00
|
|
|
le16_to_cpu(udev->descriptor.idProduct) >> 8;
|
2006-01-10 04:21:38 +08:00
|
|
|
|
2006-12-06 01:53:39 +08:00
|
|
|
return usb_cypress_load_firmware(udev, fw, CYPRESS_FX2);
|
2006-01-10 04:21:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
return -EINVAL;
|
|
|
|
}
|
|
|
|
|
2005-07-08 08:58:10 +08:00
|
|
|
/* DVB USB Driver stuff */
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_medion_properties;
|
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties;
|
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties;
|
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties;
|
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties;
|
2007-11-20 08:57:10 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties;
|
2005-07-08 08:58:10 +08:00
|
|
|
|
|
|
|
static int cxusb_probe(struct usb_interface *intf,
|
2006-12-06 01:53:39 +08:00
|
|
|
const struct usb_device_id *id)
|
2005-07-08 08:58:10 +08:00
|
|
|
{
|
2006-01-10 01:25:47 +08:00
|
|
|
if (dvb_usb_device_init(intf,&cxusb_medion_properties,THIS_MODULE,NULL) == 0 ||
|
2006-01-10 04:21:28 +08:00
|
|
|
dvb_usb_device_init(intf,&cxusb_bluebird_lgh064f_properties,THIS_MODULE,NULL) == 0 ||
|
2006-01-12 05:40:33 +08:00
|
|
|
dvb_usb_device_init(intf,&cxusb_bluebird_dee1601_properties,THIS_MODULE,NULL) == 0 ||
|
|
|
|
dvb_usb_device_init(intf,&cxusb_bluebird_lgz201_properties,THIS_MODULE,NULL) == 0 ||
|
2007-11-20 08:57:10 +08:00
|
|
|
dvb_usb_device_init(intf,&cxusb_bluebird_dtt7579_properties,THIS_MODULE,NULL) == 0 ||
|
|
|
|
dvb_usb_device_init(intf,&cxusb_bluebird_dualdig4_properties,THIS_MODULE,NULL) == 0) {
|
2006-01-10 01:25:47 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -EINVAL;
|
2005-07-08 08:58:10 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct usb_device_id cxusb_table [] = {
|
2006-12-06 01:53:39 +08:00
|
|
|
{ USB_DEVICE(USB_VID_MEDION, USB_PID_MEDION_MD95700) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LG064F_WARM) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_1_WARM) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_LGZ201_WARM) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_TH7579_WARM) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DIGITALNOW_BLUEBIRD_DUAL_1_WARM) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_COLD) },
|
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_2_WARM) },
|
2007-11-20 08:57:10 +08:00
|
|
|
{ USB_DEVICE(USB_VID_DVICO, USB_PID_DVICO_BLUEBIRD_DUAL_4) },
|
2006-12-06 01:53:39 +08:00
|
|
|
{} /* Terminating entry */
|
2005-07-08 08:58:10 +08:00
|
|
|
};
|
|
|
|
MODULE_DEVICE_TABLE (usb, cxusb_table);
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_medion_properties = {
|
2005-07-08 08:58:10 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
|
|
|
.usb_ctrl = CYPRESS_FX2,
|
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.num_adapters = 1,
|
|
|
|
.adapter = {
|
|
|
|
{
|
2006-10-13 22:34:46 +08:00
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_cx22702_frontend_attach,
|
|
|
|
.tuner_attach = cxusb_fmd1216me_tuner_attach,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x02,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2005-07-08 08:58:10 +08:00
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
.power_ctrl = cxusb_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
|
|
|
|
2005-07-08 08:58:10 +08:00
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "Medion MD95700 (MDUSBTV-HYBRID)",
|
|
|
|
{ NULL },
|
|
|
|
{ &cxusb_table[0], NULL },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_lgh064f_properties = {
|
2006-01-10 01:25:47 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
2006-01-10 04:21:38 +08:00
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-bluebird-01.fw",
|
|
|
|
.download_firmware = bluebird_patch_dvico_firmware_download,
|
2006-01-10 01:25:47 +08:00
|
|
|
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
|
|
|
use usb alt setting 7 for EP2 transfer (atsc) */
|
2006-01-10 01:25:47 +08:00
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.num_adapters = 1,
|
|
|
|
.adapter = {
|
|
|
|
{
|
2006-10-13 22:34:46 +08:00
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_lgdt3303_frontend_attach,
|
2006-10-14 08:55:57 +08:00
|
|
|
.tuner_attach = cxusb_lgh064f_tuner_attach,
|
2006-10-13 22:34:46 +08:00
|
|
|
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x02,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2006-09-30 17:53:48 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
.power_ctrl = cxusb_bluebird_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
|
|
|
|
|
|
|
.rc_interval = 100,
|
|
|
|
.rc_key_map = dvico_portable_rc_keys,
|
|
|
|
.rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
|
|
|
|
.rc_query = cxusb_rc_query,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
2006-01-10 01:25:47 +08:00
|
|
|
|
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "DViCO FusionHDTV5 USB Gold",
|
|
|
|
{ &cxusb_table[1], NULL },
|
|
|
|
{ &cxusb_table[2], NULL },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dee1601_properties = {
|
2006-01-10 04:21:28 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
2006-01-10 04:21:38 +08:00
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-bluebird-01.fw",
|
|
|
|
.download_firmware = bluebird_patch_dvico_firmware_download,
|
2006-01-10 04:21:28 +08:00
|
|
|
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
|
|
|
use usb alt setting 7 for EP2 transfer (atsc) */
|
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.num_adapters = 1,
|
|
|
|
.adapter = {
|
|
|
|
{
|
2006-10-13 22:34:46 +08:00
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_dee1601_frontend_attach,
|
|
|
|
.tuner_attach = cxusb_dee1601_tuner_attach,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
2006-09-30 17:53:48 +08:00
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
2006-10-13 22:34:46 +08:00
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x04,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2006-09-30 17:53:48 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
.power_ctrl = cxusb_bluebird_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
|
|
|
|
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_key_map = dvico_mce_rc_keys,
|
|
|
|
.rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
|
|
|
|
.rc_query = cxusb_rc_query,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
2006-01-10 04:21:28 +08:00
|
|
|
|
2006-09-28 13:16:01 +08:00
|
|
|
.num_device_descs = 3,
|
2006-01-10 04:21:28 +08:00
|
|
|
.devices = {
|
|
|
|
{ "DViCO FusionHDTV DVB-T Dual USB",
|
|
|
|
{ &cxusb_table[3], NULL },
|
|
|
|
{ &cxusb_table[4], NULL },
|
|
|
|
},
|
2006-01-12 09:21:00 +08:00
|
|
|
{ "DigitalNow DVB-T Dual USB",
|
|
|
|
{ &cxusb_table[9], NULL },
|
|
|
|
{ &cxusb_table[10], NULL },
|
|
|
|
},
|
2006-09-28 13:16:01 +08:00
|
|
|
{ "DViCO FusionHDTV DVB-T Dual Digital 2",
|
|
|
|
{ &cxusb_table[11], NULL },
|
|
|
|
{ &cxusb_table[12], NULL },
|
|
|
|
},
|
2006-01-10 04:21:28 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_lgz201_properties = {
|
2006-01-12 05:40:33 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-bluebird-01.fw",
|
|
|
|
.download_firmware = bluebird_patch_dvico_firmware_download,
|
|
|
|
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
|
|
|
use usb alt setting 7 for EP2 transfer (atsc) */
|
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.num_adapters = 2,
|
|
|
|
.adapter = {
|
|
|
|
{
|
2006-10-13 22:34:46 +08:00
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_mt352_frontend_attach,
|
|
|
|
.tuner_attach = cxusb_lgz201_tuner_attach,
|
2006-01-12 05:40:33 +08:00
|
|
|
|
2006-10-13 22:34:46 +08:00
|
|
|
/* parameter for the MPEG2-data transfer */
|
2006-09-30 17:53:48 +08:00
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
2006-10-13 22:34:46 +08:00
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x04,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2006-09-30 17:53:48 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
.power_ctrl = cxusb_bluebird_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
2006-01-12 05:40:33 +08:00
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.rc_interval = 100,
|
|
|
|
.rc_key_map = dvico_portable_rc_keys,
|
|
|
|
.rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
|
|
|
|
.rc_query = cxusb_rc_query,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
2006-01-12 05:40:33 +08:00
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "DViCO FusionHDTV DVB-T USB (LGZ201)",
|
|
|
|
{ &cxusb_table[5], NULL },
|
|
|
|
{ &cxusb_table[6], NULL },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dtt7579_properties = {
|
2006-01-12 05:40:33 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-bluebird-01.fw",
|
|
|
|
.download_firmware = bluebird_patch_dvico_firmware_download,
|
|
|
|
/* use usb alt setting 0 for EP4 transfer (dvb-t),
|
|
|
|
use usb alt setting 7 for EP2 transfer (atsc) */
|
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
2006-09-30 17:53:48 +08:00
|
|
|
.num_adapters = 1,
|
|
|
|
.adapter = {
|
|
|
|
{
|
2006-10-13 22:34:46 +08:00
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_mt352_frontend_attach,
|
|
|
|
.tuner_attach = cxusb_dtt7579_tuner_attach,
|
2006-01-12 05:40:33 +08:00
|
|
|
|
2006-10-13 22:34:46 +08:00
|
|
|
/* parameter for the MPEG2-data transfer */
|
2006-09-30 17:53:48 +08:00
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
2006-10-13 22:34:46 +08:00
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x04,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2006-09-30 17:53:48 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
.power_ctrl = cxusb_bluebird_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
|
|
|
|
|
|
|
.rc_interval = 100,
|
|
|
|
.rc_key_map = dvico_portable_rc_keys,
|
|
|
|
.rc_key_map_size = ARRAY_SIZE(dvico_portable_rc_keys),
|
|
|
|
.rc_query = cxusb_rc_query,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
2006-01-12 05:40:33 +08:00
|
|
|
|
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "DViCO FusionHDTV DVB-T USB (TH7579)",
|
|
|
|
{ &cxusb_table[7], NULL },
|
|
|
|
{ &cxusb_table[8], NULL },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2007-11-20 08:57:10 +08:00
|
|
|
static struct dvb_usb_device_properties cxusb_bluebird_dualdig4_properties = {
|
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
|
|
|
|
.usb_ctrl = CYPRESS_FX2,
|
|
|
|
|
|
|
|
.size_of_priv = sizeof(struct cxusb_state),
|
|
|
|
|
|
|
|
.num_adapters = 1,
|
|
|
|
.adapter = {
|
|
|
|
{
|
|
|
|
.streaming_ctrl = cxusb_streaming_ctrl,
|
|
|
|
.frontend_attach = cxusb_dualdig4_frontend_attach,
|
|
|
|
.tuner_attach = cxusb_dvico_xc3028_tuner_attach,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 5,
|
|
|
|
.endpoint = 0x02,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 8192,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
.power_ctrl = cxusb_power_ctrl,
|
|
|
|
|
|
|
|
.i2c_algo = &cxusb_i2c_algo,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
|
|
|
|
|
|
|
.rc_interval = 100,
|
|
|
|
.rc_key_map = dvico_mce_rc_keys,
|
|
|
|
.rc_key_map_size = ARRAY_SIZE(dvico_mce_rc_keys),
|
|
|
|
.rc_query = cxusb_bluebird2_rc_query,
|
|
|
|
|
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "DViCO FusionHDTV DVB-T Dual Digital 4",
|
|
|
|
{ NULL },
|
|
|
|
{ &cxusb_table[13], NULL },
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2005-07-08 08:58:10 +08:00
|
|
|
static struct usb_driver cxusb_driver = {
|
2005-07-08 08:58:30 +08:00
|
|
|
.name = "dvb_usb_cxusb",
|
2005-07-08 08:58:10 +08:00
|
|
|
.probe = cxusb_probe,
|
2006-12-06 01:53:39 +08:00
|
|
|
.disconnect = dvb_usb_device_exit,
|
2005-07-08 08:58:10 +08:00
|
|
|
.id_table = cxusb_table,
|
|
|
|
};
|
|
|
|
|
|
|
|
/* module stuff */
|
|
|
|
static int __init cxusb_module_init(void)
|
|
|
|
{
|
|
|
|
int result;
|
|
|
|
if ((result = usb_register(&cxusb_driver))) {
|
|
|
|
err("usb_register failed. Error number %d",result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit cxusb_module_exit(void)
|
|
|
|
{
|
|
|
|
/* deregister this driver from the USB subsystem */
|
|
|
|
usb_deregister(&cxusb_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init (cxusb_module_init);
|
|
|
|
module_exit (cxusb_module_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Patrick Boettcher <patrick.boettcher@desy.de>");
|
2006-10-16 01:51:08 +08:00
|
|
|
MODULE_AUTHOR("Michael Krufky <mkrufky@linuxtv.org>");
|
2006-01-14 00:10:25 +08:00
|
|
|
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
|
2005-07-08 08:58:10 +08:00
|
|
|
MODULE_DESCRIPTION("Driver for Conexant USB2.0 hybrid reference design");
|
|
|
|
MODULE_VERSION("1.0-alpha");
|
|
|
|
MODULE_LICENSE("GPL");
|