aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-av-core.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx18/cx18-av-core.c')
-rw-r--r--drivers/media/video/cx18/cx18-av-core.c81
1 files changed, 45 insertions, 36 deletions
diff --git a/drivers/media/video/cx18/cx18-av-core.c b/drivers/media/video/cx18/cx18-av-core.c
index 66864904c99b..9a26751615c6 100644
--- a/drivers/media/video/cx18/cx18-av-core.c
+++ b/drivers/media/video/cx18/cx18-av-core.c
@@ -182,14 +182,16 @@ static void input_change(struct cx18 *cx)
182 if (std == V4L2_STD_NTSC_M_JP) { 182 if (std == V4L2_STD_NTSC_M_JP) {
183 /* Japan uses EIAJ audio standard */ 183 /* Japan uses EIAJ audio standard */
184 cx18_av_write(cx, 0x808, 0xf7); 184 cx18_av_write(cx, 0x808, 0xf7);
185 cx18_av_write(cx, 0x80b, 0x02);
185 } else if (std == V4L2_STD_NTSC_M_KR) { 186 } else if (std == V4L2_STD_NTSC_M_KR) {
186 /* South Korea uses A2 audio standard */ 187 /* South Korea uses A2 audio standard */
187 cx18_av_write(cx, 0x808, 0xf8); 188 cx18_av_write(cx, 0x808, 0xf8);
189 cx18_av_write(cx, 0x80b, 0x03);
188 } else { 190 } else {
189 /* Others use the BTSC audio standard */ 191 /* Others use the BTSC audio standard */
190 cx18_av_write(cx, 0x808, 0xf6); 192 cx18_av_write(cx, 0x808, 0xf6);
193 cx18_av_write(cx, 0x80b, 0x01);
191 } 194 }
192 cx18_av_write(cx, 0x80b, 0x00);
193 } else if (std & V4L2_STD_PAL) { 195 } else if (std & V4L2_STD_PAL) {
194 /* Follow tuner change procedure for PAL */ 196 /* Follow tuner change procedure for PAL */
195 cx18_av_write(cx, 0x808, 0xff); 197 cx18_av_write(cx, 0x808, 0xff);
@@ -741,8 +743,8 @@ static void log_audio_status(struct cx18 *cx)
741{ 743{
742 struct cx18_av_state *state = &cx->av_state; 744 struct cx18_av_state *state = &cx->av_state;
743 u8 download_ctl = cx18_av_read(cx, 0x803); 745 u8 download_ctl = cx18_av_read(cx, 0x803);
744 u8 mod_det_stat0 = cx18_av_read(cx, 0x805); 746 u8 mod_det_stat0 = cx18_av_read(cx, 0x804);
745 u8 mod_det_stat1 = cx18_av_read(cx, 0x804); 747 u8 mod_det_stat1 = cx18_av_read(cx, 0x805);
746 u8 audio_config = cx18_av_read(cx, 0x808); 748 u8 audio_config = cx18_av_read(cx, 0x808);
747 u8 pref_mode = cx18_av_read(cx, 0x809); 749 u8 pref_mode = cx18_av_read(cx, 0x809);
748 u8 afc0 = cx18_av_read(cx, 0x80b); 750 u8 afc0 = cx18_av_read(cx, 0x80b);
@@ -760,12 +762,12 @@ static void log_audio_status(struct cx18 *cx)
760 case 0x12: p = "dual with SAP"; break; 762 case 0x12: p = "dual with SAP"; break;
761 case 0x14: p = "tri with SAP"; break; 763 case 0x14: p = "tri with SAP"; break;
762 case 0xfe: p = "forced mode"; break; 764 case 0xfe: p = "forced mode"; break;
763 default: p = "not defined"; 765 default: p = "not defined"; break;
764 } 766 }
765 CX18_INFO("Detected audio mode: %s\n", p); 767 CX18_INFO("Detected audio mode: %s\n", p);
766 768
767 switch (mod_det_stat1) { 769 switch (mod_det_stat1) {
768 case 0x00: p = "BTSC"; break; 770 case 0x00: p = "not defined"; break;
769 case 0x01: p = "EIAJ"; break; 771 case 0x01: p = "EIAJ"; break;
770 case 0x02: p = "A2-M"; break; 772 case 0x02: p = "A2-M"; break;
771 case 0x03: p = "A2-BG"; break; 773 case 0x03: p = "A2-BG"; break;
@@ -779,8 +781,13 @@ static void log_audio_status(struct cx18 *cx)
779 case 0x0b: p = "NICAM-I"; break; 781 case 0x0b: p = "NICAM-I"; break;
780 case 0x0c: p = "NICAM-L"; break; 782 case 0x0c: p = "NICAM-L"; break;
781 case 0x0d: p = "BTSC/EIAJ/A2-M Mono (4.5 MHz FMMono)"; break; 783 case 0x0d: p = "BTSC/EIAJ/A2-M Mono (4.5 MHz FMMono)"; break;
784 case 0x0e: p = "IF FM Radio"; break;
785 case 0x0f: p = "BTSC"; break;
786 case 0x10: p = "detected chrominance"; break;
787 case 0xfd: p = "unknown audio standard"; break;
788 case 0xfe: p = "forced audio standard"; break;
782 case 0xff: p = "no detected audio standard"; break; 789 case 0xff: p = "no detected audio standard"; break;
783 default: p = "not defined"; 790 default: p = "not defined"; break;
784 } 791 }
785 CX18_INFO("Detected audio standard: %s\n", p); 792 CX18_INFO("Detected audio standard: %s\n", p);
786 CX18_INFO("Audio muted: %s\n", 793 CX18_INFO("Audio muted: %s\n",
@@ -789,22 +796,23 @@ static void log_audio_status(struct cx18 *cx)
789 (download_ctl & 0x10) ? "running" : "stopped"); 796 (download_ctl & 0x10) ? "running" : "stopped");
790 797
791 switch (audio_config >> 4) { 798 switch (audio_config >> 4) {
792 case 0x00: p = "BTSC"; break; 799 case 0x00: p = "undefined"; break;
793 case 0x01: p = "EIAJ"; break; 800 case 0x01: p = "BTSC"; break;
794 case 0x02: p = "A2-M"; break; 801 case 0x02: p = "EIAJ"; break;
795 case 0x03: p = "A2-BG"; break; 802 case 0x03: p = "A2-M"; break;
796 case 0x04: p = "A2-DK1"; break; 803 case 0x04: p = "A2-BG"; break;
797 case 0x05: p = "A2-DK2"; break; 804 case 0x05: p = "A2-DK1"; break;
798 case 0x06: p = "A2-DK3"; break; 805 case 0x06: p = "A2-DK2"; break;
799 case 0x07: p = "A1 (6.0 MHz FM Mono)"; break; 806 case 0x07: p = "A2-DK3"; break;
800 case 0x08: p = "AM-L"; break; 807 case 0x08: p = "A1 (6.0 MHz FM Mono)"; break;
801 case 0x09: p = "NICAM-BG"; break; 808 case 0x09: p = "AM-L"; break;
802 case 0x0a: p = "NICAM-DK"; break; 809 case 0x0a: p = "NICAM-BG"; break;
803 case 0x0b: p = "NICAM-I"; break; 810 case 0x0b: p = "NICAM-DK"; break;
804 case 0x0c: p = "NICAM-L"; break; 811 case 0x0c: p = "NICAM-I"; break;
805 case 0x0d: p = "FM radio"; break; 812 case 0x0d: p = "NICAM-L"; break;
813 case 0x0e: p = "FM radio"; break;
806 case 0x0f: p = "automatic detection"; break; 814 case 0x0f: p = "automatic detection"; break;
807 default: p = "undefined"; 815 default: p = "undefined"; break;
808 } 816 }
809 CX18_INFO("Configured audio standard: %s\n", p); 817 CX18_INFO("Configured audio standard: %s\n", p);
810 818
@@ -815,12 +823,9 @@ static void log_audio_status(struct cx18 *cx)
815 case 0x02: p = "MONO3 (STEREO forced MONO)"; break; 823 case 0x02: p = "MONO3 (STEREO forced MONO)"; break;
816 case 0x03: p = "MONO4 (NICAM ANALOG-Language C/Analog Fallback)"; break; 824 case 0x03: p = "MONO4 (NICAM ANALOG-Language C/Analog Fallback)"; break;
817 case 0x04: p = "STEREO"; break; 825 case 0x04: p = "STEREO"; break;
818 case 0x05: p = "DUAL1 (AB)"; break; 826 case 0x05: p = "DUAL1 (AC)"; break;
819 case 0x06: p = "DUAL2 (AC) (FM)"; break; 827 case 0x06: p = "DUAL2 (BC)"; break;
820 case 0x07: p = "DUAL3 (BC) (FM)"; break; 828 case 0x07: p = "DUAL3 (AB)"; break;
821 case 0x08: p = "DUAL4 (AC) (AM)"; break;
822 case 0x09: p = "DUAL5 (BC) (AM)"; break;
823 case 0x0a: p = "SAP"; break;
824 default: p = "undefined"; 829 default: p = "undefined";
825 } 830 }
826 CX18_INFO("Configured audio mode: %s\n", p); 831 CX18_INFO("Configured audio mode: %s\n", p);
@@ -835,9 +840,11 @@ static void log_audio_status(struct cx18 *cx)
835 case 0x06: p = "BTSC"; break; 840 case 0x06: p = "BTSC"; break;
836 case 0x07: p = "EIAJ"; break; 841 case 0x07: p = "EIAJ"; break;
837 case 0x08: p = "A2-M"; break; 842 case 0x08: p = "A2-M"; break;
838 case 0x09: p = "FM Radio"; break; 843 case 0x09: p = "FM Radio (4.5 MHz)"; break;
844 case 0x0a: p = "FM Radio (5.5 MHz)"; break;
845 case 0x0b: p = "S-Video"; break;
839 case 0x0f: p = "automatic standard and mode detection"; break; 846 case 0x0f: p = "automatic standard and mode detection"; break;
840 default: p = "undefined"; 847 default: p = "undefined"; break;
841 } 848 }
842 CX18_INFO("Configured audio system: %s\n", p); 849 CX18_INFO("Configured audio system: %s\n", p);
843 } 850 }
@@ -857,22 +864,24 @@ static void log_audio_status(struct cx18 *cx)
857 case 5: p = "language AC"; break; 864 case 5: p = "language AC"; break;
858 case 6: p = "language BC"; break; 865 case 6: p = "language BC"; break;
859 case 7: p = "language AB"; break; 866 case 7: p = "language AB"; break;
860 default: p = "undefined"; 867 default: p = "undefined"; break;
861 } 868 }
862 CX18_INFO("Preferred audio mode: %s\n", p); 869 CX18_INFO("Preferred audio mode: %s\n", p);
863 870
864 if ((audio_config & 0xf) == 0xf) { 871 if ((audio_config & 0xf) == 0xf) {
865 switch ((afc0 >> 2) & 0x1) { 872 switch ((afc0 >> 3) & 0x1) {
866 case 0: p = "system DK"; break; 873 case 0: p = "system DK"; break;
867 case 1: p = "system L"; break; 874 case 1: p = "system L"; break;
868 } 875 }
869 CX18_INFO("Selected 65 MHz format: %s\n", p); 876 CX18_INFO("Selected 65 MHz format: %s\n", p);
870 877
871 switch (afc0 & 0x3) { 878 switch (afc0 & 0x7) {
872 case 0: p = "BTSC"; break; 879 case 0: p = "Chroma"; break;
873 case 1: p = "EIAJ"; break; 880 case 1: p = "BTSC"; break;
874 case 2: p = "A2-M"; break; 881 case 2: p = "EIAJ"; break;
875 default: p = "undefined"; 882 case 3: p = "A2-M"; break;
883 case 4: p = "autodetect"; break;
884 default: p = "undefined"; break;
876 } 885 }
877 CX18_INFO("Selected 45 MHz format: %s\n", p); 886 CX18_INFO("Selected 45 MHz format: %s\n", p);
878 } 887 }