diff options
author | Maxim Levitsky <maximlevitsky@gmail.com> | 2007-10-11 23:57:15 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-22 10:01:41 -0400 |
commit | c458473ebf31755373ca2f8063c9ec9744205924 (patch) | |
tree | 3852d3810dcaa4a1dddc684b7f735b493861e9df /drivers/media/video/saa7134/saa7134-video.c | |
parent | 7e7f05ca156d34b80e53105e4ef9bc1497a68439 (diff) |
V4L/DVB (6329): Additional Fixes for saa7134 suspend/resume
Fixes few more problems I found in my saa7134 resume code:
* Race between IRQ handler and .suspend()/.resume() functions
* Removes timeout timers on active buffers - those
buffers will be recaptured after resume
* Adds suspend/resume for IR code - probably
necessary if using polling mode
* Adds #ifdef CONFIG_PM overs suspend code
* Runs a quirk in set_tvnorm in suspend/resume too
* Rearranges the order of calls in saa7134_resume to
be exactly as in saa7134_initdev thus the card is
initialized in exactly the same way
* Since DMA audio capture suspend/resume isn't yet supported,
avoid re-enabling it on resume for now
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-video.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-video.c | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/drivers/media/video/saa7134/saa7134-video.c b/drivers/media/video/saa7134/saa7134-video.c index 2b0897770531..3b9ffb4b648a 100644 --- a/drivers/media/video/saa7134/saa7134-video.c +++ b/drivers/media/video/saa7134/saa7134-video.c | |||
@@ -560,15 +560,8 @@ void set_tvnorm(struct saa7134_dev *dev, struct saa7134_tvnorm *norm) | |||
560 | 560 | ||
561 | dev->crop_current = dev->crop_defrect; | 561 | dev->crop_current = dev->crop_defrect; |
562 | 562 | ||
563 | saa7134_set_decoder(dev); | 563 | saa7134_set_tvnorm_hw(dev); |
564 | 564 | ||
565 | if (card_in(dev, dev->ctl_input).tv) { | ||
566 | if ((card(dev).tuner_type == TUNER_PHILIPS_TDA8290) | ||
567 | && ((card(dev).tuner_config == 1) | ||
568 | || (card(dev).tuner_config == 2))) | ||
569 | saa7134_set_gpio(dev, 22, 5); | ||
570 | saa7134_i2c_call_clients(dev, VIDIOC_S_STD, &norm->id); | ||
571 | } | ||
572 | } | 565 | } |
573 | 566 | ||
574 | static void video_mux(struct saa7134_dev *dev, int input) | 567 | static void video_mux(struct saa7134_dev *dev, int input) |
@@ -579,7 +572,8 @@ static void video_mux(struct saa7134_dev *dev, int input) | |||
579 | saa7134_tvaudio_setinput(dev, &card_in(dev, input)); | 572 | saa7134_tvaudio_setinput(dev, &card_in(dev, input)); |
580 | } | 573 | } |
581 | 574 | ||
582 | void saa7134_set_decoder(struct saa7134_dev *dev) | 575 | |
576 | static void saa7134_set_decoder(struct saa7134_dev *dev) | ||
583 | { | 577 | { |
584 | int luma_control, sync_control, mux; | 578 | int luma_control, sync_control, mux; |
585 | 579 | ||
@@ -630,6 +624,19 @@ void saa7134_set_decoder(struct saa7134_dev *dev) | |||
630 | saa_writeb(SAA7134_RAW_DATA_OFFSET, 0x80); | 624 | saa_writeb(SAA7134_RAW_DATA_OFFSET, 0x80); |
631 | } | 625 | } |
632 | 626 | ||
627 | void saa7134_set_tvnorm_hw(struct saa7134_dev *dev) | ||
628 | { | ||
629 | saa7134_set_decoder(dev); | ||
630 | |||
631 | if (card_in(dev, dev->ctl_input).tv) { | ||
632 | if ((card(dev).tuner_type == TUNER_PHILIPS_TDA8290) | ||
633 | && ((card(dev).tuner_config == 1) | ||
634 | || (card(dev).tuner_config == 2))) | ||
635 | saa7134_set_gpio(dev, 22, 5); | ||
636 | saa7134_i2c_call_clients(dev, VIDIOC_S_STD, &dev->tvnorm->id); | ||
637 | } | ||
638 | } | ||
639 | |||
633 | static void set_h_prescale(struct saa7134_dev *dev, int task, int prescale) | 640 | static void set_h_prescale(struct saa7134_dev *dev, int task, int prescale) |
634 | { | 641 | { |
635 | static const struct { | 642 | static const struct { |