diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-tvaudio.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-tvaudio.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/media/video/saa7134/saa7134-tvaudio.c b/drivers/media/video/saa7134/saa7134-tvaudio.c index 4e9810469ae3..232af598d947 100644 --- a/drivers/media/video/saa7134/saa7134-tvaudio.c +++ b/drivers/media/video/saa7134/saa7134-tvaudio.c | |||
@@ -35,18 +35,18 @@ | |||
35 | 35 | ||
36 | /* ------------------------------------------------------------------ */ | 36 | /* ------------------------------------------------------------------ */ |
37 | 37 | ||
38 | static unsigned int audio_debug = 0; | 38 | static unsigned int audio_debug; |
39 | module_param(audio_debug, int, 0644); | 39 | module_param(audio_debug, int, 0644); |
40 | MODULE_PARM_DESC(audio_debug,"enable debug messages [tv audio]"); | 40 | MODULE_PARM_DESC(audio_debug,"enable debug messages [tv audio]"); |
41 | 41 | ||
42 | static unsigned int audio_ddep = 0; | 42 | static unsigned int audio_ddep; |
43 | module_param(audio_ddep, int, 0644); | 43 | module_param(audio_ddep, int, 0644); |
44 | MODULE_PARM_DESC(audio_ddep,"audio ddep overwrite"); | 44 | MODULE_PARM_DESC(audio_ddep,"audio ddep overwrite"); |
45 | 45 | ||
46 | static int audio_clock_override = UNSET; | 46 | static int audio_clock_override = UNSET; |
47 | module_param(audio_clock_override, int, 0644); | 47 | module_param(audio_clock_override, int, 0644); |
48 | 48 | ||
49 | static int audio_clock_tweak = 0; | 49 | static int audio_clock_tweak; |
50 | module_param(audio_clock_tweak, int, 0644); | 50 | module_param(audio_clock_tweak, int, 0644); |
51 | MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with audio crystal that's slightly off (range [-1024 .. 1024])"); | 51 | MODULE_PARM_DESC(audio_clock_tweak, "Audio clock tick fine tuning for cards with audio crystal that's slightly off (range [-1024 .. 1024])"); |
52 | 52 | ||
@@ -653,6 +653,17 @@ static char *stdres[0x20] = { | |||
653 | 653 | ||
654 | #define DSP_RETRY 32 | 654 | #define DSP_RETRY 32 |
655 | #define DSP_DELAY 16 | 655 | #define DSP_DELAY 16 |
656 | #define SAA7135_DSP_RWCLEAR_RERR 1 | ||
657 | |||
658 | static inline int saa_dsp_reset_error_bit(struct saa7134_dev *dev) | ||
659 | { | ||
660 | int state = saa_readb(SAA7135_DSP_RWSTATE); | ||
661 | if (unlikely(state & SAA7135_DSP_RWSTATE_ERR)) { | ||
662 | d2printk("%s: resetting error bit\n", dev->name); | ||
663 | saa_writeb(SAA7135_DSP_RWCLEAR, SAA7135_DSP_RWCLEAR_RERR); | ||
664 | } | ||
665 | return 0; | ||
666 | } | ||
656 | 667 | ||
657 | static inline int saa_dsp_wait_bit(struct saa7134_dev *dev, int bit) | 668 | static inline int saa_dsp_wait_bit(struct saa7134_dev *dev, int bit) |
658 | { | 669 | { |
@@ -660,8 +671,8 @@ static inline int saa_dsp_wait_bit(struct saa7134_dev *dev, int bit) | |||
660 | 671 | ||
661 | state = saa_readb(SAA7135_DSP_RWSTATE); | 672 | state = saa_readb(SAA7135_DSP_RWSTATE); |
662 | if (unlikely(state & SAA7135_DSP_RWSTATE_ERR)) { | 673 | if (unlikely(state & SAA7135_DSP_RWSTATE_ERR)) { |
663 | printk("%s: dsp access error\n",dev->name); | 674 | printk(KERN_WARNING "%s: dsp access error\n", dev->name); |
664 | /* FIXME: send ack ... */ | 675 | saa_dsp_reset_error_bit(dev); |
665 | return -EIO; | 676 | return -EIO; |
666 | } | 677 | } |
667 | while (0 == (state & bit)) { | 678 | while (0 == (state & bit)) { |