Commit 81bef2b0 authored by Michael Hunold's avatar Michael Hunold Committed by Linus Torvalds

[PATCH] DVB: misc. updates to frontend drivers

- [DVB] add legacy DishNetwork support to dvb core and stv0299, thanks to Jeremy Hall
- [DVB] mt352: major cleanup, support DVICO FusionHDTV DVB-T, thanks to Christopher Pascoe
Signed-off-by: default avatarMichael Hunold <hunold@linuxtv.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 65f4cda1
This diff is collapsed.
...@@ -4,11 +4,16 @@ ...@@ -4,11 +4,16 @@
* Written by Holger Waechtler <holger@qanu.de> * Written by Holger Waechtler <holger@qanu.de>
* and Daniel Mack <daniel@qanu.de> * and Daniel Mack <daniel@qanu.de>
* *
* Support for Samsung TDTC9251DH01C(M) tuner * AVerMedia AVerTV DVB-T 771 support by
* Wolfram Joost <dbox2@frokaschwei.de>
* *
* Support for Samsung TDTC9251DH01C(M) tuner
* Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it> * Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it>
* Amauri Celani <acelani@essegi.net> * Amauri Celani <acelani@essegi.net>
* *
* DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by
* Christopher Pascoe <c.pascoe@itee.uq.edu.au>
*
* This program is free software; you can redistribute it and/or modify * 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 * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
...@@ -29,12 +34,13 @@ ...@@ -29,12 +34,13 @@
#define _MT352_ #define _MT352_
#define I2C_MT352_ADDR 0x0f #define I2C_MT352_ADDR 0x0f
#define I2C_TUNER_ADDR 0xc2
#define ID_MT352 0x13 #define ID_MT352 0x13
#define CARD_AVDVBT771 0x00 #define CARD_AVDVBT771 0x00
#define CARD_TUA6034 0x01 #define CARD_TUA6034 0x01
#define CARD_TDTC9251DH01C 0x02 #define CARD_TDTC9251DH01C 0x02
#define CARD_DVICODVBT1 0x03
#define CARD_DVICODVBTLITE 0x04
#define msb(x) (((x) >> 8) & 0xff) #define msb(x) (((x) >> 8) & 0xff)
#define lsb(x) ((x) & 0xff) #define lsb(x) ((x) & 0xff)
...@@ -123,6 +129,9 @@ enum mt352_reg_addr { ...@@ -123,6 +129,9 @@ enum mt352_reg_addr {
}; };
struct _tuner_info { struct _tuner_info {
char *fe_name;
#define FE_NAME tuner_info[card_type].fe_name
__u32 fe_frequency_min; __u32 fe_frequency_min;
#define FE_FREQ_MIN tuner_info[card_type].fe_frequency_min #define FE_FREQ_MIN tuner_info[card_type].fe_frequency_min
...@@ -132,26 +141,8 @@ struct _tuner_info { ...@@ -132,26 +141,8 @@ struct _tuner_info {
__u32 fe_frequency_stepsize; //verificare se u32 e' corretto __u32 fe_frequency_stepsize; //verificare se u32 e' corretto
#define FE_FREQ_STEPSIZE tuner_info[card_type].fe_frequency_stepsize #define FE_FREQ_STEPSIZE tuner_info[card_type].fe_frequency_stepsize
__u32 coderate_hp_shift; //verificare se u32 giusto u8 pll_i2c_addr;
#define CODERATE_HP_SHIFT tuner_info[card_type].coderate_hp_shift #define PLL_I2C_ADDR tuner_info[card_type].pll_i2c_addr
__u32 coderate_lp_shift;
#define CODERATE_LP_SHIFT tuner_info[card_type].coderate_lp_shift
int constellation_shift;
#define CONSTELLATION_SHIFT tuner_info[card_type].constellation_shift
int tx_mode_shift;
#define TX_MODE_SHIFT tuner_info[card_type].tx_mode_shift
int guard_interval_shift;
#define GUARD_INTERVAL_SHIFT tuner_info[card_type].guard_interval_shift
int hierarchy_shift;
#define HIERARCHY_SHIFT tuner_info[card_type].hierarchy_shift
int read_reg_flag;
#define READ_REG_FLAG tuner_info[card_type].read_reg_flag
int (* mt352_init) (struct i2c_adapter *i2c); int (* mt352_init) (struct i2c_adapter *i2c);
#define MT352_INIT tuner_info[card_type].mt352_init #define MT352_INIT tuner_info[card_type].mt352_init
...@@ -166,12 +157,18 @@ struct _tuner_info { ...@@ -166,12 +157,18 @@ struct _tuner_info {
static int mt352_init_TUA6034(struct i2c_adapter *i2c); static int mt352_init_TUA6034(struct i2c_adapter *i2c);
static int mt352_init_AVERMEDIA771(struct i2c_adapter *i2c); static int mt352_init_AVERMEDIA771(struct i2c_adapter *i2c);
static int mt352_init_TDTC9251DH01C(struct i2c_adapter *i2c); static int mt352_init_TDTC9251DH01C(struct i2c_adapter *i2c);
static int mt352_init_DVICODVBT1(struct i2c_adapter *i2c);
static int mt352_init_DVICODVBTLITE(struct i2c_adapter *i2c);
static unsigned char mt352_cp_TUA6034(u32 freq); static unsigned char mt352_cp_TUA6034(u32 freq);
static unsigned char mt352_cp_AVERMEDIA771(u32 freq); static unsigned char mt352_cp_AVERMEDIA771(u32 freq);
static unsigned char mt352_cp_TDTC9251DH01C(u32 freq); static unsigned char mt352_cp_TDTC9251DH01C(u32 freq);
static unsigned char mt352_cp_DVICODVBT1(u32 freq);
static unsigned char mt352_cp_DVICODVBTLITE(u32 freq);
static unsigned char mt352_bs_TUA6034(u32 freq); static unsigned char mt352_bs_TUA6034(u32 freq);
static unsigned char mt352_bs_AVERMEDIA771(u32 freq); static unsigned char mt352_bs_AVERMEDIA771(u32 freq);
static unsigned char mt352_bs_TDTC9251DH01C(u32 freq); static unsigned char mt352_bs_TDTC9251DH01C(u32 freq);
static int mt352_detect_avermedia_771(struct i2c_adapter *i2c); static unsigned char mt352_bs_DVICODVBT1(u32 freq);
static unsigned char mt352_bs_DVICODVBTLITE(u32 freq);
static u8 mt352_read_register(struct i2c_adapter *i2c, u8 reg);
#endif /* _MT352_ */ #endif /* _MT352_ */
...@@ -885,6 +885,43 @@ static int stv0299_set_voltage (struct i2c_adapter *i2c, fe_sec_voltage_t voltag ...@@ -885,6 +885,43 @@ static int stv0299_set_voltage (struct i2c_adapter *i2c, fe_sec_voltage_t voltag
} }
static int stv0299_send_legacy_dish_cmd(struct i2c_adapter *i2c, u32 cmd,
int tuner_type)
{
u8 last = 1;
int i;
/* reset voltage at the end
if((0x50 & stv0299_readreg (i2c, 0x0c)) == 0x50)
cmd |= 0x80;
else
cmd &= 0x7F;
*/
cmd = cmd << 1;
dprintk("%s switch command: 0x%04x\n",__FUNCTION__, cmd);
stv0299_set_voltage(i2c,SEC_VOLTAGE_18,tuner_type);
msleep(32);
for (i=0; i<9; i++) {
if((cmd & 0x01) != last) {
stv0299_set_voltage(i2c,
last ? SEC_VOLTAGE_13 :
SEC_VOLTAGE_18,
tuner_type);
last = (last) ? 0 : 1;
}
cmd = cmd >> 1;
if (i != 8)
msleep(8);
}
return 0;
}
static int stv0299_set_symbolrate (struct i2c_adapter *i2c, u32 srate, int tuner_type) static int stv0299_set_symbolrate (struct i2c_adapter *i2c, u32 srate, int tuner_type)
{ {
u64 big = srate; u64 big = srate;
...@@ -1229,6 +1266,10 @@ static int uni0299_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg) ...@@ -1229,6 +1266,10 @@ static int uni0299_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
return stv0299_set_voltage (i2c, (fe_sec_voltage_t) arg, return stv0299_set_voltage (i2c, (fe_sec_voltage_t) arg,
state->tuner_type); state->tuner_type);
case FE_DISHNETWORK_SEND_LEGACY_CMD:
return stv0299_send_legacy_dish_cmd (i2c, (u32) arg,
state->tuner_type);
case FE_GET_TUNE_SETTINGS: case FE_GET_TUNE_SETTINGS:
{ {
struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg; struct dvb_frontend_tune_settings* fesettings = (struct dvb_frontend_tune_settings*) arg;
...@@ -1276,12 +1317,12 @@ static long probe_tuner (struct i2c_adapter *adapter) ...@@ -1276,12 +1317,12 @@ static long probe_tuner (struct i2c_adapter *adapter)
u8 stat [] = { 0 }; u8 stat [] = { 0 };
u8 tda6100_buf [] = { 0, 0 }; u8 tda6100_buf [] = { 0, 0 };
int ret; int ret;
struct i2c_msg msg1 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, struct i2c_msg msg1 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 },
{ .addr = 0x60, .flags = I2C_M_RD, .buf = stat, .len = 1 }}; { .addr = 0x60, .flags = I2C_M_RD, .buf = stat, .len = 1 }};
struct i2c_msg msg2 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, struct i2c_msg msg2 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 },
{ .addr = 0x61, .flags = I2C_M_RD, .buf = stat, .len = 1 }}; { .addr = 0x61, .flags = I2C_M_RD, .buf = stat, .len = 1 }};
struct i2c_msg msg3 [] = {{ .addr = 0x68, .buf = rpt, .len = 2 }, struct i2c_msg msg3 [] = {{ .addr = 0x68, .flags = 0, .buf = rpt, len: 2 },
{ .addr = 0x60, .buf = tda6100_buf, .len = 2 }}; { .addr = 0x60, .flags = 0, .buf = tda6100_buf, .len = 2 }};
stv0299_writereg (i2c, 0x01, 0x15); stv0299_writereg (i2c, 0x01, 0x15);
stv0299_writereg (i2c, 0x02, 0x30); stv0299_writereg (i2c, 0x02, 0x30);
......
...@@ -258,6 +258,8 @@ struct dvb_frontend_event { ...@@ -258,6 +258,8 @@ struct dvb_frontend_event {
#define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters) #define FE_GET_FRONTEND _IOR('o', 77, struct dvb_frontend_parameters)
#define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event) #define FE_GET_EVENT _IOR('o', 78, struct dvb_frontend_event)
#define FE_DISHNETWORK_SEND_LEGACY_CMD _IO('o', 80) /* unsigned int */
#endif /*_DVBFRONTEND_H_*/ #endif /*_DVBFRONTEND_H_*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment