summaryrefslogtreecommitdiff
path: root/v4l
diff options
context:
space:
mode:
authorGerd Knorr <devnull@localhost>2005-01-24 17:37:23 +0000
committerGerd Knorr <devnull@localhost>2005-01-24 17:37:23 +0000
commit588d0f9cc7aa0863fe8e84e16aa98e847e6d214d (patch)
tree998678a36f1672304670bfc08d4d9dd625a5f5aa /v4l
parent798aea71fd4046e8f2673d896b058eb0cac8298c (diff)
downloadmediapointer-dvb-s2-588d0f9cc7aa0863fe8e84e16aa98e847e6d214d.tar.gz
mediapointer-dvb-s2-588d0f9cc7aa0863fe8e84e16aa98e847e6d214d.tar.bz2
- sync with 2.6.11-rc2 & latest dvb cvs.
- misc card-specific tweaks.
Diffstat (limited to 'v4l')
-rw-r--r--v4l/Make.config11
-rw-r--r--v4l/mt352.c72
-rw-r--r--v4l/mt352.h1
-rw-r--r--v4l/scripts/update8
4 files changed, 45 insertions, 47 deletions
diff --git a/v4l/Make.config b/v4l/Make.config
index b941e3ff8..004d49ae5 100644
--- a/v4l/Make.config
+++ b/v4l/Make.config
@@ -10,10 +10,13 @@ CONFIG_VIDEO_CX88 := m
# 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 := n
+CONFIG_VIDEO_SAA7134_DVB := n
+ifeq ($(SUBLEVEL),10)
+ CONFIG_VIDEO_CX88_DVB := m
+ CONFIG_VIDEO_SAA7134_DVB := m
+endif
+ifeq ($(SUBLEVEL),11)
CONFIG_VIDEO_CX88_DVB := m
CONFIG_VIDEO_SAA7134_DVB := m
-else
- CONFIG_VIDEO_CX88_DVB := n
- CONFIG_VIDEO_SAA7134_DVB := n
endif
diff --git a/v4l/mt352.c b/v4l/mt352.c
index baa3f67a7..6eeb659eb 100644
--- a/v4l/mt352.c
+++ b/v4l/mt352.c
@@ -46,7 +46,7 @@ struct mt352_state {
/* configuration settings */
const struct mt352_config* config;
- int status,s0,s1,s3;
+ int s0,s1,s3;
struct dvb_frontend frontend;
};
@@ -57,32 +57,33 @@ do { \
if (debug) printk(KERN_DEBUG "mt352: " args); \
} while (0)
-int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen)
+static int mt352_single_write(struct dvb_frontend *fe, u8 reg, u8 val)
{
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
+ u8 buf[2] = { reg, val };
struct i2c_msg msg = { .addr = state->config->demod_address, .flags = 0,
- .buf = ibuf, .len = ilen };
- if (debug) {
- int i;
- printk("%s:",__FUNCTION__);
- for (i = 0; i < ilen; i++)
- printk(" %02x",ibuf[i]);
- printk("\n");
- }
-
+ .buf = buf, .len = 2 };
int err = i2c_transfer(state->i2c, &msg, 1);
if (err != 1) {
- printk(KERN_WARNING
- "mt352_write() failed (err = %d)!\n", err);
+ printk("mt352_write() to reg %x failed (err = %d)!\n", reg, err);
return err;
}
+ return 0;
+}
+
+int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen)
+{
+ int err,i;
+ for (i=0; i < ilen-1; i++)
+ if ((err = mt352_single_write(fe,ibuf[0]+i,ibuf[i+1])))
+ return err;
return 0;
}
static int mt352_read_register(struct mt352_state* state, u8 reg)
{
- int ret,i;
+ int ret;
u8 b0 [] = { reg };
u8 b1 [] = { 0 };
struct i2c_msg msg [] = { { .addr = state->config->demod_address,
@@ -92,24 +93,22 @@ static int mt352_read_register(struct mt352_state* state, u8 reg)
.flags = I2C_M_RD,
.buf = b1, .len = 1 } };
- for (i = 0; i < 5; i++) {
- ret = i2c_transfer(state->i2c, msg, 2);
- if (2 == ret)
- break;
- msleep(10);
- dprintk("%s: readreg error #%d, retrying\n",
- __FUNCTION__, i+1);
- }
+ ret = i2c_transfer(state->i2c, msg, 2);
if (ret != 2) {
- printk(KERN_WARNING
- "%s: readreg error (ret == %i)\n", __FUNCTION__, ret);
- return -1;
+ printk("%s: readreg error (reg=%d, ret==%i)\n",
+ __FUNCTION__, reg, ret);
+ return ret;
}
return b1[0];
}
+int mt352_read(struct dvb_frontend *fe, u8 reg)
+{
+ return mt352_read_register(fe->demodulator_priv,reg);
+}
+
static int mt352_sleep(struct dvb_frontend* fe)
{
static u8 mt352_softdown[] = { CLOCK_CTL, 0x20, 0x08 };
@@ -435,6 +434,7 @@ static int mt352_get_parameters(struct dvb_frontend* fe,
static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status)
{
struct mt352_state* state = (struct mt352_state*) fe->demodulator_priv;
+#if 1
int val;
if (0 != mt352_read_register(state, INTERRUPT_0)) {
@@ -448,6 +448,13 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status)
if (-1 != val)
state->s3 = val;
}
+#else
+ state->s0 = mt352_read_register(state, STATUS_0);
+ state->s1 = mt352_read_register(state, STATUS_1);
+ state->s3 = mt352_read_register(state, STATUS_3);
+ if (-1 == state->s0 || -1 == state->s1 || -1 == state->s3)
+ return -EIO;
+#endif
*status = 0;
if (state->s0 & (1 << 4))
@@ -465,20 +472,6 @@ static int mt352_read_status(struct dvb_frontend* fe, fe_status_t* status)
(FE_HAS_CARRIER | FE_HAS_VITERBI | FE_HAS_SYNC))
*status &= ~FE_HAS_LOCK;
- if (debug && state->status != *status) {
- /* log status bit changes */
- printk("%s:%s%s%s%s%s | r0=0x%02x r1=0x%02x r3=0x%02x\n",
- __FUNCTION__,
- *status & FE_HAS_CARRIER ? " CARRIER" : "",
- *status & FE_HAS_VITERBI ? " VITERBI" : "",
- *status & FE_HAS_LOCK ? " LOCK" : "",
- *status & FE_HAS_SYNC ? " SYNC" : "",
- *status & FE_HAS_SIGNAL ? " SIGNAL" : "",
- state->s0, state->s1, state->s3);
-
- }
- state->status = *status;
-
return 0;
}
@@ -631,6 +624,7 @@ MODULE_LICENSE("GPL");
EXPORT_SYMBOL(mt352_attach);
EXPORT_SYMBOL(mt352_write);
+EXPORT_SYMBOL(mt352_read);
/*
* Local variables:
* c-basic-offset: 8
diff --git a/v4l/mt352.h b/v4l/mt352.h
index 8bc032f7f..f5d8a5aed 100644
--- a/v4l/mt352.h
+++ b/v4l/mt352.h
@@ -61,6 +61,7 @@ extern struct dvb_frontend* mt352_attach(const struct mt352_config* config,
struct i2c_adapter* i2c);
extern int mt352_write(struct dvb_frontend* fe, u8* ibuf, int ilen);
+extern int mt352_read(struct dvb_frontend *fe, u8 reg);
#endif // MT352_H
diff --git a/v4l/scripts/update b/v4l/scripts/update
index 1a9731e47..f52983e4c 100644
--- a/v4l/scripts/update
+++ b/v4l/scripts/update
@@ -69,10 +69,10 @@ v4l2basic
#xrmmod v4l1-compat
#xinsmod v4l1-compat debug=1
-xinsmod tveeprom debug=1
-xinsmod dvb-pll debug=1
+xinsmod tveeprom debug=0
+xinsmod dvb-pll debug=0
xinsmod btcx-risc debug=0
-xinsmod ir-common debug=1 repeat=0
+xinsmod ir-common debug=0 repeat=0
xinsmod tuner debug=1
xinsmod tda9887 debug=0 qss=1
xinsmod msp3400 debug=0
@@ -99,5 +99,5 @@ xinsmod saa7134-empress
xinsmod cx22702 debug=0
xinsmod mt352 debug=1
xinsmod video-buf-dvb
-xinsmod cx88-dvb
+#xinsmod cx88-dvb
xinsmod saa7134-dvb