summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/mxb.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/mxb.c')
-rw-r--r--linux/drivers/media/video/mxb.c108
1 files changed, 46 insertions, 62 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");