summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2005-01-04 16:31:20 +0000
committerGerd Knorr <devnull@localhost>2005-01-04 16:31:20 +0000
commitd11bf9fb3ca8e03aa181518279de67fcd51ee374 (patch)
tree4ad254e15a99aa03cfb729c21331c9da4004a45d /v4l
parent5bac93165c075e9bde153e2abd14d5c5a550d90a (diff)
downloadmediapointer-dvb-s2-d11bf9fb3ca8e03aa181518279de67fcd51ee374.tar.gz
mediapointer-dvb-s2-d11bf9fb3ca8e03aa181518279de67fcd51ee374.tar.bz2
- more pinnacle 300i stuff (not working yet).
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Make.config6
-rw-r--r--v4l/mt352.c41
-rw-r--r--v4l/scripts/update8
3 files changed, 35 insertions, 20 deletions
diff --git a/v4l/Make.config b/v4l/Make.config
index c3c14b78f..b941e3ff8 100644
--- a/v4l/Make.config
+++ b/v4l/Make.config
@@ -8,9 +8,9 @@ CONFIG_VIDEO_TUNER := m
CONFIG_VIDEO_TVAUDIO := m
CONFIG_VIDEO_CX88 := m
-# doesn't build without patches from dvb cvs
-# use "make DVB=1" to build with DVB support.
-ifeq ($(DVB),1)
+# doesn't build on kernels older than 2.6.10
+# Hmm, need a more clever check once we have 2.6.11 ...
+ifeq ($(KERNELRELEASE),2.6.10)
CONFIG_VIDEO_CX88_DVB := m
CONFIG_VIDEO_SAA7134_DVB := m
else
diff --git a/v4l/mt352.c b/v4l/mt352.c
index 4638207be..9d7ddefc1 100644
--- a/v4l/mt352.c
+++ b/v4l/mt352.c
@@ -107,11 +107,14 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
struct dvb_frontend_parameters *param)
{
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
- unsigned char buf[14];
+ unsigned char buf[13];
+ static unsigned char go[2] = { 0x5b, 0x01 };
unsigned int tps = 0;
struct dvb_ofdm_parameters *op = &param->u.ofdm;
- int i;
+ int regs, tune, i;
+ dprintk("%s: hello\n",__FUNCTION__);
+
switch (op->code_rate_HP) {
case FEC_2_3:
tps |= (1 << 7);
@@ -243,21 +246,30 @@ static int mt352_set_parameters(struct dvb_frontend* fe,
state->config->pll_set(fe, param, buf+8);
- buf[13] = 0x01; /* TUNER_GO!! */
+ if (0 != buf[8]) {
+ /* default */
+ regs = 13;
+ tune = 0;
+ } else {
+ /* no tuner address given => don't write these registers */
+ regs = 8;
+ tune = 1;
+ }
/* Only send the tuning request if the tuner doesn't have the requested
* parameters already set. Enhances tuning time and prevents stream
* breakup when retuning the same transponder. */
- for (i = 1; i < 13; i++) {
+ for (i = 1; i < regs; i++) {
if (buf[i] != mt352_read_register(state, i + 0x50)) {
- mt352_write(fe, buf, sizeof(buf));
+ mt352_write(fe, buf, regs);
+ tune = 1;
break;
}
- if (8 == i && 0 == buf[i])
- /* no tuner address given => skip that part */
- break;
}
+ if (tune)
+ mt352_write(fe, go, sizeof(go)); /* set TUNER_GO */
+
return 0;
}
@@ -381,7 +393,7 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status)
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
u8 r;
- *status = 0;
+ *status = 0;
r = mt352_read_register (state, STATUS_0);
if (r & (1 << 4))
*status = FE_HAS_CARRIER;
@@ -462,22 +474,24 @@ static int mt352_init(struct dvb_frontend* fe)
static u8 mt352_reset_attach [] = { RESET, 0xC0 };
+ dprintk("%s: hello\n",__FUNCTION__);
+
if ((mt352_read_register(state, CLOCK_CTL) & 0x10) == 0 ||
(mt352_read_register(state, CONFIG) & 0x20) == 0) {
- /* Do a "hard" reset */
+ /* Do a "hard" reset */
mt352_write(fe, mt352_reset_attach, sizeof(mt352_reset_attach));
return state->config->demod_init(fe);
}
return 0;
- }
+}
static void mt352_release(struct dvb_frontend* fe)
{
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
- kfree(state);
- }
+ kfree(state);
+}
static struct dvb_frontend_ops mt352_ops;
@@ -489,6 +503,7 @@ struct dvb_frontend* mt352_attach(const struct mt352_config* config,
/* allocate memory for the internal state */
state = (struct mt352_state*) kmalloc(sizeof(struct mt352_state), GFP_KERNEL);
if (state == NULL) goto error;
+ memset(state,0,sizeof(*state));
/* setup the state */
state->config = config;
diff --git a/v4l/scripts/update b/v4l/scripts/update
index 8ac84be67..8e5c3e5e0 100644
--- a/v4l/scripts/update
+++ b/v4l/scripts/update
@@ -73,8 +73,8 @@ xinsmod tveeprom debug=0
xinsmod dvb-pll debug=1
xinsmod btcx-risc debug=0
xinsmod ir-common debug=1 repeat=0
-xinsmod tuner debug=0
-xinsmod tda9887 debug=0 port2=0
+xinsmod tuner debug=1
+xinsmod tda9887 debug=0
xinsmod msp3400 debug=0
# bttv
@@ -97,7 +97,7 @@ xinsmod saa7134-empress
# dvb stuff
xinsmod cx22702 debug=0
-xinsmod mt352 debug=0
+xinsmod mt352 debug=1
xinsmod video-buf-dvb
-xinsmod cx88-dvb
xinsmod saa7134-dvb
+xinsmod cx88-dvb