diff options
author | Michael Hunold <devnull@localhost> | 2003-04-30 10:15:46 +0000 |
---|---|---|
committer | Michael Hunold <devnull@localhost> | 2003-04-30 10:15:46 +0000 |
commit | 4bdbd31d1ae35244fc58d39fc00f31e18599c782 (patch) | |
tree | e1f3211eca651e3003f6cede823cc3d9b017e01a /linux/drivers | |
parent | 154d8f58826e37fee3f32fab0493158e93ed19d4 (diff) | |
download | mediapointer-dvb-s2-4bdbd31d1ae35244fc58d39fc00f31e18599c782.tar.gz mediapointer-dvb-s2-4bdbd31d1ae35244fc58d39fc00f31e18599c782.tar.bz2 |
- introduce dvb_functions.h in order to make the dvb subsystem
less dependent on the linux kernel. here is the place to store
additional dvb_* functions, which encapsulate linux kernel functionality
which cannot be expressed as a one-liner
- rename ddelay() to dvb_delay(), move it to dvb_functions.h
- change all files to include dvb_functions.h instead of dvb_compat.h
- compile fix for the saa7111 driver
Diffstat (limited to 'linux/drivers')
19 files changed, 64 insertions, 54 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dmxdev.c b/linux/drivers/media/dvb/dvb-core/dmxdev.c index 9abef670b..b5e8cea92 100644 --- a/linux/drivers/media/dvb/dvb-core/dmxdev.c +++ b/linux/drivers/media/dvb/dvb-core/dmxdev.c @@ -33,7 +33,7 @@ #include <linux/wait.h> #include "dmxdev.h" -#include "dvb_compat.h" +#include "dvb_functions.h" MODULE_PARM(debug,"i"); static int debug = 0; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_compat.h b/linux/drivers/media/dvb/dvb-core/dvb_compat.h index cbbaee353..a777e7bdb 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_compat.h +++ b/linux/drivers/media/dvb/dvb-core/dvb_compat.h @@ -7,21 +7,11 @@ #include <linux/version.h> #include <linux/fs.h> +#include "dvb_functions.h" + /* necessary dummy functions due to the > 2.5.67 kernel i2c changes */ #define i2c_get_adapdata(adapter) (struct saa7146_dev*)adapter->data; -/** - * a sleeping delay function, waits i ms - * - */ -static -inline void ddelay(int i) -{ - current->state=TASK_INTERRUPTIBLE; - schedule_timeout((HZ*i)/1000); -} - - static inline void kernel_thread_setup (const char *thread_name) { diff --git a/linux/drivers/media/dvb/dvb-core/dvb_demux.c b/linux/drivers/media/dvb/dvb-core/dvb_demux.c index f7ff477fd..183d5f0c4 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_demux.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_demux.c @@ -30,7 +30,7 @@ #include <linux/string.h> #include "dvb_demux.h" -#include "dvb_compat.h" +#include "dvb_functions.h" #define NOBUFS diff --git a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c index 98d15c9ed..a1542b8b8 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c @@ -36,7 +36,7 @@ #include "dvb_frontend.h" #include "dvbdev.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int dvb_frontend_debug = 0; @@ -196,7 +196,7 @@ void dvb_call_frontend_notifiers (struct dvb_frontend_data *fe, fe->lost_sync_jiffies = jiffies; if (((s ^ fe->status) & FE_HAS_LOCK) && (s & FE_HAS_LOCK)) - ddelay (fe->info->notifier_delay); + dvb_delay (fe->info->notifier_delay); fe->status = s; diff --git a/linux/drivers/media/dvb/dvb-core/dvb_functions.h b/linux/drivers/media/dvb/dvb-core/dvb_functions.h new file mode 100644 index 000000000..f37bd8bad --- /dev/null +++ b/linux/drivers/media/dvb/dvb-core/dvb_functions.h @@ -0,0 +1,18 @@ +#ifndef __DVB_FUNCTIONS_H__ +#define __DVB_FUNCTIONS_H__ + +/** + * a sleeping delay function, waits i ms + * + */ +static +inline void dvb_delay(int i) +{ + current->state=TASK_INTERRUPTIBLE; + schedule_timeout((HZ*i)/1000); +} + +#include "dvb_compat.h" + +#endif + diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c index 9d9a9f3e9..c0d45e8bc 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c @@ -26,7 +26,7 @@ #include <linux/module.h> #include "dvb_i2c.h" -#include "dvb_compat.h" +#include "dvb_functions.h" struct dvb_i2c_device { diff --git a/linux/drivers/media/dvb/dvb-core/dvb_net.c b/linux/drivers/media/dvb/dvb-core/dvb_net.c index a799c7cca..323613b0c 100644 --- a/linux/drivers/media/dvb/dvb-core/dvb_net.c +++ b/linux/drivers/media/dvb/dvb-core/dvb_net.c @@ -35,9 +35,7 @@ #include "dvb_demux.h" #include "dvb_net.h" - -#include "dvb_compat.h" - +#include "dvb_functions.h" #define DVB_NET_MULTICAST_MAX 10 diff --git a/linux/drivers/media/dvb/dvb-core/dvbdev.c b/linux/drivers/media/dvb/dvb-core/dvbdev.c index 468eeb5c1..9ac944c3c 100644 --- a/linux/drivers/media/dvb/dvb-core/dvbdev.c +++ b/linux/drivers/media/dvb/dvb-core/dvbdev.c @@ -32,7 +32,7 @@ #include <linux/slab.h> #include "dvbdev.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int dvbdev_debug = 0; diff --git a/linux/drivers/media/dvb/frontends/alps_tdmb7.c b/linux/drivers/media/dvb/frontends/alps_tdmb7.c index df95c64a6..45b96ba4e 100644 --- a/linux/drivers/media/dvb/frontends/alps_tdmb7.c +++ b/linux/drivers/media/dvb/frontends/alps_tdmb7.c @@ -28,7 +28,7 @@ #include <linux/slab.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; @@ -167,7 +167,7 @@ int cx22700_init (struct dvb_i2c_bus *i2c) cx22700_writereg (i2c, 0x00, 0x02); /* soft reset */ cx22700_writereg (i2c, 0x00, 0x00); - ddelay (HZ/100); + dvb_delay (HZ/100); for (i=0; i<sizeof(init_tab); i+=2) cx22700_writereg (i2c, init_tab[i], init_tab[i+1]); diff --git a/linux/drivers/media/dvb/frontends/at76c651.c b/linux/drivers/media/dvb/frontends/at76c651.c index 56ad686f4..0e4647bc5 100644 --- a/linux/drivers/media/dvb/frontends/at76c651.c +++ b/linux/drivers/media/dvb/frontends/at76c651.c @@ -35,7 +35,7 @@ #include "dvb_frontend.h" #include "dvb_i2c.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; @@ -105,7 +105,7 @@ at76c651_writereg(struct dvb_i2c_bus *i2c, u8 reg, u8 data) "(reg == 0x%02x, val == 0x%02x, ret == %i)\n", __FUNCTION__, reg, data, ret); - ddelay(10); + dvb_delay(10); return (ret != 1) ? -EREMOTEIO : 0; diff --git a/linux/drivers/media/dvb/frontends/cx24110.c b/linux/drivers/media/dvb/frontends/cx24110.c index 5bcb420b3..ed2441cdd 100644 --- a/linux/drivers/media/dvb/frontends/cx24110.c +++ b/linux/drivers/media/dvb/frontends/cx24110.c @@ -39,7 +39,7 @@ #include <linux/init.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; #define dprintk if (debug) printk @@ -245,7 +245,7 @@ int cx24108_set_tv_freq (struct dvb_i2c_bus *i2c, u32 freq) cx24108_write(i2c,pll); cx24110_writereg(i2c,0x56,0x7f); - ddelay(HZ/10); /* wait a moment for the tuner pll to lock */ + dvb_delay(HZ/10); /* wait a moment for the tuner pll to lock */ /* tuner pll lock can be monitored on GPIO pin 4 of cx24110 */ while(!(cx24110_readreg(i2c,0x66)&0x20)&&i<1000) i++; diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-401.c b/linux/drivers/media/dvb/frontends/grundig_29504-401.c index 5609c0279..0c3cb3316 100644 --- a/linux/drivers/media/dvb/frontends/grundig_29504-401.c +++ b/linux/drivers/media/dvb/frontends/grundig_29504-401.c @@ -30,7 +30,7 @@ #include <linux/slab.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; diff --git a/linux/drivers/media/dvb/frontends/grundig_29504-491.c b/linux/drivers/media/dvb/frontends/grundig_29504-491.c index 0658208b5..313782339 100644 --- a/linux/drivers/media/dvb/frontends/grundig_29504-491.c +++ b/linux/drivers/media/dvb/frontends/grundig_29504-491.c @@ -32,7 +32,7 @@ #include <linux/slab.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; #define dprintk if (debug) printk @@ -249,7 +249,7 @@ void tda8083_wait_diseqc_fifo (struct dvb_i2c_bus *i2c, int timeout) while (jiffies - start < timeout && !(tda8083_readreg(i2c, 0x02) & 0x80)) { - ddelay(50); + dvb_delay(50); }; } diff --git a/linux/drivers/media/dvb/frontends/stv0299.c b/linux/drivers/media/dvb/frontends/stv0299.c index 936dbb91b..a7aa39da2 100644 --- a/linux/drivers/media/dvb/frontends/stv0299.c +++ b/linux/drivers/media/dvb/frontends/stv0299.c @@ -43,7 +43,7 @@ #include <linux/string.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static int debug = 0; #define dprintk if (debug) printk @@ -434,7 +434,7 @@ int stv0299_wait_diseqc_fifo (struct dvb_i2c_bus *i2c, int timeout) dprintk ("%s: timeout!!\n", __FUNCTION__); return -ETIMEDOUT; } - ddelay(10); + dvb_delay(10); }; return 0; @@ -453,7 +453,7 @@ int stv0299_wait_diseqc_idle (struct dvb_i2c_bus *i2c, int timeout) dprintk ("%s: timeout!!\n", __FUNCTION__); return -ETIMEDOUT; } - ddelay(10); + dvb_delay(10); }; return 0; diff --git a/linux/drivers/media/dvb/frontends/ves1820.c b/linux/drivers/media/dvb/frontends/ves1820.c index be3a54f14..12dcfd8eb 100644 --- a/linux/drivers/media/dvb/frontends/ves1820.c +++ b/linux/drivers/media/dvb/frontends/ves1820.c @@ -27,7 +27,7 @@ #include <linux/slab.h> #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" #if 0 @@ -123,7 +123,7 @@ int ves1820_writereg (struct dvb_frontend *fe, u8 reg, u8 data) "(reg == 0x%02x, val == 0x%02x, ret == %i)\n", __FUNCTION__, reg, data, ret); - ddelay(10); + dvb_delay(10); return (ret != 1) ? -EREMOTEIO : 0; } @@ -209,7 +209,7 @@ int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0) * check lock and toggle inversion bit if required... */ if (!(ves1820_readreg (fe, 0x11) & 0x08)) { - ddelay(10); + dvb_delay(10); if (!(ves1820_readreg (fe, 0x11) & 0x08)) { reg0 ^= 0x20; ves1820_writereg (fe, 0x00, reg0 & 0xfe); diff --git a/linux/drivers/media/dvb/ttpci/av7110.c b/linux/drivers/media/dvb/ttpci/av7110.c index 4f87b6a0b..6a0d2878c 100644 --- a/linux/drivers/media/dvb/ttpci/av7110.c +++ b/linux/drivers/media/dvb/ttpci/av7110.c @@ -75,7 +75,7 @@ #include "dvb_i2c.h" #include "dvb_frontend.h" -#include "dvb_compat.h" +#include "dvb_functions.h" #if 1 @@ -317,7 +317,7 @@ recover_arm(av7110_t *av7110) reset_arm(av7110); } - ddelay(100); + dvb_delay(100); restart_feeds(av7110); outcom(av7110, COMTYPE_PIDFILTER, SetIR, 1, av7110->ir_config); } @@ -1120,7 +1120,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length) start = jiffies; while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_FREE) { printk(KERN_ERR "%s: timeout waiting for COMMAND idle\n", __FUNCTION__); return -1; @@ -1131,7 +1131,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length) start = jiffies; while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_SHAKE) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); return -1; @@ -1142,7 +1142,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length) start = jiffies; while ( rdebi(av7110, DEBINOSWAP, MSGSTATE, 0, 2) & OSDQFull ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_OSD) { printk(KERN_ERR "%s: timeout waiting for !OSDQFull\n", __FUNCTION__); return -1; @@ -1162,7 +1162,7 @@ static int OutCommand(av7110_t *av7110, u16* buf, int length) start = jiffies; while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_FREE) { printk(KERN_ERR "%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); return -1; @@ -1282,7 +1282,7 @@ static int CommandRequest(av7110_t *av7110, u16 *Buff, int length, u16 *buf, int while ( rdebi(av7110, DEBINOSWAP, COMMAND, 0, 2) ) { #ifdef _NOHANDSHAKE - ddelay(1); + dvb_delay(1); #endif if ((jiffies - start) > ARM_WAIT_FREE) { printk("%s: timeout waiting for COMMAND to complete\n", __FUNCTION__); @@ -1294,7 +1294,7 @@ static int CommandRequest(av7110_t *av7110, u16 *Buff, int length, u16 *buf, int #ifndef _NOHANDSHAKE start = jiffies; while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_SHAKE) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); up(&av7110->dcomlock); @@ -1453,7 +1453,7 @@ static int FlushText(av7110_t *av7110) return -ERESTARTSYS; start = jiffies; while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_OSD) { printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__); up(&av7110->dcomlock); @@ -1476,7 +1476,7 @@ static int WriteText(av7110_t *av7110, u8 win, u16 x, u16 y, u8* buf) start = jiffies; while ( rdebi(av7110, DEBINOSWAP, BUFF1_BASE, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_OSD) { printk(KERN_ERR "%s: timeout waiting for BUFF1_BASE == 0\n", __FUNCTION__); up(&av7110->dcomlock); @@ -1486,7 +1486,7 @@ static int WriteText(av7110_t *av7110, u8 win, u16 x, u16 y, u8* buf) #ifndef _NOHANDSHAKE start = jiffies; while ( rdebi(av7110, DEBINOSWAP, HANDSHAKE_REG, 0, 2 ) ) { - ddelay(1); + dvb_delay(1); if ((jiffies - start) > ARM_WAIT_SHAKE) { printk(KERN_ERR "%s: timeout waiting for HANDSHAKE_REG\n", __FUNCTION__); up(&av7110->dcomlock); @@ -4302,7 +4302,7 @@ int av7110_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *p printk ("av7110: DVB-C analog module detected, " "initializing MSP3400\n"); av7110->adac_type = DVB_ADAC_MSP; - ddelay(100); + dvb_delay(100); msp_writereg(av7110, 0x12, 0x0013, 0x0c00); msp_writereg(av7110, 0x12, 0x0000, 0x7f00); // loudspeaker + headphone msp_writereg(av7110, 0x12, 0x0008, 0x0220); // loudspeaker source @@ -4357,7 +4357,7 @@ int av7110_detach (struct saa7146_dev* saa) wake_up_interruptible(&av7110->arm_wait); while (av7110->arm_thread) - ddelay(1); + dvb_delay(1); dvb_unregister(av7110); diff --git a/linux/drivers/media/dvb/ttpci/budget-av.c b/linux/drivers/media/dvb/ttpci/budget-av.c index 6ab987f8e..3b7c386b0 100644 --- a/linux/drivers/media/dvb/ttpci/budget-av.c +++ b/linux/drivers/media/dvb/ttpci/budget-av.c @@ -33,7 +33,7 @@ #include <media/saa7146_vv.h> #include "budget.h" -#include "dvb_compat.h" +#include "dvb_functions.h" struct budget_av { struct budget budget; @@ -165,7 +165,7 @@ int budget_av_detach (struct saa7146_dev *dev) saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTLO); - ddelay(200); + dvb_delay(200); saa7146_unregister_device (&budget_av->vd, dev); @@ -211,7 +211,7 @@ int budget_av_attach (struct saa7146_dev* dev, //test_knc_ci(av7110); saa7146_setgpio(dev, 0, SAA7146_GPIO_OUTHI); - ddelay(500); + dvb_delay(500); if ((err = saa7113_init (budget_av))) { budget_av_detach(dev); diff --git a/linux/drivers/media/dvb/ttpci/budget.c b/linux/drivers/media/dvb/ttpci/budget.c index 6291a71c8..9143989c8 100644 --- a/linux/drivers/media/dvb/ttpci/budget.c +++ b/linux/drivers/media/dvb/ttpci/budget.c @@ -30,7 +30,7 @@ */ #include "budget.h" -#include "dvb_compat.h" +#include "dvb_functions.h" static void Set22K (struct budget *budget, int state) @@ -99,7 +99,7 @@ int SendDiSEqCMsg (struct budget *budget, int len, u8 *msg, int burst) udelay(12500); saa7146_setgpio(dev, 3, SAA7146_GPIO_OUTLO); } - ddelay(20); + dvb_delay(20); } return 0; diff --git a/linux/drivers/media/video/saa7111.c b/linux/drivers/media/video/saa7111.c index b25b64bfc..286ee8f0d 100644 --- a/linux/drivers/media/video/saa7111.c +++ b/linux/drivers/media/video/saa7111.c @@ -121,7 +121,11 @@ static int saa7111_attach(struct i2c_adapter *adap, int addr, unsigned short fla memset(decoder, 0, sizeof(*decoder)); decoder->client = client; +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) + client->data = decoder; +#else i2c_set_clientdata(client, decoder); +#endif decoder->addr = addr; decoder->norm = VIDEO_MODE_NTSC; decoder->input = 0; |