diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2012-04-29 17:59:38 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-05-14 13:55:52 -0400 |
commit | d69f4a517c0a9b0b4795f4604aed8cf96dcd5223 (patch) | |
tree | 5bee9b277d48f7c5e1359913d5000ecd219123c6 /drivers/media/video/mxb.c | |
parent | 6e65ca942b9664a987866ac0c62e7e450777056b (diff) |
[media] mxb: fix initial audio + ntsc/secam support
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/mxb.c')
-rw-r--r-- | drivers/media/video/mxb.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 2bed92ff9476..aa3d75c1e351 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c | |||
@@ -268,6 +268,8 @@ static int mxb_probe(struct saa7146_dev *dev) | |||
268 | /* we store the pointer in our private data field */ | 268 | /* we store the pointer in our private data field */ |
269 | dev->ext_priv = mxb; | 269 | dev->ext_priv = mxb; |
270 | 270 | ||
271 | v4l2_ctrl_handler_setup(hdl); | ||
272 | |||
271 | return 0; | 273 | return 0; |
272 | } | 274 | } |
273 | 275 | ||
@@ -374,7 +376,7 @@ static int mxb_init_done(struct saa7146_dev* dev) | |||
374 | 376 | ||
375 | /* the rest for mxb */ | 377 | /* the rest for mxb */ |
376 | mxb->cur_input = 0; | 378 | mxb->cur_input = 0; |
377 | mxb->cur_mute = 1; | 379 | mxb->cur_mute = 0; |
378 | 380 | ||
379 | mxb->cur_mode = V4L2_TUNER_MODE_STEREO; | 381 | mxb->cur_mode = V4L2_TUNER_MODE_STEREO; |
380 | 382 | ||
@@ -749,6 +751,10 @@ static int mxb_detach(struct saa7146_dev *dev) | |||
749 | 751 | ||
750 | DEB_EE("dev:%p\n", dev); | 752 | DEB_EE("dev:%p\n", dev); |
751 | 753 | ||
754 | /* mute audio on tea6420s */ | ||
755 | tea6420_route_line(mxb, 6); | ||
756 | tea6420_route_cd(mxb, 6); | ||
757 | |||
752 | saa7146_unregister_device(&mxb->video_dev,dev); | 758 | saa7146_unregister_device(&mxb->video_dev,dev); |
753 | if (MXB_BOARD_CAN_DO_VBI(dev)) | 759 | if (MXB_BOARD_CAN_DO_VBI(dev)) |
754 | saa7146_unregister_device(&mxb->vbi_dev, dev); | 760 | saa7146_unregister_device(&mxb->vbi_dev, dev); |
@@ -774,16 +780,22 @@ static int std_callback(struct saa7146_dev *dev, struct saa7146_standard *standa | |||
774 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 780 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
775 | /* unset the 7111 gpio register -- I don't know what this does exactly */ | 781 | /* unset the 7111 gpio register -- I don't know what this does exactly */ |
776 | saa7111a_call(mxb, core, s_gpio, 0); | 782 | saa7111a_call(mxb, core, s_gpio, 0); |
777 | tuner_call(mxb, core, s_std, std); | 783 | saa7111a_call(mxb, core, s_std, std); |
784 | if (mxb->cur_input == 0) | ||
785 | tuner_call(mxb, core, s_std, std); | ||
778 | } else { | 786 | } else { |
779 | v4l2_std_id std = V4L2_STD_PAL_BG; | 787 | v4l2_std_id std = V4L2_STD_PAL_BG; |
780 | 788 | ||
789 | if (mxb->cur_input) | ||
790 | std = standard->id; | ||
781 | DEB_D("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM\n"); | 791 | DEB_D("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM\n"); |
782 | /* set the 7146 gpio register -- I don't know what this does exactly */ | 792 | /* set the 7146 gpio register -- I don't know what this does exactly */ |
783 | saa7146_write(dev, GPIO_CTRL, 0x00404050); | 793 | saa7146_write(dev, GPIO_CTRL, 0x00404050); |
784 | /* set the 7111 gpio register -- I don't know what this does exactly */ | 794 | /* set the 7111 gpio register -- I don't know what this does exactly */ |
785 | saa7111a_call(mxb, core, s_gpio, 1); | 795 | saa7111a_call(mxb, core, s_gpio, 1); |
786 | tuner_call(mxb, core, s_std, std); | 796 | saa7111a_call(mxb, core, s_std, std); |
797 | if (mxb->cur_input == 0) | ||
798 | tuner_call(mxb, core, s_std, std); | ||
787 | } | 799 | } |
788 | return 0; | 800 | return 0; |
789 | } | 801 | } |