···11/*22 dpc7146.c - v4l2 driver for the dpc7146 demonstration board33-33+44 Copyright (C) 2000-2003 Michael Hunold <michael@mihu.de>5566 This program is free software; you can redistribute it and/or modify···5252#define SAA711X_DECODED_BYTES_OF_TS_2 0x1C5353#define SAA711X_STATUS_BYTE 0x1F54545555-#define DPC_BOARD_CAN_DO_VBI(dev) (dev->revision != 0) 5555+#define DPC_BOARD_CAN_DO_VBI(dev) (dev->revision != 0)56565757static int debug = 0;5858module_param(debug, int, 0);···8181 struct video_device *video_dev;8282 struct video_device *vbi_dev;83838484- struct i2c_adapter i2c_adapter; 8484+ struct i2c_adapter i2c_adapter;8585 struct i2c_client *saa7111a;8686-8686+8787 int cur_input; /* current input */8888};89899090/* fixme: add vbi stuff here */9191static int dpc_probe(struct saa7146_dev* dev)9292{9393- struct dpc* dpc = NULL; 9393+ struct dpc* dpc = NULL;9494 struct i2c_client *client;9595 struct list_head *item;9696···118118 /* loop through all i2c-devices on the bus and look who is there */119119 list_for_each(item,&dpc->i2c_adapter.clients) {120120 client = list_entry(item, struct i2c_client, list);121121- if( I2C_SAA7111A == client->addr ) 121121+ if( I2C_SAA7111A == client->addr )122122 dpc->saa7111a = client;123123 }124124125125 /* check if all devices are present */126126 if( 0 == dpc->saa7111a ) {127127- DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); 127127+ DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n"));128128 i2c_del_adapter(&dpc->i2c_adapter);129129 kfree(dpc);130130 return -ENODEV;131131 }132132-133133- /* all devices are present, probe was successful */ 134134- DEB_D(("dpc_v4l2.o: dpc_probe succeeded for this device.\n")); 132132+133133+ /* all devices are present, probe was successful */134134+ DEB_D(("dpc_v4l2.o: dpc_probe succeeded for this device.\n"));135135136136 /* we store the pointer in our private data field */137137 dev->ext_priv = dpc;···182182static int dpc_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)183183{184184 struct dpc* dpc = (struct dpc*)dev->ext_priv;185185-185185+186186 DEB_D(("dpc_v4l2.o: dpc_attach called.\n"));187187188188 /* checking for i2c-devices can be omitted here, because we···193193 ERR(("cannot register capture v4l2 device. skipping.\n"));194194 return -1;195195 }196196-196196+197197 /* initialization stuff (vbi) (only for revision > 0 and for extensions which want it)*/198198 if( 0 != DPC_BOARD_CAN_DO_VBI(dev)) {199199 if( 0 != saa7146_register_device(&dpc->vbi_dev, dev, "dpc", VFL_TYPE_VBI)) {···205205206206 printk("dpc: found 'dpc7146 demonstration board'-%d.\n",dpc_num);207207 dpc_num++;208208-208208+209209 /* the rest */210210 dpc->cur_input = 0;211211 dpc_init_done(dev);212212-212212+213213 return 0;214214}215215216216static int dpc_detach(struct saa7146_dev* dev)217217{218218 struct dpc* dpc = (struct dpc*)dev->ext_priv;219219-219219+220220 DEB_EE(("dev:%p\n",dev));221221222222 i2c_release_client(dpc->saa7111a);···238238int dpc_vbi_bypass(struct saa7146_dev* dev)239239{240240 struct dpc* dpc = (struct dpc*)dev->ext_priv;241241-241241+242242 int i = 1;243243244244 /* switch bypass in saa7111a */245245 if ( 0 != dpc->saa7111a->driver->command(dpc->saa7111a,SAA711X_VBI_BYPASS, &i)) {246246 printk("dpc_v4l2.o: VBI_BYPASS: could not address saa7111a.\n");247247 return -1;248248- } 248248+ }249249250250 return 0;251251}252252#endif253253254254-static int dpc_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 254254+static int dpc_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)255255{256256 struct saa7146_dev *dev = fh->dev;257257 struct dpc* dpc = (struct dpc*)dev->ext_priv;258258/*259259- struct saa7146_vv *vv = dev->vv_data; 259259+ struct saa7146_vv *vv = dev->vv_data;260260*/261261 switch(cmd)262262 {···264264 {265265 struct v4l2_input *i = arg;266266 DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));267267-267267+268268 if( i->index < 0 || i->index >= DPC_INPUTS) {269269 return -EINVAL;270270 }271271-271271+272272 memcpy(i, &dpc_inputs[i->index], sizeof(struct v4l2_input));273273274274 DEB_D(("dpc_v4l2.o: v4l2_ioctl: VIDIOC_ENUMINPUT %d.\n",i->index));···289289 if (input < 0 || input >= DPC_INPUTS) {290290 return -EINVAL;291291 }292292-292292+293293 dpc->cur_input = input;294294295295 /* fixme: switch input here, switch audio, too! */296296// saa7146_set_hps_source_and_sync(dev, input_port_selection[input].hps_source, input_port_selection[input].hps_sync);297297 printk("dpc_v4l2.o: VIDIOC_S_INPUT: fixme switch input.\n");298298-298298+299299 return 0;300300 }301301 default:···334334static struct saa7146_extension extension;335335336336static struct saa7146_pci_extension_data dpc = {337337- .ext_priv = "Multimedia eXtension Board",338338- .ext = &extension,337337+ .ext_priv = "Multimedia eXtension Board",338338+ .ext = &extension,339339};340340341341static struct pci_device_id pci_tbl[] = {···357357 .capabilities = V4L2_CAP_VBI_CAPTURE,358358 .stds = &standard[0],359359 .num_stds = sizeof(standard)/sizeof(struct saa7146_standard),360360- .std_callback = &std_callback, 360360+ .std_callback = &std_callback,361361 .ioctls = &ioctls[0],362362 .ioctl = dpc_ioctl,363363};···365365static struct saa7146_extension extension = {366366 .name = "dpc7146 demonstration board",367367 .flags = SAA7146_USE_I2C_IRQ,368368-368368+369369 .pci_tbl = &pci_tbl[0],370370 .module = THIS_MODULE,371371···375375376376 .irq_mask = 0,377377 .irq_func = NULL,378378-}; 378378+};379379380380static int __init dpc_init_module(void)381381{···383383 DEB_S(("failed to register extension.\n"));384384 return -ENODEV;385385 }386386-386386+387387 return 0;388388}389389
+5-5
drivers/media/video/hexium_gemini.c
···11/*22 hexium_gemini.c - v4l2 driver for Hexium Gemini frame grabber cards33-33+44 Visit http://www.mihu.de/linux/saa7146/ and follow the link55 to "hexium" for further details about this card.66-66+77 Copyright (C) 2003 Michael Hunold <michael@mihu.de>8899 This program is free software; you can redistribute it and/or modify···81818282 struct video_device *video_dev;8383 struct i2c_adapter i2c_adapter;8484-8484+8585 int cur_input; /* current input */8686 v4l2_std_id cur_std; /* current standard */8787 int cur_bw; /* current black/white status */···174174 .h_offset = 1, .h_pixels = 720,175175 .v_max_out = 576, .h_max_out = 768,176176 }177177-}; 177177+};178178179179/* bring hardware to a sane state. this has to be done, just in case someone180180 wants to capture from this device before it has been properly initialized.···311311 struct saa7146_dev *dev = fh->dev;312312 struct hexium *hexium = (struct hexium *) dev->ext_priv;313313/*314314- struct saa7146_vv *vv = dev->vv_data; 314314+ struct saa7146_vv *vv = dev->vv_data;315315*/316316 switch (cmd) {317317 case VIDIOC_ENUMINPUT:
+9-9
drivers/media/video/hexium_orion.c
···3344 Visit http://www.mihu.de/linux/saa7146/ and follow the link55 to "hexium" for further details about this card.66-66+77 Copyright (C) 2003 Michael Hunold <michael@mihu.de>8899 This program is free software; you can redistribute it and/or modify···6969{7070 int type;7171 struct video_device *video_dev;7272- struct i2c_adapter i2c_adapter; 7272+ struct i2c_adapter i2c_adapter;73737474 int cur_input; /* current input */7575};···8686};87878888static struct {8989- struct hexium_data data[8]; 8989+ struct hexium_data data[8];9090} hexium_input_select[] = {9191{9292 { /* cvbs 1 */···153153 { 0x30, 0x60 },154154 { 0x31, 0xB5 }, // ??155155 { 0x21, 0x03 },156156- } 156156+ }157157}, {158158 { /* y/c 1 */159159 { 0x06, 0x80 },···187187 { 0x31, 0x75 },188188 { 0x21, 0x21 },189189 }190190-} 190190+}191191};192192193193static struct saa7146_standard hexium_standards[] = {···207207 .h_offset = 1, .h_pixels = 720,208208 .v_max_out = 576, .h_max_out = 768,209209 }210210-}; 210210+};211211212212/* this is only called for old HV-PCI6/Orion cards213213 without eeprom */···272272 return 0;273273 }274274275275- /* check if this is an old hexium Orion card by looking at 275275+ /* check if this is an old hexium Orion card by looking at276276 a saa7110 at address 0x4e */277277 if (0 == (err = i2c_smbus_xfer(&hexium->i2c_adapter, 0x4e, 0, I2C_SMBUS_READ, 0x00, I2C_SMBUS_BYTE_DATA, &data))) {278278 printk("hexium_orion: device is a Hexium HV-PCI6/Orion (old).\n");···314314{315315 union i2c_smbus_data data;316316 int i = 0;317317-317317+318318 DEB_D((".\n"));319319320320 for (i = 0; i < 8; i++) {···375375 struct saa7146_dev *dev = fh->dev;376376 struct hexium *hexium = (struct hexium *) dev->ext_priv;377377/*378378- struct saa7146_vv *vv = dev->vv_data; 378378+ struct saa7146_vv *vv = dev->vv_data;379379*/380380 switch (cmd) {381381 case VIDIOC_ENUMINPUT:
+73-73
drivers/media/video/mxb.c
···11/*22 mxb - v4l2 driver for the Multimedia eXtension Board33-33+44 Copyright (C) 1998-2006 Michael Hunold <michael@mihu.de>5566 Visit http://www.mihu.de/linux/saa7146/mxb/77 for further details about this card.88-88+99 This program is free software; you can redistribute it and/or modify1010 it under the terms of the GNU General Public License as published by1111 the Free Software Foundation; either version 2 of the License, or···35353636#define I2C_SAA7111 0x2437373838-#define MXB_BOARD_CAN_DO_VBI(dev) (dev->revision != 0) 3838+#define MXB_BOARD_CAN_DO_VBI(dev) (dev->revision != 0)39394040/* global variable */4141static int mxb_num = 0;42424343-/* initial frequence the tuner will be tuned to. 4343+/* initial frequence the tuner will be tuned to.4444 in verden (lower saxony, germany) 4148 is a4545 channel called "phoenix" */4646static int freq = 4148;···5555enum { TUNER, AUX1, AUX3, AUX3_YC };56565757static struct v4l2_input mxb_inputs[MXB_INPUTS] = {5858- { TUNER, "Tuner", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 }, 5858+ { TUNER, "Tuner", V4L2_INPUT_TYPE_TUNER, 1, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },5959 { AUX1, "AUX1", V4L2_INPUT_TYPE_CAMERA, 2, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },6060 { AUX3, "AUX3 Composite", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },6161 { AUX3_YC, "AUX3 S-Video", V4L2_INPUT_TYPE_CAMERA, 4, 0, V4L2_STD_PAL_BG|V4L2_STD_NTSC_M, 0 },···6666static struct {6767 int hps_source;6868 int hps_sync;6969-} input_port_selection[MXB_INPUTS] = { 6969+} input_port_selection[MXB_INPUTS] = {7070 { SAA7146_HPS_SOURCE_PORT_A, SAA7146_HPS_SYNC_PORT_A },7171 { SAA7146_HPS_SOURCE_PORT_A, SAA7146_HPS_SYNC_PORT_A },7272 { SAA7146_HPS_SOURCE_PORT_A, SAA7146_HPS_SYNC_PORT_A },···8181/* these are the necessary input-output-pins for bringing one audio source8282(see above) to the CD-output */8383static struct tea6420_multiplex TEA6420_cd[MXB_AUDIOS+1][2] =8484- { 8484+ {8585 {{1,1,0},{1,1,0}}, /* Tuner */8686 {{5,1,0},{6,1,0}}, /* AUX 1 */8787 {{4,1,0},{6,1,0}}, /* AUX 2 */···122122 { VIDIOC_S_FREQUENCY, SAA7146_EXCLUSIVE },123123 { VIDIOC_G_AUDIO, SAA7146_EXCLUSIVE },124124 { VIDIOC_S_AUDIO, SAA7146_EXCLUSIVE },125125- { MXB_S_AUDIO_CD, SAA7146_EXCLUSIVE }, /* custom control */ 126126- { MXB_S_AUDIO_LINE, SAA7146_EXCLUSIVE }, /* custom control */ 125125+ { MXB_S_AUDIO_CD, SAA7146_EXCLUSIVE }, /* custom control */126126+ { MXB_S_AUDIO_LINE, SAA7146_EXCLUSIVE }, /* custom control */127127 { 0, 0 }128128};129129···132132 struct video_device *video_dev;133133 struct video_device *vbi_dev;134134135135- struct i2c_adapter i2c_adapter; 135135+ struct i2c_adapter i2c_adapter;136136137137 struct i2c_client* saa7111a;138138 struct i2c_client* tda9840;···200200 client = list_entry(item, struct i2c_client, list);201201 if( I2C_TEA6420_1 == client->addr )202202 mxb->tea6420_1 = client;203203- if( I2C_TEA6420_2 == client->addr ) 203203+ if( I2C_TEA6420_2 == client->addr )204204 mxb->tea6420_2 = client;205205- if( I2C_TEA6415C_2 == client->addr ) 205205+ if( I2C_TEA6415C_2 == client->addr )206206 mxb->tea6415c = client;207207- if( I2C_TDA9840 == client->addr ) 207207+ if( I2C_TDA9840 == client->addr )208208 mxb->tda9840 = client;209209 if( I2C_SAA7111 == client->addr )210210 mxb->saa7111a = client;211211- if( 0x60 == client->addr ) 211211+ if( 0x60 == client->addr )212212 mxb->tuner = client;213213 }214214···222222 return -ENODEV;223223 }224224225225- /* all devices are present, probe was successful */ 225225+ /* all devices are present, probe was successful */226226227227 /* we store the pointer in our private data field */228228 dev->ext_priv = mxb;···230230 return 0;231231}232232233233-/* some init data for the saa7740, the so-called 'sound arena module'. 233233+/* some init data for the saa7740, the so-called 'sound arena module'.234234 there are no specs available, so we simply use some init values */235235static struct {236236 int length;···330330 v4l2_std_id std = V4L2_STD_PAL_BG;331331332332 int i = 0, err = 0;333333- struct tea6415c_multiplex vm; 333333+ struct tea6415c_multiplex vm;334334335335 /* select video mode in saa7111a */336336 i = VIDEO_MODE_PAL;···380380 vm.in = 3;381381 vm.out = 13;382382 mxb->tea6415c->driver->command(mxb->tea6415c,TEA6415C_SWITCH, &vm);383383-383383+384384 /* the rest for mxb */385385 mxb->cur_input = 0;386386 mxb->cur_mute = 1;387387388388 mxb->cur_mode = V4L2_TUNER_MODE_STEREO;389389 mxb->tda9840->driver->command(mxb->tda9840, TDA9840_SWITCH, &mxb->cur_mode);390390-390390+391391 /* check if the saa7740 (aka 'sound arena module') is present392392- on the mxb. if so, we must initialize it. due to lack of 392392+ on the mxb. if so, we must initialize it. due to lack of393393 informations about the saa7740, the values were reverse394394 engineered. */395395 msg.addr = 0x1b;···409409 break;410410 }411411412412- msg.len = mxb_saa7740_init[i].length; 412412+ msg.len = mxb_saa7740_init[i].length;413413 msg.buf = &mxb_saa7740_init[i].data[0];414414 if( 1 != (err = i2c_transfer(&mxb->i2c_adapter, &msg, 1))) {415415 DEB_D(("failed to initialize 'sound arena module'.\n"));···418418 }419419 INFO(("'sound arena module' detected.\n"));420420 }421421-err: 421421+err:422422 /* the rest for saa7146: you should definitely set some basic values423423 for the input-port handling of the saa7146. */424424425425 /* ext->saa has been filled by the core driver */426426-426426+427427 /* some stuff is done via variables */428428 saa7146_set_hps_source_and_sync(dev, input_port_selection[mxb->cur_input].hps_source, input_port_selection[mxb->cur_input].hps_sync);429429···431431432432 /* this is ugly, but because of the fact that this is completely433433 hardware dependend, it should be done directly... */434434- saa7146_write(dev, DD1_STREAM_B, 0x00000000);434434+ saa7146_write(dev, DD1_STREAM_B, 0x00000000);435435 saa7146_write(dev, DD1_INIT, 0x02000200);436436 saa7146_write(dev, MC2, (MASK_09 | MASK_25 | MASK_10 | MASK_26));437437···453453static int mxb_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *info)454454{455455 struct mxb* mxb = (struct mxb*)dev->ext_priv;456456-456456+457457 DEB_EE(("dev:%p\n",dev));458458459459 /* checking for i2c-devices can be omitted here, because we···464464 ERR(("cannot register capture v4l2 device. skipping.\n"));465465 return -1;466466 }467467-467467+468468 /* initialization stuff (vbi) (only for revision > 0 and for extensions which want it)*/469469 if( 0 != MXB_BOARD_CAN_DO_VBI(dev)) {470470 if( 0 != saa7146_register_device(&mxb->vbi_dev, dev, "mxb", VFL_TYPE_VBI)) {···513513 return 0;514514}515515516516-static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg) 516516+static int mxb_ioctl(struct saa7146_fh *fh, unsigned int cmd, void *arg)517517{518518 struct saa7146_dev *dev = fh->dev;519519 struct mxb* mxb = (struct mxb*)dev->ext_priv;520520- struct saa7146_vv *vv = dev->vv_data; 521521-520520+ struct saa7146_vv *vv = dev->vv_data;521521+522522 switch(cmd) {523523 case VIDIOC_ENUMINPUT:524524 {525525 struct v4l2_input *i = arg;526526-526526+527527 DEB_EE(("VIDIOC_ENUMINPUT %d.\n",i->index));528528 if( i->index < 0 || i->index >= MXB_INPUTS) {529529 return -EINVAL;···559559 break;560560 }561561 }562562-562562+563563 if( i < 0 ) {564564 return -EAGAIN;565565 }566566-566566+567567 switch (vc->id ) {568568 case V4L2_CID_AUDIO_MUTE: {569569 vc->value = mxb->cur_mute;···571571 return 0;572572 }573573 }574574-574574+575575 DEB_EE(("VIDIOC_G_CTRL V4L2_CID_AUDIO_MUTE:%d.\n",vc->value));576576 return 0;577577 }···580580 {581581 struct v4l2_control *vc = arg;582582 int i = 0;583583-583583+584584 for (i = MAXCONTROLS - 1; i >= 0; i--) {585585 if (mxb_controls[i].id == vc->id) {586586 break;587587 }588588 }589589-589589+590590 if( i < 0 ) {591591 return -EAGAIN;592592 }593593-593593+594594 switch (vc->id ) {595595 case V4L2_CID_AUDIO_MUTE: {596596 mxb->cur_mute = vc->value;···614614 *input = mxb->cur_input;615615616616 DEB_EE(("VIDIOC_G_INPUT %d.\n",*input));617617- return 0; 618618- } 617617+ return 0;618618+ }619619 case VIDIOC_S_INPUT:620620 {621621 int input = *(int *)arg;622622- struct tea6415c_multiplex vm; 622622+ struct tea6415c_multiplex vm;623623 int i = 0;624624625625 DEB_EE(("VIDIOC_S_INPUT %d.\n",input));···627627 if (input < 0 || input >= MXB_INPUTS) {628628 return -EINVAL;629629 }630630-630630+631631 /* fixme: locke das setzen des inputs mit hilfe des mutexes632632 mutex_lock(&dev->lock);633633 video_mux(dev,*i);634634 mutex_unlock(&dev->lock);635635 */636636-636636+637637 /* fixme: check if streaming capture638638 if ( 0 != dev->streaming ) {639639 DEB_D(("VIDIOC_S_INPUT illegal while streaming.\n"));640640 return -EPERM;641641 }642642 */643643-643643+644644 mxb->cur_input = input;645645-645645+646646 saa7146_set_hps_source_and_sync(dev, input_port_selection[input].hps_source, input_port_selection[input].hps_sync);647647-647647+648648 /* prepare switching of tea6415c and saa7111a;649649 have a look at the 'background'-file for further informations */650650 switch( input ) {651651-651651+652652 case TUNER:653653 {654654 i = 0;655655 vm.in = 3;656656 vm.out = 17;657657-657657+658658 if ( 0 != mxb->tea6415c->driver->command(mxb->tea6415c,TEA6415C_SWITCH, &vm)) {659659 printk("VIDIOC_S_INPUT: could not address tea6415c #1\n");660660 return -EFAULT;···662662 /* connect tuner-output always to multicable */663663 vm.in = 3;664664 vm.out = 13;665665- break; 665665+ break;666666 }667667 case AUX3_YC:668668 {···703703 break;704704 }705705 }706706-706706+707707 /* switch video in saa7111a */708708 if ( 0 != mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_INPUT, &i)) {709709 printk("VIDIOC_S_INPUT: could not address saa7111a #1.\n");710710- } 710710+ }711711712712 /* switch the audio-source only if necessary */713713 if( 0 == mxb->cur_mute ) {···738738 t->rangehigh = 13684; /* 855.25 MHz / 62.5 kHz = 13684 */739739 /* FIXME: add the real signal strength here */740740 t->signal = 0xffff;741741- t->afc = 0; 741741+ t->afc = 0;742742743743 mxb->tda9840->driver->command(mxb->tda9840,TDA9840_DETECT, &byte);744744 t->audmode = mxb->cur_mode;745745-745745+746746 if( byte < 0 ) {747747 t->rxsubchans = V4L2_TUNER_SUB_MONO;748748 } else {···777777 struct v4l2_tuner *t = arg;778778 int result = 0;779779 int byte = 0;780780-780780+781781 if( 0 != t->index ) {782782 DEB_D(("VIDIOC_S_TUNER: channel %d does not have a tuner attached.\n",t->index));783783 return -EINVAL;784784 }785785-785785+786786 switch(t->audmode) {787787 case V4L2_TUNER_MODE_STEREO: {788788 mxb->cur_mode = V4L2_TUNER_MODE_STEREO;···813813 if( 0 != (result = mxb->tda9840->driver->command(mxb->tda9840, TDA9840_SWITCH, &byte))) {814814 printk("VIDIOC_S_TUNER error. result:%d, byte:%d\n",result,byte);815815 }816816-816816+817817 return 0;818818 }819819 case VIDIOC_G_FREQUENCY:···839839840840 if (V4L2_TUNER_ANALOG_TV != f->type)841841 return -EINVAL;842842-842842+843843 if(0 != mxb->cur_input) {844844 DEB_D(("VIDIOC_S_FREQ: channel %d does not have a tuner!\n",mxb->cur_input));845845 return -EINVAL;···848848 mxb->cur_freq = *f;849849 DEB_EE(("VIDIOC_S_FREQUENCY: freq:0x%08x.\n", mxb->cur_freq.frequency));850850851851- /* tune in desired frequency */ 851851+ /* tune in desired frequency */852852 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, &mxb->cur_freq);853853854854 /* hack: changing the frequency should invalidate the vbi-counter (=> alevt) */···861861 case MXB_S_AUDIO_CD:862862 {863863 int i = *(int*)arg;864864-864864+865865 if( i < 0 || i >= MXB_AUDIOS ) {866866 DEB_D(("illegal argument to MXB_S_AUDIO_CD: i:%d.\n",i));867867 return -EINVAL;868868 }869869-869869+870870 DEB_EE(("MXB_S_AUDIO_CD: i:%d.\n",i));871871872872 mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_cd[i][0]);···877877 case MXB_S_AUDIO_LINE:878878 {879879 int i = *(int*)arg;880880-880880+881881 if( i < 0 || i >= MXB_AUDIOS ) {882882 DEB_D(("illegal argument to MXB_S_AUDIO_LINE: i:%d.\n",i));883883 return -EINVAL;884884 }885885-885885+886886 DEB_EE(("MXB_S_AUDIO_LINE: i:%d.\n",i));887887 mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[i][0]);888888 mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[i][1]);···894894 struct v4l2_audio *a = arg;895895896896 if( a->index < 0 || a->index > MXB_INPUTS ) {897897- DEB_D(("VIDIOC_G_AUDIO %d out of range.\n",a->index));897897+ DEB_D(("VIDIOC_G_AUDIO %d out of range.\n",a->index));898898 return -EINVAL;899899 }900900-901901- DEB_EE(("VIDIOC_G_AUDIO %d.\n",a->index));900900+901901+ DEB_EE(("VIDIOC_G_AUDIO %d.\n",a->index));902902 memcpy(a, &mxb_audios[video_audio_connect[mxb->cur_input]], sizeof(struct v4l2_audio));903903-903903+904904 return 0;905905 }906906 case VIDIOC_S_AUDIO:···908908 struct v4l2_audio *a = arg;909909 DEB_D(("VIDIOC_S_AUDIO %d.\n",a->index));910910 return 0;911911- } 911911+ }912912 default:913913/*914914 DEB2(printk("does not handle this ioctl.\n"));···928928 v4l2_std_id std = V4L2_STD_PAL_I;929929 DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n"));930930 /* set the 7146 gpio register -- I don't know what this does exactly */931931- saa7146_write(dev, GPIO_CTRL, 0x00404050);931931+ saa7146_write(dev, GPIO_CTRL, 0x00404050);932932 /* unset the 7111 gpio register -- I don't know what this does exactly */933933 mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero);934934 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);···936936 v4l2_std_id std = V4L2_STD_PAL_BG;937937 DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n"));938938 /* set the 7146 gpio register -- I don't know what this does exactly */939939- saa7146_write(dev, GPIO_CTRL, 0x00404050);939939+ saa7146_write(dev, GPIO_CTRL, 0x00404050);940940 /* set the 7111 gpio register -- I don't know what this does exactly */941941 mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one);942942 mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std);···969969};970970971971static struct saa7146_pci_extension_data mxb = {972972- .ext_priv = "Multimedia eXtension Board",973973- .ext = &extension,972972+ .ext_priv = "Multimedia eXtension Board",973973+ .ext = &extension,974974};975975976976static struct pci_device_id pci_tbl[] = {···992992 .capabilities = V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE,993993 .stds = &standard[0],994994 .num_stds = sizeof(standard)/sizeof(struct saa7146_standard),995995- .std_callback = &std_callback, 995995+ .std_callback = &std_callback,996996 .ioctls = &ioctls[0],997997 .ioctl = mxb_ioctl,998998};···10001000static struct saa7146_extension extension = {10011001 .name = MXB_IDENTIFIER,10021002 .flags = SAA7146_USE_I2C_IRQ,10031003-10031003+10041004 .pci_tbl = &pci_tbl[0],10051005 .module = THIS_MODULE,10061006···1010101010111011 .irq_mask = 0,10121012 .irq_func = NULL,10131013-}; 10131013+};1014101410151015static int __init mxb_init_module(void)10161016{···10181018 DEB_S(("failed to register extension.\n"));10191019 return -ENODEV;10201020 }10211021-10211021+10221022 return 0;10231023}10241024