Re: idea on how to break the static dependencies on demodulator modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Another revision:

*) Solve the static function problem - all of them turned out to be methods 
for writing to the demod, so I added a new write() function pointer.

*) Add symbol_put()s for the rest of the demods.

There are still some static functions - hyowever these are all i2c gate 
control ones, which are already covered by the pll refactoring changes.

Only budget-ci has been converted to DVB_ATTACH so far. I'm waiting till the 
pll stage 1 is done before going any further.
diff -r 2b05b5271ae1 linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
--- a/linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/b2c2/flexcop-fe-tuner.c	Tue Apr 18 02:22:40 2006 +0100
@@ -157,11 +157,11 @@ static int samsung_tbmu24112_set_symbol_
 	else if (srate < 30000000) { aclk = 0xb6; bclk = 0x53; }
 	else if (srate < 45000000) { aclk = 0xb4; bclk = 0x51; }
 
-	stv0299_writereg (fe, 0x13, aclk);
-	stv0299_writereg (fe, 0x14, bclk);
-	stv0299_writereg (fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg (fe, 0x20, (ratio >>  8) & 0xff);
-	stv0299_writereg (fe, 0x21, (ratio      ) & 0xf0);
+	STV0299_WRITEREG (fe, 0x13, aclk);
+	STV0299_WRITEREG (fe, 0x14, bclk);
+	STV0299_WRITEREG (fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG (fe, 0x20, (ratio >>  8) & 0xff);
+	STV0299_WRITEREG (fe, 0x21, (ratio      ) & 0xf0);
 
 	return 0;
 }
@@ -253,13 +253,13 @@ static int samsung_tdtc9251dh0_demod_ini
 	static u8 mt352_agc_cfg [] = { 0x67, 0x28, 0xa1 };
 	static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+	MT352_WRITE(fe, mt352_clock_config, sizeof(mt352_clock_config));
 	udelay(2000);
-	mt352_write(fe, mt352_reset, sizeof(mt352_reset));
-	mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
-
-	mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
-	mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
+	MT352_WRITE(fe, mt352_reset, sizeof(mt352_reset));
+	MT352_WRITE(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
+	MT352_WRITE(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c
--- a/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/bt8xx/dvb-bt8xx.c	Tue Apr 18 02:22:40 2006 +0100
@@ -136,14 +136,14 @@ static int thomson_dtt7579_demod_init(st
 	static u8 mt352_gpp_ctl_cfg [] = { 0x8C, 0x33 };
 	static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+	MT352_WRITE(fe, mt352_clock_config, sizeof(mt352_clock_config));
 	udelay(2000);
-	mt352_write(fe, mt352_reset, sizeof(mt352_reset));
-	mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
-
-	mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
-	mt352_write(fe, mt352_gpp_ctl_cfg, sizeof(mt352_gpp_ctl_cfg));
-	mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
+	MT352_WRITE(fe, mt352_reset, sizeof(mt352_reset));
+	MT352_WRITE(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
+	MT352_WRITE(fe, mt352_gpp_ctl_cfg, sizeof(mt352_gpp_ctl_cfg));
+	MT352_WRITE(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
 
 	return 0;
 }
@@ -232,12 +232,12 @@ static int cx24108_pll_set(struct dvb_fr
 	/* everything is shifted left 11 bits to left-align the bits in the
 	   32bit word. Output to the tuner goes MSB-aligned, after all */
 	printk("cx24108 debug: pump=%d, n=%d, a=%d\n",pump,n,a);
-	cx24110_pll_write(fe,band);
+	CX24110_PLL_WRITE(fe,band);
 	/* set vga and vca to their widest-band settings, as a precaution.
 	   SetSymbolrate might not be called to set this up */
-	cx24110_pll_write(fe,0x500c0000);
-	cx24110_pll_write(fe,0x83f1f800);
-	cx24110_pll_write(fe,pll);
+	CX24110_PLL_WRITE(fe,0x500c0000);
+	CX24110_PLL_WRITE(fe,0x83f1f800);
+	CX24110_PLL_WRITE(fe,pll);
 	//writereg(client,0x56,0x7f);
 
 	return 0;
@@ -330,15 +330,15 @@ static int advbt771_samsung_tdtc9251dh0_
 	static u8 mt352_av771_extra[] = { 0xB5, 0x7A };
 	static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+	MT352_WRITE(fe, mt352_clock_config, sizeof(mt352_clock_config));
 	udelay(2000);
-	mt352_write(fe, mt352_reset, sizeof(mt352_reset));
-	mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
-
-	mt352_write(fe, mt352_agc_cfg,sizeof(mt352_agc_cfg));
+	MT352_WRITE(fe, mt352_reset, sizeof(mt352_reset));
+	MT352_WRITE(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, mt352_agc_cfg,sizeof(mt352_agc_cfg));
 	udelay(2000);
-	mt352_write(fe, mt352_av771_extra,sizeof(mt352_av771_extra));
-	mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
+	MT352_WRITE(fe, mt352_av771_extra,sizeof(mt352_av771_extra));
+	MT352_WRITE(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
 
 	return 0;
 }
@@ -502,12 +502,12 @@ static int digitv_alps_tded4_demod_init(
 	static u8 mt352_agc_cfg [] = { 0x67, 0x20, 0xa0 };
 	static u8 mt352_capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+	MT352_WRITE(fe, mt352_clock_config, sizeof(mt352_clock_config));
 	udelay(2000);
-	mt352_write(fe, mt352_reset, sizeof(mt352_reset));
-	mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
-	mt352_write(fe, mt352_agc_cfg,sizeof(mt352_agc_cfg));
-	mt352_write(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
+	MT352_WRITE(fe, mt352_reset, sizeof(mt352_reset));
+	MT352_WRITE(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+	MT352_WRITE(fe, mt352_agc_cfg,sizeof(mt352_agc_cfg));
+	MT352_WRITE(fe, mt352_capt_range_cfg, sizeof(mt352_capt_range_cfg));
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-core/dvb_frontend.h
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h	Tue Apr 18 02:22:40 2006 +0100
@@ -57,6 +57,8 @@ struct dvb_frontend_ops {
 
 	int (*init)(struct dvb_frontend* fe);
 	int (*sleep)(struct dvb_frontend* fe);
+
+	int (*write)(struct dvb_frontend* fe, u8* buf, int len);
 
 	/* if this is set, it overrides the default swzigzag */
 	int (*tune)(struct dvb_frontend* fe,
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-core/dvbdev.h
--- a/linux/drivers/media/dvb/dvb-core/dvbdev.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-core/dvbdev.h	Tue Apr 18 02:22:40 2006 +0100
@@ -104,4 +104,13 @@ extern int dvb_usercopy(struct inode *in
 			    int (*func)(struct inode *inode, struct file *file,
 			    unsigned int cmd, void *arg));
 
+#define DVB_ATTACH(RESULT, MODULE, FUNCTION,ARGS...) \
+do { \
+	typeof(&FUNCTION) __a; \
+	request_module(MODULE); \
+	__a = symbol_get(FUNCTION); \
+	if (__a) RESULT = __a(ARGS); \
+	else RESULT = NULL; \
+} while(0);
+
 #endif /* #ifndef _DVBDEV_H_ */
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-usb/cxusb.c
--- a/linux/drivers/media/dvb/dvb-usb/cxusb.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-usb/cxusb.c	Tue Apr 18 02:22:40 2006 +0100
@@ -281,14 +281,14 @@ static int cxusb_dee1601_demod_init(stru
 	static u8 gpp_ctl_cfg []   = { GPP_CTL,    0x33 };
 	static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 
 	return 0;
 }
@@ -302,14 +302,14 @@ static int cxusb_mt352_demod_init(struct
 	static u8 gpp_ctl_cfg []   = { GPP_CTL,    0x33 };
 	static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 	return 0;
 }
 
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-usb/digitv.c
--- a/linux/drivers/media/dvb/dvb-usb/digitv.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-usb/digitv.c	Tue Apr 18 02:22:40 2006 +0100
@@ -100,12 +100,12 @@ static int digitv_mt352_demod_init(struc
 	int i;
 
 	for (i = 0; i < ARRAY_SIZE(reset_buf); i += 2)
-		mt352_write(fe, &reset_buf[i], 2);
+		MT352_WRITE(fe, &reset_buf[i], 2);
 
 	msleep(1);
 
 	for (i = 0; i < ARRAY_SIZE(init_buf); i += 2)
-		mt352_write(fe, &init_buf[i], 2);
+		MT352_WRITE(fe, &init_buf[i], 2);
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/dvb-usb/umt-010.c
--- a/linux/drivers/media/dvb/dvb-usb/umt-010.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/dvb-usb/umt-010.c	Tue Apr 18 02:22:40 2006 +0100
@@ -30,22 +30,22 @@ static int umt_mt352_demod_init(struct d
 	static u8 mt352_acq_ctl[] = { 0x53, 0x50 };
 	static u8 mt352_input_freq_1[] = { 0x56, 0x31, 0x06 };
 
-	mt352_write(fe, mt352_clock_config, sizeof(mt352_clock_config));
+	MT352_WRITE(fe, mt352_clock_config, sizeof(mt352_clock_config));
 	udelay(2000);
-	mt352_write(fe, mt352_reset, sizeof(mt352_reset));
-	mt352_write(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio));
+	MT352_WRITE(fe, mt352_reset, sizeof(mt352_reset));
+	MT352_WRITE(fe, mt352_mclk_ratio, sizeof(mt352_mclk_ratio));
 
-	mt352_write(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
-	mt352_write(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
+	MT352_WRITE(fe, mt352_adc_ctl_1_cfg, sizeof(mt352_adc_ctl_1_cfg));
+	MT352_WRITE(fe, mt352_agc_cfg, sizeof(mt352_agc_cfg));
 
-	mt352_write(fe, mt352_sec_agc_cfg1, sizeof(mt352_sec_agc_cfg1));
-	mt352_write(fe, mt352_sec_agc_cfg2, sizeof(mt352_sec_agc_cfg2));
-	mt352_write(fe, mt352_sec_agc_cfg3, sizeof(mt352_sec_agc_cfg3));
-	mt352_write(fe, mt352_sec_agc_cfg4, sizeof(mt352_sec_agc_cfg4));
-	mt352_write(fe, mt352_sec_agc_cfg5, sizeof(mt352_sec_agc_cfg5));
+	MT352_WRITE(fe, mt352_sec_agc_cfg1, sizeof(mt352_sec_agc_cfg1));
+	MT352_WRITE(fe, mt352_sec_agc_cfg2, sizeof(mt352_sec_agc_cfg2));
+	MT352_WRITE(fe, mt352_sec_agc_cfg3, sizeof(mt352_sec_agc_cfg3));
+	MT352_WRITE(fe, mt352_sec_agc_cfg4, sizeof(mt352_sec_agc_cfg4));
+	MT352_WRITE(fe, mt352_sec_agc_cfg5, sizeof(mt352_sec_agc_cfg5));
 
-	mt352_write(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl));
-	mt352_write(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1));
+	MT352_WRITE(fe, mt352_acq_ctl, sizeof(mt352_acq_ctl));
+	MT352_WRITE(fe, mt352_input_freq_1, sizeof(mt352_input_freq_1));
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/at76c651.c
--- a/linux/drivers/media/dvb/frontends/at76c651.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/at76c651.c	Tue Apr 18 02:22:40 2006 +0100
@@ -356,6 +356,7 @@ static void at76c651_release(struct dvb_
 {
 	struct at76c651_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(at76c651_attach);
 }
 
 static struct dvb_frontend_ops at76c651_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/bcm3510.c
--- a/linux/drivers/media/dvb/frontends/bcm3510.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/bcm3510.c	Tue Apr 18 02:22:40 2006 +0100
@@ -591,6 +591,7 @@ static void bcm3510_release(struct dvb_f
 {
 	struct bcm3510_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(bcm3510_attach);
 }
 
 /* firmware download:
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/bsbe1.h
--- a/linux/drivers/media/dvb/frontends/bsbe1.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/bsbe1.h	Tue Apr 18 02:22:40 2006 +0100
@@ -80,11 +80,11 @@ static int alps_bsbe1_set_symbol_rate(st
 	else if (srate < 30000000) { aclk = 0xb6; bclk = 0x53; }
 	else if (srate < 45000000) { aclk = 0xb4; bclk = 0x51; }
 
-	stv0299_writereg(fe, 0x13, aclk);
-	stv0299_writereg(fe, 0x14, bclk);
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >>  8) & 0xff);
-	stv0299_writereg(fe, 0x21, (ratio      ) & 0xf0);
+	STV0299_WRITEREG(fe, 0x13, aclk);
+	STV0299_WRITEREG(fe, 0x14, bclk);
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >>  8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, (ratio      ) & 0xf0);
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/bsru6.h
--- a/linux/drivers/media/dvb/frontends/bsru6.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/bsru6.h	Tue Apr 18 02:22:40 2006 +0100
@@ -92,11 +92,11 @@ static int alps_bsru6_set_symbol_rate(st
 		bclk = 0x51;
 	}
 
-	stv0299_writereg(fe, 0x13, aclk);
-	stv0299_writereg(fe, 0x14, bclk);
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
-	stv0299_writereg(fe, 0x21, ratio & 0xf0);
+	STV0299_WRITEREG(fe, 0x13, aclk);
+	STV0299_WRITEREG(fe, 0x14, bclk);
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >> 8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, ratio & 0xf0);
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/cx22700.c
--- a/linux/drivers/media/dvb/frontends/cx22700.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/cx22700.c	Tue Apr 18 02:22:40 2006 +0100
@@ -365,6 +365,7 @@ static void cx22700_release(struct dvb_f
 {
 	struct cx22700_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(cx22700_attach);
 }
 
 static struct dvb_frontend_ops cx22700_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/cx22702.c
--- a/linux/drivers/media/dvb/frontends/cx22702.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/cx22702.c	Tue Apr 18 02:22:40 2006 +0100
@@ -478,6 +478,7 @@ static void cx22702_release(struct dvb_f
 {
 	struct cx22702_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(cx22702_attach);
 }
 
 static struct dvb_frontend_ops cx22702_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/cx24110.c
--- a/linux/drivers/media/dvb/frontends/cx24110.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/cx24110.c	Tue Apr 18 02:22:40 2006 +0100
@@ -313,16 +313,17 @@ static int cx24110_set_symbolrate (struc
 
 }
 
-int cx24110_pll_write (struct dvb_frontend* fe, u32 data)
-{
-	struct cx24110_state *state = fe->demodulator_priv;
+int cx24110_pll_write (struct dvb_frontend* fe, u8 *buf, int len)
+{
+	struct cx24110_state *state = fe->demodulator_priv;
+
+	if (len != 3)
+		return -EINVAL;
 
 /* tuner data is 21 bits long, must be left-aligned in data */
 /* tuner cx24108 is written through a dedicated 3wire interface on the demod chip */
 /* FIXME (low): add error handling, avoid infinite loops if HW fails... */
 
-	dprintk("cx24110 debug: cx24108_write(%8.8x)\n",data);
-
 	cx24110_writereg(state,0x6d,0x30); /* auto mode at 62kHz */
 	cx24110_writereg(state,0x70,0x15); /* auto mode 21 bits */
 
@@ -331,19 +332,19 @@ int cx24110_pll_write (struct dvb_fronte
 		cx24110_writereg(state,0x72,0);
 
 	/* write the topmost 8 bits */
-	cx24110_writereg(state,0x72,(data>>24)&0xff);
+	cx24110_writereg(state,0x72,buf[0]);
 
 	/* wait for the send to be completed */
 	while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)
 		;
 
 	/* send another 8 bytes */
-	cx24110_writereg(state,0x72,(data>>16)&0xff);
+	cx24110_writereg(state,0x72,buf[1]);
 	while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)
 		;
 
 	/* and the topmost 5 bits of this byte */
-	cx24110_writereg(state,0x72,(data>>8)&0xff);
+	cx24110_writereg(state,0x72,buf[2]);
 	while ((cx24110_readreg(state,0x6d)&0xc0)==0x80)
 		;
 
@@ -595,6 +596,7 @@ static void cx24110_release(struct dvb_f
 {
 	struct cx24110_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(cx24110_attach);
 }
 
 static struct dvb_frontend_ops cx24110_ops;
@@ -652,6 +654,8 @@ static struct dvb_frontend_ops cx24110_o
 
 	.init = cx24110_initfe,
 	.sleep = cx24110_sleep,
+	.write = cx24110_pll_write,
+
 	.set_frontend = cx24110_set_frontend,
 	.get_frontend = cx24110_get_frontend,
 	.read_status = cx24110_read_status,
@@ -674,4 +678,3 @@ MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(cx24110_attach);
-EXPORT_SYMBOL(cx24110_pll_write);
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/cx24110.h
--- a/linux/drivers/media/dvb/frontends/cx24110.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/cx24110.h	Tue Apr 18 02:22:40 2006 +0100
@@ -41,6 +41,10 @@ extern struct dvb_frontend* cx24110_atta
 extern struct dvb_frontend* cx24110_attach(const struct cx24110_config* config,
 					   struct i2c_adapter* i2c);
 
-extern int cx24110_pll_write(struct dvb_frontend* fe, u32 data);
+#define CX24110_PLL_WRITE(FE, VAL) \
+	do { \
+		u8 buf[] = {(u8) ((VAL)>>24), (u8) ((VAL)>>16), (u8) ((VAL)>>8)}; \
+		if (FE->ops->write) FE->ops->write(FE, buf, 3); \
+	} while(0);
 
 #endif // CX24110_H
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/cx24123.c
--- a/linux/drivers/media/dvb/frontends/cx24123.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/cx24123.c	Tue Apr 18 02:22:40 2006 +0100
@@ -955,6 +955,7 @@ static void cx24123_release(struct dvb_f
 	struct cx24123_state* state = fe->demodulator_priv;
 	dprintk("%s\n",__FUNCTION__);
 	kfree(state);
+	symbol_put(cx24123_attach);
 }
 
 static struct dvb_frontend_ops cx24123_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/dib3000mb.c
--- a/linux/drivers/media/dvb/frontends/dib3000mb.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/dib3000mb.c	Tue Apr 18 02:22:40 2006 +0100
@@ -649,6 +649,7 @@ static void dib3000mb_release(struct dvb
 {
 	struct dib3000_state *state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(dib3000mb_attach);
 }
 
 /* pid filter and transfer stuff */
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/dib3000mc.c
--- a/linux/drivers/media/dvb/frontends/dib3000mc.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/dib3000mc.c	Tue Apr 18 02:22:40 2006 +0100
@@ -746,6 +746,7 @@ static void dib3000mc_release(struct dvb
 {
 	struct dib3000_state *state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(dib3000mc_attach);
 }
 
 /* pid filter and transfer stuff */
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/dvb_dummy_fe.c
--- a/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/dvb_dummy_fe.c	Tue Apr 18 02:22:40 2006 +0100
@@ -100,10 +100,25 @@ static int dvb_dummy_fe_set_voltage(stru
 	return 0;
 }
 
-static void dvb_dummy_fe_release(struct dvb_frontend* fe)
-{
-	struct dvb_dummy_fe_state* state = fe->demodulator_priv;
-	kfree(state);
+static void dvb_dummy_fe_ofdm_release(struct dvb_frontend* fe)
+{
+	struct dvb_dummy_fe_state* state = fe->demodulator_priv;
+	kfree(state);
+	symbol_put(dvb_dummy_fe_ofdm_attach);
+}
+
+static void dvb_dummy_fe_qpsk_release(struct dvb_frontend* fe)
+{
+	struct dvb_dummy_fe_state* state = fe->demodulator_priv;
+	kfree(state);
+	symbol_put(dvb_dummy_fe_qpsk_attach);
+}
+
+static void dvb_dummy_fe_qam_release(struct dvb_frontend* fe)
+{
+	struct dvb_dummy_fe_state* state = fe->demodulator_priv;
+	kfree(state);
+	symbol_put(dvb_dummy_fe_qam_attach);
 }
 
 static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops;
@@ -174,7 +189,7 @@ error:
 	kfree(state);
 	return NULL;
 }
-
+FIXME
 static struct dvb_frontend_ops dvb_dummy_fe_ofdm_ops = {
 
 	.info = {
@@ -192,7 +207,7 @@ static struct dvb_frontend_ops dvb_dummy
 				FE_CAN_HIERARCHY_AUTO,
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = dvb_dummy_fe_ofdm_release,
 
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
@@ -222,7 +237,7 @@ static struct dvb_frontend_ops dvb_dummy
 			FE_CAN_FEC_AUTO | FE_CAN_INVERSION_AUTO
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = dvb_dummy_fe_qam_release,
 
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
@@ -254,7 +269,7 @@ static struct dvb_frontend_ops dvb_dummy
 			FE_CAN_QPSK
 	},
 
-	.release = dvb_dummy_fe_release,
+	.release = dvb_dummy_fe_qpsk_release,
 
 	.init = dvb_dummy_fe_init,
 	.sleep = dvb_dummy_fe_sleep,
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/l64781.c
--- a/linux/drivers/media/dvb/frontends/l64781.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/l64781.c	Tue Apr 18 02:22:40 2006 +0100
@@ -487,6 +487,7 @@ static void l64781_release(struct dvb_fr
 {
 	struct l64781_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(l64781_attach);
 }
 
 static struct dvb_frontend_ops l64781_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/lgdt330x.c
--- a/linux/drivers/media/dvb/frontends/lgdt330x.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/lgdt330x.c	Tue Apr 18 02:22:40 2006 +0100
@@ -719,6 +719,7 @@ static void lgdt330x_release(struct dvb_
 {
 	struct lgdt330x_state* state = (struct lgdt330x_state*) fe->demodulator_priv;
 	kfree(state);
+	symbol_put(lgdt330x_attach);
 }
 
 static struct dvb_frontend_ops lgdt3302_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/mt312.c
--- a/linux/drivers/media/dvb/frontends/mt312.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/mt312.c	Tue Apr 18 02:22:40 2006 +0100
@@ -610,6 +610,7 @@ static void mt312_release(struct dvb_fro
 {
 	struct mt312_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(vp310_mt312_attach);
 }
 
 static struct dvb_frontend_ops vp310_mt312_ops = {
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/mt352.c
--- a/linux/drivers/media/dvb/frontends/mt352.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/mt352.c	Tue Apr 18 02:22:40 2006 +0100
@@ -525,6 +525,7 @@ static void mt352_release(struct dvb_fro
 {
 	struct mt352_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(mt352_attach);
 }
 
 static struct dvb_frontend_ops mt352_ops;
@@ -578,6 +579,7 @@ static struct dvb_frontend_ops mt352_ops
 
 	.init = mt352_init,
 	.sleep = mt352_sleep,
+	.write = mt352_write,
 
 	.set_frontend = mt352_set_parameters,
 	.get_frontend = mt352_get_parameters,
@@ -598,4 +600,3 @@ MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(mt352_attach);
-EXPORT_SYMBOL(mt352_write);
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/mt352.h
--- a/linux/drivers/media/dvb/frontends/mt352.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/mt352.h	Tue Apr 18 02:22:40 2006 +0100
@@ -60,6 +60,9 @@ extern struct dvb_frontend* mt352_attach
 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);
+#define MT352_WRITE(FE, BUF, LEN) \
+	do { \
+		if (FE->ops->write) FE->ops->write(FE, BUF, LEN); \
+	} while(0);
 
 #endif // MT352_H
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/nxt200x.c
--- a/linux/drivers/media/dvb/frontends/nxt200x.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/nxt200x.c	Tue Apr 18 02:22:40 2006 +0100
@@ -1141,6 +1141,7 @@ static void nxt200x_release(struct dvb_f
 {
 	struct nxt200x_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(nxt200x_attach);
 }
 
 static struct dvb_frontend_ops nxt200x_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/nxt6000.c
--- a/linux/drivers/media/dvb/frontends/nxt6000.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/nxt6000.c	Tue Apr 18 02:22:40 2006 +0100
@@ -490,6 +490,7 @@ static void nxt6000_release(struct dvb_f
 {
 	struct nxt6000_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(nxt6000_attach);
 }
 
 static int nxt6000_read_snr(struct dvb_frontend* fe, u16* snr)
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/or51132.c
--- a/linux/drivers/media/dvb/frontends/or51132.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/or51132.c	Tue Apr 18 02:22:40 2006 +0100
@@ -605,6 +605,7 @@ static void or51132_release(struct dvb_f
 {
 	struct or51132_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(or51132_attach);
 }
 
 static struct dvb_frontend_ops or51132_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/or51211.c
--- a/linux/drivers/media/dvb/frontends/or51211.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/or51211.c	Tue Apr 18 02:22:40 2006 +0100
@@ -568,6 +568,7 @@ static void or51211_release(struct dvb_f
 	struct or51211_state* state = fe->demodulator_priv;
 	state->config->sleep(fe);
 	kfree(state);
+	symbol_put(or51211_attach);
 }
 
 static struct dvb_frontend_ops or51211_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/s5h1420.c
--- a/linux/drivers/media/dvb/frontends/s5h1420.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/s5h1420.c	Tue Apr 18 02:22:40 2006 +0100
@@ -738,6 +738,7 @@ static void s5h1420_release(struct dvb_f
 {
 	struct s5h1420_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(s5h1420_attach);
 }
 
 static struct dvb_frontend_ops s5h1420_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/sp8870.c
--- a/linux/drivers/media/dvb/frontends/sp8870.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/sp8870.c	Tue Apr 18 02:22:40 2006 +0100
@@ -545,6 +545,7 @@ static void sp8870_release(struct dvb_fr
 {
 	struct sp8870_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(sp8870_attach);
 }
 
 static struct dvb_frontend_ops sp8870_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/sp887x.c
--- a/linux/drivers/media/dvb/frontends/sp887x.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/sp887x.c	Tue Apr 18 02:22:40 2006 +0100
@@ -539,6 +539,7 @@ static void sp887x_release(struct dvb_fr
 {
 	struct sp887x_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(sp887x_attach);
 }
 
 static struct dvb_frontend_ops sp887x_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/stv0297.c
--- a/linux/drivers/media/dvb/frontends/stv0297.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/stv0297.c	Tue Apr 18 02:22:40 2006 +0100
@@ -617,6 +617,7 @@ static void stv0297_release(struct dvb_f
 {
 	struct stv0297_state *state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(stv2097_attach);
 }
 
 static struct dvb_frontend_ops stv0297_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/stv0299.c
--- a/linux/drivers/media/dvb/frontends/stv0299.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/stv0299.c	Tue Apr 18 02:22:40 2006 +0100
@@ -93,11 +93,14 @@ static int stv0299_writeregI (struct stv
 	return (ret != 1) ? -EREMOTEIO : 0;
 }
 
-int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data)
-{
-	struct stv0299_state* state = fe->demodulator_priv;
-
-	return stv0299_writeregI(state, reg, data);
+int stv0299_write(struct dvb_frontend* fe, u8 *buf, int len)
+{
+	struct stv0299_state* state = fe->demodulator_priv;
+
+	if (len != 2)
+		return -EINVAL;
+
+	return stv0299_writeregI(state, buf[0], buf[1]);
 }
 
 static u8 stv0299_readreg (struct stv0299_state* state, u8 reg)
@@ -630,6 +633,7 @@ static void stv0299_release(struct dvb_f
 {
 	struct stv0299_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(stv0299_attach);
 }
 
 static struct dvb_frontend_ops stv0299_ops;
@@ -695,6 +699,7 @@ static struct dvb_frontend_ops stv0299_o
 
 	.init = stv0299_init,
 	.sleep = stv0299_sleep,
+	.write = stv0299_write,
 
 	.set_frontend = stv0299_set_frontend,
 	.get_frontend = stv0299_get_frontend,
@@ -725,5 +730,4 @@ MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(stv0299_enable_plli2c);
-EXPORT_SYMBOL(stv0299_writereg);
 EXPORT_SYMBOL(stv0299_attach);
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/stv0299.h
--- a/linux/drivers/media/dvb/frontends/stv0299.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/stv0299.h	Tue Apr 18 02:22:40 2006 +0100
@@ -93,10 +93,15 @@ struct stv0299_config
 	int (*pll_set)(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct dvb_frontend_parameters *params);
 };
 
-extern int stv0299_writereg (struct dvb_frontend* fe, u8 reg, u8 data);
 extern int stv0299_enable_plli2c (struct dvb_frontend* fe);
 
 extern struct dvb_frontend* stv0299_attach(const struct stv0299_config* config,
 					   struct i2c_adapter* i2c);
 
+#define STV0299_WRITEREG(FE, REG, VAL) \
+	do { \
+		u8 buf[] = {REG, VAL}; \
+		if (FE->ops->write) FE->ops->write(FE, buf, 2); \
+	} while(0);
+
 #endif // STV0299_H
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/tda10021.c
--- a/linux/drivers/media/dvb/frontends/tda10021.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/tda10021.c	Tue Apr 18 02:22:40 2006 +0100
@@ -390,6 +390,7 @@ static void tda10021_release(struct dvb_
 {
 	struct tda10021_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(tda10021_attach);
 }
 
 static struct dvb_frontend_ops tda10021_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/tda1004x.c
--- a/linux/drivers/media/dvb/frontends/tda1004x.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c	Tue Apr 18 02:22:40 2006 +0100
@@ -580,11 +580,14 @@ static int tda1004x_decode_fec(int tdafe
 	return -1;
 }
 
-int tda1004x_write_byte(struct dvb_frontend* fe, int reg, int data)
-{
-	struct tda1004x_state* state = fe->demodulator_priv;
-
-	return tda1004x_write_byteI(state, reg, data);
+int tda1004x_write(struct dvb_frontend* fe, u8 *buf, int len)
+{
+	struct tda1004x_state* state = fe->demodulator_priv;
+
+	if (len != 2)
+		return -EINVAL;
+
+	return tda1004x_write_byteI(state, buf[0], buf[1]);
 }
 
 static int tda10045_init(struct dvb_frontend* fe)
@@ -1211,10 +1214,18 @@ static int tda1004x_get_tune_settings(st
 	return 0;
 }
 
-static void tda1004x_release(struct dvb_frontend* fe)
+static void tda10045_release(struct dvb_frontend* fe)
 {
 	struct tda1004x_state *state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(tda10045_attach);
+}
+
+static void tda10046_release(struct dvb_frontend* fe)
+{
+	struct tda1004x_state *state = fe->demodulator_priv;
+	kfree(state);
+	symbol_put(tda10046_attach);
 }
 
 static struct dvb_frontend_ops tda10045_ops = {
@@ -1231,7 +1242,7 @@ static struct dvb_frontend_ops tda10045_
 		    FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO
 	},
 
-	.release = tda1004x_release,
+	.release = tda10045_release,
 
 	.init = tda10045_init,
 	.sleep = tda1004x_sleep,
@@ -1289,7 +1300,7 @@ static struct dvb_frontend_ops tda10046_
 		    FE_CAN_TRANSMISSION_MODE_AUTO | FE_CAN_GUARD_INTERVAL_AUTO
 	},
 
-	.release = tda1004x_release,
+	.release = tda10046_release,
 
 	.init = tda10046_init,
 	.sleep = tda1004x_sleep,
@@ -1342,4 +1353,3 @@ MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(tda10045_attach);
 EXPORT_SYMBOL(tda10046_attach);
-EXPORT_SYMBOL(tda1004x_write_byte);
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/tda1004x.h
--- a/linux/drivers/media/dvb/frontends/tda1004x.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/tda1004x.h	Tue Apr 18 02:22:40 2006 +0100
@@ -81,7 +81,10 @@ extern struct dvb_frontend* tda10045_att
 
 extern struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
 					    struct i2c_adapter* i2c);
-
-extern int tda1004x_write_byte(struct dvb_frontend* fe, int reg, int data);
+#define TDA1004X_WRITEREG(FE, REG, VAL) \
+	do { \
+		u8 buf[] = {REG, VAL}; \
+		if (FE->ops->write) FE->ops->write(FE, buf, 2); \
+	} while(0);
 
 #endif // TDA1004X_H
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/tda8083.c
--- a/linux/drivers/media/dvb/frontends/tda8083.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/tda8083.c	Tue Apr 18 02:22:40 2006 +0100
@@ -379,6 +379,7 @@ static void tda8083_release(struct dvb_f
 {
 	struct tda8083_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(tda8083_attach);
 }
 
 static struct dvb_frontend_ops tda8083_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/tda80xx.c
--- a/linux/drivers/media/dvb/frontends/tda80xx.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/tda80xx.c	Tue Apr 18 02:22:40 2006 +0100
@@ -626,6 +626,7 @@ static void tda80xx_release(struct dvb_f
 		free_irq(state->config->irq, &state->worklet);
 
 	kfree(state);
+	symbol_put(tda80xx_attach);
 }
 
 static struct dvb_frontend_ops tda80xx_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/ves1820.c
--- a/linux/drivers/media/dvb/frontends/ves1820.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/ves1820.c	Tue Apr 18 02:22:40 2006 +0100
@@ -364,6 +364,7 @@ static void ves1820_release(struct dvb_f
 {
 	struct ves1820_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(ves1820_attach);
 }
 
 static struct dvb_frontend_ops ves1820_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/ves1x93.c
--- a/linux/drivers/media/dvb/frontends/ves1x93.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/ves1x93.c	Tue Apr 18 02:22:40 2006 +0100
@@ -440,6 +440,7 @@ static void ves1x93_release(struct dvb_f
 {
 	struct ves1x93_state* state = fe->demodulator_priv;
 	kfree(state);
+	symbol_put(ves1x93_attach);
 }
 
 static struct dvb_frontend_ops ves1x93_ops;
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/zl10353.c
--- a/linux/drivers/media/dvb/frontends/zl10353.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/zl10353.c	Tue Apr 18 02:22:40 2006 +0100
@@ -245,8 +245,8 @@ static void zl10353_release(struct dvb_f
 static void zl10353_release(struct dvb_frontend *fe)
 {
 	struct zl10353_state *state = fe->demodulator_priv;
-
 	kfree(state);
+	symbol_put(zl10353_attach);
 }
 
 static struct dvb_frontend_ops zl10353_ops;
@@ -302,6 +302,7 @@ static struct dvb_frontend_ops zl10353_o
 
 	.init = zl10353_init,
 	.sleep = zl10353_sleep,
+	.write = zl10353_write,
 
 	.set_frontend = zl10353_set_parameters,
 	.get_tune_settings = zl10353_get_tune_settings,
@@ -320,4 +321,3 @@ MODULE_LICENSE("GPL");
 MODULE_LICENSE("GPL");
 
 EXPORT_SYMBOL(zl10353_attach);
-EXPORT_SYMBOL(zl10353_write);
diff -r 2b05b5271ae1 linux/drivers/media/dvb/frontends/zl10353.h
--- a/linux/drivers/media/dvb/frontends/zl10353.h	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/frontends/zl10353.h	Tue Apr 18 02:22:40 2006 +0100
@@ -38,6 +38,4 @@ extern struct dvb_frontend* zl10353_atta
 extern struct dvb_frontend* zl10353_attach(const struct zl10353_config *config,
 					   struct i2c_adapter *i2c);
 
-extern int zl10353_write(struct dvb_frontend *fe, u8 *ibuf, int ilen);
-
 #endif /* ZL10353_H */
diff -r 2b05b5271ae1 linux/drivers/media/dvb/ttpci/budget-av.c
--- a/linux/drivers/media/dvb/ttpci/budget-av.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/ttpci/budget-av.c	Tue Apr 18 02:22:40 2006 +0100
@@ -462,12 +462,12 @@ static int philips_su1278_ty_ci_set_symb
 	if (srate < 4000000)
 		m1 = 0x10;
 
-	stv0299_writereg(fe, 0x13, aclk);
-	stv0299_writereg(fe, 0x14, bclk);
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
-	stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
-	stv0299_writereg(fe, 0x0f, 0x80 | m1);
+	STV0299_WRITEREG(fe, 0x13, aclk);
+	STV0299_WRITEREG(fe, 0x14, bclk);
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >> 8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, (ratio) & 0xf0);
+	STV0299_WRITEREG(fe, 0x0f, 0x80 | m1);
 
 	return 0;
 }
@@ -953,16 +953,16 @@ static int philips_sd1878_ci_set_symbol_
 	if (srate < 4000000)
 		m1 = 0x10;
 
-	stv0299_writereg(fe, 0x0e, 0x23);
-	stv0299_writereg(fe, 0x0f, 0x94);
-	stv0299_writereg(fe, 0x10, 0x39);
-	stv0299_writereg(fe, 0x13, aclk);
-	stv0299_writereg(fe, 0x14, bclk);
-	stv0299_writereg(fe, 0x15, 0xc9);
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
-	stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
-	stv0299_writereg(fe, 0x0f, 0x80 | m1);
+	STV0299_WRITEREG(fe, 0x0e, 0x23);
+	STV0299_WRITEREG(fe, 0x0f, 0x94);
+	STV0299_WRITEREG(fe, 0x10, 0x39);
+	STV0299_WRITEREG(fe, 0x13, aclk);
+	STV0299_WRITEREG(fe, 0x14, bclk);
+	STV0299_WRITEREG(fe, 0x15, 0xc9);
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >> 8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, (ratio) & 0xf0);
+	STV0299_WRITEREG(fe, 0x0f, 0x80 | m1);
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/dvb/ttpci/budget-ci.c
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c	Tue Apr 18 02:22:40 2006 +0100
@@ -590,32 +590,32 @@ static u8 philips_su1278_tt_inittab[] = 
 
 static int philips_su1278_tt_set_symbol_rate(struct dvb_frontend *fe, u32 srate, u32 ratio)
 {
-	stv0299_writereg(fe, 0x0e, 0x44);
+	STV0299_WRITEREG(fe, 0x0e, 0x44);
 	if (srate >= 10000000) {
-		stv0299_writereg(fe, 0x13, 0x97);
-		stv0299_writereg(fe, 0x14, 0x95);
-		stv0299_writereg(fe, 0x15, 0xc9);
-		stv0299_writereg(fe, 0x17, 0x8c);
-		stv0299_writereg(fe, 0x1a, 0xfe);
-		stv0299_writereg(fe, 0x1c, 0x7f);
-		stv0299_writereg(fe, 0x2d, 0x09);
+		STV0299_WRITEREG(fe, 0x13, 0x97);
+		STV0299_WRITEREG(fe, 0x14, 0x95);
+		STV0299_WRITEREG(fe, 0x15, 0xc9);
+		STV0299_WRITEREG(fe, 0x17, 0x8c);
+		STV0299_WRITEREG(fe, 0x1a, 0xfe);
+		STV0299_WRITEREG(fe, 0x1c, 0x7f);
+		STV0299_WRITEREG(fe, 0x2d, 0x09);
 	} else {
-		stv0299_writereg(fe, 0x13, 0x99);
-		stv0299_writereg(fe, 0x14, 0x8d);
-		stv0299_writereg(fe, 0x15, 0xce);
-		stv0299_writereg(fe, 0x17, 0x43);
-		stv0299_writereg(fe, 0x1a, 0x1d);
-		stv0299_writereg(fe, 0x1c, 0x12);
-		stv0299_writereg(fe, 0x2d, 0x05);
-	}
-	stv0299_writereg(fe, 0x0e, 0x23);
-	stv0299_writereg(fe, 0x0f, 0x94);
-	stv0299_writereg(fe, 0x10, 0x39);
-	stv0299_writereg(fe, 0x15, 0xc9);
-
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
-	stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
+		STV0299_WRITEREG(fe, 0x13, 0x99);
+		STV0299_WRITEREG(fe, 0x14, 0x8d);
+		STV0299_WRITEREG(fe, 0x15, 0xce);
+		STV0299_WRITEREG(fe, 0x17, 0x43);
+		STV0299_WRITEREG(fe, 0x1a, 0x1d);
+		STV0299_WRITEREG(fe, 0x1c, 0x12);
+		STV0299_WRITEREG(fe, 0x2d, 0x05);
+	}
+	STV0299_WRITEREG(fe, 0x0e, 0x23);
+	STV0299_WRITEREG(fe, 0x0f, 0x94);
+	STV0299_WRITEREG(fe, 0x10, 0x39);
+	STV0299_WRITEREG(fe, 0x15, 0xc9);
+
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >> 8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, (ratio) & 0xf0);
 
 	return 0;
 }
@@ -742,17 +742,17 @@ static int philips_tdm1316l_pll_set(stru
 	// setup PLL filter and TDA9889
 	switch (params->u.ofdm.bandwidth) {
 	case BANDWIDTH_6_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0x14);
+		TDA1004X_WRITEREG(fe, 0x0C, 0x14);
 		filter = 0;
 		break;
 
 	case BANDWIDTH_7_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0x80);
+		TDA1004X_WRITEREG(fe, 0x0C, 0x80);
 		filter = 0;
 		break;
 
 	case BANDWIDTH_8_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0x14);
+		TDA1004X_WRITEREG(fe, 0x0C, 0x14);
 		filter = 1;
 		break;
 
@@ -972,23 +972,18 @@ static struct stv0297_config dvbc_philip
 	.pll_set = dvbc_philips_tdm1316l_pll_set,
 };
 
-
-
-
 static void frontend_init(struct budget_ci *budget_ci)
 {
 	switch (budget_ci->budget.dev->pci->subsystem_device) {
 	case 0x100c:		// Hauppauge/TT Nova-CI budget (stv0299/ALPS BSRU6(tsa5059))
-		budget_ci->budget.dvb_frontend =
-			stv0299_attach(&alps_bsru6_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "stv0299", stv0299_attach, &alps_bsru6_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			break;
 		}
 		break;
 
 	case 0x100f:		// Hauppauge/TT Nova-CI budget (stv0299b/Philips su1278(tsa5059))
-		budget_ci->budget.dvb_frontend =
-			stv0299_attach(&philips_su1278_tt_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "stv2099", stv0299_attach, &philips_su1278_tt_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			break;
 		}
@@ -996,8 +991,7 @@ static void frontend_init(struct budget_
 
 	case 0x1010:		// TT DVB-C CI budget (stv0297/Philips tdm1316l(tda6651tt))
 		budget_ci->tuner_pll_address = 0x61;
-		budget_ci->budget.dvb_frontend =
-			stv0297_attach(&dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "stv0297", stv0297_attach, &dvbc_philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			break;
 		}
@@ -1005,8 +999,7 @@ static void frontend_init(struct budget_
 
 	case 0x1011:		// Hauppauge/TT Nova-T budget (tda10045/Philips tdm1316l(tda6651tt) + TDA9889)
 		budget_ci->tuner_pll_address = 0x63;
-		budget_ci->budget.dvb_frontend =
-			tda10045_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "tda1004x", tda10045_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			break;
 		}
@@ -1014,15 +1007,14 @@ static void frontend_init(struct budget_
 
 	case 0x1012:		// TT DVB-T CI budget (tda10046/Philips tdm1316l(tda6651tt))
 		budget_ci->tuner_pll_address = 0x60;
-		budget_ci->budget.dvb_frontend =
-			tda10046_attach(&philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "tda1004x", tda10046_attach, &philips_tdm1316l_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			break;
 		}
 		break;
 
 	case 0x1017:		// TT S-1500 PCI
-		budget_ci->budget.dvb_frontend = stv0299_attach(&alps_bsbe1_config, &budget_ci->budget.i2c_adap);
+		DVB_ATTACH(budget_ci->budget.dvb_frontend, "stv0299", stv0299_attach, &alps_bsbe1_config, &budget_ci->budget.i2c_adap);
 		if (budget_ci->budget.dvb_frontend) {
 			budget_ci->budget.dvb_frontend->ops->dishnetwork_send_legacy_command = NULL;
 			if (lnbp21_init(budget_ci->budget.dvb_frontend, &budget_ci->budget.i2c_adap, LNBP21_LLC, 0)) {
diff -r 2b05b5271ae1 linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c
--- a/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/dvb/ttusb-budget/dvb-ttusb-budget.c	Tue Apr 18 02:22:40 2006 +0100
@@ -1137,17 +1137,17 @@ static int philips_tdm1316l_pll_set(stru
 	// setup PLL filter
 	switch (params->u.ofdm.bandwidth) {
 	case BANDWIDTH_6_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0);
+		TDA1004X_WRITEREG(fe, 0x0C, 0);
 		filter = 0;
 		break;
 
 	case BANDWIDTH_7_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0);
+		TDA1004X_WRITEREG(fe, 0x0C, 0);
 		filter = 0;
 		break;
 
 	case BANDWIDTH_8_MHZ:
-		tda1004x_write_byte(fe, 0x0C, 0xFF);
+		TDA1004X_WRITEREG(fe, 0x0C, 0xFF);
 		filter = 1;
 		break;
 
@@ -1298,11 +1298,11 @@ static int alps_stv0299_set_symbol_rate(
 		bclk = 0x51;
 	}
 
-	stv0299_writereg(fe, 0x13, aclk);
-	stv0299_writereg(fe, 0x14, bclk);
-	stv0299_writereg(fe, 0x1f, (ratio >> 16) & 0xff);
-	stv0299_writereg(fe, 0x20, (ratio >> 8) & 0xff);
-	stv0299_writereg(fe, 0x21, (ratio) & 0xf0);
+	STV0299_WRITEREG(fe, 0x13, aclk);
+	STV0299_WRITEREG(fe, 0x14, bclk);
+	STV0299_WRITEREG(fe, 0x1f, (ratio >> 16) & 0xff);
+	STV0299_WRITEREG(fe, 0x20, (ratio >> 8) & 0xff);
+	STV0299_WRITEREG(fe, 0x21, (ratio) & 0xf0);
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/video/cx88/cx88-dvb.c
--- a/linux/drivers/media/video/cx88/cx88-dvb.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/video/cx88/cx88-dvb.c	Tue Apr 18 02:22:40 2006 +0100
@@ -139,14 +139,14 @@ static int dvico_fusionhdtv_demod_init(s
 	static u8 gpp_ctl_cfg []   = { GPP_CTL,    0x33 };
 	static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 	return 0;
 }
 
@@ -159,14 +159,14 @@ static int dvico_dual_demod_init(struct 
 	static u8 gpp_ctl_cfg []   = { GPP_CTL,    0x33 };
 	static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 
 	return 0;
 }
@@ -181,15 +181,15 @@ static int dntv_live_dvbt_demod_init(str
 	static u8 dntv_extra[]     = { 0xB5, 0x7A };
 	static u8 capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(2000);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
 	udelay(2000);
-	mt352_write(fe, dntv_extra,     sizeof(dntv_extra));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, dntv_extra,     sizeof(dntv_extra));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 
 	return 0;
 }
@@ -223,15 +223,15 @@ static int dntv_live_dvbt_pro_demod_init
 	static u8 dntv_extra[]     = { 0xB5, 0x7A };
 	static u8 capt_range_cfg[] = { 0x75, 0x32 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(2000);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
 	udelay(2000);
-	mt352_write(fe, dntv_extra,     sizeof(dntv_extra));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, dntv_extra,     sizeof(dntv_extra));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 
 	return 0;
 }
diff -r 2b05b5271ae1 linux/drivers/media/video/saa7134/saa7134-dvb.c
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c	Thu Apr 13 12:29:04 2006 -0400
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c	Tue Apr 18 02:22:40 2006 +0100
@@ -100,17 +100,17 @@ static int mt352_pinnacle_init(struct dv
 
 	printk("%s: %s called\n",dev->name,__FUNCTION__);
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
-	mt352_write(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
-
-	mt352_write(fe, fsm_ctl_cfg,    sizeof(fsm_ctl_cfg));
-	mt352_write(fe, scan_ctl_cfg,   sizeof(scan_ctl_cfg));
-	mt352_write(fe, irq_cfg,        sizeof(irq_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, gpp_ctl_cfg,    sizeof(gpp_ctl_cfg));
+
+	MT352_WRITE(fe, fsm_ctl_cfg,    sizeof(fsm_ctl_cfg));
+	MT352_WRITE(fe, scan_ctl_cfg,   sizeof(scan_ctl_cfg));
+	MT352_WRITE(fe, irq_cfg,        sizeof(irq_cfg));
 
 	return 0;
 }
@@ -123,12 +123,12 @@ static int mt352_aver777_init(struct dvb
 	static u8 agc_cfg []       = { AGC_TARGET, 0x28, 0xa0 };
 	static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 };
 
-	mt352_write(fe, clock_config,   sizeof(clock_config));
+	MT352_WRITE(fe, clock_config,   sizeof(clock_config));
 	udelay(200);
-	mt352_write(fe, reset,          sizeof(reset));
-	mt352_write(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
-	mt352_write(fe, agc_cfg,        sizeof(agc_cfg));
-	mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg));
+	MT352_WRITE(fe, reset,          sizeof(reset));
+	MT352_WRITE(fe, adc_ctl_1_cfg,  sizeof(adc_ctl_1_cfg));
+	MT352_WRITE(fe, agc_cfg,        sizeof(agc_cfg));
+	MT352_WRITE(fe, capt_range_cfg, sizeof(capt_range_cfg));
 
 	return 0;
 }
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux