Lines Matching +full:0 +full:x528
42 } while (0)
167 #define SAA7134_MUTE_MASK 0xbb
168 #define SAA7134_MUTE_ANALOG 0x04
169 #define SAA7134_MUTE_I2S 0x40
175 int ausel=0, ics=0, ocs=0; in mute_input_7134()
215 case TV: ausel=0xc0; ics=0x00; ocs=0x02; break; in mute_input_7134()
216 case LINE1: ausel=0x80; ics=0x00; ocs=0x00; break; in mute_input_7134()
217 case LINE2: ausel=0x80; ics=0x08; ocs=0x01; break; in mute_input_7134()
218 case LINE2_LEFT: ausel=0x80; ics=0x08; ocs=0x05; break; in mute_input_7134()
220 saa_andorb(SAA7134_AUDIO_FORMAT_CTRL, 0xc0, ausel); in mute_input_7134()
221 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x08, ics); in mute_input_7134()
222 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x07, ocs); in mute_input_7134()
225 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x00); in mute_input_7134()
227 saa_andorb(SAA7134_SIF_SAMPLE_FREQ, 0x03, 0x01); in mute_input_7134()
230 if (0 == card(dev).gpiomask) in mute_input_7134()
243 int acpf, tweak = 0; in tvaudio_setmode()
246 acpf = 0x19066; in tvaudio_setmode()
248 acpf = 0x1e000; in tvaudio_setmode()
261 saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD0, (acpf & 0x0000ff) >> 0); in tvaudio_setmode()
262 saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD1, (acpf & 0x00ff00) >> 8); in tvaudio_setmode()
263 saa_writeb(SAA7134_AUDIO_CLOCKS_PER_FIELD2, (acpf & 0x030000) >> 16); in tvaudio_setmode()
269 saa_writeb(SAA7134_DEMODULATOR, 0x00); in tvaudio_setmode()
270 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x00); in tvaudio_setmode()
271 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x22); in tvaudio_setmode()
272 saa_writeb(SAA7134_FM_DEMATRIX, 0x80); in tvaudio_setmode()
273 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa0); in tvaudio_setmode()
276 saa_writeb(SAA7134_DEMODULATOR, 0x00); in tvaudio_setmode()
277 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x01); in tvaudio_setmode()
278 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x22); in tvaudio_setmode()
279 saa_writeb(SAA7134_FM_DEMATRIX, 0x80); in tvaudio_setmode()
280 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa0); in tvaudio_setmode()
283 saa_writeb(SAA7134_DEMODULATOR, 0x10); in tvaudio_setmode()
284 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x00); in tvaudio_setmode()
285 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x44); in tvaudio_setmode()
286 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1); in tvaudio_setmode()
287 saa_writeb(SAA7134_NICAM_CONFIG, 0x00); in tvaudio_setmode()
290 saa_writeb(SAA7134_DEMODULATOR, 0x12); in tvaudio_setmode()
291 saa_writeb(SAA7134_DCXO_IDENT_CTRL, 0x00); in tvaudio_setmode()
292 saa_writeb(SAA7134_FM_DEEMPHASIS, 0x44); in tvaudio_setmode()
293 saa_writeb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0xa1); in tvaudio_setmode()
294 saa_writeb(SAA7134_NICAM_CONFIG, 0x00); in tvaudio_setmode()
306 if (timeout < 0) { in tvaudio_sleep()
324 return 0; in tvaudio_checkcarrier()
336 if (0 == i) in tvaudio_checkcarrier()
376 idp = (saa_readb(SAA7134_IDENT_SIF) & 0xe0) >> 5; in tvaudio_getstereo()
377 audio_dbg(1, "getstereo: fm/stereo: idp=0x%x\n", idp); in tvaudio_getstereo()
378 if (0x03 == (idp & 0x03)) in tvaudio_getstereo()
380 else if (0x05 == (idp & 0x05)) in tvaudio_getstereo()
382 else if (0x01 == (idp & 0x01)) in tvaudio_getstereo()
391 audio_dbg(1, "getstereo: nicam=0x%x\n", nicam); in tvaudio_getstereo()
392 if (nicam & 0x1) { in tvaudio_getstereo()
394 audio_dbg(1, "getstereo: nicam_status=0x%x\n", in tvaudio_getstereo()
397 switch (nicam_status & 0x03) { in tvaudio_getstereo()
398 case 0x01: in tvaudio_getstereo()
401 case 0x02: in tvaudio_getstereo()
432 [ V4L2_TUNER_MODE_MONO ] = 0x00, /* ch1 */ in tvaudio_setstereo()
433 [ V4L2_TUNER_MODE_STEREO ] = 0x80, /* auto */ in tvaudio_setstereo()
434 [ V4L2_TUNER_MODE_LANG1 ] = 0x00, /* ch1 */ in tvaudio_setstereo()
435 [ V4L2_TUNER_MODE_LANG2 ] = 0x01, /* ch2 */ in tvaudio_setstereo()
436 [ V4L2_TUNER_MODE_LANG1_LANG2 ] = 0x80, /* auto */ in tvaudio_setstereo()
457 return 0; in tvaudio_setstereo()
482 saa_writeb(SAA7134_MONITOR_SELECT, 0xa0); in tvaudio_thread()
483 saa_writeb(SAA7134_FM_DEMATRIX, 0x80); in tvaudio_thread()
494 max1 = 0; in tvaudio_thread()
495 max2 = 0; in tvaudio_thread()
496 nscan = 0; in tvaudio_thread()
497 carrier = 0; in tvaudio_thread()
498 default_carrier = 0; in tvaudio_thread()
499 for (i = 0; i < ARRAY_SIZE(mainscan); i++) { in tvaudio_thread()
514 saa_writeb(SAA7134_MONITOR_SELECT,0x00); in tvaudio_thread()
515 tvaudio_setmode(dev,&tvaudio[0],NULL); in tvaudio_thread()
516 for (i = 0; i < ARRAY_SIZE(mainscan); i++) { in tvaudio_thread()
521 for (max1 = 0, max2 = 0, i = 0; i < ARRAY_SIZE(mainscan); i++) { in tvaudio_thread()
532 if (0 != carrier && max1 > 2000 && max1 > max2*3) { in tvaudio_thread()
538 dev->automute = 0; in tvaudio_thread()
540 } else if (0 != dev->last_carrier) { in tvaudio_thread()
555 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x00); in tvaudio_thread()
558 for (audio = UNSET, i = 0; i < TVAUDIO; i++) { in tvaudio_thread()
575 saa_andorb(SAA7134_STEREO_DAC_OUTPUT_SELECT, 0x30, 0x30); in tvaudio_thread()
607 return 0; in tvaudio_thread()
613 static char *stdres[0x20] = {
614 [0x00] = "no standard detected",
615 [0x01] = "B/G (in progress)",
616 [0x02] = "D/K (in progress)",
617 [0x03] = "M (in progress)",
619 [0x04] = "B/G A2",
620 [0x05] = "B/G NICAM",
621 [0x06] = "D/K A2 (1)",
622 [0x07] = "D/K A2 (2)",
623 [0x08] = "D/K A2 (3)",
624 [0x09] = "D/K NICAM",
625 [0x0a] = "L NICAM",
626 [0x0b] = "I NICAM",
628 [0x0c] = "M Korea",
629 [0x0d] = "M BTSC ",
630 [0x0e] = "M EIAJ",
632 [0x0f] = "FM radio / IF 10.7 / 50 deemp",
633 [0x10] = "FM radio / IF 10.7 / 75 deemp",
634 [0x11] = "FM radio / IF sel / 50 deemp",
635 [0x12] = "FM radio / IF sel / 75 deemp",
637 [0x13 ... 0x1e ] = "unknown",
638 [0x1f] = "??? [in progress]",
652 return 0; in saa_dsp_reset_error_bit()
665 while (0 == (state & bit)) { in saa_dsp_wait_bit()
666 if (unlikely(0 == count)) { in saa_dsp_wait_bit()
678 return 0; in saa_dsp_wait_bit()
686 audio_dbg(2, "dsp write reg 0x%x = 0x%06x\n", in saa_dsp_writel()
687 (reg << 2) & 0xffffffff, value); in saa_dsp_writel()
689 if (err < 0) in saa_dsp_writel()
693 if (err < 0) in saa_dsp_writel()
695 return 0; in saa_dsp_writel()
703 value = saa_readl(0x528 >> 2); in getstereo_7133()
704 if (value & 0x20) in getstereo_7133()
706 if (value & 0x40) in getstereo_7133()
713 u32 reg = 0; in mute_input_7133()
718 xbarin = 0x03; in mute_input_7133()
721 reg = 0x02; in mute_input_7133()
722 xbarin = 0; in mute_input_7133()
725 reg = 0x00; in mute_input_7133()
729 reg = 0x09; in mute_input_7133()
732 saa_dsp_writel(dev, 0x464 >> 2, xbarin); in mute_input_7133()
734 reg = 0x07; in mute_input_7133()
735 xbarout = 0xbbbbbb; in mute_input_7133()
737 xbarout = 0xbbbb10; in mute_input_7133()
738 saa_dsp_writel(dev, 0x46c >> 2, xbarout); in mute_input_7133()
740 saa_writel(0x594 >> 2, reg); in mute_input_7133()
744 if (0 != card(dev).gpiomask) { in mute_input_7133()
757 return 0; in mute_input_7133()
777 if (audio_ddep >= 0x04 && audio_ddep <= 0x0e) { in tvaudio_thread_ddep()
779 norms = (audio_ddep << 2) | 0x01; in tvaudio_thread_ddep()
785 norms = (0x11 << 2) | 0x01; in tvaudio_thread_ddep()
787 saa_dsp_writel(dev, 0x42c >> 2, 0x729555); in tvaudio_thread_ddep()
789 norms = (0x0f << 2) | 0x01; in tvaudio_thread_ddep()
793 norms = 0; in tvaudio_thread_ddep()
795 norms |= 0x04; in tvaudio_thread_ddep()
797 norms |= 0x20; in tvaudio_thread_ddep()
799 norms |= 0x08; in tvaudio_thread_ddep()
801 norms |= 0x40; in tvaudio_thread_ddep()
803 norms |= 0x10; in tvaudio_thread_ddep()
804 if (0 == norms) in tvaudio_thread_ddep()
805 norms = 0x7c; /* all */ in tvaudio_thread_ddep()
807 (norms & 0x04) ? " B/G" : "", in tvaudio_thread_ddep()
808 (norms & 0x08) ? " D/K" : "", in tvaudio_thread_ddep()
809 (norms & 0x10) ? " L/L'" : "", in tvaudio_thread_ddep()
810 (norms & 0x20) ? " I" : "", in tvaudio_thread_ddep()
811 (norms & 0x40) ? " M" : ""); in tvaudio_thread_ddep()
815 saa_dsp_writel(dev, 0x454 >> 2, 0); in tvaudio_thread_ddep()
816 saa_dsp_writel(dev, 0x454 >> 2, norms | 0x80); in tvaudio_thread_ddep()
819 saa_dsp_writel(dev, 0x464 >> 2, 0x000000); in tvaudio_thread_ddep()
820 saa_dsp_writel(dev, 0x470 >> 2, 0x101010); in tvaudio_thread_ddep()
824 value = saa_readl(0x528 >> 2) & 0xffffff; in tvaudio_thread_ddep()
826 audio_dbg(1, "tvaudio thread status: 0x%x [%s%s%s]\n", in tvaudio_thread_ddep()
827 value, stdres[value & 0x1f], in tvaudio_thread_ddep()
828 (value & 0x000020) ? ",stereo" : "", in tvaudio_thread_ddep()
829 (value & 0x000040) ? ",dual" : ""); in tvaudio_thread_ddep()
831 (value & 0x000080) ? " A2/EIAJ pilot tone " : "", in tvaudio_thread_ddep()
832 (value & 0x000100) ? " A2/EIAJ dual " : "", in tvaudio_thread_ddep()
833 (value & 0x000200) ? " A2/EIAJ stereo " : "", in tvaudio_thread_ddep()
834 (value & 0x000400) ? " A2/EIAJ noise mute " : "", in tvaudio_thread_ddep()
836 (value & 0x000800) ? " BTSC/FM radio pilot " : "", in tvaudio_thread_ddep()
837 (value & 0x001000) ? " SAP carrier " : "", in tvaudio_thread_ddep()
838 (value & 0x002000) ? " BTSC stereo noise mute " : "", in tvaudio_thread_ddep()
839 (value & 0x004000) ? " SAP noise mute " : "", in tvaudio_thread_ddep()
840 (value & 0x008000) ? " VDSP " : "", in tvaudio_thread_ddep()
842 (value & 0x010000) ? " NICST " : "", in tvaudio_thread_ddep()
843 (value & 0x020000) ? " NICDU " : "", in tvaudio_thread_ddep()
844 (value & 0x040000) ? " NICAM muted " : "", in tvaudio_thread_ddep()
845 (value & 0x080000) ? " NICAM reserve sound " : "", in tvaudio_thread_ddep()
847 (value & 0x100000) ? " init done " : ""); in tvaudio_thread_ddep()
852 return 0; in tvaudio_thread_ddep()
869 saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x0E000000, 0x00000000); in saa7134_enable_i2s()
875 saa_writeb(SAA7133_I2S_AUDIO_CONTROL, 0x00); in saa7134_enable_i2s()
877 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x11); in saa7134_enable_i2s()
881 i2s_format = (dev->input->amux == TV) ? 0x00 : 0x01; in saa7134_enable_i2s()
884 saa_writeb(SAA7134_I2S_OUTPUT_SELECT, 0x80); in saa7134_enable_i2s()
886 saa_writeb(SAA7134_I2S_OUTPUT_LEVEL, 0x0F); in saa7134_enable_i2s()
887 saa_writeb(SAA7134_I2S_AUDIO_OUTPUT, 0x01); in saa7134_enable_i2s()
944 saa_writeb(SAA7134_CHANNEL1_LEVEL, level & 0x1f); in saa7134_tvaudio_setvolume()
945 saa_writeb(SAA7134_CHANNEL2_LEVEL, level & 0x1f); in saa7134_tvaudio_setvolume()
946 saa_writeb(SAA7134_NICAM_LEVEL_ADJUST, level & 0x1f); in saa7134_tvaudio_setvolume()
978 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x00); in saa7134_tvaudio_init()
984 saa_writeb(SAA7134_AUDIO_CLOCK0, clock & 0xff); in saa7134_tvaudio_init()
985 saa_writeb(SAA7134_AUDIO_CLOCK1, (clock >> 8) & 0xff); in saa7134_tvaudio_init()
986 saa_writeb(SAA7134_AUDIO_CLOCK2, (clock >> 16) & 0xff); in saa7134_tvaudio_init()
988 saa_writeb(SAA7134_AUDIO_PLL_CTRL, 0x01); in saa7134_tvaudio_init()
989 saa_writeb(SAA7134_NICAM_ERROR_LOW, 0x14); in saa7134_tvaudio_init()
990 saa_writeb(SAA7134_NICAM_ERROR_HIGH, 0x50); in saa7134_tvaudio_init()
994 saa_writel(0x598 >> 2, clock); in saa7134_tvaudio_init()
995 saa_dsp_writel(dev, 0x474 >> 2, 0x00); in saa7134_tvaudio_init()
996 saa_dsp_writel(dev, 0x450 >> 2, 0x00); in saa7134_tvaudio_init()
1015 dev->thread.scan1 = dev->thread.scan2 = 0; in saa7134_tvaudio_init2()
1028 return 0; in saa7134_tvaudio_init2()
1035 return 0; in saa7134_tvaudio_close()
1044 saa_andorb(SAA7134_ANALOG_IO_SELECT, 0x07, 0x00); /* LINE1 */ in saa7134_tvaudio_fini()
1045 return 0; in saa7134_tvaudio_fini()
1052 dev->automute = 0; in saa7134_tvaudio_do_scan()
1061 dev->automute = 0; in saa7134_tvaudio_do_scan()
1064 return 0; in saa7134_tvaudio_do_scan()