diff options
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/mxb.c | 19 | ||||
-rw-r--r-- | linux/drivers/media/video/mxb.h | 38 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9840.c | 26 | ||||
-rw-r--r-- | linux/drivers/media/video/tda9840.h | 44 | ||||
-rw-r--r-- | linux/drivers/media/video/tea6415c.c | 30 | ||||
-rw-r--r-- | linux/drivers/media/video/tea6415c.h | 33 | ||||
-rw-r--r-- | linux/drivers/media/video/tea6420.c | 30 | ||||
-rw-r--r-- | linux/drivers/media/video/tea6420.h | 33 |
8 files changed, 134 insertions, 119 deletions
diff --git a/linux/drivers/media/video/mxb.c b/linux/drivers/media/video/mxb.c index 29be50726..b12daa05d 100644 --- a/linux/drivers/media/video/mxb.c +++ b/linux/drivers/media/video/mxb.c @@ -18,7 +18,8 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include <saa7146_vv.h> +#define DEBUG_VARIABLE debug +#include "saa7146_vv.h" #include "mxb.h" #include "tea6415c.h" @@ -69,10 +70,13 @@ static int mxb_num = 0; in verden (lower saxony, germany) 4148 is a channel called "phoenix" */ static int freq = 4148; - MODULE_PARM(freq,"i"); MODULE_PARM_DESC(freq, "initial frequency the tuner will be tuned to while setup"); +static int debug = 0; +MODULE_PARM(debug,"i"); +MODULE_PARM_DESC(debug, "debug verbosity"); + #define MXB_INPUTS 4 enum { TUNER, AUX1, AUX3, AUX3_YC }; @@ -102,7 +106,7 @@ static int video_audio_connect[MXB_AUDIOS] = /* these are the necessary input-output-pins for bringing one audio source (see above) to the CD-output */ -static struct audio_multiplex TEA6420_cd[MXB_AUDIOS+1][2] = +static struct tea6420_multiplex TEA6420_cd[MXB_AUDIOS+1][2] = { {{1,1,0},{1,1,0}}, /* Tuner */ {{5,1,0},{6,1,0}}, /* AUX 1 */ @@ -115,7 +119,7 @@ static struct audio_multiplex TEA6420_cd[MXB_AUDIOS+1][2] = /* these are the necessary input-output-pins for bringing one audio source (see above) to the line-output */ -static struct audio_multiplex TEA6420_line[MXB_AUDIOS+1][2] = +static struct tea6420_multiplex TEA6420_line[MXB_AUDIOS+1][2] = { {{2,3,0},{1,2,0}}, {{5,3,0},{6,2,0}}, @@ -237,7 +241,8 @@ static int mxb_probe(struct saa7146_dev* dev) /* check if all devices are present */ if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) { - DEB_D(("this saa7146 is not on an mxb.\n")); + printk("mxb: did not find all i2c devices. are you sure you\n"); + printk("mxb: insmod'ed tea6420, tea6415c, saa7111, tea6415c and tuner?\n"); i2c_del_adapter(&mxb->i2c_adapter); kfree(mxb); return -ENODEV; @@ -349,7 +354,7 @@ static int mxb_init_done(struct saa7146_dev* dev) struct i2c_msg msg; int i = 0, err = 0; - struct tea6415c_video_multiplex vm; + struct tea6415c_multiplex vm; /* write configuration to saa7111a */ i = i2c_master_send(mxb->saa7111a, init, sizeof(init)); @@ -648,7 +653,7 @@ static int mxb_ioctl(struct saa7146_dev *dev, unsigned int cmd, void *arg) case VIDIOC_S_INPUT: { int input = *(int *)arg; - struct tea6415c_video_multiplex vm; + struct tea6415c_multiplex vm; int i = 0; DEB_EE(("VIDIOC_S_INPUT %d.\n",input)); diff --git a/linux/drivers/media/video/mxb.h b/linux/drivers/media/video/mxb.h index 3f73ea7ca..755e7927b 100644 --- a/linux/drivers/media/video/mxb.h +++ b/linux/drivers/media/video/mxb.h @@ -3,8 +3,8 @@ #define BASE_VIDIOC_MXB 10 -#define MXB_S_AUDIO_CD _IOW ('V', BASE_VIDIOC_PRIVATE+BASE_VIDIOC_MXB+00, int) -#define MXB_S_AUDIO_LINE _IOW ('V', BASE_VIDIOC_PRIVATE+BASE_VIDIOC_MXB+01, int) +#define MXB_S_AUDIO_CD _IOW ('V', BASE_VIDIOC_PRIVATE+BASE_VIDIOC_MXB+0, int) +#define MXB_S_AUDIO_LINE _IOW ('V', BASE_VIDIOC_PRIVATE+BASE_VIDIOC_MXB+1, int) #define MXB_IDENTIFIER "Multimedia eXtension Board" @@ -12,11 +12,31 @@ /* these are the available audio sources, which can switched to the line- and cd-output individually */ -struct v4l2_audio mxb_audios[MXB_AUDIOS] = - { { 0, "Tuner", 0}, - { 1, "AUX1", 0}, - { 2, "AUX2", 0}, - { 3, "AUX3", 0}, - { 4, "Radio (X9)", 0}, - { 5, "CD-ROM (X10)", 0} }; +struct v4l2_audio mxb_audios[MXB_AUDIOS] = { + { + .index = 0, + .name = "Tuner", + .capability = V4L2_AUDCAP_STEREO, + } , { + .index = 1, + .name = "AUX1", + .capability = V4L2_AUDCAP_STEREO, + } , { + .index = 2, + .name = "AUX2", + .capability = V4L2_AUDCAP_STEREO, + } , { + .index = 3, + .name = "AUX3", + .capability = V4L2_AUDCAP_STEREO, + } , { + .index = 4, + .name = "Radio (X9)", + .capability = V4L2_AUDCAP_STEREO, + } , { + .index = 5, + .name = "CD-ROM (X10)", + .capability = V4L2_AUDCAP_STEREO, + } +}; #endif diff --git a/linux/drivers/media/video/tda9840.c b/linux/drivers/media/video/tda9840.c index dfdf04968..6da68d762 100644 --- a/linux/drivers/media/video/tda9840.c +++ b/linux/drivers/media/video/tda9840.c @@ -1,3 +1,29 @@ + /* + tda9840.h - i2c-driver for the tda9840 by SGS Thomson + + Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de> + + The tda9840 is a stereo/dual sound processor with digital + identification. It can be found at address 0x84 on the i2c-bus. + + For detailed informations download the specifications directly + from SGS Thomson at http://www.st.com + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + #include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> diff --git a/linux/drivers/media/video/tda9840.h b/linux/drivers/media/video/tda9840.h index 54e4a77e4..28021053b 100644 --- a/linux/drivers/media/video/tda9840.h +++ b/linux/drivers/media/video/tda9840.h @@ -1,50 +1,16 @@ - /* - tda9840.h - definitions for the i2c-driver - for the tda9840 by SGS Thomson - - Copyright (C) 1998,1999,2000 Michael Hunold <michael@mihu.de> - - The tda9840 is a stereo/dual sound processor with digital - identification. It can be found at address 0x84 on the i2c-bus. - - For detailed informations download the specifications directly - from SGS Thomson at http://www.st.com - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - #ifndef __INCLUDED_TDA9840__ #define __INCLUDED_TDA9840__ #define I2C_TDA9840 0x42 -/* I'm using the currently unused letter 'd' for - identifying. perhaps this will be changed in the - future. - - (see /usr/src/linux/Documentation/ioctl-number.txt - for further details.) */ - -#define TDA9840_DETECT _IOR('d',1,int) +#define TDA9840_DETECT _IOR('v',1,int) /* return values for TDA9840_DETCT */ #define TDA9840_MONO_DETECT 0x0 #define TDA9840_DUAL_DETECT 0x1 #define TDA9840_STEREO_DETECT 0x2 #define TDA9840_INCORRECT_DETECT 0x3 -#define TDA9840_SWITCH _IOW('d',2,int) +#define TDA9840_SWITCH _IOW('v',2,int) /* modes than can be set with TDA9840_SWITCH */ #define TDA9840_SET_MUTE 0x00 #define TDA9840_SET_MONO 0x10 @@ -57,13 +23,13 @@ /* values may range between +2.5 and -2.0; the value has to be multiplied with 10 */ -#define TDA9840_LEVEL_ADJUST _IOW('d',3,int) +#define TDA9840_LEVEL_ADJUST _IOW('v',3,int) /* values may range between +2.5 and -2.4; the value has to be multiplied with 10 */ -#define TDA9840_STEREO_ADJUST _IOW('d',4,int) +#define TDA9840_STEREO_ADJUST _IOW('v',4,int) /* currently not implemented */ -#define TDA9840_TEST _IOW('d',5,int) +#define TDA9840_TEST _IOW('v',5,int) #endif diff --git a/linux/drivers/media/video/tea6415c.c b/linux/drivers/media/video/tea6415c.c index dd65664d4..7cbc580de 100644 --- a/linux/drivers/media/video/tea6415c.c +++ b/linux/drivers/media/video/tea6415c.c @@ -1,3 +1,31 @@ + /* + tea6415c.h - i2c-driver for the tea6415c by SGS Thomson + + Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de> + + The tea6415c is a bus controlled video-matrix-switch + with 8 inputs and 6 outputs. + It is cascadable, i.e. it can be found at the addresses + 0x86 and 0x06 on the i2c-bus. + + For detailed informations download the specifications directly + from SGS Thomson at http://www.st.com + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License vs published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mvss Ave, Cambridge, MA 02139, USA. + */ + #include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> @@ -153,7 +181,7 @@ static int tea6415c_switch(struct i2c_client *client, int i, int o) static int tea6415c_command(struct i2c_client *client, unsigned int cmd, void* arg) { - struct tea6415c_video_multiplex *v = (struct tea6415c_video_multiplex*)arg; + struct tea6415c_multiplex *v = (struct tea6415c_multiplex*)arg; int result = 0; switch (cmd) { diff --git a/linux/drivers/media/video/tea6415c.h b/linux/drivers/media/video/tea6415c.h index 775fb6fe8..f84ed8005 100644 --- a/linux/drivers/media/video/tea6415c.h +++ b/linux/drivers/media/video/tea6415c.h @@ -1,32 +1,3 @@ - /* - tea6415c.h - definitions for the i2c-driver - for the tea6415c by SGS Thomson - - Copyright (C) 1998,1999,2000 Michael Hunold <michael@mihu.de> - - The tea6415c is a bus controlled video-matrix-switch - with 8 inputs and 6 outputs. - It is cascadable, i.e. it can be found at the addresses - 0x86 and 0x06 on the i2c-bus. - - For detailed informations download the specifications directly - from SGS Thomson at http://www.st.com - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License vs published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mvss Ave, Cambridge, MA 02139, USA. - */ - #ifndef __INCLUDED_TEA6415C__ #define __INCLUDED_TEA6415C__ @@ -57,12 +28,12 @@ #define TEA6415C_INPUT7 1 #define TEA6415C_INPUT8 11 -struct tea6415c_video_multiplex +struct tea6415c_multiplex { int in; /* input-pin */ int out; /* output-pin */ }; -#define TEA6415C_SWITCH _IOW('t',1,struct tea6415c_video_multiplex) +#define TEA6415C_SWITCH _IOW('v',1,struct tea6415c_multiplex) #endif diff --git a/linux/drivers/media/video/tea6420.c b/linux/drivers/media/video/tea6420.c index 38bd85b6a..d860d1002 100644 --- a/linux/drivers/media/video/tea6420.c +++ b/linux/drivers/media/video/tea6420.c @@ -1,3 +1,31 @@ + /* + tea6420.h - i2c-driver for the tea6420 by SGS Thomson + + Copyright (C) 1998-2003 Michael Hunold <michael@mihu.de> + + The tea6420 is a bus controlled audio-matrix with 5 stereo inputs, + 4 stereo outputs and gain control for each output. + It is cascadable, i.e. it can be found at the adresses 0x98 + and 0x9a on the i2c-bus. + + For detailed informations download the specifications directly + from SGS Thomson at http://www.st.com + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + #include <linux/version.h> #include <linux/module.h> #include <linux/kernel.h> @@ -133,7 +161,7 @@ static int tea6420_detach(struct i2c_client *client) static int tea6420_command(struct i2c_client *client, unsigned int cmd, void* arg) { - struct audio_multiplex *a = (struct audio_multiplex*)arg; + struct tea6420_multiplex *a = (struct tea6420_multiplex*)arg; int result = 0; switch (cmd) { diff --git a/linux/drivers/media/video/tea6420.h b/linux/drivers/media/video/tea6420.h index 5cda0c408..ea664df15 100644 --- a/linux/drivers/media/video/tea6420.h +++ b/linux/drivers/media/video/tea6420.h @@ -1,32 +1,3 @@ - /* - tea6420.h - definitions for the i2c-driver - for the tea6420 by SGS Thomson - - Copyright (C) 1998,1999,2000 Michael Hunold <michael@mihu.de> - - The tea6420 is a bus controlled audio-matrix with 5 stereo inputs, - 4 stereo outputs and gain control for each output. - It is cascadable, i.e. it can be found at the adresses 0x98 - and 0x9a on the i2c-bus. - - For detailed informations download the specifications directly - from SGS Thomson at http://www.st.com - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - */ - #ifndef __INCLUDED_TEA6420__ #define __INCLUDED_TEA6420__ @@ -34,13 +5,13 @@ #define I2C_TEA6420_1 0x4c #define I2C_TEA6420_2 0x4d -struct audio_multiplex +struct tea6420_multiplex { int in; /* input of audio switch */ int out; /* output of audio switch */ int gain; /* gain of connection */ }; -#define TEA6420_SWITCH _IOW('t',1,struct audio_multiplex) +#define TEA6420_SWITCH _IOW('v',1,struct tea6420_multiplex) #endif |