int n_amixer = apcm->substream->runtime->channels, i = 0;
int device = apcm->substream->pcm->device;
unsigned int pitch;
- unsigned long flags;
if (NULL != apcm->src) {
/* Prepared pcm playback */
src = apcm->src;
for (i = 0; i < n_amixer; i++) {
amixer = apcm->amixers[i];
- spin_lock_irqsave(&atc->atc_lock, flags);
+ mutex_lock(&atc->atc_mutex);
amixer->ops->setup(amixer, &src->rsc,
INIT_VOL, atc->pcm[i+device*2]);
- spin_unlock_irqrestore(&atc->atc_lock, flags);
+ mutex_unlock(&atc->atc_mutex);
src = src->ops->next_interleave(src);
if (NULL == src)
src = apcm->src;
spdif_passthru_playback_setup(struct ct_atc *atc, struct ct_atc_pcm *apcm)
{
struct dao *dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
- unsigned long flags;
unsigned int rate = apcm->substream->runtime->rate;
unsigned int status;
int err;
return -ENOENT;
}
- spin_lock_irqsave(&atc->atc_lock, flags);
+ mutex_lock(&atc->atc_mutex);
dao->ops->get_spos(dao, &status);
if (((status >> 24) & IEC958_AES3_CON_FS) != iec958_con_fs) {
status &= ((~IEC958_AES3_CON_FS) << 24);
}
if ((rate != atc->pll_rate) && (32000 != rate))
err = atc_pll_init(atc, rate);
- spin_unlock_irqrestore(&atc->atc_lock, flags);
+ mutex_unlock(&atc->atc_mutex);
return err;
}
struct dao *dao;
int err;
int i;
- unsigned long flags;
if (NULL != apcm->src)
return 0;
src = apcm->src;
}
/* Connect to SPDIFOO */
- spin_lock_irqsave(&atc->atc_lock, flags);
+ mutex_lock(&atc->atc_mutex);
dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
amixer = apcm->amixers[0];
dao->ops->set_left_input(dao, &amixer->rsc);
amixer = apcm->amixers[1];
dao->ops->set_right_input(dao, &amixer->rsc);
- spin_unlock_irqrestore(&atc->atc_lock, flags);
+ mutex_unlock(&atc->atc_mutex);
ct_timer_prepare(apcm->timer);
static int atc_spdif_out_passthru(struct ct_atc *atc, unsigned char state)
{
- unsigned long flags;
struct dao_desc da_dsc = {0};
struct dao *dao;
int err;
struct rsc *rscs[2] = {NULL};
unsigned int spos = 0;
- spin_lock_irqsave(&atc->atc_lock, flags);
+ mutex_lock(&atc->atc_mutex);
dao = container_of(atc->daios[SPDIFOO], struct dao, daio);
da_dsc.msr = state ? 1 : atc->msr;
da_dsc.passthru = state ? 1 : 0;
}
dao->ops->set_spos(dao, spos);
dao->ops->commit_write(dao);
- spin_unlock_irqrestore(&atc->atc_lock, flags);
+ mutex_unlock(&atc->atc_mutex);
return err;
}
atc->msr = msr;
atc->chip_type = chip_type;
- spin_lock_init(&atc->atc_lock);
+ mutex_init(&atc->atc_mutex);
/* Find card model */
err = atc_identify_card(atc);