Lines Matching refs:atc
80 int (*create)(struct ct_atc *atc,
126 atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm);
133 static int ct_map_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm) in ct_map_audio_buffer() argument
142 vm = atc->vm; in ct_map_audio_buffer()
152 static void ct_unmap_audio_buffer(struct ct_atc *atc, struct ct_atc_pcm *apcm) in ct_unmap_audio_buffer() argument
159 vm = atc->vm; in ct_unmap_audio_buffer()
166 static unsigned long atc_get_ptp_phys(struct ct_atc *atc, int index) in atc_get_ptp_phys() argument
168 return atc->vm->get_ptp_phys(atc->vm, index); in atc_get_ptp_phys()
240 static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_playback_prepare() argument
242 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; in atc_pcm_playback_prepare()
243 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; in atc_pcm_playback_prepare()
254 atc_pcm_release_resources(atc, apcm); in atc_pcm_playback_prepare()
258 desc.msr = atc->msr; in atc_pcm_playback_prepare()
265 (atc->rsr * atc->msr)); in atc_pcm_playback_prepare()
270 atc->card)); in atc_pcm_playback_prepare()
280 mix_dsc.msr = atc->msr; in atc_pcm_playback_prepare()
291 err = ct_map_audio_buffer(atc, apcm); in atc_pcm_playback_prepare()
299 mutex_lock(&atc->atc_mutex); in atc_pcm_playback_prepare()
301 INIT_VOL, atc->pcm[i+device*2]); in atc_pcm_playback_prepare()
302 mutex_unlock(&atc->atc_mutex); in atc_pcm_playback_prepare()
313 atc_pcm_release_resources(atc, apcm); in atc_pcm_playback_prepare()
318 atc_pcm_release_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_release_resources() argument
320 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; in atc_pcm_release_resources()
321 struct srcimp_mgr *srcimp_mgr = atc->rsc_mgrs[SRCIMP]; in atc_pcm_release_resources()
322 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; in atc_pcm_release_resources()
323 struct sum_mgr *sum_mgr = atc->rsc_mgrs[SUM]; in atc_pcm_release_resources()
368 ct_unmap_audio_buffer(atc, apcm); in atc_pcm_release_resources()
375 static int atc_pcm_playback_start(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_playback_start() argument
400 static int atc_pcm_stop(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_stop() argument
427 atc_pcm_playback_position(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_playback_position() argument
438 dev_dbg(atc->card->dev, in atc_pcm_playback_position()
459 static void setup_src_node_conf(struct ct_atc *atc, struct ct_atc_pcm *apcm, in setup_src_node_conf() argument
465 pitch = atc_get_pitch((atc->rsr * atc->msr), in setup_src_node_conf()
469 if (1 == atc->msr) { /* FIXME: do we really need SRC here if pitch==1 */ in setup_src_node_conf()
474 } else if (2 <= atc->msr) { in setup_src_node_conf()
478 conf[0].pitch = (atc->msr << 24); in setup_src_node_conf()
480 conf[0].imp_msr = atc->msr; in setup_src_node_conf()
482 conf[1].pitch = atc_get_pitch(atc->rsr, in setup_src_node_conf()
492 = conf[0].imp_msr = atc->msr; in setup_src_node_conf()
500 atc_pcm_capture_get_resources(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_capture_get_resources() argument
502 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; in atc_pcm_capture_get_resources()
503 struct srcimp_mgr *srcimp_mgr = atc->rsc_mgrs[SRCIMP]; in atc_pcm_capture_get_resources()
504 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; in atc_pcm_capture_get_resources()
505 struct sum_mgr *sum_mgr = atc->rsc_mgrs[SUM]; in atc_pcm_capture_get_resources()
518 atc_pcm_release_resources(atc, apcm); in atc_pcm_capture_get_resources()
526 pitch = atc_get_pitch((atc->rsr * atc->msr), in atc_pcm_capture_get_resources()
529 setup_src_node_conf(atc, apcm, src_node_conf, &n_srcc); in atc_pcm_capture_get_resources()
536 n_amixer += multi * atc->msr; in atc_pcm_capture_get_resources()
537 n_srcimp += multi * atc->msr; in atc_pcm_capture_get_resources()
582 mix_dsc.msr = atc->msr; in atc_pcm_capture_get_resources()
597 sum_dsc.msr = atc->msr; in atc_pcm_capture_get_resources()
602 pitch = atc_get_pitch((atc->rsr * atc->msr), in atc_pcm_capture_get_resources()
609 srcimp_dsc.msr = (pitch <= 0x8000000) ? atc->msr : 1; in atc_pcm_capture_get_resources()
633 err = ct_map_audio_buffer(atc, apcm); in atc_pcm_capture_get_resources()
640 atc_pcm_release_resources(atc, apcm); in atc_pcm_capture_get_resources()
644 static int atc_pcm_capture_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_capture_prepare() argument
649 struct ct_mixer *mixer = atc->mixer; in atc_pcm_capture_prepare()
656 atc_pcm_release_resources(atc, apcm); in atc_pcm_capture_prepare()
659 err = atc_pcm_capture_get_resources(atc, apcm); in atc_pcm_capture_prepare()
689 pitch = atc_get_pitch((atc->rsr * atc->msr), in atc_pcm_capture_prepare()
697 for (j = 0; j < atc->msr; j++) { in atc_pcm_capture_prepare()
722 static int atc_pcm_capture_start(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_capture_start() argument
725 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; in atc_pcm_capture_start()
743 atc->card)); in atc_pcm_capture_start()
773 atc_pcm_capture_position(struct ct_atc *atc, struct ct_atc_pcm *apcm) in atc_pcm_capture_position() argument
782 static int spdif_passthru_playback_get_resources(struct ct_atc *atc, in spdif_passthru_playback_get_resources() argument
785 struct src_mgr *src_mgr = atc->rsc_mgrs[SRC]; in spdif_passthru_playback_get_resources()
786 struct amixer_mgr *amixer_mgr = atc->rsc_mgrs[AMIXER]; in spdif_passthru_playback_get_resources()
792 unsigned int pitch, rsr = atc->pll_rate; in spdif_passthru_playback_get_resources()
795 atc_pcm_release_resources(atc, apcm); in spdif_passthru_playback_get_resources()
813 atc->card)); in spdif_passthru_playback_get_resources()
835 err = ct_map_audio_buffer(atc, apcm); in spdif_passthru_playback_get_resources()
842 atc_pcm_release_resources(atc, apcm); in spdif_passthru_playback_get_resources()
846 static int atc_pll_init(struct ct_atc *atc, int rate) in atc_pll_init() argument
848 struct hw *hw = atc->hw; in atc_pll_init()
851 atc->pll_rate = err ? 0 : rate; in atc_pll_init()
856 spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm) in spdif_passthru_playback_setup() argument
858 struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio); in spdif_passthru_playback_setup()
878 mutex_lock(&atc->atc_mutex); in spdif_passthru_playback_setup()
886 if ((rate != atc->pll_rate) && (32000 != rate)) in spdif_passthru_playback_setup()
887 err = atc_pll_init(atc, rate); in spdif_passthru_playback_setup()
888 mutex_unlock(&atc->atc_mutex); in spdif_passthru_playback_setup()
894 spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm) in spdif_passthru_playback_prepare() argument
902 atc_pcm_release_resources(atc, apcm); in spdif_passthru_playback_prepare()
906 err = spdif_passthru_playback_setup(atc, apcm); in spdif_passthru_playback_prepare()
911 err = spdif_passthru_playback_get_resources(atc, apcm); in spdif_passthru_playback_prepare()
925 mutex_lock(&atc->atc_mutex); in spdif_passthru_playback_prepare()
926 dao = container_of(atc->daios[SPDIFOO], struct dao, daio); in spdif_passthru_playback_prepare()
931 mutex_unlock(&atc->atc_mutex); in spdif_passthru_playback_prepare()
938 static int atc_select_line_in(struct ct_atc *atc) in atc_select_line_in() argument
940 struct hw *hw = atc->hw; in atc_select_line_in()
941 struct ct_mixer *mixer = atc->mixer; in atc_select_line_in()
952 src = atc->srcs[2]; in atc_select_line_in()
954 src = atc->srcs[3]; in atc_select_line_in()
960 static int atc_select_mic_in(struct ct_atc *atc) in atc_select_mic_in() argument
962 struct hw *hw = atc->hw; in atc_select_mic_in()
963 struct ct_mixer *mixer = atc->mixer; in atc_select_mic_in()
974 src = atc->srcs[2]; in atc_select_mic_in()
976 src = atc->srcs[3]; in atc_select_mic_in()
982 static struct capabilities atc_capabilities(struct ct_atc *atc) in atc_capabilities() argument
984 struct hw *hw = atc->hw; in atc_capabilities()
989 static int atc_output_switch_get(struct ct_atc *atc) in atc_output_switch_get() argument
991 struct hw *hw = atc->hw; in atc_output_switch_get()
996 static int atc_output_switch_put(struct ct_atc *atc, int position) in atc_output_switch_put() argument
998 struct hw *hw = atc->hw; in atc_output_switch_put()
1003 static int atc_mic_source_switch_get(struct ct_atc *atc) in atc_mic_source_switch_get() argument
1005 struct hw *hw = atc->hw; in atc_mic_source_switch_get()
1010 static int atc_mic_source_switch_put(struct ct_atc *atc, int position) in atc_mic_source_switch_put() argument
1012 struct hw *hw = atc->hw; in atc_mic_source_switch_put()
1017 static int atc_select_digit_io(struct ct_atc *atc) in atc_select_digit_io() argument
1019 struct hw *hw = atc->hw; in atc_select_digit_io()
1029 static int atc_daio_unmute(struct ct_atc *atc, unsigned char state, int type) in atc_daio_unmute() argument
1031 struct daio_mgr *daio_mgr = atc->rsc_mgrs[DAIO]; in atc_daio_unmute()
1034 daio_mgr->daio_enable(daio_mgr, atc->daios[type]); in atc_daio_unmute()
1036 daio_mgr->daio_disable(daio_mgr, atc->daios[type]); in atc_daio_unmute()
1044 atc_dao_get_status(struct ct_atc *atc, unsigned int *status, int type) in atc_dao_get_status() argument
1046 struct dao *dao = container_of(atc->daios[type], struct dao, daio); in atc_dao_get_status()
1051 atc_dao_set_status(struct ct_atc *atc, unsigned int status, int type) in atc_dao_set_status() argument
1053 struct dao *dao = container_of(atc->daios[type], struct dao, daio); in atc_dao_set_status()
1060 static int atc_line_front_unmute(struct ct_atc *atc, unsigned char state) in atc_line_front_unmute() argument
1062 return atc_daio_unmute(atc, state, LINEO1); in atc_line_front_unmute()
1065 static int atc_line_surround_unmute(struct ct_atc *atc, unsigned char state) in atc_line_surround_unmute() argument
1067 return atc_daio_unmute(atc, state, LINEO2); in atc_line_surround_unmute()
1070 static int atc_line_clfe_unmute(struct ct_atc *atc, unsigned char state) in atc_line_clfe_unmute() argument
1072 return atc_daio_unmute(atc, state, LINEO3); in atc_line_clfe_unmute()
1075 static int atc_line_rear_unmute(struct ct_atc *atc, unsigned char state) in atc_line_rear_unmute() argument
1077 return atc_daio_unmute(atc, state, LINEO4); in atc_line_rear_unmute()
1080 static int atc_line_in_unmute(struct ct_atc *atc, unsigned char state) in atc_line_in_unmute() argument
1082 return atc_daio_unmute(atc, state, LINEIM); in atc_line_in_unmute()
1085 static int atc_mic_unmute(struct ct_atc *atc, unsigned char state) in atc_mic_unmute() argument
1087 return atc_daio_unmute(atc, state, MIC); in atc_mic_unmute()
1090 static int atc_spdif_out_unmute(struct ct_atc *atc, unsigned char state) in atc_spdif_out_unmute() argument
1092 return atc_daio_unmute(atc, state, SPDIFOO); in atc_spdif_out_unmute()
1095 static int atc_spdif_in_unmute(struct ct_atc *atc, unsigned char state) in atc_spdif_in_unmute() argument
1097 return atc_daio_unmute(atc, state, SPDIFIO); in atc_spdif_in_unmute()
1100 static int atc_spdif_out_get_status(struct ct_atc *atc, unsigned int *status) in atc_spdif_out_get_status() argument
1102 return atc_dao_get_status(atc, status, SPDIFOO); in atc_spdif_out_get_status()
1105 static int atc_spdif_out_set_status(struct ct_atc *atc, unsigned int status) in atc_spdif_out_set_status() argument
1107 return atc_dao_set_status(atc, status, SPDIFOO); in atc_spdif_out_set_status()
1110 static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state) in atc_spdif_out_passthru() argument
1115 struct ct_mixer *mixer = atc->mixer; in atc_spdif_out_passthru()
1119 mutex_lock(&atc->atc_mutex); in atc_spdif_out_passthru()
1120 dao = container_of(atc->daios[SPDIFOO], struct dao, daio); in atc_spdif_out_passthru()
1121 da_dsc.msr = state ? 1 : atc->msr; in atc_spdif_out_passthru()
1132 if (atc->pll_rate != atc->rsr) in atc_spdif_out_passthru()
1133 err = atc_pll_init(atc, atc->rsr); in atc_spdif_out_passthru()
1137 mutex_unlock(&atc->atc_mutex); in atc_spdif_out_passthru()
1142 static int atc_release_resources(struct ct_atc *atc) in atc_release_resources() argument
1155 if (atc->mixer) { in atc_release_resources()
1156 mixer = atc->mixer; in atc_release_resources()
1165 if (atc->daios) { in atc_release_resources()
1166 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; in atc_release_resources()
1167 for (i = 0; i < atc->n_daio; i++) { in atc_release_resources()
1168 daio = atc->daios[i]; in atc_release_resources()
1176 kfree(atc->daios); in atc_release_resources()
1177 atc->daios = NULL; in atc_release_resources()
1180 if (atc->pcm) { in atc_release_resources()
1181 sum_mgr = atc->rsc_mgrs[SUM]; in atc_release_resources()
1182 for (i = 0; i < atc->n_pcm; i++) in atc_release_resources()
1183 sum_mgr->put_sum(sum_mgr, atc->pcm[i]); in atc_release_resources()
1185 kfree(atc->pcm); in atc_release_resources()
1186 atc->pcm = NULL; in atc_release_resources()
1189 if (atc->srcs) { in atc_release_resources()
1190 src_mgr = atc->rsc_mgrs[SRC]; in atc_release_resources()
1191 for (i = 0; i < atc->n_src; i++) in atc_release_resources()
1192 src_mgr->put_src(src_mgr, atc->srcs[i]); in atc_release_resources()
1194 kfree(atc->srcs); in atc_release_resources()
1195 atc->srcs = NULL; in atc_release_resources()
1198 if (atc->srcimps) { in atc_release_resources()
1199 srcimp_mgr = atc->rsc_mgrs[SRCIMP]; in atc_release_resources()
1200 for (i = 0; i < atc->n_srcimp; i++) { in atc_release_resources()
1201 srcimp = atc->srcimps[i]; in atc_release_resources()
1203 srcimp_mgr->put_srcimp(srcimp_mgr, atc->srcimps[i]); in atc_release_resources()
1205 kfree(atc->srcimps); in atc_release_resources()
1206 atc->srcimps = NULL; in atc_release_resources()
1212 static int ct_atc_destroy(struct ct_atc *atc) in ct_atc_destroy() argument
1216 if (!atc) in ct_atc_destroy()
1219 if (atc->timer) { in ct_atc_destroy()
1220 ct_timer_free(atc->timer); in ct_atc_destroy()
1221 atc->timer = NULL; in ct_atc_destroy()
1224 atc_release_resources(atc); in ct_atc_destroy()
1227 if (atc->mixer) in ct_atc_destroy()
1228 ct_mixer_destroy(atc->mixer); in ct_atc_destroy()
1231 if (rsc_mgr_funcs[i].destroy && atc->rsc_mgrs[i]) in ct_atc_destroy()
1232 rsc_mgr_funcs[i].destroy(atc->rsc_mgrs[i]); in ct_atc_destroy()
1236 if (atc->hw) in ct_atc_destroy()
1237 destroy_hw_obj(atc->hw); in ct_atc_destroy()
1240 if (atc->vm) { in ct_atc_destroy()
1241 ct_vm_destroy(atc->vm); in ct_atc_destroy()
1242 atc->vm = NULL; in ct_atc_destroy()
1245 kfree(atc); in ct_atc_destroy()
1252 struct ct_atc *atc = dev->device_data; in atc_dev_free() local
1253 return ct_atc_destroy(atc); in atc_dev_free()
1256 static int atc_identify_card(struct ct_atc *atc, unsigned int ssid) in atc_identify_card() argument
1262 switch (atc->chip_type) { in atc_identify_card()
1264 atc->chip_name = "20K1"; in atc_identify_card()
1268 atc->chip_name = "20K2"; in atc_identify_card()
1278 vendor_id = atc->pci->subsystem_vendor; in atc_identify_card()
1279 device_id = atc->pci->subsystem_device; in atc_identify_card()
1284 dev_err(atc->card->dev, in atc_identify_card()
1289 atc->model = p->value; in atc_identify_card()
1291 if (atc->chip_type == ATC20K1) in atc_identify_card()
1292 atc->model = CT20K1_UNKNOWN; in atc_identify_card()
1294 atc->model = CT20K2_UNKNOWN; in atc_identify_card()
1296 atc->model_name = ct_subsys_name[atc->model]; in atc_identify_card()
1297 dev_info(atc->card->dev, "chip %s model %s (%04x:%04x) is found\n", in atc_identify_card()
1298 atc->chip_name, atc->model_name, in atc_identify_card()
1303 int ct_atc_create_alsa_devs(struct ct_atc *atc) in ct_atc_create_alsa_devs() argument
1308 alsa_dev_funcs[MIXER].public_name = atc->chip_name; in ct_atc_create_alsa_devs()
1314 err = alsa_dev_funcs[i].create(atc, i, in ct_atc_create_alsa_devs()
1317 dev_err(atc->card->dev, in ct_atc_create_alsa_devs()
1326 static int atc_create_hw_devs(struct ct_atc *atc) in atc_create_hw_devs() argument
1332 err = create_hw_obj(atc->pci, atc->chip_type, atc->model, &hw); in atc_create_hw_devs()
1334 dev_err(atc->card->dev, "Failed to create hw obj!!!\n"); in atc_create_hw_devs()
1337 hw->card = atc->card; in atc_create_hw_devs()
1338 atc->hw = hw; in atc_create_hw_devs()
1341 info.rsr = atc->rsr; in atc_create_hw_devs()
1342 info.msr = atc->msr; in atc_create_hw_devs()
1343 info.vm_pgt_phys = atc_get_ptp_phys(atc, 0); in atc_create_hw_devs()
1352 err = rsc_mgr_funcs[i].create(atc->hw, &atc->rsc_mgrs[i]); in atc_create_hw_devs()
1354 dev_err(atc->card->dev, in atc_create_hw_devs()
1363 static int atc_get_resources(struct ct_atc *atc) in atc_get_resources() argument
1375 num_daios = ((atc->model == CTSB1270) ? 8 : 7); in atc_get_resources()
1376 num_srcs = ((atc->model == CTSB1270) ? 6 : 4); in atc_get_resources()
1378 atc->daios = kcalloc(num_daios, sizeof(void *), GFP_KERNEL); in atc_get_resources()
1379 if (!atc->daios) in atc_get_resources()
1382 atc->srcs = kcalloc(num_srcs, sizeof(void *), GFP_KERNEL); in atc_get_resources()
1383 if (!atc->srcs) in atc_get_resources()
1386 atc->srcimps = kcalloc(num_srcs, sizeof(void *), GFP_KERNEL); in atc_get_resources()
1387 if (!atc->srcimps) in atc_get_resources()
1390 atc->pcm = kcalloc(2 * 4, sizeof(void *), GFP_KERNEL); in atc_get_resources()
1391 if (!atc->pcm) in atc_get_resources()
1394 daio_mgr = (struct daio_mgr *)atc->rsc_mgrs[DAIO]; in atc_get_resources()
1395 da_desc.msr = atc->msr; in atc_get_resources()
1396 for (i = 0, atc->n_daio = 0; i < num_daios; i++) { in atc_get_resources()
1397 da_desc.type = (atc->model != CTSB073X) ? i : in atc_get_resources()
1400 (struct daio **)&atc->daios[i]); in atc_get_resources()
1402 dev_err(atc->card->dev, in atc_get_resources()
1407 atc->n_daio++; in atc_get_resources()
1410 src_mgr = atc->rsc_mgrs[SRC]; in atc_get_resources()
1412 src_dsc.msr = atc->msr; in atc_get_resources()
1414 for (i = 0, atc->n_src = 0; i < num_srcs; i++) { in atc_get_resources()
1416 (struct src **)&atc->srcs[i]); in atc_get_resources()
1420 atc->n_src++; in atc_get_resources()
1423 srcimp_mgr = atc->rsc_mgrs[SRCIMP]; in atc_get_resources()
1425 for (i = 0, atc->n_srcimp = 0; i < num_srcs; i++) { in atc_get_resources()
1427 (struct srcimp **)&atc->srcimps[i]); in atc_get_resources()
1431 atc->n_srcimp++; in atc_get_resources()
1434 sum_mgr = atc->rsc_mgrs[SUM]; in atc_get_resources()
1435 sum_dsc.msr = atc->msr; in atc_get_resources()
1436 for (i = 0, atc->n_pcm = 0; i < (2*4); i++) { in atc_get_resources()
1438 (struct sum **)&atc->pcm[i]); in atc_get_resources()
1442 atc->n_pcm++; in atc_get_resources()
1487 static void atc_connect_resources(struct ct_atc *atc) in atc_connect_resources() argument
1497 mixer = atc->mixer; in atc_connect_resources()
1501 dao = container_of(atc->daios[j], struct dao, daio); in atc_connect_resources()
1506 dai = container_of(atc->daios[LINEIM], struct dai, daio); in atc_connect_resources()
1507 atc_connect_dai(atc->rsc_mgrs[SRC], dai, in atc_connect_resources()
1508 (struct src **)&atc->srcs[2], in atc_connect_resources()
1509 (struct srcimp **)&atc->srcimps[2]); in atc_connect_resources()
1510 src = atc->srcs[2]; in atc_connect_resources()
1512 src = atc->srcs[3]; in atc_connect_resources()
1515 if (atc->model == CTSB1270) { in atc_connect_resources()
1517 dai = container_of(atc->daios[MIC], struct dai, daio); in atc_connect_resources()
1518 atc_connect_dai(atc->rsc_mgrs[SRC], dai, in atc_connect_resources()
1519 (struct src **)&atc->srcs[4], in atc_connect_resources()
1520 (struct srcimp **)&atc->srcimps[4]); in atc_connect_resources()
1521 src = atc->srcs[4]; in atc_connect_resources()
1523 src = atc->srcs[5]; in atc_connect_resources()
1527 dai = container_of(atc->daios[SPDIFIO], struct dai, daio); in atc_connect_resources()
1528 atc_connect_dai(atc->rsc_mgrs[SRC], dai, in atc_connect_resources()
1529 (struct src **)&atc->srcs[0], in atc_connect_resources()
1530 (struct srcimp **)&atc->srcimps[0]); in atc_connect_resources()
1532 src = atc->srcs[0]; in atc_connect_resources()
1534 src = atc->srcs[1]; in atc_connect_resources()
1538 sum = atc->pcm[j]; in atc_connect_resources()
1540 sum = atc->pcm[j+1]; in atc_connect_resources()
1546 static int atc_suspend(struct ct_atc *atc) in atc_suspend() argument
1548 struct hw *hw = atc->hw; in atc_suspend()
1550 snd_power_change_state(atc->card, SNDRV_CTL_POWER_D3hot); in atc_suspend()
1552 atc_release_resources(atc); in atc_suspend()
1559 static int atc_hw_resume(struct ct_atc *atc) in atc_hw_resume() argument
1561 struct hw *hw = atc->hw; in atc_hw_resume()
1565 info.rsr = atc->rsr; in atc_hw_resume()
1566 info.msr = atc->msr; in atc_hw_resume()
1567 info.vm_pgt_phys = atc_get_ptp_phys(atc, 0); in atc_hw_resume()
1571 static int atc_resources_resume(struct ct_atc *atc) in atc_resources_resume() argument
1577 err = atc_get_resources(atc); in atc_resources_resume()
1579 atc_release_resources(atc); in atc_resources_resume()
1584 atc_connect_resources(atc); in atc_resources_resume()
1586 mixer = atc->mixer; in atc_resources_resume()
1592 static int atc_resume(struct ct_atc *atc) in atc_resume() argument
1597 err = atc_hw_resume(atc); in atc_resume()
1599 dev_err(atc->card->dev, in atc_resume()
1601 snd_card_disconnect(atc->card); in atc_resume()
1605 err = atc_resources_resume(atc); in atc_resume()
1609 snd_power_change_state(atc->card, SNDRV_CTL_POWER_D0); in atc_resume()
1671 struct ct_atc *atc; in ct_atc_create() local
1679 atc = kzalloc(sizeof(*atc), GFP_KERNEL); in ct_atc_create()
1680 if (!atc) in ct_atc_create()
1684 *atc = atc_preset; in ct_atc_create()
1686 atc->card = card; in ct_atc_create()
1687 atc->pci = pci; in ct_atc_create()
1688 atc->rsr = rsr; in ct_atc_create()
1689 atc->msr = msr; in ct_atc_create()
1690 atc->chip_type = chip_type; in ct_atc_create()
1692 mutex_init(&atc->atc_mutex); in ct_atc_create()
1695 err = atc_identify_card(atc, ssid); in ct_atc_create()
1702 err = ct_vm_create(&atc->vm, pci); in ct_atc_create()
1707 err = atc_create_hw_devs(atc); in ct_atc_create()
1711 err = ct_mixer_create(atc, (struct ct_mixer **)&atc->mixer); in ct_atc_create()
1718 err = atc_get_resources(atc); in ct_atc_create()
1723 atc_connect_resources(atc); in ct_atc_create()
1725 atc->timer = ct_timer_new(atc); in ct_atc_create()
1726 if (!atc->timer) { in ct_atc_create()
1731 err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, atc, &ops); in ct_atc_create()
1735 *ratc = atc; in ct_atc_create()
1739 ct_atc_destroy(atc); in ct_atc_create()