diff options
author | Trent Piepho <xyzzy@speakeasy.org> | 2007-08-17 04:50:22 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-10-09 21:05:21 -0400 |
commit | fa40b2237ab6ed239967f76432438080232b88fe (patch) | |
tree | cddcc0b21f2d36236e3211a612e9cb0d79365843 | |
parent | 82e67246cd2a860637ee9d27776ad48d32734f6c (diff) |
V4L/DVB (6034): cx88: Add parameter to control radio deemphasis time constant
FM radio transmission use a preemphasis/deemphasis scheme to reduce
high-frequency noise. The cx88 audio decoder is supposedly set to no
deemphasis by the current driver.
However, the "no deemphasis" setting doesn't work. On my chip, cx23883, it
produces the same result as the 75 us time constant. Maybe the default
settings on the cx23881 are for 50 us?
Since the deemphasis time constant varies by country, allow setting it via a
module parameter.
Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index 99e120483ec..9aee8c51ee2 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -62,6 +62,10 @@ static unsigned int always_analog = 0; | |||
62 | module_param(always_analog,int,0644); | 62 | module_param(always_analog,int,0644); |
63 | MODULE_PARM_DESC(always_analog,"force analog audio out"); | 63 | MODULE_PARM_DESC(always_analog,"force analog audio out"); |
64 | 64 | ||
65 | static unsigned int radio_deemphasis = 0; | ||
66 | module_param(radio_deemphasis,int,0644); | ||
67 | MODULE_PARM_DESC(radio_deemphasis, "Radio deemphasis time constant, " | ||
68 | "0=None, 1=50us (elsewhere), 2=75us (USA)"); | ||
65 | 69 | ||
66 | #define dprintk(fmt, arg...) if (audio_debug) \ | 70 | #define dprintk(fmt, arg...) if (audio_debug) \ |
67 | printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) | 71 | printk(KERN_DEBUG "%s/0: " fmt, core->name , ## arg) |
@@ -678,6 +682,10 @@ static void set_audio_standard_FM(struct cx88_core *core, | |||
678 | }; | 682 | }; |
679 | 683 | ||
680 | /* It is enough to leave default values? */ | 684 | /* It is enough to leave default values? */ |
685 | /* No, it's not! The deemphasis registers are reset to the 75us | ||
686 | * values by default. Analyzing the spectrum of the decoded audio | ||
687 | * reveals that "no deemphasis" is the same as 75 us, while the 50 us | ||
688 | * setting results in less deemphasis. */ | ||
681 | static const struct rlist fm_no_deemph[] = { | 689 | static const struct rlist fm_no_deemph[] = { |
682 | 690 | ||
683 | {AUD_POLYPH80SCALEFAC, 0x0003}, | 691 | {AUD_POLYPH80SCALEFAC, 0x0003}, |
@@ -688,6 +696,7 @@ static void set_audio_standard_FM(struct cx88_core *core, | |||
688 | set_audio_start(core, SEL_FMRADIO); | 696 | set_audio_start(core, SEL_FMRADIO); |
689 | 697 | ||
690 | switch (deemph) { | 698 | switch (deemph) { |
699 | default: | ||
691 | case FM_NO_DEEMPH: | 700 | case FM_NO_DEEMPH: |
692 | set_audio_registers(core, fm_no_deemph); | 701 | set_audio_registers(core, fm_no_deemph); |
693 | break; | 702 | break; |
@@ -757,7 +766,7 @@ void cx88_set_tvaudio(struct cx88_core *core) | |||
757 | set_audio_standard_EIAJ(core); | 766 | set_audio_standard_EIAJ(core); |
758 | break; | 767 | break; |
759 | case WW_FM: | 768 | case WW_FM: |
760 | set_audio_standard_FM(core, FM_NO_DEEMPH); | 769 | set_audio_standard_FM(core, radio_deemphasis); |
761 | break; | 770 | break; |
762 | case WW_NONE: | 771 | case WW_NONE: |
763 | default: | 772 | default: |