aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci/ctxfi/ctatc.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/pci/ctxfi/ctatc.c')
-rw-r--r--sound/pci/ctxfi/ctatc.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/sound/pci/ctxfi/ctatc.c b/sound/pci/ctxfi/ctatc.c
index 80fb2baed7a7..b0adc8094009 100644
--- a/sound/pci/ctxfi/ctatc.c
+++ b/sound/pci/ctxfi/ctatc.c
@@ -259,7 +259,6 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
259 int n_amixer = apcm->substream->runtime->channels, i = 0; 259 int n_amixer = apcm->substream->runtime->channels, i = 0;
260 int device = apcm->substream->pcm->device; 260 int device = apcm->substream->pcm->device;
261 unsigned int pitch; 261 unsigned int pitch;
262 unsigned long flags;
263 262
264 if (NULL != apcm->src) { 263 if (NULL != apcm->src) {
265 /* Prepared pcm playback */ 264 /* Prepared pcm playback */
@@ -311,10 +310,10 @@ static int atc_pcm_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
311 src = apcm->src; 310 src = apcm->src;
312 for (i = 0; i < n_amixer; i++) { 311 for (i = 0; i < n_amixer; i++) {
313 amixer = apcm->amixers[i]; 312 amixer = apcm->amixers[i];
314 spin_lock_irqsave(&atc->atc_lock, flags); 313 mutex_lock(&atc->atc_mutex);
315 amixer->ops->setup(amixer, &src->rsc, 314 amixer->ops->setup(amixer, &src->rsc,
316 INIT_VOL, atc->pcm[i+device*2]); 315 INIT_VOL, atc->pcm[i+device*2]);
317 spin_unlock_irqrestore(&atc->atc_lock, flags); 316 mutex_unlock(&atc->atc_mutex);
318 src = src->ops->next_interleave(src); 317 src = src->ops->next_interleave(src);
319 if (NULL == src) 318 if (NULL == src)
320 src = apcm->src; 319 src = apcm->src;
@@ -865,7 +864,6 @@ static int
865spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm) 864spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm)
866{ 865{
867 struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio); 866 struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
868 unsigned long flags;
869 unsigned int rate = apcm->substream->runtime->rate; 867 unsigned int rate = apcm->substream->runtime->rate;
870 unsigned int status; 868 unsigned int status;
871 int err; 869 int err;
@@ -885,7 +883,7 @@ spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm)
885 return -ENOENT; 883 return -ENOENT;
886 } 884 }
887 885
888 spin_lock_irqsave(&atc->atc_lock, flags); 886 mutex_lock(&atc->atc_mutex);
889 dao->ops->get_spos(dao, &status); 887 dao->ops->get_spos(dao, &status);
890 if (((status >> 24) & IEC958_AES3_CON_FS) != iec958_con_fs) { 888 if (((status >> 24) & IEC958_AES3_CON_FS) != iec958_con_fs) {
891 status &= ((~IEC958_AES3_CON_FS) << 24); 889 status &= ((~IEC958_AES3_CON_FS) << 24);
@@ -895,7 +893,7 @@ spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm)
895 } 893 }
896 if ((rate != atc->pll_rate) && (32000 != rate)) 894 if ((rate != atc->pll_rate) && (32000 != rate))
897 err = atc_pll_init(atc, rate); 895 err = atc_pll_init(atc, rate);
898 spin_unlock_irqrestore(&atc->atc_lock, flags); 896 mutex_unlock(&atc->atc_mutex);
899 897
900 return err; 898 return err;
901} 899}
@@ -908,7 +906,6 @@ spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
908 struct dao *dao; 906 struct dao *dao;
909 int err; 907 int err;
910 int i; 908 int i;
911 unsigned long flags;
912 909
913 if (NULL != apcm->src) 910 if (NULL != apcm->src)
914 return 0; 911 return 0;
@@ -934,13 +931,13 @@ spdif_passthru_playback_prepare(struct ct_atc *atc, struct ct_atc_pcm *apcm)
934 src = apcm->src; 931 src = apcm->src;
935 } 932 }
936 /* Connect to SPDIFOO */ 933 /* Connect to SPDIFOO */
937 spin_lock_irqsave(&atc->atc_lock, flags); 934 mutex_lock(&atc->atc_mutex);
938 dao = container_of(atc->daios[SPDIFOO], struct dao, daio); 935 dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
939 amixer = apcm->amixers[0]; 936 amixer = apcm->amixers[0];
940 dao->ops->set_left_input(dao, &amixer->rsc); 937 dao->ops->set_left_input(dao, &amixer->rsc);
941 amixer = apcm->amixers[1]; 938 amixer = apcm->amixers[1];
942 dao->ops->set_right_input(dao, &amixer->rsc); 939 dao->ops->set_right_input(dao, &amixer->rsc);
943 spin_unlock_irqrestore(&atc->atc_lock, flags); 940 mutex_unlock(&atc->atc_mutex);
944 941
945 ct_timer_prepare(apcm->timer); 942 ct_timer_prepare(apcm->timer);
946 943
@@ -1088,7 +1085,6 @@ static int atc_spdif_out_set_status(struct ct_atc *atc, unsigned int status)
1088 1085
1089static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state) 1086static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state)
1090{ 1087{
1091 unsigned long flags;
1092 struct dao_desc da_dsc = {0}; 1088 struct dao_desc da_dsc = {0};
1093 struct dao *dao; 1089 struct dao *dao;
1094 int err; 1090 int err;
@@ -1096,7 +1092,7 @@ static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state)
1096 struct rsc *rscs[2] = {NULL}; 1092 struct rsc *rscs[2] = {NULL};
1097 unsigned int spos = 0; 1093 unsigned int spos = 0;
1098 1094
1099 spin_lock_irqsave(&atc->atc_lock, flags); 1095 mutex_lock(&atc->atc_mutex);
1100 dao = container_of(atc->daios[SPDIFOO], struct dao, daio); 1096 dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
1101 da_dsc.msr = state ? 1 : atc->msr; 1097 da_dsc.msr = state ? 1 : atc->msr;
1102 da_dsc.passthru = state ? 1 : 0; 1098 da_dsc.passthru = state ? 1 : 0;
@@ -1114,7 +1110,7 @@ static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state)
1114 } 1110 }
1115 dao->ops->set_spos(dao, spos); 1111 dao->ops->set_spos(dao, spos);
1116 dao->ops->commit_write(dao); 1112 dao->ops->commit_write(dao);
1117 spin_unlock_irqrestore(&atc->atc_lock, flags); 1113 mutex_unlock(&atc->atc_mutex);
1118 1114
1119 return err; 1115 return err;
1120} 1116}
@@ -1572,7 +1568,7 @@ int __devinit ct_atc_create(struct snd_card *card, struct pci_dev *pci,
1572 atc->msr = msr; 1568 atc->msr = msr;
1573 atc->chip_type = chip_type; 1569 atc->chip_type = chip_type;
1574 1570
1575 spin_lock_init(&atc->atc_lock); 1571 mutex_init(&atc->atc_mutex);
1576 1572
1577 /* Find card model */ 1573 /* Find card model */
1578 err = atc_identify_card(atc); 1574 err = atc_identify_card(atc);