diff options
Diffstat (limited to 'linux/drivers/media/video')
-rw-r--r-- | linux/drivers/media/video/mxb.c | 108 | ||||
-rw-r--r-- | linux/drivers/media/video/saa7111.c | 2 |
2 files changed, 47 insertions, 63 deletions
diff --git a/linux/drivers/media/video/mxb.c b/linux/drivers/media/video/mxb.c index d7ad7cfd1..c9688cf9c 100644 --- a/linux/drivers/media/video/mxb.c +++ b/linux/drivers/media/video/mxb.c @@ -42,8 +42,7 @@ static int mxb_num = 0; static int freq = 4148; /* debug verbosity */ -/* fixme */ -static int debug = 247; +static int debug = 0; #ifdef MODULE MODULE_PARM(freq,"i"); @@ -52,8 +51,7 @@ MODULE_PARM(debug,"i"); MODULE_PARM_DESC(debug, "debug verbosity"); #endif - -#define MXB_INPUTS 4 +#define MXB_INPUTS 4 enum { TUNER, AUX1, AUX3, AUX3_YC }; static struct v4l2_input mxb_inputs[MXB_INPUTS] = { @@ -296,22 +294,26 @@ static int mxb_init_done(struct saa7146_dev* dev) 0x00, /* 17 - VBI */ }; - struct video_decoder_init saa7111a_init; struct i2c_msg msg; int i = 0, err = 0; struct tea6415c_video_multiplex vm; - memcpy(&saa7111a_init.data, &init, sizeof(init)); - saa7111a_init.count = sizeof(init); - /* write configuration to saa7111a */ - mxb->saa7111a->driver->command(mxb->saa7111a, DECODER_INIT, &saa7111a_init); + i = i2c_master_send(mxb->saa7111a, init, sizeof(init)); + if (i < 0) { + DEB_D(("failed to initialize saa7111a. this should never happen.\n")); + } + /* select tuner-output on saa7111a */ i = 0; mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_INPUT, &i); i = VIDEO_MODE_PAL; mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_NORM, &i); + + /* select a tuner type */ + i = 5; + mxb->tuner->driver->command(mxb->tuner,TUNER_SET_TYPE, &i); /* mute audio on tea6420s */ mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); @@ -934,76 +936,58 @@ static struct saa7146_sub_info sub_data[] = { { 0xffff, 0xffff }, }; -static struct saa7146_extension extension = { - MXB_IDENTIFIER, - MXB_INPUTS, - MXB_AUDIOS, - V4L2_CAP_TUNER, - - sub_data, - - THIS_MODULE, - +static +struct saa7146_extension extension = { + .name = MXB_IDENTIFIER, + .inputs = MXB_INPUTS, + .audios = MXB_AUDIOS, + .capabilities = V4L2_CAP_TUNER, + + .devices = &sub_data[0], + .module = THIS_MODULE, + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,51) - mxb_inc_use, - mxb_dec_use, + .inc_use = mxb_inc_use, + .dec_use = mxb_dec_use, #endif - &standard[0], - sizeof(standard)/sizeof(struct saa7146_standard), - &std_callback, + .stds = &standard[0], + .num_stds = sizeof(standard)/sizeof(struct saa7146_standard), + .std_callback = &std_callback, - 1, - mxb_vbi_bypass, - - &ioctls[0], - - mxb_preinit, - mxb_probe, - mxb_attach, - mxb_detach, - - mxb_ioctl, + .use_kernel_i2c = 1, + .vbi = mxb_vbi_bypass, - 0, - NULL, -}; + .ioctls = &ioctls[0], + + .preinit = mxb_preinit, + .probe = mxb_probe, + .attach = mxb_attach, + .detach = mxb_detach, + .ioctl = mxb_ioctl, + + .irq_mask = 0, + .irq_func = NULL, +}; -static int mxb_init(void) +int __init mxb_init_module(void) { if( 0 != saa7146_register_extension(&extension)) { DEB_S(("failed to register extension.\n")); return -ENODEV; } - - /* mxb_num gets increased if the probe function is called successfully */ - - if( 0 == mxb_num ) { - INFO(("no mxb(s) found.\n")); - return -ENODEV; - } - - INFO(("%d mxb(s) found.\n", mxb_num)); + return 0; } -#ifdef MODULE -MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); -MODULE_DESCRIPTION("video4linux driver for the Siemens-Nixdorf 'Multimedia eXtension board'"); -MODULE_LICENSE("GPL"); - -EXPORT_NO_SYMBOLS; - -static int mxb_init_module(void) -{ - return mxb_init(); -} - -static void mxb_cleanup_module(void) +void __exit mxb_cleanup_module(void) { saa7146_unregister_extension(&extension); } module_init(mxb_init_module); module_exit(mxb_cleanup_module); -#endif + +MODULE_DESCRIPTION("video4linux driver for the Siemens-Nixdorf 'Multimedia eXtension board'"); +MODULE_AUTHOR("Michael Hunold <michael@mihu.de>"); +MODULE_LICENSE("GPL"); diff --git a/linux/drivers/media/video/saa7111.c b/linux/drivers/media/video/saa7111.c index 256654ad3..461e797cc 100644 --- a/linux/drivers/media/video/saa7111.c +++ b/linux/drivers/media/video/saa7111.c @@ -59,7 +59,7 @@ struct saa7111 { /* hmm, the saa7111(a) specs don't say anything about address 34>>1 (= 17 = 0x11), only for 0x24 and 0x25 ... */ -static unsigned short normal_i2c[] = { 34>>1, 0x24, 0x25, I2C_CLIENT_END }; +static unsigned short normal_i2c[] = { 0x24, 0x25, I2C_CLIENT_END }; static unsigned short normal_i2c_range[] = { I2C_CLIENT_END }; /* magic definition of all other variables and things */ |