2008-09-09 04:16:40 +08:00
|
|
|
/* DVB USB framework compliant Linux driver for the
|
2011-02-26 05:41:23 +08:00
|
|
|
* DVBWorld DVB-S 2101, 2102, DVB-S2 2104, DVB-C 3101,
|
|
|
|
* TeVii S600, S630, S650, S660, S480,
|
|
|
|
* Prof 1100, 7500,
|
2011-02-26 05:41:22 +08:00
|
|
|
* Geniatech SU3000 Cards
|
2011-02-26 05:41:23 +08:00
|
|
|
* Copyright (C) 2008-2011 Igor M. Liplianin (liplianin@me.by)
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* see Documentation/dvb/README.dvb-usb for more information
|
|
|
|
*/
|
2008-07-20 19:05:50 +08:00
|
|
|
#include "dw2102.h"
|
2008-09-18 06:19:19 +08:00
|
|
|
#include "si21xx.h"
|
2008-07-20 19:05:50 +08:00
|
|
|
#include "stv0299.h"
|
|
|
|
#include "z0194a.h"
|
2008-10-05 20:11:21 +08:00
|
|
|
#include "stv0288.h"
|
|
|
|
#include "stb6000.h"
|
|
|
|
#include "eds1547.h"
|
2008-09-09 04:16:40 +08:00
|
|
|
#include "cx24116.h"
|
2009-06-15 07:51:45 +08:00
|
|
|
#include "tda1002x.h"
|
2009-06-20 20:54:18 +08:00
|
|
|
#include "mt312.h"
|
|
|
|
#include "zl10039.h"
|
2009-11-28 01:37:35 +08:00
|
|
|
#include "ds3000.h"
|
|
|
|
#include "stv0900.h"
|
|
|
|
#include "stv6110.h"
|
|
|
|
#include "stb6100.h"
|
|
|
|
#include "stb6100_proc.h"
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
#ifndef USB_PID_DW2102
|
|
|
|
#define USB_PID_DW2102 0x2102
|
|
|
|
#endif
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
#ifndef USB_PID_DW2104
|
|
|
|
#define USB_PID_DW2104 0x2104
|
|
|
|
#endif
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
#ifndef USB_PID_DW3101
|
|
|
|
#define USB_PID_DW3101 0x3101
|
|
|
|
#endif
|
|
|
|
|
2008-11-06 09:12:56 +08:00
|
|
|
#ifndef USB_PID_CINERGY_S
|
|
|
|
#define USB_PID_CINERGY_S 0x0064
|
|
|
|
#endif
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
#ifndef USB_PID_TEVII_S630
|
|
|
|
#define USB_PID_TEVII_S630 0xd630
|
|
|
|
#endif
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
#ifndef USB_PID_TEVII_S650
|
|
|
|
#define USB_PID_TEVII_S650 0xd650
|
|
|
|
#endif
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
#ifndef USB_PID_TEVII_S660
|
|
|
|
#define USB_PID_TEVII_S660 0xd660
|
|
|
|
#endif
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
#ifndef USB_PID_TEVII_S480_1
|
|
|
|
#define USB_PID_TEVII_S480_1 0xd481
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef USB_PID_TEVII_S480_2
|
|
|
|
#define USB_PID_TEVII_S480_2 0xd482
|
|
|
|
#endif
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
#ifndef USB_PID_PROF_1100
|
|
|
|
#define USB_PID_PROF_1100 0xb012
|
2009-06-20 20:54:18 +08:00
|
|
|
#endif
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
#define DW210X_READ_MSG 0
|
|
|
|
#define DW210X_WRITE_MSG 1
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
#define REG_1F_SYMBOLRATE_BYTE0 0x1f
|
|
|
|
#define REG_20_SYMBOLRATE_BYTE1 0x20
|
|
|
|
#define REG_21_SYMBOLRATE_BYTE2 0x21
|
2008-09-09 04:16:40 +08:00
|
|
|
/* on my own*/
|
2008-07-20 19:05:50 +08:00
|
|
|
#define DW2102_VOLTAGE_CTRL (0x1800)
|
2011-02-26 05:41:22 +08:00
|
|
|
#define SU3000_STREAM_CTRL (0x1900)
|
2008-07-20 19:05:50 +08:00
|
|
|
#define DW2102_RC_QUERY (0x1a00)
|
2011-02-26 05:41:22 +08:00
|
|
|
#define DW2102_LED_CTRL (0x1b00)
|
2008-07-20 19:05:50 +08:00
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
#define err_str "did not find the firmware file. (%s) " \
|
|
|
|
"Please see linux/Documentation/dvb/ for more details " \
|
|
|
|
"on firmware-problems."
|
|
|
|
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
struct rc_map_dvb_usb_table_table {
|
|
|
|
struct rc_map_table *rc_keys;
|
2009-06-15 06:41:22 +08:00
|
|
|
int rc_keys_size;
|
2008-07-20 19:05:50 +08:00
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
struct su3000_state {
|
|
|
|
u8 initialized;
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
struct s6x0_state {
|
|
|
|
int (*old_set_voltage)(struct dvb_frontend *f, fe_sec_voltage_t v);
|
|
|
|
};
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
/* debug */
|
|
|
|
static int dvb_usb_dw2102_debug;
|
|
|
|
module_param_named(debug, dvb_usb_dw2102_debug, int, 0644);
|
2009-06-13 19:10:24 +08:00
|
|
|
MODULE_PARM_DESC(debug, "set debugging level (1=info 2=xfer 4=rc(or-able))."
|
|
|
|
DVB_USB_DEBUG_STATUS);
|
|
|
|
|
2009-06-15 06:41:22 +08:00
|
|
|
/* keymaps */
|
|
|
|
static int ir_keymap;
|
|
|
|
module_param_named(keymap, ir_keymap, int, 0644);
|
2011-02-26 05:41:22 +08:00
|
|
|
MODULE_PARM_DESC(keymap, "set keymap 0=default 1=dvbworld 2=tevii 3=tbs ..."
|
|
|
|
" 256=none");
|
2008-09-09 04:16:40 +08:00
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
/* demod probe */
|
|
|
|
static int demod_probe = 1;
|
|
|
|
module_param_named(demod, demod_probe, int, 0644);
|
|
|
|
MODULE_PARM_DESC(demod, "demod to probe (1=cx24116 2=stv0903+stv6110 "
|
|
|
|
"4=stv0903+stb6100(or-able)).");
|
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr);
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static int dw210x_op_rw(struct usb_device *dev, u8 request, u16 value,
|
2008-09-09 04:16:40 +08:00
|
|
|
u16 index, u8 * data, u16 len, int flags)
|
2008-07-20 19:05:50 +08:00
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
u8 u8buf[len];
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
unsigned int pipe = (flags == DW210X_READ_MSG) ?
|
2008-09-09 04:16:40 +08:00
|
|
|
usb_rcvctrlpipe(dev, 0) : usb_sndctrlpipe(dev, 0);
|
2008-09-18 06:19:19 +08:00
|
|
|
u8 request_type = (flags == DW210X_READ_MSG) ? USB_DIR_IN : USB_DIR_OUT;
|
2008-07-20 19:05:50 +08:00
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
if (flags == DW210X_WRITE_MSG)
|
2008-07-20 19:05:50 +08:00
|
|
|
memcpy(u8buf, data, len);
|
2008-09-09 04:16:40 +08:00
|
|
|
ret = usb_control_msg(dev, pipe, request, request_type | USB_TYPE_VENDOR,
|
|
|
|
value, index , u8buf, len, 2000);
|
2008-07-20 19:05:50 +08:00
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
if (flags == DW210X_READ_MSG)
|
2008-07-20 19:05:50 +08:00
|
|
|
memcpy(data, u8buf, len);
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* I2C */
|
|
|
|
static int dw2102_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
|
|
|
int num)
|
|
|
|
{
|
2009-06-15 07:51:45 +08:00
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
2008-07-20 19:05:50 +08:00
|
|
|
int i = 0, ret = 0;
|
|
|
|
u8 buf6[] = {0x2c, 0x05, 0xc0, 0, 0, 0, 0};
|
|
|
|
u16 value;
|
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
switch (num) {
|
|
|
|
case 2:
|
|
|
|
/* read stv0299 register */
|
|
|
|
value = msg[0].buf[0];/* register */
|
|
|
|
for (i = 0; i < msg[1].len; i++) {
|
2011-02-28 03:22:57 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb5, value + i, 0,
|
2008-09-18 06:19:19 +08:00
|
|
|
buf6, 2, DW210X_READ_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
msg[1].buf[i] = buf6[0];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
switch (msg[0].addr) {
|
|
|
|
case 0x68:
|
|
|
|
/* write to stv0299 register */
|
|
|
|
buf6[0] = 0x2a;
|
|
|
|
buf6[1] = msg[0].buf[0];
|
|
|
|
buf6[2] = msg[0].buf[1];
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
buf6, 3, DW210X_WRITE_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
break;
|
|
|
|
case 0x60:
|
|
|
|
if (msg[0].flags == 0) {
|
|
|
|
/* write to tuner pll */
|
|
|
|
buf6[0] = 0x2c;
|
|
|
|
buf6[1] = 5;
|
|
|
|
buf6[2] = 0xc0;
|
|
|
|
buf6[3] = msg[0].buf[0];
|
|
|
|
buf6[4] = msg[0].buf[1];
|
|
|
|
buf6[5] = msg[0].buf[2];
|
|
|
|
buf6[6] = msg[0].buf[3];
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
buf6, 7, DW210X_WRITE_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
} else {
|
2008-09-09 04:16:40 +08:00
|
|
|
/* read from tuner */
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb5, 0, 0,
|
|
|
|
buf6, 1, DW210X_READ_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
msg[0].buf[0] = buf6[0];
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case (DW2102_RC_QUERY):
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
|
|
|
buf6, 2, DW210X_READ_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
msg[0].buf[0] = buf6[0];
|
|
|
|
msg[0].buf[1] = buf6[1];
|
|
|
|
break;
|
|
|
|
case (DW2102_VOLTAGE_CTRL):
|
|
|
|
buf6[0] = 0x30;
|
|
|
|
buf6[1] = msg[0].buf[0];
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
buf6, 2, DW210X_WRITE_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static int dw2102_serit_i2c_transfer(struct i2c_adapter *adap,
|
|
|
|
struct i2c_msg msg[], int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
int ret = 0;
|
|
|
|
u8 buf6[] = {0, 0, 0, 0, 0, 0, 0};
|
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
switch (num) {
|
|
|
|
case 2:
|
|
|
|
/* read si2109 register by number */
|
2009-11-28 01:37:35 +08:00
|
|
|
buf6[0] = msg[0].addr << 1;
|
2008-09-18 06:19:19 +08:00
|
|
|
buf6[1] = msg[0].len;
|
|
|
|
buf6[2] = msg[0].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
buf6, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
/* read si2109 register */
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc3, 0xd0, 0,
|
|
|
|
buf6, msg[1].len + 2, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[1].buf, buf6 + 2, msg[1].len);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
switch (msg[0].addr) {
|
|
|
|
case 0x68:
|
|
|
|
/* write to si2109 register */
|
2009-11-28 01:37:35 +08:00
|
|
|
buf6[0] = msg[0].addr << 1;
|
2008-09-18 06:19:19 +08:00
|
|
|
buf6[1] = msg[0].len;
|
|
|
|
memcpy(buf6 + 2, msg[0].buf, msg[0].len);
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0, buf6,
|
|
|
|
msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
case(DW2102_RC_QUERY):
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
|
|
|
buf6, 2, DW210X_READ_MSG);
|
|
|
|
msg[0].buf[0] = buf6[0];
|
|
|
|
msg[0].buf[1] = buf6[1];
|
|
|
|
break;
|
|
|
|
case(DW2102_VOLTAGE_CTRL):
|
|
|
|
buf6[0] = 0x30;
|
|
|
|
buf6[1] = msg[0].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
buf6, 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
2009-06-15 07:51:45 +08:00
|
|
|
|
2008-10-05 20:11:21 +08:00
|
|
|
static int dw2102_earda_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
int ret = 0;
|
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
switch (num) {
|
|
|
|
case 2: {
|
|
|
|
/* read */
|
|
|
|
/* first write first register number */
|
2009-06-15 07:51:45 +08:00
|
|
|
u8 ibuf[msg[1].len + 2], obuf[3];
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[0] = msg[0].addr << 1;
|
2008-10-05 20:11:21 +08:00
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
obuf[2] = msg[0].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
/* second read registers */
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc3, 0xd1 , 0,
|
|
|
|
ibuf, msg[1].len + 2, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[1].buf, ibuf + 2, msg[1].len);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
switch (msg[0].addr) {
|
|
|
|
case 0x68: {
|
|
|
|
/* write to register */
|
|
|
|
u8 obuf[msg[0].len + 2];
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[0] = msg[0].addr << 1;
|
2008-10-05 20:11:21 +08:00
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
memcpy(obuf + 2, msg[0].buf, msg[0].len);
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 0x61: {
|
|
|
|
/* write to tuner */
|
|
|
|
u8 obuf[msg[0].len + 2];
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[0] = msg[0].addr << 1;
|
2008-10-05 20:11:21 +08:00
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
memcpy(obuf + 2, msg[0].buf, msg[0].len);
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(DW2102_RC_QUERY): {
|
|
|
|
u8 ibuf[2];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
|
|
|
ibuf, 2, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[0].buf, ibuf , 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(DW2102_VOLTAGE_CTRL): {
|
|
|
|
u8 obuf[2];
|
|
|
|
obuf[0] = 0x30;
|
|
|
|
obuf[1] = msg[0].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
obuf, 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
2008-09-18 06:19:19 +08:00
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
static int dw2104_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[], int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
int ret = 0;
|
2009-11-28 01:37:35 +08:00
|
|
|
int len, i, j;
|
2008-09-09 04:16:40 +08:00
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
for (j = 0; j < num; j++) {
|
|
|
|
switch (msg[j].addr) {
|
2008-09-09 04:16:40 +08:00
|
|
|
case(DW2102_RC_QUERY): {
|
|
|
|
u8 ibuf[2];
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
|
|
|
ibuf, 2, DW210X_READ_MSG);
|
2009-11-28 01:37:35 +08:00
|
|
|
memcpy(msg[j].buf, ibuf , 2);
|
2008-09-09 04:16:40 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(DW2102_VOLTAGE_CTRL): {
|
|
|
|
u8 obuf[2];
|
|
|
|
obuf[0] = 0x30;
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[1] = msg[j].buf[0];
|
2008-09-18 06:19:19 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb2, 0, 0,
|
|
|
|
obuf, 2, DW210X_WRITE_MSG);
|
2008-09-09 04:16:40 +08:00
|
|
|
break;
|
|
|
|
}
|
2009-11-28 01:37:35 +08:00
|
|
|
/*case 0x55: cx24116
|
|
|
|
case 0x6a: stv0903
|
|
|
|
case 0x68: ds3000, stv0903
|
|
|
|
case 0x60: ts2020, stv6110, stb6100 */
|
|
|
|
default: {
|
|
|
|
if (msg[j].flags == I2C_M_RD) {
|
|
|
|
/* read registers */
|
|
|
|
u8 ibuf[msg[j].len + 2];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc3,
|
|
|
|
(msg[j].addr << 1) + 1, 0,
|
|
|
|
ibuf, msg[j].len + 2,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
memcpy(msg[j].buf, ibuf + 2, msg[j].len);
|
|
|
|
mdelay(10);
|
|
|
|
} else if (((msg[j].buf[0] == 0xb0) &&
|
|
|
|
(msg[j].addr == 0x68)) ||
|
|
|
|
((msg[j].buf[0] == 0xf7) &&
|
|
|
|
(msg[j].addr == 0x55))) {
|
|
|
|
/* write firmware */
|
|
|
|
u8 obuf[19];
|
|
|
|
obuf[0] = msg[j].addr << 1;
|
|
|
|
obuf[1] = (msg[j].len > 15 ? 17 : msg[j].len);
|
|
|
|
obuf[2] = msg[j].buf[0];
|
|
|
|
len = msg[j].len - 1;
|
|
|
|
i = 1;
|
|
|
|
do {
|
|
|
|
memcpy(obuf + 3, msg[j].buf + i,
|
|
|
|
(len > 16 ? 16 : len));
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, (len > 16 ? 16 : len) + 3,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
i += 16;
|
|
|
|
len -= 16;
|
|
|
|
} while (len > 0);
|
|
|
|
} else {
|
|
|
|
/* write registers */
|
|
|
|
u8 obuf[msg[j].len + 2];
|
|
|
|
obuf[0] = msg[j].addr << 1;
|
|
|
|
obuf[1] = msg[j].len;
|
|
|
|
memcpy(obuf + 2, msg[j].buf, msg[j].len);
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[j].len + 2,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2008-09-09 04:16:40 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static int dw3101_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
|
|
|
int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
int ret = 0, i;
|
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
switch (num) {
|
|
|
|
case 2: {
|
|
|
|
/* read */
|
|
|
|
/* first write first register number */
|
|
|
|
u8 ibuf[msg[1].len + 2], obuf[3];
|
|
|
|
obuf[0] = msg[0].addr << 1;
|
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
obuf[2] = msg[0].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
/* second read registers */
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc3, 0x19 , 0,
|
|
|
|
ibuf, msg[1].len + 2, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[1].buf, ibuf + 2, msg[1].len);
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case 1:
|
|
|
|
switch (msg[0].addr) {
|
|
|
|
case 0x60:
|
|
|
|
case 0x0c: {
|
|
|
|
/* write to register */
|
|
|
|
u8 obuf[msg[0].len + 2];
|
|
|
|
obuf[0] = msg[0].addr << 1;
|
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
memcpy(obuf + 2, msg[0].buf, msg[0].len);
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xc2, 0, 0,
|
|
|
|
obuf, msg[0].len + 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case(DW2102_RC_QUERY): {
|
|
|
|
u8 ibuf[2];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
|
|
|
ibuf, 2, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[0].buf, ibuf , 2);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < num; i++) {
|
|
|
|
deb_xfer("%02x:%02x: %s ", i, msg[i].addr,
|
|
|
|
msg[i].flags == 0 ? ">>>" : "<<<");
|
|
|
|
debug_dump(msg[i].buf, msg[i].len, deb_xfer);
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
static int s6x0_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
2009-06-20 20:54:18 +08:00
|
|
|
int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
2009-12-23 05:00:07 +08:00
|
|
|
struct usb_device *udev;
|
2009-06-20 20:54:18 +08:00
|
|
|
int ret = 0;
|
2009-11-28 01:37:35 +08:00
|
|
|
int len, i, j;
|
2009-06-20 20:54:18 +08:00
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
2009-12-23 05:00:07 +08:00
|
|
|
udev = d->udev;
|
2009-06-20 20:54:18 +08:00
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
for (j = 0; j < num; j++) {
|
|
|
|
switch (msg[j].addr) {
|
2009-06-20 20:54:18 +08:00
|
|
|
case (DW2102_RC_QUERY): {
|
2011-02-26 05:41:23 +08:00
|
|
|
u8 ibuf[5];
|
2009-06-20 20:54:18 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0xb8, 0, 0,
|
2011-02-26 05:41:23 +08:00
|
|
|
ibuf, 5, DW210X_READ_MSG);
|
|
|
|
memcpy(msg[j].buf, ibuf + 3, 2);
|
2009-06-20 20:54:18 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case (DW2102_VOLTAGE_CTRL): {
|
|
|
|
u8 obuf[2];
|
2009-12-15 07:24:56 +08:00
|
|
|
|
|
|
|
obuf[0] = 1;
|
|
|
|
obuf[1] = msg[j].buf[1];/* off-on */
|
|
|
|
ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
|
|
|
|
obuf, 2, DW210X_WRITE_MSG);
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[0] = 3;
|
2009-12-15 07:24:56 +08:00
|
|
|
obuf[1] = msg[j].buf[0];/* 13v-18v */
|
2009-06-20 20:54:18 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
|
|
|
|
obuf, 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
2011-02-26 05:41:22 +08:00
|
|
|
case (DW2102_LED_CTRL): {
|
|
|
|
u8 obuf[2];
|
|
|
|
|
|
|
|
obuf[0] = 5;
|
|
|
|
obuf[1] = msg[j].buf[0];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0x8a, 0, 0,
|
|
|
|
obuf, 2, DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
2009-11-28 01:37:35 +08:00
|
|
|
/*case 0x55: cx24116
|
|
|
|
case 0x6a: stv0903
|
|
|
|
case 0x68: ds3000, stv0903
|
|
|
|
case 0x60: ts2020, stv6110, stb6100
|
|
|
|
case 0xa0: eeprom */
|
|
|
|
default: {
|
|
|
|
if (msg[j].flags == I2C_M_RD) {
|
|
|
|
/* read registers */
|
|
|
|
u8 ibuf[msg[j].len];
|
|
|
|
ret = dw210x_op_rw(d->udev, 0x91, 0, 0,
|
|
|
|
ibuf, msg[j].len,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
memcpy(msg[j].buf, ibuf, msg[j].len);
|
|
|
|
break;
|
|
|
|
} else if ((msg[j].buf[0] == 0xb0) &&
|
|
|
|
(msg[j].addr == 0x68)) {
|
|
|
|
/* write firmware */
|
|
|
|
u8 obuf[19];
|
|
|
|
obuf[0] = (msg[j].len > 16 ?
|
|
|
|
18 : msg[j].len + 1);
|
|
|
|
obuf[1] = msg[j].addr << 1;
|
|
|
|
obuf[2] = msg[j].buf[0];
|
|
|
|
len = msg[j].len - 1;
|
|
|
|
i = 1;
|
|
|
|
do {
|
|
|
|
memcpy(obuf + 3, msg[j].buf + i,
|
|
|
|
(len > 16 ? 16 : len));
|
|
|
|
ret = dw210x_op_rw(d->udev, 0x80, 0, 0,
|
|
|
|
obuf, (len > 16 ? 16 : len) + 3,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
i += 16;
|
|
|
|
len -= 16;
|
|
|
|
} while (len > 0);
|
2011-02-28 03:18:38 +08:00
|
|
|
} else if (j < (num - 1)) {
|
2009-12-15 07:24:56 +08:00
|
|
|
/* write register addr before read */
|
|
|
|
u8 obuf[msg[j].len + 2];
|
|
|
|
obuf[0] = msg[j + 1].len;
|
|
|
|
obuf[1] = (msg[j].addr << 1);
|
|
|
|
memcpy(obuf + 2, msg[j].buf, msg[j].len);
|
2011-02-28 03:18:38 +08:00
|
|
|
ret = dw210x_op_rw(d->udev,
|
|
|
|
udev->descriptor.idProduct ==
|
|
|
|
0x7500 ? 0x92 : 0x90, 0, 0,
|
2009-12-15 07:24:56 +08:00
|
|
|
obuf, msg[j].len + 2,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
break;
|
2009-11-28 01:37:35 +08:00
|
|
|
} else {
|
|
|
|
/* write registers */
|
|
|
|
u8 obuf[msg[j].len + 2];
|
|
|
|
obuf[0] = msg[j].len + 1;
|
|
|
|
obuf[1] = (msg[j].addr << 1);
|
|
|
|
memcpy(obuf + 2, msg[j].buf, msg[j].len);
|
2011-02-28 03:18:38 +08:00
|
|
|
ret = dw210x_op_rw(d->udev, 0x80, 0, 0,
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf, msg[j].len + 2,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2009-06-20 20:54:18 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static int su3000_i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],
|
|
|
|
int num)
|
|
|
|
{
|
|
|
|
struct dvb_usb_device *d = i2c_get_adapdata(adap);
|
|
|
|
u8 obuf[0x40], ibuf[0x40];
|
|
|
|
|
|
|
|
if (!d)
|
|
|
|
return -ENODEV;
|
|
|
|
if (mutex_lock_interruptible(&d->i2c_mutex) < 0)
|
|
|
|
return -EAGAIN;
|
|
|
|
|
|
|
|
switch (num) {
|
|
|
|
case 1:
|
|
|
|
switch (msg[0].addr) {
|
|
|
|
case SU3000_STREAM_CTRL:
|
|
|
|
obuf[0] = msg[0].buf[0] + 0x36;
|
|
|
|
obuf[1] = 3;
|
|
|
|
obuf[2] = 0;
|
|
|
|
if (dvb_usb_generic_rw(d, obuf, 3, ibuf, 0, 0) < 0)
|
|
|
|
err("i2c transfer failed.");
|
|
|
|
break;
|
|
|
|
case DW2102_RC_QUERY:
|
|
|
|
obuf[0] = 0x10;
|
|
|
|
if (dvb_usb_generic_rw(d, obuf, 1, ibuf, 2, 0) < 0)
|
|
|
|
err("i2c transfer failed.");
|
|
|
|
msg[0].buf[1] = ibuf[0];
|
|
|
|
msg[0].buf[0] = ibuf[1];
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
/* always i2c write*/
|
|
|
|
obuf[0] = 0x08;
|
|
|
|
obuf[1] = msg[0].addr;
|
|
|
|
obuf[2] = msg[0].len;
|
|
|
|
|
|
|
|
memcpy(&obuf[3], msg[0].buf, msg[0].len);
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d, obuf, msg[0].len + 3,
|
|
|
|
ibuf, 1, 0) < 0)
|
|
|
|
err("i2c transfer failed.");
|
|
|
|
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
/* always i2c read */
|
|
|
|
obuf[0] = 0x09;
|
|
|
|
obuf[1] = msg[0].len;
|
|
|
|
obuf[2] = msg[1].len;
|
|
|
|
obuf[3] = msg[0].addr;
|
|
|
|
memcpy(&obuf[4], msg[0].buf, msg[0].len);
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d, obuf, msg[0].len + 4,
|
|
|
|
ibuf, msg[1].len + 1, 0) < 0)
|
|
|
|
err("i2c transfer failed.");
|
|
|
|
|
|
|
|
memcpy(msg[1].buf, &ibuf[1], msg[1].len);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
warn("more than 2 i2c messages at a time is not handled yet.");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
mutex_unlock(&d->i2c_mutex);
|
|
|
|
return num;
|
|
|
|
}
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static u32 dw210x_i2c_func(struct i2c_adapter *adapter)
|
2008-07-20 19:05:50 +08:00
|
|
|
{
|
|
|
|
return I2C_FUNC_I2C;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct i2c_algorithm dw2102_i2c_algo = {
|
|
|
|
.master_xfer = dw2102_i2c_transfer,
|
2008-09-18 06:19:19 +08:00
|
|
|
.functionality = dw210x_i2c_func,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct i2c_algorithm dw2102_serit_i2c_algo = {
|
|
|
|
.master_xfer = dw2102_serit_i2c_transfer,
|
|
|
|
.functionality = dw210x_i2c_func,
|
2008-07-20 19:05:50 +08:00
|
|
|
};
|
|
|
|
|
2008-10-05 20:11:21 +08:00
|
|
|
static struct i2c_algorithm dw2102_earda_i2c_algo = {
|
|
|
|
.master_xfer = dw2102_earda_i2c_transfer,
|
|
|
|
.functionality = dw210x_i2c_func,
|
|
|
|
};
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
static struct i2c_algorithm dw2104_i2c_algo = {
|
|
|
|
.master_xfer = dw2104_i2c_transfer,
|
2008-09-18 06:19:19 +08:00
|
|
|
.functionality = dw210x_i2c_func,
|
2008-09-09 04:16:40 +08:00
|
|
|
};
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static struct i2c_algorithm dw3101_i2c_algo = {
|
|
|
|
.master_xfer = dw3101_i2c_transfer,
|
|
|
|
.functionality = dw210x_i2c_func,
|
|
|
|
};
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
static struct i2c_algorithm s6x0_i2c_algo = {
|
|
|
|
.master_xfer = s6x0_i2c_transfer,
|
2009-06-20 20:54:18 +08:00
|
|
|
.functionality = dw210x_i2c_func,
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static struct i2c_algorithm su3000_i2c_algo = {
|
|
|
|
.master_xfer = su3000_i2c_transfer,
|
|
|
|
.functionality = dw210x_i2c_func,
|
|
|
|
};
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static int dw210x_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
|
2008-09-09 04:16:40 +08:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u8 ibuf[] = {0, 0};
|
|
|
|
u8 eeprom[256], eepromline[16];
|
|
|
|
|
|
|
|
for (i = 0; i < 256; i++) {
|
2008-09-18 06:19:19 +08:00
|
|
|
if (dw210x_op_rw(d->udev, 0xb6, 0xa0 , i, ibuf, 2, DW210X_READ_MSG) < 0) {
|
2008-09-09 04:16:40 +08:00
|
|
|
err("read eeprom failed.");
|
|
|
|
return -1;
|
|
|
|
} else {
|
|
|
|
eepromline[i%16] = ibuf[0];
|
|
|
|
eeprom[i] = ibuf[0];
|
|
|
|
}
|
|
|
|
if ((i % 16) == 15) {
|
|
|
|
deb_xfer("%02x: ", i - 15);
|
|
|
|
debug_dump(eepromline, 16, deb_xfer);
|
|
|
|
}
|
|
|
|
}
|
2009-06-15 07:51:45 +08:00
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
memcpy(mac, eeprom + 8, 6);
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
static int s6x0_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
|
2009-06-20 20:54:18 +08:00
|
|
|
{
|
|
|
|
int i, ret;
|
2009-11-28 01:37:35 +08:00
|
|
|
u8 ibuf[] = { 0 }, obuf[] = { 0 };
|
|
|
|
u8 eeprom[256], eepromline[16];
|
|
|
|
struct i2c_msg msg[] = {
|
|
|
|
{
|
|
|
|
.addr = 0xa0 >> 1,
|
|
|
|
.flags = 0,
|
|
|
|
.buf = obuf,
|
|
|
|
.len = 1,
|
|
|
|
}, {
|
|
|
|
.addr = 0xa0 >> 1,
|
|
|
|
.flags = I2C_M_RD,
|
|
|
|
.buf = ibuf,
|
|
|
|
.len = 1,
|
|
|
|
}
|
|
|
|
};
|
2009-06-20 20:54:18 +08:00
|
|
|
|
|
|
|
for (i = 0; i < 256; i++) {
|
2009-11-28 01:37:35 +08:00
|
|
|
obuf[0] = i;
|
|
|
|
ret = s6x0_i2c_transfer(&d->i2c_adap, msg, 2);
|
|
|
|
if (ret != 2) {
|
2009-06-20 20:54:18 +08:00
|
|
|
err("read eeprom failed.");
|
|
|
|
return -1;
|
|
|
|
} else {
|
2009-11-28 01:37:35 +08:00
|
|
|
eepromline[i % 16] = ibuf[0];
|
|
|
|
eeprom[i] = ibuf[0];
|
2009-06-20 20:54:18 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
if ((i % 16) == 15) {
|
|
|
|
deb_xfer("%02x: ", i - 15);
|
|
|
|
debug_dump(eepromline, 16, deb_xfer);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
memcpy(mac, eeprom + 16, 6);
|
|
|
|
return 0;
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static int su3000_streaming_ctrl(struct dvb_usb_adapter *adap, int onoff)
|
|
|
|
{
|
|
|
|
static u8 command_start[] = {0x00};
|
|
|
|
static u8 command_stop[] = {0x01};
|
|
|
|
struct i2c_msg msg = {
|
|
|
|
.addr = SU3000_STREAM_CTRL,
|
|
|
|
.flags = 0,
|
|
|
|
.buf = onoff ? command_start : command_stop,
|
|
|
|
.len = 1
|
|
|
|
};
|
|
|
|
|
|
|
|
i2c_transfer(&adap->dev->i2c_adap, &msg, 1);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int su3000_power_ctrl(struct dvb_usb_device *d, int i)
|
|
|
|
{
|
|
|
|
struct su3000_state *state = (struct su3000_state *)d->priv;
|
|
|
|
u8 obuf[] = {0xde, 0};
|
|
|
|
|
|
|
|
info("%s: %d, initialized %d\n", __func__, i, state->initialized);
|
|
|
|
|
|
|
|
if (i && !state->initialized) {
|
|
|
|
state->initialized = 1;
|
|
|
|
/* reset board */
|
|
|
|
dvb_usb_generic_rw(d, obuf, 2, NULL, 0, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int su3000_read_mac_address(struct dvb_usb_device *d, u8 mac[6])
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
u8 obuf[] = { 0x1f, 0xf0 };
|
|
|
|
u8 ibuf[] = { 0 };
|
|
|
|
struct i2c_msg msg[] = {
|
|
|
|
{
|
|
|
|
.addr = 0x51,
|
|
|
|
.flags = 0,
|
|
|
|
.buf = obuf,
|
|
|
|
.len = 2,
|
|
|
|
}, {
|
|
|
|
.addr = 0x51,
|
|
|
|
.flags = I2C_M_RD,
|
|
|
|
.buf = ibuf,
|
|
|
|
.len = 1,
|
|
|
|
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
for (i = 0; i < 6; i++) {
|
|
|
|
obuf[1] = 0xf0 + i;
|
|
|
|
if (i2c_transfer(&d->i2c_adap, msg, 2) != 2)
|
|
|
|
break;
|
|
|
|
else
|
|
|
|
mac[i] = ibuf[0];
|
|
|
|
|
|
|
|
debug_dump(mac, 6, printk);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int su3000_identify_state(struct usb_device *udev,
|
|
|
|
struct dvb_usb_device_properties *props,
|
|
|
|
struct dvb_usb_device_description **desc,
|
|
|
|
int *cold)
|
|
|
|
{
|
|
|
|
info("%s\n", __func__);
|
|
|
|
|
|
|
|
*cold = 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static int dw210x_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
|
2008-07-20 19:05:50 +08:00
|
|
|
{
|
2009-12-15 07:24:56 +08:00
|
|
|
static u8 command_13v[] = {0x00, 0x01};
|
|
|
|
static u8 command_18v[] = {0x01, 0x01};
|
|
|
|
static u8 command_off[] = {0x00, 0x00};
|
|
|
|
struct i2c_msg msg = {
|
|
|
|
.addr = DW2102_VOLTAGE_CTRL,
|
|
|
|
.flags = 0,
|
|
|
|
.buf = command_off,
|
|
|
|
.len = 2,
|
2008-07-20 19:05:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
struct dvb_usb_adapter *udev_adap =
|
|
|
|
(struct dvb_usb_adapter *)(fe->dvb->priv);
|
|
|
|
if (voltage == SEC_VOLTAGE_18)
|
2009-12-15 07:24:56 +08:00
|
|
|
msg.buf = command_18v;
|
|
|
|
else if (voltage == SEC_VOLTAGE_13)
|
|
|
|
msg.buf = command_13v;
|
|
|
|
|
|
|
|
i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
|
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
static int s660_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
|
|
|
|
{
|
|
|
|
struct dvb_usb_adapter *d =
|
|
|
|
(struct dvb_usb_adapter *)(fe->dvb->priv);
|
|
|
|
struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
|
|
|
|
|
|
|
|
dw210x_set_voltage(fe, voltage);
|
|
|
|
if (st->old_set_voltage)
|
|
|
|
st->old_set_voltage(fe, voltage);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static void dw210x_led_ctrl(struct dvb_frontend *fe, int offon)
|
|
|
|
{
|
|
|
|
static u8 led_off[] = { 0 };
|
|
|
|
static u8 led_on[] = { 1 };
|
|
|
|
struct i2c_msg msg = {
|
|
|
|
.addr = DW2102_LED_CTRL,
|
|
|
|
.flags = 0,
|
|
|
|
.buf = led_off,
|
|
|
|
.len = 1
|
|
|
|
};
|
|
|
|
struct dvb_usb_adapter *udev_adap =
|
|
|
|
(struct dvb_usb_adapter *)(fe->dvb->priv);
|
|
|
|
|
|
|
|
if (offon)
|
|
|
|
msg.buf = led_on;
|
|
|
|
i2c_transfer(&udev_adap->dev->i2c_adap, &msg, 1);
|
|
|
|
}
|
|
|
|
|
2008-10-18 00:45:55 +08:00
|
|
|
static struct stv0299_config sharp_z0194a_config = {
|
|
|
|
.demod_address = 0x68,
|
|
|
|
.inittab = sharp_z0194a_inittab,
|
|
|
|
.mclk = 88000000UL,
|
|
|
|
.invert = 1,
|
|
|
|
.skip_reinit = 0,
|
|
|
|
.lock_output = STV0299_LOCKOUTPUT_1,
|
|
|
|
.volt13_op0_op1 = STV0299_VOLT13_OP1,
|
|
|
|
.min_delay_ms = 100,
|
|
|
|
.set_symbol_rate = sharp_z0194a_set_symbol_rate,
|
|
|
|
};
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
static struct cx24116_config dw2104_config = {
|
|
|
|
.demod_address = 0x55,
|
2008-09-10 00:57:47 +08:00
|
|
|
.mpg_clk_pos_pol = 0x01,
|
2008-09-09 04:16:40 +08:00
|
|
|
};
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static struct si21xx_config serit_sp1511lhb_config = {
|
|
|
|
.demod_address = 0x68,
|
|
|
|
.min_delay_ms = 100,
|
|
|
|
|
|
|
|
};
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static struct tda10023_config dw3101_tda10023_config = {
|
|
|
|
.demod_address = 0x0c,
|
|
|
|
.invert = 1,
|
|
|
|
};
|
|
|
|
|
2009-06-20 20:54:18 +08:00
|
|
|
static struct mt312_config zl313_config = {
|
|
|
|
.demod_address = 0x0e,
|
|
|
|
};
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
static struct ds3000_config dw2104_ds3000_config = {
|
|
|
|
.demod_address = 0x68,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct stv0900_config dw2104a_stv0900_config = {
|
|
|
|
.demod_address = 0x6a,
|
|
|
|
.demod_mode = 0,
|
|
|
|
.xtal = 27000000,
|
|
|
|
.clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
|
|
|
|
.diseqc_mode = 2,/* 2/3 PWM */
|
|
|
|
.tun1_maddress = 0,/* 0x60 */
|
|
|
|
.tun1_adc = 0,/* 2 Vpp */
|
|
|
|
.path1_mode = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct stb6100_config dw2104a_stb6100_config = {
|
|
|
|
.tuner_address = 0x60,
|
|
|
|
.refclock = 27000000,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct stv0900_config dw2104_stv0900_config = {
|
|
|
|
.demod_address = 0x68,
|
|
|
|
.demod_mode = 0,
|
|
|
|
.xtal = 8000000,
|
|
|
|
.clkmode = 3,
|
|
|
|
.diseqc_mode = 2,
|
|
|
|
.tun1_maddress = 0,
|
|
|
|
.tun1_adc = 1,/* 1 Vpp */
|
|
|
|
.path1_mode = 3,
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct stv6110_config dw2104_stv6110_config = {
|
|
|
|
.i2c_address = 0x60,
|
|
|
|
.mclk = 16000000,
|
|
|
|
.clk_div = 1,
|
|
|
|
};
|
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
static struct stv0900_config prof_7500_stv0900_config = {
|
|
|
|
.demod_address = 0x6a,
|
|
|
|
.demod_mode = 0,
|
|
|
|
.xtal = 27000000,
|
|
|
|
.clkmode = 3,/* 0-CLKI, 2-XTALI, else AUTO */
|
|
|
|
.diseqc_mode = 2,/* 2/3 PWM */
|
|
|
|
.tun1_maddress = 0,/* 0x60 */
|
|
|
|
.tun1_adc = 0,/* 2 Vpp */
|
|
|
|
.path1_mode = 3,
|
|
|
|
.tun1_type = 3,
|
2011-02-26 05:41:22 +08:00
|
|
|
.set_lock_led = dw210x_led_ctrl,
|
2009-12-15 07:24:56 +08:00
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static struct ds3000_config su3000_ds3000_config = {
|
|
|
|
.demod_address = 0x68,
|
|
|
|
.ci_mode = 1,
|
|
|
|
};
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
static int dw2104_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
2009-11-28 01:37:35 +08:00
|
|
|
struct dvb_tuner_ops *tuner_ops = NULL;
|
|
|
|
|
|
|
|
if (demod_probe & 4) {
|
|
|
|
d->fe = dvb_attach(stv0900_attach, &dw2104a_stv0900_config,
|
|
|
|
&d->dev->i2c_adap, 0);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
if (dvb_attach(stb6100_attach, d->fe,
|
|
|
|
&dw2104a_stb6100_config,
|
|
|
|
&d->dev->i2c_adap)) {
|
|
|
|
tuner_ops = &d->fe->ops.tuner_ops;
|
|
|
|
tuner_ops->set_frequency = stb6100_set_freq;
|
|
|
|
tuner_ops->get_frequency = stb6100_get_freq;
|
|
|
|
tuner_ops->set_bandwidth = stb6100_set_bandw;
|
|
|
|
tuner_ops->get_bandwidth = stb6100_get_bandw;
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached STV0900+STB6100!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (demod_probe & 2) {
|
|
|
|
d->fe = dvb_attach(stv0900_attach, &dw2104_stv0900_config,
|
|
|
|
&d->dev->i2c_adap, 0);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
if (dvb_attach(stv6110_attach, d->fe,
|
|
|
|
&dw2104_stv6110_config,
|
|
|
|
&d->dev->i2c_adap)) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached STV0900+STV6110A!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (demod_probe & 1) {
|
|
|
|
d->fe = dvb_attach(cx24116_attach, &dw2104_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached cx24116!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
2008-09-18 06:19:19 +08:00
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
2009-11-28 01:37:35 +08:00
|
|
|
info("Attached DS3000!\n");
|
2008-09-09 04:16:40 +08:00
|
|
|
return 0;
|
|
|
|
}
|
2009-11-28 01:37:35 +08:00
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
static struct dvb_usb_device_properties dw2102_properties;
|
2009-06-15 06:41:22 +08:00
|
|
|
static struct dvb_usb_device_properties dw2104_properties;
|
2009-11-28 01:37:35 +08:00
|
|
|
static struct dvb_usb_device_properties s6x0_properties;
|
2008-09-18 06:19:19 +08:00
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
static int dw2102_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
2008-09-18 06:19:19 +08:00
|
|
|
if (dw2102_properties.i2c_algo == &dw2102_serit_i2c_algo) {
|
|
|
|
/*dw2102_properties.adapter->tuner_attach = NULL;*/
|
|
|
|
d->fe = dvb_attach(si21xx_attach, &serit_sp1511lhb_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached si21xx!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
2009-11-28 01:37:35 +08:00
|
|
|
|
2008-10-05 20:11:21 +08:00
|
|
|
if (dw2102_properties.i2c_algo == &dw2102_earda_i2c_algo) {
|
|
|
|
d->fe = dvb_attach(stv0288_attach, &earda_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
2009-11-28 01:37:35 +08:00
|
|
|
if (dvb_attach(stb6000_attach, d->fe, 0x61,
|
|
|
|
&d->dev->i2c_adap)) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached stv0288!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2008-10-05 20:11:21 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
if (dw2102_properties.i2c_algo == &dw2102_i2c_algo) {
|
|
|
|
/*dw2102_properties.adapter->tuner_attach = dw2102_tuner_attach;*/
|
|
|
|
d->fe = dvb_attach(stv0299_attach, &sharp_z0194a_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached stv0299!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
2008-07-20 19:05:50 +08:00
|
|
|
}
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static int dw3101_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
|
|
|
d->fe = dvb_attach(tda10023_attach, &dw3101_tda10023_config,
|
|
|
|
&d->dev->i2c_adap, 0x48);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
info("Attached tda10023!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static int zl100313_frontend_attach(struct dvb_usb_adapter *d)
|
2009-06-20 20:54:18 +08:00
|
|
|
{
|
|
|
|
d->fe = dvb_attach(mt312_attach, &zl313_config,
|
2009-11-28 01:37:35 +08:00
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
if (dvb_attach(zl10039_attach, d->fe, 0x60,
|
|
|
|
&d->dev->i2c_adap)) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached zl100313+zl10039!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int stv0288_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
2009-11-28 01:37:35 +08:00
|
|
|
d->fe = dvb_attach(stv0288_attach, &earda_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe != NULL) {
|
|
|
|
if (dvb_attach(stb6000_attach, d->fe, 0x61,
|
|
|
|
&d->dev->i2c_adap)) {
|
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
info("Attached stv0288+stb6000!\n");
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
return -EIO;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int ds3000_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
2011-02-26 05:41:23 +08:00
|
|
|
struct s6x0_state *st = (struct s6x0_state *)d->dev->priv;
|
2011-02-26 05:41:23 +08:00
|
|
|
u8 obuf[] = {7, 1};
|
2011-02-26 05:41:23 +08:00
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
d->fe = dvb_attach(ds3000_attach, &dw2104_ds3000_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
if (d->fe == NULL)
|
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
st->old_set_voltage = d->fe->ops.set_voltage;
|
|
|
|
d->fe->ops.set_voltage = s660_set_voltage;
|
2011-02-26 05:41:23 +08:00
|
|
|
|
|
|
|
dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
info("Attached ds3000+ds2020!\n");
|
|
|
|
|
|
|
|
return 0;
|
2009-06-20 20:54:18 +08:00
|
|
|
}
|
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
static int prof_7500_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
2011-02-26 05:41:23 +08:00
|
|
|
u8 obuf[] = {7, 1};
|
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
d->fe = dvb_attach(stv0900_attach, &prof_7500_stv0900_config,
|
|
|
|
&d->dev->i2c_adap, 0);
|
|
|
|
if (d->fe == NULL)
|
|
|
|
return -EIO;
|
2011-02-26 05:41:23 +08:00
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
d->fe->ops.set_voltage = dw210x_set_voltage;
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
dw210x_op_rw(d->dev->udev, 0x8a, 0, 0, obuf, 2, DW210X_WRITE_MSG);
|
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
info("Attached STV0900+STB6100A!\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static int su3000_frontend_attach(struct dvb_usb_adapter *d)
|
|
|
|
{
|
|
|
|
u8 obuf[3] = { 0xe, 0x80, 0 };
|
|
|
|
u8 ibuf[] = { 0 };
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
|
|
|
|
err("command 0x0e transfer failed.");
|
|
|
|
|
|
|
|
obuf[0] = 0xe;
|
|
|
|
obuf[1] = 0x83;
|
|
|
|
obuf[2] = 0;
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
|
|
|
|
err("command 0x0e transfer failed.");
|
|
|
|
|
|
|
|
obuf[0] = 0xe;
|
|
|
|
obuf[1] = 0x83;
|
|
|
|
obuf[2] = 1;
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d->dev, obuf, 3, ibuf, 1, 0) < 0)
|
|
|
|
err("command 0x0e transfer failed.");
|
|
|
|
|
|
|
|
obuf[0] = 0x51;
|
|
|
|
|
|
|
|
if (dvb_usb_generic_rw(d->dev, obuf, 1, ibuf, 1, 0) < 0)
|
|
|
|
err("command 0x51 transfer failed.");
|
|
|
|
|
|
|
|
d->fe = dvb_attach(ds3000_attach, &su3000_ds3000_config,
|
|
|
|
&d->dev->i2c_adap);
|
|
|
|
if (d->fe == NULL)
|
|
|
|
return -EIO;
|
|
|
|
|
|
|
|
info("Attached DS3000!\n");
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
static int dw2102_tuner_attach(struct dvb_usb_adapter *adap)
|
|
|
|
{
|
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
|
|
|
|
&adap->dev->i2c_adap, DVB_PLL_OPERA1);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static int dw3101_tuner_attach(struct dvb_usb_adapter *adap)
|
|
|
|
{
|
|
|
|
dvb_attach(dvb_pll_attach, adap->fe, 0x60,
|
|
|
|
&adap->dev->i2c_adap, DVB_PLL_TUA6034);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
static struct rc_map_table rc_map_dw210x_table[] = {
|
2009-08-30 02:19:31 +08:00
|
|
|
{ 0xf80a, KEY_Q }, /*power*/
|
|
|
|
{ 0xf80c, KEY_M }, /*mute*/
|
|
|
|
{ 0xf811, KEY_1 },
|
|
|
|
{ 0xf812, KEY_2 },
|
|
|
|
{ 0xf813, KEY_3 },
|
|
|
|
{ 0xf814, KEY_4 },
|
|
|
|
{ 0xf815, KEY_5 },
|
|
|
|
{ 0xf816, KEY_6 },
|
|
|
|
{ 0xf817, KEY_7 },
|
|
|
|
{ 0xf818, KEY_8 },
|
|
|
|
{ 0xf819, KEY_9 },
|
|
|
|
{ 0xf810, KEY_0 },
|
|
|
|
{ 0xf81c, KEY_PAGEUP }, /*ch+*/
|
|
|
|
{ 0xf80f, KEY_PAGEDOWN }, /*ch-*/
|
|
|
|
{ 0xf81a, KEY_O }, /*vol+*/
|
|
|
|
{ 0xf80e, KEY_Z }, /*vol-*/
|
|
|
|
{ 0xf804, KEY_R }, /*rec*/
|
|
|
|
{ 0xf809, KEY_D }, /*fav*/
|
|
|
|
{ 0xf808, KEY_BACKSPACE }, /*rewind*/
|
|
|
|
{ 0xf807, KEY_A }, /*fast*/
|
|
|
|
{ 0xf80b, KEY_P }, /*pause*/
|
|
|
|
{ 0xf802, KEY_ESC }, /*cancel*/
|
|
|
|
{ 0xf803, KEY_G }, /*tab*/
|
|
|
|
{ 0xf800, KEY_UP }, /*up*/
|
|
|
|
{ 0xf81f, KEY_ENTER }, /*ok*/
|
|
|
|
{ 0xf801, KEY_DOWN }, /*down*/
|
|
|
|
{ 0xf805, KEY_C }, /*cap*/
|
|
|
|
{ 0xf806, KEY_S }, /*stop*/
|
|
|
|
{ 0xf840, KEY_F }, /*full*/
|
|
|
|
{ 0xf81e, KEY_W }, /*tvmode*/
|
|
|
|
{ 0xf81b, KEY_B }, /*recall*/
|
2009-06-15 06:41:22 +08:00
|
|
|
};
|
2008-07-20 19:05:50 +08:00
|
|
|
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
static struct rc_map_table rc_map_tevii_table[] = {
|
2009-08-30 02:19:31 +08:00
|
|
|
{ 0xf80a, KEY_POWER },
|
|
|
|
{ 0xf80c, KEY_MUTE },
|
|
|
|
{ 0xf811, KEY_1 },
|
|
|
|
{ 0xf812, KEY_2 },
|
|
|
|
{ 0xf813, KEY_3 },
|
|
|
|
{ 0xf814, KEY_4 },
|
|
|
|
{ 0xf815, KEY_5 },
|
|
|
|
{ 0xf816, KEY_6 },
|
|
|
|
{ 0xf817, KEY_7 },
|
|
|
|
{ 0xf818, KEY_8 },
|
|
|
|
{ 0xf819, KEY_9 },
|
|
|
|
{ 0xf810, KEY_0 },
|
|
|
|
{ 0xf81c, KEY_MENU },
|
|
|
|
{ 0xf80f, KEY_VOLUMEDOWN },
|
|
|
|
{ 0xf81a, KEY_LAST },
|
|
|
|
{ 0xf80e, KEY_OPEN },
|
|
|
|
{ 0xf804, KEY_RECORD },
|
|
|
|
{ 0xf809, KEY_VOLUMEUP },
|
|
|
|
{ 0xf808, KEY_CHANNELUP },
|
|
|
|
{ 0xf807, KEY_PVR },
|
|
|
|
{ 0xf80b, KEY_TIME },
|
|
|
|
{ 0xf802, KEY_RIGHT },
|
|
|
|
{ 0xf803, KEY_LEFT },
|
|
|
|
{ 0xf800, KEY_UP },
|
|
|
|
{ 0xf81f, KEY_OK },
|
|
|
|
{ 0xf801, KEY_DOWN },
|
|
|
|
{ 0xf805, KEY_TUNER },
|
|
|
|
{ 0xf806, KEY_CHANNELDOWN },
|
|
|
|
{ 0xf840, KEY_PLAYPAUSE },
|
|
|
|
{ 0xf81e, KEY_REWIND },
|
|
|
|
{ 0xf81b, KEY_FAVORITES },
|
|
|
|
{ 0xf81d, KEY_BACK },
|
|
|
|
{ 0xf84d, KEY_FASTFORWARD },
|
|
|
|
{ 0xf844, KEY_EPG },
|
|
|
|
{ 0xf84c, KEY_INFO },
|
|
|
|
{ 0xf841, KEY_AB },
|
|
|
|
{ 0xf843, KEY_AUDIO },
|
|
|
|
{ 0xf845, KEY_SUBTITLE },
|
|
|
|
{ 0xf84a, KEY_LIST },
|
|
|
|
{ 0xf846, KEY_F1 },
|
|
|
|
{ 0xf847, KEY_F2 },
|
|
|
|
{ 0xf85e, KEY_F3 },
|
|
|
|
{ 0xf85c, KEY_F4 },
|
|
|
|
{ 0xf852, KEY_F5 },
|
|
|
|
{ 0xf85a, KEY_F6 },
|
|
|
|
{ 0xf856, KEY_MODE },
|
|
|
|
{ 0xf858, KEY_SWITCHVIDEOMODE },
|
2008-07-20 19:05:50 +08:00
|
|
|
};
|
|
|
|
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
static struct rc_map_table rc_map_tbs_table[] = {
|
2009-08-30 02:19:31 +08:00
|
|
|
{ 0xf884, KEY_POWER },
|
|
|
|
{ 0xf894, KEY_MUTE },
|
|
|
|
{ 0xf887, KEY_1 },
|
|
|
|
{ 0xf886, KEY_2 },
|
|
|
|
{ 0xf885, KEY_3 },
|
|
|
|
{ 0xf88b, KEY_4 },
|
|
|
|
{ 0xf88a, KEY_5 },
|
|
|
|
{ 0xf889, KEY_6 },
|
|
|
|
{ 0xf88f, KEY_7 },
|
|
|
|
{ 0xf88e, KEY_8 },
|
|
|
|
{ 0xf88d, KEY_9 },
|
|
|
|
{ 0xf892, KEY_0 },
|
|
|
|
{ 0xf896, KEY_CHANNELUP },
|
|
|
|
{ 0xf891, KEY_CHANNELDOWN },
|
|
|
|
{ 0xf893, KEY_VOLUMEUP },
|
|
|
|
{ 0xf88c, KEY_VOLUMEDOWN },
|
|
|
|
{ 0xf883, KEY_RECORD },
|
|
|
|
{ 0xf898, KEY_PAUSE },
|
|
|
|
{ 0xf899, KEY_OK },
|
|
|
|
{ 0xf89a, KEY_SHUFFLE },
|
|
|
|
{ 0xf881, KEY_UP },
|
|
|
|
{ 0xf890, KEY_LEFT },
|
|
|
|
{ 0xf882, KEY_RIGHT },
|
|
|
|
{ 0xf888, KEY_DOWN },
|
|
|
|
{ 0xf895, KEY_FAVORITES },
|
|
|
|
{ 0xf897, KEY_SUBTITLE },
|
|
|
|
{ 0xf89d, KEY_ZOOM },
|
|
|
|
{ 0xf89f, KEY_EXIT },
|
|
|
|
{ 0xf89e, KEY_MENU },
|
|
|
|
{ 0xf89c, KEY_EPG },
|
|
|
|
{ 0xf880, KEY_PREVIOUS },
|
|
|
|
{ 0xf89b, KEY_MODE }
|
2009-06-15 06:41:22 +08:00
|
|
|
};
|
2008-07-20 19:05:50 +08:00
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static struct rc_map_table rc_map_su3000_table[] = {
|
|
|
|
{ 0x25, KEY_POWER }, /* right-bottom Red */
|
|
|
|
{ 0x0a, KEY_MUTE }, /* -/-- */
|
|
|
|
{ 0x01, KEY_1 },
|
|
|
|
{ 0x02, KEY_2 },
|
|
|
|
{ 0x03, KEY_3 },
|
|
|
|
{ 0x04, KEY_4 },
|
|
|
|
{ 0x05, KEY_5 },
|
|
|
|
{ 0x06, KEY_6 },
|
|
|
|
{ 0x07, KEY_7 },
|
|
|
|
{ 0x08, KEY_8 },
|
|
|
|
{ 0x09, KEY_9 },
|
|
|
|
{ 0x00, KEY_0 },
|
|
|
|
{ 0x20, KEY_UP }, /* CH+ */
|
|
|
|
{ 0x21, KEY_DOWN }, /* CH+ */
|
|
|
|
{ 0x12, KEY_VOLUMEUP }, /* Brightness Up */
|
|
|
|
{ 0x13, KEY_VOLUMEDOWN },/* Brightness Down */
|
|
|
|
{ 0x1f, KEY_RECORD },
|
|
|
|
{ 0x17, KEY_PLAY },
|
|
|
|
{ 0x16, KEY_PAUSE },
|
|
|
|
{ 0x0b, KEY_STOP },
|
|
|
|
{ 0x27, KEY_FASTFORWARD },/* >> */
|
|
|
|
{ 0x26, KEY_REWIND }, /* << */
|
|
|
|
{ 0x0d, KEY_OK }, /* Mute */
|
|
|
|
{ 0x11, KEY_LEFT }, /* VOL- */
|
|
|
|
{ 0x10, KEY_RIGHT }, /* VOL+ */
|
|
|
|
{ 0x29, KEY_BACK }, /* button under 9 */
|
|
|
|
{ 0x2c, KEY_MENU }, /* TTX */
|
|
|
|
{ 0x2b, KEY_EPG }, /* EPG */
|
|
|
|
{ 0x1e, KEY_RED }, /* OSD */
|
|
|
|
{ 0x0e, KEY_GREEN }, /* Window */
|
|
|
|
{ 0x2d, KEY_YELLOW }, /* button under << */
|
|
|
|
{ 0x0f, KEY_BLUE }, /* bottom yellow button */
|
|
|
|
{ 0x14, KEY_AUDIO }, /* Snapshot */
|
|
|
|
{ 0x38, KEY_TV }, /* TV/Radio */
|
|
|
|
{ 0x0c, KEY_ESC } /* upper Red buttton */
|
|
|
|
};
|
|
|
|
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
static struct rc_map_dvb_usb_table_table keys_tables[] = {
|
|
|
|
{ rc_map_dw210x_table, ARRAY_SIZE(rc_map_dw210x_table) },
|
|
|
|
{ rc_map_tevii_table, ARRAY_SIZE(rc_map_tevii_table) },
|
|
|
|
{ rc_map_tbs_table, ARRAY_SIZE(rc_map_tbs_table) },
|
2011-02-26 05:41:22 +08:00
|
|
|
{ rc_map_su3000_table, ARRAY_SIZE(rc_map_su3000_table) },
|
2009-06-15 06:41:22 +08:00
|
|
|
};
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
static int dw2102_rc_query(struct dvb_usb_device *d, u32 *event, int *state)
|
|
|
|
{
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
struct rc_map_table *keymap = d->props.rc.legacy.rc_map_table;
|
|
|
|
int keymap_size = d->props.rc.legacy.rc_map_size;
|
2008-07-20 19:05:50 +08:00
|
|
|
u8 key[2];
|
2009-06-13 19:10:24 +08:00
|
|
|
struct i2c_msg msg = {
|
|
|
|
.addr = DW2102_RC_QUERY,
|
|
|
|
.flags = I2C_M_RD,
|
|
|
|
.buf = key,
|
|
|
|
.len = 2
|
2008-07-20 19:05:50 +08:00
|
|
|
};
|
|
|
|
int i;
|
2009-06-15 06:41:22 +08:00
|
|
|
/* override keymap */
|
|
|
|
if ((ir_keymap > 0) && (ir_keymap <= ARRAY_SIZE(keys_tables))) {
|
|
|
|
keymap = keys_tables[ir_keymap - 1].rc_keys ;
|
|
|
|
keymap_size = keys_tables[ir_keymap - 1].rc_keys_size;
|
2011-02-26 05:41:22 +08:00
|
|
|
} else if (ir_keymap > ARRAY_SIZE(keys_tables))
|
|
|
|
return 0; /* none */
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
*state = REMOTE_NO_KEY_PRESSED;
|
2009-06-20 20:54:18 +08:00
|
|
|
if (d->props.i2c_algo->master_xfer(&d->i2c_adap, &msg, 1) == 1) {
|
2009-06-15 06:41:22 +08:00
|
|
|
for (i = 0; i < keymap_size ; i++) {
|
2009-08-30 02:19:31 +08:00
|
|
|
if (rc5_data(&keymap[i]) == msg.buf[0]) {
|
2008-07-20 19:05:50 +08:00
|
|
|
*state = REMOTE_KEY_PRESSED;
|
2010-07-31 22:24:57 +08:00
|
|
|
*event = keymap[i].keycode;
|
2008-07-20 19:05:50 +08:00
|
|
|
break;
|
|
|
|
}
|
2009-06-13 19:10:24 +08:00
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
}
|
2009-06-13 19:10:24 +08:00
|
|
|
|
|
|
|
if ((*state) == REMOTE_KEY_PRESSED)
|
|
|
|
deb_rc("%s: found rc key: %x, %x, event: %x\n",
|
|
|
|
__func__, key[0], key[1], (*event));
|
|
|
|
else if (key[0] != 0xff)
|
|
|
|
deb_rc("%s: unknown rc key: %x, %x\n",
|
|
|
|
__func__, key[0], key[1]);
|
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
}
|
2009-06-13 19:10:24 +08:00
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct usb_device_id dw2102_table[] = {
|
|
|
|
{USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2102)},
|
|
|
|
{USB_DEVICE(USB_VID_CYPRESS, 0x2101)},
|
2009-06-15 07:51:45 +08:00
|
|
|
{USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW2104)},
|
|
|
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S650)},
|
2008-11-06 09:12:56 +08:00
|
|
|
{USB_DEVICE(USB_VID_TERRATEC, USB_PID_CINERGY_S)},
|
2009-06-15 07:51:45 +08:00
|
|
|
{USB_DEVICE(USB_VID_CYPRESS, USB_PID_DW3101)},
|
2009-06-20 20:54:18 +08:00
|
|
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S630)},
|
2009-11-28 01:37:35 +08:00
|
|
|
{USB_DEVICE(0x3011, USB_PID_PROF_1100)},
|
|
|
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S660)},
|
2009-12-15 07:24:56 +08:00
|
|
|
{USB_DEVICE(0x3034, 0x7500)},
|
2011-02-26 05:41:22 +08:00
|
|
|
{USB_DEVICE(0x1f4d, 0x3000)},
|
2011-02-26 05:41:22 +08:00
|
|
|
{USB_DEVICE(USB_VID_TERRATEC, 0x00a8)},
|
2011-02-26 05:41:23 +08:00
|
|
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_1)},
|
|
|
|
{USB_DEVICE(0x9022, USB_PID_TEVII_S480_2)},
|
2011-02-28 03:17:25 +08:00
|
|
|
{USB_DEVICE(0x1f4d, 0x3100)},
|
2008-07-20 19:05:50 +08:00
|
|
|
{ }
|
|
|
|
};
|
|
|
|
|
|
|
|
MODULE_DEVICE_TABLE(usb, dw2102_table);
|
|
|
|
|
|
|
|
static int dw2102_load_firmware(struct usb_device *dev,
|
|
|
|
const struct firmware *frmwr)
|
|
|
|
{
|
|
|
|
u8 *b, *p;
|
|
|
|
int ret = 0, i;
|
|
|
|
u8 reset;
|
2008-10-05 20:11:21 +08:00
|
|
|
u8 reset16[] = {0, 0, 0, 0, 0, 0, 0};
|
2008-07-20 19:05:50 +08:00
|
|
|
const struct firmware *fw;
|
2009-11-28 01:37:35 +08:00
|
|
|
const char *fw_2101 = "dvb-usb-dw2101.fw";
|
2009-06-20 20:54:18 +08:00
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
switch (dev->descriptor.idProduct) {
|
|
|
|
case 0x2101:
|
2009-11-28 01:37:35 +08:00
|
|
|
ret = request_firmware(&fw, fw_2101, &dev->dev);
|
2008-07-20 19:05:50 +08:00
|
|
|
if (ret != 0) {
|
2009-11-28 01:37:35 +08:00
|
|
|
err(err_str, fw_2101);
|
2008-07-20 19:05:50 +08:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
break;
|
2008-09-09 04:16:40 +08:00
|
|
|
default:
|
2008-07-20 19:05:50 +08:00
|
|
|
fw = frmwr;
|
|
|
|
break;
|
|
|
|
}
|
2008-09-09 04:16:40 +08:00
|
|
|
info("start downloading DW210X firmware");
|
2008-07-20 19:05:50 +08:00
|
|
|
p = kmalloc(fw->size, GFP_KERNEL);
|
|
|
|
reset = 1;
|
|
|
|
/*stop the CPU*/
|
2008-09-18 06:19:19 +08:00
|
|
|
dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1, DW210X_WRITE_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1, DW210X_WRITE_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
if (p != NULL) {
|
|
|
|
memcpy(p, fw->data, fw->size);
|
|
|
|
for (i = 0; i < fw->size; i += 0x40) {
|
|
|
|
b = (u8 *) p + i;
|
2008-09-18 06:19:19 +08:00
|
|
|
if (dw210x_op_rw(dev, 0xa0, i, 0, b , 0x40,
|
|
|
|
DW210X_WRITE_MSG) != 0x40) {
|
2008-07-20 19:05:50 +08:00
|
|
|
err("error while transferring firmware");
|
|
|
|
ret = -EINVAL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* restart the CPU */
|
|
|
|
reset = 0;
|
2008-09-18 06:19:19 +08:00
|
|
|
if (ret || dw210x_op_rw(dev, 0xa0, 0x7f92, 0, &reset, 1,
|
|
|
|
DW210X_WRITE_MSG) != 1) {
|
2008-07-20 19:05:50 +08:00
|
|
|
err("could not restart the USB controller CPU.");
|
|
|
|
ret = -EINVAL;
|
|
|
|
}
|
2008-09-18 06:19:19 +08:00
|
|
|
if (ret || dw210x_op_rw(dev, 0xa0, 0xe600, 0, &reset, 1,
|
|
|
|
DW210X_WRITE_MSG) != 1) {
|
2008-07-20 19:05:50 +08:00
|
|
|
err("could not restart the USB controller CPU.");
|
|
|
|
ret = -EINVAL;
|
|
|
|
}
|
|
|
|
/* init registers */
|
|
|
|
switch (dev->descriptor.idProduct) {
|
2009-06-15 07:51:45 +08:00
|
|
|
case USB_PID_TEVII_S650:
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
dw2104_properties.rc.legacy.rc_map_table = rc_map_tevii_table;
|
|
|
|
dw2104_properties.rc.legacy.rc_map_size =
|
|
|
|
ARRAY_SIZE(rc_map_tevii_table);
|
2009-06-15 06:41:22 +08:00
|
|
|
case USB_PID_DW2104:
|
2008-09-09 04:16:40 +08:00
|
|
|
reset = 1;
|
2008-09-18 06:19:19 +08:00
|
|
|
dw210x_op_rw(dev, 0xc4, 0x0000, 0, &reset, 1,
|
|
|
|
DW210X_WRITE_MSG);
|
2009-06-15 07:51:45 +08:00
|
|
|
/* break omitted intentionally */
|
|
|
|
case USB_PID_DW3101:
|
2008-09-09 04:16:40 +08:00
|
|
|
reset = 0;
|
2008-09-18 06:19:19 +08:00
|
|
|
dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
|
|
|
|
DW210X_WRITE_MSG);
|
2008-09-09 04:16:40 +08:00
|
|
|
break;
|
2008-11-06 09:12:56 +08:00
|
|
|
case USB_PID_CINERGY_S:
|
2008-07-20 19:05:50 +08:00
|
|
|
case USB_PID_DW2102:
|
2008-09-18 06:19:19 +08:00
|
|
|
dw210x_op_rw(dev, 0xbf, 0x0040, 0, &reset, 0,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
/* check STV0299 frontend */
|
|
|
|
dw210x_op_rw(dev, 0xb5, 0, 0, &reset16[0], 2,
|
|
|
|
DW210X_READ_MSG);
|
2008-12-04 23:49:23 +08:00
|
|
|
if ((reset16[0] == 0xa1) || (reset16[0] == 0x80)) {
|
2008-09-18 06:19:19 +08:00
|
|
|
dw2102_properties.i2c_algo = &dw2102_i2c_algo;
|
2008-10-05 20:11:21 +08:00
|
|
|
dw2102_properties.adapter->tuner_attach = &dw2102_tuner_attach;
|
|
|
|
break;
|
|
|
|
} else {
|
|
|
|
/* check STV0288 frontend */
|
|
|
|
reset16[0] = 0xd0;
|
|
|
|
reset16[1] = 1;
|
|
|
|
reset16[2] = 0;
|
|
|
|
dw210x_op_rw(dev, 0xc2, 0, 0, &reset16[0], 3,
|
|
|
|
DW210X_WRITE_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xc3, 0xd1, 0, &reset16[0], 3,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
if (reset16[2] == 0x11) {
|
|
|
|
dw2102_properties.i2c_algo = &dw2102_earda_i2c_algo;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2008-07-20 19:05:50 +08:00
|
|
|
case 0x2101:
|
2008-09-18 06:19:19 +08:00
|
|
|
dw210x_op_rw(dev, 0xbc, 0x0030, 0, &reset16[0], 2,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xba, 0x0000, 0, &reset16[0], 7,
|
|
|
|
DW210X_READ_MSG);
|
|
|
|
dw210x_op_rw(dev, 0xb9, 0x0000, 0, &reset16[0], 2,
|
|
|
|
DW210X_READ_MSG);
|
2008-07-20 19:05:50 +08:00
|
|
|
break;
|
|
|
|
}
|
2009-06-15 07:51:45 +08:00
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
msleep(100);
|
2008-07-20 19:05:50 +08:00
|
|
|
kfree(p);
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct dvb_usb_device_properties dw2102_properties = {
|
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-dw2102.fw",
|
|
|
|
.no_reconnect = 1,
|
|
|
|
|
2008-09-18 06:19:19 +08:00
|
|
|
.i2c_algo = &dw2102_serit_i2c_algo,
|
2010-08-01 05:04:09 +08:00
|
|
|
|
|
|
|
.rc.legacy = {
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
.rc_map_table = rc_map_dw210x_table,
|
|
|
|
.rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_query = dw2102_rc_query,
|
|
|
|
},
|
2008-07-20 19:05:50 +08:00
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x81,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.num_adapters = 1,
|
|
|
|
.download_firmware = dw2102_load_firmware,
|
2008-09-18 06:19:19 +08:00
|
|
|
.read_mac_address = dw210x_read_mac_address,
|
2009-06-15 07:51:45 +08:00
|
|
|
.adapter = {
|
2008-07-20 19:05:50 +08:00
|
|
|
{
|
|
|
|
.frontend_attach = dw2102_frontend_attach,
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 8,
|
|
|
|
.endpoint = 0x82,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 4096,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2008-11-06 09:12:56 +08:00
|
|
|
.num_device_descs = 3,
|
2008-07-20 19:05:50 +08:00
|
|
|
.devices = {
|
|
|
|
{"DVBWorld DVB-S 2102 USB2.0",
|
|
|
|
{&dw2102_table[0], NULL},
|
|
|
|
{NULL},
|
|
|
|
},
|
|
|
|
{"DVBWorld DVB-S 2101 USB2.0",
|
|
|
|
{&dw2102_table[1], NULL},
|
|
|
|
{NULL},
|
2008-11-06 09:12:56 +08:00
|
|
|
},
|
|
|
|
{"TerraTec Cinergy S USB",
|
|
|
|
{&dw2102_table[4], NULL},
|
|
|
|
{NULL},
|
2008-07-20 19:05:50 +08:00
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
static struct dvb_usb_device_properties dw2104_properties = {
|
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-dw2104.fw",
|
|
|
|
.no_reconnect = 1,
|
|
|
|
|
|
|
|
.i2c_algo = &dw2104_i2c_algo,
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc.legacy = {
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
.rc_map_table = rc_map_dw210x_table,
|
|
|
|
.rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_query = dw2102_rc_query,
|
|
|
|
},
|
2008-09-09 04:16:40 +08:00
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x81,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.num_adapters = 1,
|
|
|
|
.download_firmware = dw2102_load_firmware,
|
2008-09-18 06:19:19 +08:00
|
|
|
.read_mac_address = dw210x_read_mac_address,
|
2008-09-09 04:16:40 +08:00
|
|
|
.adapter = {
|
|
|
|
{
|
|
|
|
.frontend_attach = dw2104_frontend_attach,
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 8,
|
|
|
|
.endpoint = 0x82,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 4096,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
.num_device_descs = 2,
|
|
|
|
.devices = {
|
|
|
|
{ "DVBWorld DW2104 USB2.0",
|
|
|
|
{&dw2102_table[2], NULL},
|
|
|
|
{NULL},
|
|
|
|
},
|
|
|
|
{ "TeVii S650 USB2.0",
|
|
|
|
{&dw2102_table[3], NULL},
|
|
|
|
{NULL},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-06-15 07:51:45 +08:00
|
|
|
static struct dvb_usb_device_properties dw3101_properties = {
|
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.firmware = "dvb-usb-dw3101.fw",
|
|
|
|
.no_reconnect = 1,
|
|
|
|
|
|
|
|
.i2c_algo = &dw3101_i2c_algo,
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc.legacy = {
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
.rc_map_table = rc_map_dw210x_table,
|
|
|
|
.rc_map_size = ARRAY_SIZE(rc_map_dw210x_table),
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_query = dw2102_rc_query,
|
|
|
|
},
|
2009-06-15 07:51:45 +08:00
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x81,
|
|
|
|
/* parameter for the MPEG2-data transfer */
|
|
|
|
.num_adapters = 1,
|
|
|
|
.download_firmware = dw2102_load_firmware,
|
|
|
|
.read_mac_address = dw210x_read_mac_address,
|
|
|
|
.adapter = {
|
|
|
|
{
|
|
|
|
.frontend_attach = dw3101_frontend_attach,
|
|
|
|
.tuner_attach = dw3101_tuner_attach,
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 8,
|
|
|
|
.endpoint = 0x82,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 4096,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
|
|
|
.num_device_descs = 1,
|
|
|
|
.devices = {
|
|
|
|
{ "DVBWorld DVB-C 3101 USB2.0",
|
|
|
|
{&dw2102_table[5], NULL},
|
|
|
|
{NULL},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
static struct dvb_usb_device_properties s6x0_properties = {
|
2009-06-20 20:54:18 +08:00
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
2011-02-26 05:41:23 +08:00
|
|
|
.size_of_priv = sizeof(struct s6x0_state),
|
2009-06-20 20:54:18 +08:00
|
|
|
.firmware = "dvb-usb-s630.fw",
|
|
|
|
.no_reconnect = 1,
|
|
|
|
|
2009-11-28 01:37:35 +08:00
|
|
|
.i2c_algo = &s6x0_i2c_algo,
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc.legacy = {
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
.rc_map_table = rc_map_tevii_table,
|
|
|
|
.rc_map_size = ARRAY_SIZE(rc_map_tevii_table),
|
2010-08-01 05:04:09 +08:00
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_query = dw2102_rc_query,
|
|
|
|
},
|
2009-06-20 20:54:18 +08:00
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x81,
|
|
|
|
.num_adapters = 1,
|
|
|
|
.download_firmware = dw2102_load_firmware,
|
2009-11-28 01:37:35 +08:00
|
|
|
.read_mac_address = s6x0_read_mac_address,
|
2009-06-20 20:54:18 +08:00
|
|
|
.adapter = {
|
|
|
|
{
|
2011-02-26 05:41:22 +08:00
|
|
|
.frontend_attach = zl100313_frontend_attach,
|
2009-06-20 20:54:18 +08:00
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 8,
|
|
|
|
.endpoint = 0x82,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 4096,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
|
|
|
},
|
2011-02-26 05:41:22 +08:00
|
|
|
.num_device_descs = 1,
|
2009-06-20 20:54:18 +08:00
|
|
|
.devices = {
|
|
|
|
{"TeVii S630 USB",
|
|
|
|
{&dw2102_table[6], NULL},
|
|
|
|
{NULL},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
struct dvb_usb_device_properties *p1100;
|
|
|
|
static struct dvb_usb_device_description d1100 = {
|
|
|
|
"Prof 1100 USB ",
|
|
|
|
{&dw2102_table[7], NULL},
|
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
struct dvb_usb_device_properties *s660;
|
|
|
|
static struct dvb_usb_device_description d660 = {
|
|
|
|
"TeVii S660 USB",
|
|
|
|
{&dw2102_table[8], NULL},
|
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:23 +08:00
|
|
|
static struct dvb_usb_device_description d480_1 = {
|
|
|
|
"TeVii S480.1 USB",
|
|
|
|
{&dw2102_table[12], NULL},
|
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
|
|
|
static struct dvb_usb_device_description d480_2 = {
|
|
|
|
"TeVii S480.2 USB",
|
|
|
|
{&dw2102_table[13], NULL},
|
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
2009-12-15 07:24:56 +08:00
|
|
|
struct dvb_usb_device_properties *p7500;
|
|
|
|
static struct dvb_usb_device_description d7500 = {
|
|
|
|
"Prof 7500 USB DVB-S2",
|
|
|
|
{&dw2102_table[9], NULL},
|
|
|
|
{NULL},
|
|
|
|
};
|
|
|
|
|
2011-02-26 05:41:22 +08:00
|
|
|
static struct dvb_usb_device_properties su3000_properties = {
|
|
|
|
.caps = DVB_USB_IS_AN_I2C_ADAPTER,
|
|
|
|
.usb_ctrl = DEVICE_SPECIFIC,
|
|
|
|
.size_of_priv = sizeof(struct su3000_state),
|
|
|
|
.power_ctrl = su3000_power_ctrl,
|
|
|
|
.num_adapters = 1,
|
|
|
|
.identify_state = su3000_identify_state,
|
|
|
|
.i2c_algo = &su3000_i2c_algo,
|
|
|
|
|
|
|
|
.rc.legacy = {
|
|
|
|
.rc_map_table = rc_map_su3000_table,
|
|
|
|
.rc_map_size = ARRAY_SIZE(rc_map_su3000_table),
|
|
|
|
.rc_interval = 150,
|
|
|
|
.rc_query = dw2102_rc_query,
|
|
|
|
},
|
|
|
|
|
|
|
|
.read_mac_address = su3000_read_mac_address,
|
|
|
|
|
|
|
|
.generic_bulk_ctrl_endpoint = 0x01,
|
|
|
|
|
|
|
|
.adapter = {
|
|
|
|
{
|
|
|
|
.streaming_ctrl = su3000_streaming_ctrl,
|
|
|
|
.frontend_attach = su3000_frontend_attach,
|
|
|
|
.stream = {
|
|
|
|
.type = USB_BULK,
|
|
|
|
.count = 8,
|
|
|
|
.endpoint = 0x82,
|
|
|
|
.u = {
|
|
|
|
.bulk = {
|
|
|
|
.buffersize = 4096,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2011-02-28 03:17:25 +08:00
|
|
|
.num_device_descs = 3,
|
2011-02-26 05:41:22 +08:00
|
|
|
.devices = {
|
|
|
|
{ "SU3000HD DVB-S USB2.0",
|
|
|
|
{ &dw2102_table[10], NULL },
|
|
|
|
{ NULL },
|
|
|
|
},
|
2011-02-26 05:41:22 +08:00
|
|
|
{ "Terratec Cinergy S2 USB HD",
|
|
|
|
{ &dw2102_table[11], NULL },
|
|
|
|
{ NULL },
|
|
|
|
},
|
2011-02-28 03:17:25 +08:00
|
|
|
{ "X3M TV SPC1400HD PCI",
|
|
|
|
{ &dw2102_table[14], NULL },
|
|
|
|
{ NULL },
|
|
|
|
},
|
2011-02-26 05:41:22 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2008-07-20 19:05:50 +08:00
|
|
|
static int dw2102_probe(struct usb_interface *intf,
|
|
|
|
const struct usb_device_id *id)
|
|
|
|
{
|
2011-02-26 05:41:22 +08:00
|
|
|
p1100 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
|
|
|
|
if (!p1100)
|
|
|
|
return -ENOMEM;
|
|
|
|
/* copy default structure */
|
|
|
|
memcpy(p1100, &s6x0_properties,
|
|
|
|
sizeof(struct dvb_usb_device_properties));
|
|
|
|
/* fill only different fields */
|
|
|
|
p1100->firmware = "dvb-usb-p1100.fw";
|
|
|
|
p1100->devices[0] = d1100;
|
|
|
|
p1100->rc.legacy.rc_map_table = rc_map_tbs_table;
|
|
|
|
p1100->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
|
|
|
|
p1100->adapter->frontend_attach = stv0288_frontend_attach;
|
|
|
|
|
|
|
|
s660 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
|
|
|
|
if (!s660) {
|
|
|
|
kfree(p1100);
|
|
|
|
return -ENOMEM;
|
|
|
|
}
|
|
|
|
memcpy(s660, &s6x0_properties,
|
|
|
|
sizeof(struct dvb_usb_device_properties));
|
|
|
|
s660->firmware = "dvb-usb-s660.fw";
|
2011-02-26 05:41:23 +08:00
|
|
|
s660->num_device_descs = 3;
|
2011-02-26 05:41:22 +08:00
|
|
|
s660->devices[0] = d660;
|
2011-02-26 05:41:23 +08:00
|
|
|
s660->devices[1] = d480_1;
|
|
|
|
s660->devices[2] = d480_2;
|
2011-02-26 05:41:22 +08:00
|
|
|
s660->adapter->frontend_attach = ds3000_frontend_attach;
|
2009-12-15 07:24:56 +08:00
|
|
|
|
|
|
|
p7500 = kzalloc(sizeof(struct dvb_usb_device_properties), GFP_KERNEL);
|
2011-02-26 05:41:22 +08:00
|
|
|
if (!p7500) {
|
|
|
|
kfree(p1100);
|
|
|
|
kfree(s660);
|
2009-12-15 07:24:56 +08:00
|
|
|
return -ENOMEM;
|
2011-02-26 05:41:22 +08:00
|
|
|
}
|
2009-12-15 07:24:56 +08:00
|
|
|
memcpy(p7500, &s6x0_properties,
|
|
|
|
sizeof(struct dvb_usb_device_properties));
|
|
|
|
p7500->firmware = "dvb-usb-p7500.fw";
|
|
|
|
p7500->devices[0] = d7500;
|
[media] rc: Name RC keymap tables as rc_map_table
Remote keytables had different names all over the place. Part of the fault
is due to a bad naming when rc subsystem was created, but there were lots
of old names that were still here.
Use a common standard for everything.
Patch generated by this script:
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_scancode,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,ir_codes_,rc_map_,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_key_map,rc_map_table,g <$i >a && mv a $i; done
for i in `find drivers/staging -type f -name *.[ch]` `find include/media -type f -name *.[ch]` `find drivers/media -type f -name *.[ch]`; do sed s,rc_map_table_size,rc_map_size,g <$i >a && mv a $i; done
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2010-11-18 02:46:09 +08:00
|
|
|
p7500->rc.legacy.rc_map_table = rc_map_tbs_table;
|
|
|
|
p7500->rc.legacy.rc_map_size = ARRAY_SIZE(rc_map_tbs_table);
|
2009-12-15 07:24:56 +08:00
|
|
|
p7500->adapter->frontend_attach = prof_7500_frontend_attach;
|
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
if (0 == dvb_usb_device_init(intf, &dw2102_properties,
|
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
|
|
|
0 == dvb_usb_device_init(intf, &dw2104_properties,
|
2009-06-15 07:51:45 +08:00
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
|
|
|
0 == dvb_usb_device_init(intf, &dw3101_properties,
|
2009-06-20 20:54:18 +08:00
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
2009-11-28 01:37:35 +08:00
|
|
|
0 == dvb_usb_device_init(intf, &s6x0_properties,
|
2009-12-15 07:24:56 +08:00
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
2011-02-26 05:41:22 +08:00
|
|
|
0 == dvb_usb_device_init(intf, p1100,
|
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
|
|
|
0 == dvb_usb_device_init(intf, s660,
|
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
2009-12-15 07:24:56 +08:00
|
|
|
0 == dvb_usb_device_init(intf, p7500,
|
2011-02-26 05:41:22 +08:00
|
|
|
THIS_MODULE, NULL, adapter_nr) ||
|
|
|
|
0 == dvb_usb_device_init(intf, &su3000_properties,
|
|
|
|
THIS_MODULE, NULL, adapter_nr))
|
2008-09-09 04:16:40 +08:00
|
|
|
return 0;
|
2009-11-28 01:37:35 +08:00
|
|
|
|
2008-09-09 04:16:40 +08:00
|
|
|
return -ENODEV;
|
2008-07-20 19:05:50 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
static struct usb_driver dw2102_driver = {
|
|
|
|
.name = "dw2102",
|
|
|
|
.probe = dw2102_probe,
|
|
|
|
.disconnect = dvb_usb_device_exit,
|
|
|
|
.id_table = dw2102_table,
|
|
|
|
};
|
|
|
|
|
|
|
|
static int __init dw2102_module_init(void)
|
|
|
|
{
|
|
|
|
int ret = usb_register(&dw2102_driver);
|
|
|
|
if (ret)
|
|
|
|
err("usb_register failed. Error number %d", ret);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void __exit dw2102_module_exit(void)
|
|
|
|
{
|
|
|
|
usb_deregister(&dw2102_driver);
|
|
|
|
}
|
|
|
|
|
|
|
|
module_init(dw2102_module_init);
|
|
|
|
module_exit(dw2102_module_exit);
|
|
|
|
|
|
|
|
MODULE_AUTHOR("Igor M. Liplianin (c) liplianin@me.by");
|
2009-06-15 07:51:45 +08:00
|
|
|
MODULE_DESCRIPTION("Driver for DVBWorld DVB-S 2101, 2102, DVB-S2 2104,"
|
|
|
|
" DVB-C 3101 USB2.0,"
|
2011-02-26 05:41:23 +08:00
|
|
|
" TeVii S600, S630, S650, S660, S480,"
|
2011-02-26 05:41:22 +08:00
|
|
|
" Prof 1100, 7500 USB2.0,"
|
|
|
|
" Geniatech SU3000 devices");
|
2008-07-20 19:05:50 +08:00
|
|
|
MODULE_VERSION("0.1");
|
|
|
|
MODULE_LICENSE("GPL");
|