Lines Matching refs:mxb
142 struct mxb struct
163 #define saa7111a_call(mxb, o, f, args...) \ argument
164 v4l2_subdev_call(mxb->saa7111a, o, f, ##args)
165 #define tda9840_call(mxb, o, f, args...) \ argument
166 v4l2_subdev_call(mxb->tda9840, o, f, ##args)
167 #define tea6415c_call(mxb, o, f, args...) \ argument
168 v4l2_subdev_call(mxb->tea6415c, o, f, ##args)
169 #define tuner_call(mxb, o, f, args...) \ argument
170 v4l2_subdev_call(mxb->tuner, o, f, ##args)
174 static void mxb_update_audmode(struct mxb *mxb) in mxb_update_audmode() argument
177 .audmode = mxb->cur_mode, in mxb_update_audmode()
180 tda9840_call(mxb, tuner, s_tuner, &t); in mxb_update_audmode()
183 static inline void tea6420_route(struct mxb *mxb, int idx) in tea6420_route() argument
185 v4l2_subdev_call(mxb->tea6420_1, audio, s_routing, in tea6420_route()
187 v4l2_subdev_call(mxb->tea6420_2, audio, s_routing, in tea6420_route()
189 v4l2_subdev_call(mxb->tea6420_1, audio, s_routing, in tea6420_route()
191 v4l2_subdev_call(mxb->tea6420_2, audio, s_routing, in tea6420_route()
201 struct mxb *mxb = dev->ext_priv; in mxb_s_ctrl() local
205 mxb->cur_mute = ctrl->val; in mxb_s_ctrl()
207 tea6420_route(mxb, ctrl->val ? 6 : in mxb_s_ctrl()
208 video_audio_connect[mxb->cur_input]); in mxb_s_ctrl()
223 struct mxb *mxb = NULL; in mxb_probe() local
229 mxb = kzalloc(sizeof(struct mxb), GFP_KERNEL); in mxb_probe()
230 if (mxb == NULL) { in mxb_probe()
236 snprintf(mxb->i2c_adapter.name, sizeof(mxb->i2c_adapter.name), "mxb%d", mxb_num); in mxb_probe()
238 saa7146_i2c_adapter_prepare(dev, &mxb->i2c_adapter, SAA7146_I2C_BUS_BIT_RATE_480); in mxb_probe()
239 if (i2c_add_adapter(&mxb->i2c_adapter) < 0) { in mxb_probe()
241 kfree(mxb); in mxb_probe()
245 mxb->saa7111a = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
247 mxb->tea6420_1 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
249 mxb->tea6420_2 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
251 mxb->tea6415c = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
253 mxb->tda9840 = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
255 mxb->tuner = v4l2_i2c_new_subdev(&dev->v4l2_dev, &mxb->i2c_adapter, in mxb_probe()
259 if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || in mxb_probe()
260 !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) { in mxb_probe()
262 i2c_del_adapter(&mxb->i2c_adapter); in mxb_probe()
263 kfree(mxb); in mxb_probe()
270 dev->ext_priv = mxb; in mxb_probe()
339 struct mxb* mxb = (struct mxb*)dev->ext_priv; in mxb_init_done() local
347 tea6420_route(mxb, 6); in mxb_init_done()
350 saa7111a_call(mxb, video, s_std, std); in mxb_init_done()
353 saa7111a_call(mxb, video, s_routing, SAA7115_COMPOSITE0, in mxb_init_done()
360 tuner_call(mxb, tuner, s_type_addr, &tun_setup); in mxb_init_done()
362 mxb->cur_freq.tuner = 0; in mxb_init_done()
363 mxb->cur_freq.type = V4L2_TUNER_ANALOG_TV; in mxb_init_done()
364 mxb->cur_freq.frequency = freq; in mxb_init_done()
365 tuner_call(mxb, tuner, s_frequency, &mxb->cur_freq); in mxb_init_done()
370 saa7111a_call(mxb, core, s_gpio, 1); in mxb_init_done()
371 saa7111a_call(mxb, video, s_std, std); in mxb_init_done()
372 tuner_call(mxb, video, s_std, std); in mxb_init_done()
375 tea6415c_call(mxb, video, s_routing, 3, 17, 0); in mxb_init_done()
378 tea6415c_call(mxb, video, s_routing, 3, 13, 0); in mxb_init_done()
381 mxb->cur_input = 0; in mxb_init_done()
382 mxb->cur_audinput = video_audio_connect[mxb->cur_input]; in mxb_init_done()
383 mxb->cur_mute = 1; in mxb_init_done()
385 mxb->cur_mode = V4L2_TUNER_MODE_STEREO; in mxb_init_done()
386 mxb_update_audmode(mxb); in mxb_init_done()
397 err = i2c_transfer(&mxb->i2c_adapter, &msg, 1); in mxb_init_done()
411 err = i2c_transfer(&mxb->i2c_adapter, &msg, 1); in mxb_init_done()
426 saa7146_set_hps_source_and_sync(dev, input_port_selection[mxb->cur_input].hps_source, in mxb_init_done()
427 input_port_selection[mxb->cur_input].hps_sync); in mxb_init_done()
461 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_g_input() local
462 *i = mxb->cur_input; in vidioc_g_input()
471 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_s_input() local
480 mxb->cur_input = input; in vidioc_s_input()
491 err = tea6415c_call(mxb, video, s_routing, 3, 17, 0); in vidioc_s_input()
495 err = tea6415c_call(mxb, video, s_routing, 3, 13, 0); in vidioc_s_input()
509 err = tea6415c_call(mxb, video, s_routing, 1, 17, 0); in vidioc_s_input()
516 mxb->video_dev.tvnorms = mxb_inputs[input].std; in vidioc_s_input()
517 mxb->vbi_dev.tvnorms = mxb_inputs[input].std; in vidioc_s_input()
520 if (saa7111a_call(mxb, video, s_routing, i, SAA7111_FMT_CCIR, 0)) in vidioc_s_input()
523 mxb->cur_audinput = video_audio_connect[input]; in vidioc_s_input()
525 if (0 == mxb->cur_mute) in vidioc_s_input()
526 tea6420_route(mxb, mxb->cur_audinput); in vidioc_s_input()
527 if (mxb->cur_audinput == 0) in vidioc_s_input()
528 mxb_update_audmode(mxb); in vidioc_s_input()
536 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_g_tuner() local
551 t->audmode = mxb->cur_mode; in vidioc_g_tuner()
558 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_s_tuner() local
566 mxb->cur_mode = t->audmode; in vidioc_s_tuner()
580 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_g_frequency() local
584 *f = mxb->cur_freq; in vidioc_g_frequency()
586 DEB_EE("VIDIOC_G_FREQ: freq:0x%08x\n", mxb->cur_freq.frequency); in vidioc_g_frequency()
593 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_s_frequency() local
601 DEB_EE("VIDIOC_S_FREQUENCY: freq:0x%08x\n", mxb->cur_freq.frequency); in vidioc_s_frequency()
604 tuner_call(mxb, tuner, s_frequency, f); in vidioc_s_frequency()
606 mxb->cur_freq = *f; in vidioc_s_frequency()
607 tuner_call(mxb, tuner, g_frequency, &mxb->cur_freq); in vidioc_s_frequency()
608 if (mxb->cur_audinput == 0) in vidioc_s_frequency()
609 mxb_update_audmode(mxb); in vidioc_s_frequency()
624 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_g_audio() local
627 *a = mxb_audios[mxb->cur_audinput]; in vidioc_g_audio()
634 struct mxb *mxb = (struct mxb *)dev->ext_priv; in vidioc_s_audio() local
638 !(mxb_inputs[mxb->cur_input].audioset & (1 << a->index))) in vidioc_s_audio()
641 if (mxb->cur_audinput != a->index) { in vidioc_s_audio()
642 mxb->cur_audinput = a->index; in vidioc_s_audio()
643 tea6420_route(mxb, a->index); in vidioc_s_audio()
644 if (mxb->cur_audinput == 0) in vidioc_s_audio()
645 mxb_update_audmode(mxb); in vidioc_s_audio()
678 struct mxb *mxb; in mxb_attach() local
693 mxb = (struct mxb *)dev->ext_priv; in mxb_attach()
721 if (saa7146_register_device(&mxb->video_dev, dev, "mxb", VFL_TYPE_VIDEO)) { in mxb_attach()
729 if (saa7146_register_device(&mxb->vbi_dev, dev, "mxb", VFL_TYPE_VBI)) { in mxb_attach()
743 struct mxb *mxb = (struct mxb *)dev->ext_priv; in mxb_detach() local
748 tea6420_route(mxb, 6); in mxb_detach()
750 saa7146_unregister_device(&mxb->video_dev,dev); in mxb_detach()
752 saa7146_unregister_device(&mxb->vbi_dev, dev); in mxb_detach()
757 i2c_del_adapter(&mxb->i2c_adapter); in mxb_detach()
758 kfree(mxb); in mxb_detach()
765 struct mxb *mxb = (struct mxb *)dev->ext_priv; in std_callback() local
773 saa7111a_call(mxb, core, s_gpio, 0); in std_callback()
774 saa7111a_call(mxb, video, s_std, std); in std_callback()
775 if (mxb->cur_input == 0) in std_callback()
776 tuner_call(mxb, video, s_std, std); in std_callback()
780 if (mxb->cur_input) in std_callback()
785 saa7111a_call(mxb, core, s_gpio, 1); in std_callback()
786 saa7111a_call(mxb, video, s_std, std); in std_callback()
787 if (mxb->cur_input == 0) in std_callback()
788 tuner_call(mxb, video, s_std, std); in std_callback()
817 static struct saa7146_pci_extension_data mxb = { variable
828 .driver_data = (unsigned long)&mxb,