diff options
author | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:20:00 +0000 |
---|---|---|
committer | Patrick Boettcher <devnull@localhost> | 2005-01-13 13:20:00 +0000 |
commit | 90d3d94d395a445b76de9341168c2f6189e115f6 (patch) | |
tree | 4512505322661053a553030a73e8f0270717c09d /linux/drivers/media/dvb/frontends/mt352.c | |
parent | d69367a3854ae0e40b9d8348f88e59af5ebb7752 (diff) | |
download | mediapointer-dvb-s2-90d3d94d395a445b76de9341168c2f6189e115f6.tar.gz mediapointer-dvb-s2-90d3d94d395a445b76de9341168c2f6189e115f6.tar.bz2 |
- exported an mt352_read_reg-function
- implemented a single byte write_register function (needed for dibusb)
same for mt352.h in revision 1.4 to 1.5
Diffstat (limited to 'linux/drivers/media/dvb/frontends/mt352.c')
-rw-r--r-- | linux/drivers/media/dvb/frontends/mt352.c | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/linux/drivers/media/dvb/frontends/mt352.c b/linux/drivers/media/dvb/frontends/mt352.c index bb33c4c75..9f525aee0 100644 --- a/linux/drivers/media/dvb/frontends/mt352.c +++ b/linux/drivers/media/dvb/frontends/mt352.c @@ -58,17 +58,27 @@ static int debug; 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 }; + .buf = buf, .len = 2 }; int err = i2c_transfer(state->i2c, &msg, 1); if (err != 1) { - dprintk("mt352_write() failed (err = %d)!\n", err); + dprintk("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; } @@ -92,10 +102,11 @@ static u8 mt352_read_register(struct mt352_state* state, u8 reg) return b1[0]; } - - - - +u8 mt352_read(struct dvb_frontend *fe, u8 reg) +{ + return mt352_read_register(fe->demodulator_priv,reg); +} + @@ -556,3 +567,4 @@ MODULE_LICENSE("GPL"); EXPORT_SYMBOL(mt352_attach); EXPORT_SYMBOL(mt352_write); +EXPORT_SYMBOL(mt352_read); |