Lines Matching refs:core

92 static void set_audio_registers(struct cx88_core *core, const struct rlist *l)  in set_audio_registers()  argument
113 static void set_audio_start(struct cx88_core *core, u32 mode) in set_audio_start() argument
124 static void set_audio_finish(struct cx88_core *core, u32 ctl) in set_audio_finish() argument
129 cx88_stop_audio_dma(core); in set_audio_finish()
131 cx88_start_audio_dma(core); in set_audio_finish()
133 if (core->board.mpeg & CX88_MPEG_BLACKBIRD) { in set_audio_finish()
145 if ((always_analog) || (!(core->board.mpeg & CX88_MPEG_BLACKBIRD))) { in set_audio_finish()
157 core->last_change = jiffies; in set_audio_finish()
162 static void set_audio_standard_BTSC(struct cx88_core *core, unsigned int sap, in set_audio_standard_BTSC() argument
261 set_audio_start(core, SEL_SAP); in set_audio_standard_BTSC()
262 set_audio_registers(core, btsc_sap); in set_audio_standard_BTSC()
263 set_audio_finish(core, mode); in set_audio_standard_BTSC()
266 set_audio_start(core, SEL_BTSC); in set_audio_standard_BTSC()
267 set_audio_registers(core, btsc); in set_audio_standard_BTSC()
268 set_audio_finish(core, mode); in set_audio_standard_BTSC()
272 static void set_audio_standard_NICAM(struct cx88_core *core, u32 mode) in set_audio_standard_NICAM() argument
343 set_audio_start(core, SEL_NICAM); in set_audio_standard_NICAM()
344 switch (core->tvaudio) { in set_audio_standard_NICAM()
347 set_audio_registers(core, nicam_l); in set_audio_standard_NICAM()
351 set_audio_registers(core, nicam_bgdki_common); in set_audio_standard_NICAM()
352 set_audio_registers(core, nicam_i); in set_audio_standard_NICAM()
364 set_audio_registers(core, nicam_bgdki_common); in set_audio_standard_NICAM()
365 set_audio_registers(core, nicam_default); in set_audio_standard_NICAM()
370 set_audio_finish(core, mode); in set_audio_standard_NICAM()
373 static void set_audio_standard_A2(struct cx88_core *core, u32 mode) in set_audio_standard_A2() argument
600 set_audio_start(core, SEL_A2); in set_audio_standard_A2()
601 switch (core->tvaudio) { in set_audio_standard_A2()
604 set_audio_registers(core, a2_bgdk_common); in set_audio_standard_A2()
605 set_audio_registers(core, a2_bg); in set_audio_standard_A2()
606 set_audio_registers(core, a2_deemph50); in set_audio_standard_A2()
610 set_audio_registers(core, a2_bgdk_common); in set_audio_standard_A2()
611 set_audio_registers(core, a2_dk); in set_audio_standard_A2()
612 set_audio_registers(core, a2_deemph50); in set_audio_standard_A2()
616 set_audio_registers(core, a1_i); in set_audio_standard_A2()
617 set_audio_registers(core, a2_deemph50); in set_audio_standard_A2()
621 set_audio_registers(core, am_l); in set_audio_standard_A2()
635 set_audio_finish(core, mode); in set_audio_standard_A2()
638 static void set_audio_standard_EIAJ(struct cx88_core *core) in set_audio_standard_EIAJ() argument
647 set_audio_start(core, SEL_EIAJ); in set_audio_standard_EIAJ()
648 set_audio_registers(core, eiaj); in set_audio_standard_EIAJ()
649 set_audio_finish(core, EN_EIAJ_AUTO_STEREO); in set_audio_standard_EIAJ()
652 static void set_audio_standard_FM(struct cx88_core *core, in set_audio_standard_FM() argument
702 set_audio_start(core, SEL_FMRADIO); in set_audio_standard_FM()
707 set_audio_registers(core, fm_no_deemph); in set_audio_standard_FM()
711 set_audio_registers(core, fm_deemph_50); in set_audio_standard_FM()
715 set_audio_registers(core, fm_deemph_75); in set_audio_standard_FM()
719 set_audio_finish(core, EN_FMRADIO_AUTO_STEREO); in set_audio_standard_FM()
724 static int cx88_detect_nicam(struct cx88_core *core) in cx88_detect_nicam() argument
747 void cx88_set_tvaudio(struct cx88_core *core) in cx88_set_tvaudio() argument
749 switch (core->tvaudio) { in cx88_set_tvaudio()
751 set_audio_standard_BTSC(core, 0, EN_BTSC_AUTO_STEREO); in cx88_set_tvaudio()
759 set_audio_standard_A2(core, EN_A2_FORCE_MONO1); in cx88_set_tvaudio()
765 set_audio_standard_NICAM(core, EN_NICAM_AUTO_STEREO); in cx88_set_tvaudio()
766 if (cx88_detect_nicam(core) == 0) { in cx88_set_tvaudio()
768 set_audio_standard_A2(core, EN_A2_FORCE_MONO1); in cx88_set_tvaudio()
769 core->audiomode_current = V4L2_TUNER_MODE_MONO; in cx88_set_tvaudio()
770 core->use_nicam = 0; in cx88_set_tvaudio()
772 core->use_nicam = 1; in cx88_set_tvaudio()
776 set_audio_standard_EIAJ(core); in cx88_set_tvaudio()
779 set_audio_standard_FM(core, radio_deemphasis); in cx88_set_tvaudio()
782 set_audio_start(core, 0x01); in cx88_set_tvaudio()
788 cx_write(AUD_I2SINPUTCNTL, core->board.i2sinputcntl); in cx88_set_tvaudio()
791 set_audio_finish(core, EN_I2SIN_ENABLE); in cx88_set_tvaudio()
795 pr_info("unknown tv audio mode [%d]\n", core->tvaudio); in cx88_set_tvaudio()
801 void cx88_newstation(struct cx88_core *core) in cx88_newstation() argument
803 core->audiomode_manual = UNSET; in cx88_newstation()
804 core->last_change = jiffies; in cx88_newstation()
808 void cx88_get_stereo(struct cx88_core *core, struct v4l2_tuner *t) in cx88_get_stereo() argument
820 if (core->astat != reg) in cx88_get_stereo()
824 core->astat = reg; in cx88_get_stereo()
846 switch (core->tvaudio) { in cx88_get_stereo()
852 if (!core->use_nicam) { in cx88_get_stereo()
853 t->rxsubchans = cx88_dsp_detect_stereo_sap(core); in cx88_get_stereo()
881 void cx88_set_stereo(struct cx88_core *core, u32 mode, int manual) in cx88_set_stereo() argument
887 core->audiomode_manual = mode; in cx88_set_stereo()
889 if (core->audiomode_manual != UNSET) in cx88_set_stereo()
892 core->audiomode_current = mode; in cx88_set_stereo()
894 switch (core->tvaudio) { in cx88_set_stereo()
898 set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_MONO); in cx88_set_stereo()
901 set_audio_standard_BTSC(core, 0, EN_BTSC_AUTO_STEREO); in cx88_set_stereo()
904 set_audio_standard_BTSC(core, 1, EN_BTSC_FORCE_SAP); in cx88_set_stereo()
908 set_audio_standard_BTSC(core, 0, EN_BTSC_FORCE_STEREO); in cx88_set_stereo()
917 if (core->use_nicam == 1) { in cx88_set_stereo()
921 set_audio_standard_NICAM(core, in cx88_set_stereo()
925 set_audio_standard_NICAM(core, in cx88_set_stereo()
930 set_audio_standard_NICAM(core, in cx88_set_stereo()
935 if ((core->tvaudio == WW_I) || in cx88_set_stereo()
936 (core->tvaudio == WW_L)) { in cx88_set_stereo()
938 set_audio_standard_A2(core, EN_A2_FORCE_MONO1); in cx88_set_stereo()
989 struct cx88_core *core = data; in cx88_audio_thread() local
1001 switch (core->tvaudio) { in cx88_audio_thread()
1007 if (core->use_nicam) in cx88_audio_thread()
1012 cx88_get_stereo(core, &t); in cx88_audio_thread()
1014 if (core->audiomode_manual != UNSET) in cx88_audio_thread()
1023 if (mode == core->audiomode_current) in cx88_audio_thread()
1026 cx88_set_stereo(core, mode, 0); in cx88_audio_thread()