diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-06-24 01:05:03 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-24 03:06:39 -0400 |
commit | b45009b0288a96a3458f4f8e93cb776678d41875 (patch) | |
tree | c912e8d3dcc625fe92cdd1bac97bab7539fce4d7 /drivers/media/video/cx88/cx88-tvaudio.c | |
parent | 2d03e289ea4b13d78ce55f1ea0b0d45b8f1b34c3 (diff) |
[PATCH] v4l: CX88 cards update
This patch adds support for various CX88 cards and allows specifying
card addresses.
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Michael Krufky <mkrufky@m1k.net>
Signed-off-by: cybercide@f2s.com <cybercide@f2s.com>
Signed-off-by: Catalin Climov <catalin@climov.com>
Signed-off-by: Nickolay V Shmyrev <nshmyrev@yandex.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/cx88/cx88-tvaudio.c')
-rw-r--r-- | drivers/media/video/cx88/cx88-tvaudio.c | 103 |
1 files changed, 63 insertions, 40 deletions
diff --git a/drivers/media/video/cx88/cx88-tvaudio.c b/drivers/media/video/cx88/cx88-tvaudio.c index f2a9475a2fee..46d78b1dc9b2 100644 --- a/drivers/media/video/cx88/cx88-tvaudio.c +++ b/drivers/media/video/cx88/cx88-tvaudio.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | $Id: cx88-tvaudio.c,v 1.34 2005/03/07 16:10:51 kraxel Exp $ | 2 | $Id: cx88-tvaudio.c,v 1.36 2005/06/05 05:53:45 mchehab Exp $ |
3 | 3 | ||
4 | cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver | 4 | cx88x-audio.c - Conexant CX23880/23881 audio downstream driver driver |
5 | 5 | ||
@@ -127,7 +127,8 @@ static void set_audio_start(struct cx88_core *core, | |||
127 | cx_write(AUD_VOL_CTL, (1 << 6)); | 127 | cx_write(AUD_VOL_CTL, (1 << 6)); |
128 | 128 | ||
129 | // increase level of input by 12dB | 129 | // increase level of input by 12dB |
130 | cx_write(AUD_AFE_12DB_EN, 0x0001); | 130 | // cx_write(AUD_AFE_12DB_EN, 0x0001); |
131 | cx_write(AUD_AFE_12DB_EN, 0x0000); | ||
131 | 132 | ||
132 | // start programming | 133 | // start programming |
133 | cx_write(AUD_CTL, 0x0000); | 134 | cx_write(AUD_CTL, 0x0000); |
@@ -143,9 +144,15 @@ static void set_audio_finish(struct cx88_core *core) | |||
143 | u32 volume; | 144 | u32 volume; |
144 | 145 | ||
145 | if (cx88_boards[core->board].blackbird) { | 146 | if (cx88_boards[core->board].blackbird) { |
147 | // sets sound input from external adc | ||
148 | cx_set(AUD_CTL, EN_I2SIN_ENABLE); | ||
149 | //cx_write(AUD_I2SINPUTCNTL, 0); | ||
150 | cx_write(AUD_I2SINPUTCNTL, 4); | ||
151 | cx_write(AUD_BAUDRATE, 1); | ||
146 | // 'pass-thru mode': this enables the i2s output to the mpeg encoder | 152 | // 'pass-thru mode': this enables the i2s output to the mpeg encoder |
147 | cx_set(AUD_CTL, 0x2000); | 153 | cx_set(AUD_CTL, EN_I2SOUT_ENABLE); |
148 | cx_write(AUD_I2SOUTPUTCNTL, 1); | 154 | cx_write(AUD_I2SOUTPUTCNTL, 1); |
155 | cx_write(AUD_I2SCNTL, 0); | ||
149 | //cx_write(AUD_APB_IN_RATE_ADJ, 0); | 156 | //cx_write(AUD_APB_IN_RATE_ADJ, 0); |
150 | } | 157 | } |
151 | 158 | ||
@@ -707,50 +714,65 @@ static void set_audio_standard_EIAJ(struct cx88_core *core) | |||
707 | set_audio_finish(core); | 714 | set_audio_finish(core); |
708 | } | 715 | } |
709 | 716 | ||
710 | static void set_audio_standard_FM(struct cx88_core *core) | 717 | static void set_audio_standard_FM(struct cx88_core *core, enum cx88_deemph_type deemph) |
711 | { | 718 | { |
712 | #if 0 /* FIXME */ | 719 | static const struct rlist fm_deemph_50[] = { |
713 | switch (dev->audio_properties.FM_deemphasis) | 720 | { AUD_DEEMPH0_G0, 0x0C45 }, |
714 | { | 721 | { AUD_DEEMPH0_A0, 0x6262 }, |
715 | case WW_FM_DEEMPH_50: | 722 | { AUD_DEEMPH0_B0, 0x1C29 }, |
716 | //Set De-emphasis filter coefficients for 50 usec | 723 | { AUD_DEEMPH0_A1, 0x3FC66}, |
717 | cx_write(AUD_DEEMPH0_G0, 0x0C45); | 724 | { AUD_DEEMPH0_B1, 0x399A }, |
718 | cx_write(AUD_DEEMPH0_A0, 0x6262); | 725 | |
719 | cx_write(AUD_DEEMPH0_B0, 0x1C29); | 726 | { AUD_DEEMPH1_G0, 0x0D80 }, |
720 | cx_write(AUD_DEEMPH0_A1, 0x3FC66); | 727 | { AUD_DEEMPH1_A0, 0x6262 }, |
721 | cx_write(AUD_DEEMPH0_B1, 0x399A); | 728 | { AUD_DEEMPH1_B0, 0x1C29 }, |
722 | 729 | { AUD_DEEMPH1_A1, 0x3FC66}, | |
723 | cx_write(AUD_DEEMPH1_G0, 0x0D80); | 730 | { AUD_DEEMPH1_B1, 0x399A}, |
724 | cx_write(AUD_DEEMPH1_A0, 0x6262); | 731 | |
725 | cx_write(AUD_DEEMPH1_B0, 0x1C29); | 732 | { AUD_POLYPH80SCALEFAC, 0x0003}, |
726 | cx_write(AUD_DEEMPH1_A1, 0x3FC66); | 733 | { /* end of list */ }, |
727 | cx_write(AUD_DEEMPH1_B1, 0x399A); | 734 | }; |
735 | static const struct rlist fm_deemph_75[] = { | ||
736 | { AUD_DEEMPH0_G0, 0x091B }, | ||
737 | { AUD_DEEMPH0_A0, 0x6B68 }, | ||
738 | { AUD_DEEMPH0_B0, 0x11EC }, | ||
739 | { AUD_DEEMPH0_A1, 0x3FC66}, | ||
740 | { AUD_DEEMPH0_B1, 0x399A }, | ||
741 | |||
742 | { AUD_DEEMPH1_G0, 0x0AA0 }, | ||
743 | { AUD_DEEMPH1_A0, 0x6B68 }, | ||
744 | { AUD_DEEMPH1_B0, 0x11EC }, | ||
745 | { AUD_DEEMPH1_A1, 0x3FC66}, | ||
746 | { AUD_DEEMPH1_B1, 0x399A}, | ||
747 | |||
748 | { AUD_POLYPH80SCALEFAC, 0x0003}, | ||
749 | { /* end of list */ }, | ||
750 | }; | ||
728 | 751 | ||
729 | break; | 752 | /* It is enough to leave default values? */ |
753 | static const struct rlist fm_no_deemph[] = { | ||
730 | 754 | ||
731 | case WW_FM_DEEMPH_75: | 755 | { AUD_POLYPH80SCALEFAC, 0x0003}, |
732 | //Set De-emphasis filter coefficients for 75 usec | 756 | { /* end of list */ }, |
733 | cx_write(AUD_DEEMPH0_G0, 0x91B ); | 757 | }; |
734 | cx_write(AUD_DEEMPH0_A0, 0x6B68); | ||
735 | cx_write(AUD_DEEMPH0_B0, 0x11EC); | ||
736 | cx_write(AUD_DEEMPH0_A1, 0x3FC66); | ||
737 | cx_write(AUD_DEEMPH0_B1, 0x399A); | ||
738 | 758 | ||
739 | cx_write(AUD_DEEMPH1_G0, 0xAA0 ); | 759 | dprintk("%s (status: unknown)\n",__FUNCTION__); |
740 | cx_write(AUD_DEEMPH1_A0, 0x6B68); | 760 | set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); |
741 | cx_write(AUD_DEEMPH1_B0, 0x11EC); | ||
742 | cx_write(AUD_DEEMPH1_A1, 0x3FC66); | ||
743 | cx_write(AUD_DEEMPH1_B1, 0x399A); | ||
744 | 761 | ||
762 | switch (deemph) | ||
763 | { | ||
764 | case FM_NO_DEEMPH: | ||
765 | set_audio_registers(core, fm_no_deemph); | ||
745 | break; | 766 | break; |
746 | } | ||
747 | #endif | ||
748 | 767 | ||
749 | dprintk("%s (status: unknown)\n",__FUNCTION__); | 768 | case FM_DEEMPH_50: |
750 | set_audio_start(core, 0x0020, EN_FMRADIO_AUTO_STEREO); | 769 | set_audio_registers(core, fm_deemph_50); |
770 | break; | ||
751 | 771 | ||
752 | // AB: 10/2/01: this register is not being reset appropriately on occasion. | 772 | case FM_DEEMPH_75: |
753 | cx_write(AUD_POLYPH80SCALEFAC,3); | 773 | set_audio_registers(core, fm_deemph_75); |
774 | break; | ||
775 | } | ||
754 | 776 | ||
755 | set_audio_finish(core); | 777 | set_audio_finish(core); |
756 | } | 778 | } |
@@ -778,7 +800,7 @@ void cx88_set_tvaudio(struct cx88_core *core) | |||
778 | set_audio_standard_EIAJ(core); | 800 | set_audio_standard_EIAJ(core); |
779 | break; | 801 | break; |
780 | case WW_FM: | 802 | case WW_FM: |
781 | set_audio_standard_FM(core); | 803 | set_audio_standard_FM(core,FM_NO_DEEMPH); |
782 | break; | 804 | break; |
783 | case WW_SYSTEM_L_AM: | 805 | case WW_SYSTEM_L_AM: |
784 | set_audio_standard_NICAM_L(core, 1); | 806 | set_audio_standard_NICAM_L(core, 1); |
@@ -1029,4 +1051,5 @@ EXPORT_SYMBOL(cx88_audio_thread); | |||
1029 | * Local variables: | 1051 | * Local variables: |
1030 | * c-basic-offset: 8 | 1052 | * c-basic-offset: 8 |
1031 | * End: | 1053 | * End: |
1054 | * kate: eol "unix"; indent-width 3; remove-trailing-space on; replace-trailing-space-save on; tab-width 8; replace-tabs off; space-indent off; mixed-indent off | ||
1032 | */ | 1055 | */ |