X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=sound%2Fpci%2Fcs46xx%2Fdsp_spos.c;h=81bcae073bc0334c631380bb9112dfe72dd83fa7;hb=987b0145d94eecf292d8b301228356f44611ab7c;hp=f407d2a5ce3b6a37a1f0f99d26b04cc99985c1ec;hpb=f7ed79d23a47594e7834d66a8f14449796d4f3e6;p=linux-2.6.git diff --git a/sound/pci/cs46xx/dsp_spos.c b/sound/pci/cs46xx/dsp_spos.c index f407d2a5c..81bcae073 100644 --- a/sound/pci/cs46xx/dsp_spos.c +++ b/sound/pci/cs46xx/dsp_spos.c @@ -28,8 +28,6 @@ #include #include #include -#include - #include #include #include @@ -293,7 +291,7 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) snd_assert(ins != NULL, return); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); for (i = 0; i < ins->nscb; ++i) { if (ins->scbs[i].deleted) continue; @@ -304,7 +302,7 @@ void cs46xx_dsp_spos_destroy (struct snd_cs46xx * chip) vfree(ins->symbol_table.symbols); kfree(ins->modules); kfree(ins); - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); } int cs46xx_dsp_load_module (struct snd_cs46xx * chip, struct dsp_module_desc * module) @@ -503,7 +501,7 @@ static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry, struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i,j; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); snd_iprintf(buffer, "MODULES:\n"); for ( i = 0; i < ins->nmodules; ++i ) { snd_iprintf(buffer, "\n%s:\n", ins->modules[i].module_name); @@ -516,7 +514,7 @@ static void cs46xx_dsp_proc_modules_read (struct snd_info_entry *entry, desc->segment_type,desc->offset, desc->size); } } - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); } static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry, @@ -527,7 +525,7 @@ static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry, int i, j, col; void __iomem *dst = chip->region.idx[1].remap_addr + DSP_PARAMETER_BYTE_OFFSET; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); snd_iprintf(buffer, "TASK TREES:\n"); for ( i = 0; i < ins->ntask; ++i) { snd_iprintf(buffer,"\n%04x %s:\n",ins->tasks[i].address,ins->tasks[i].task_name); @@ -544,7 +542,7 @@ static void cs46xx_dsp_proc_task_tree_read (struct snd_info_entry *entry, } snd_iprintf(buffer,"\n"); - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); } static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry, @@ -554,7 +552,7 @@ static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry, struct dsp_spos_instance * ins = chip->dsp_spos_instance; int i; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); snd_iprintf(buffer, "SCB's:\n"); for ( i = 0; i < ins->nscb; ++i) { if (ins->scbs[i].deleted) @@ -577,7 +575,7 @@ static void cs46xx_dsp_proc_scb_read (struct snd_info_entry *entry, } snd_iprintf(buffer,"\n"); - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); } static void cs46xx_dsp_proc_parameter_dump_read (struct snd_info_entry *entry, @@ -858,14 +856,14 @@ int cs46xx_dsp_proc_init (struct snd_card *card, struct snd_cs46xx *chip) } ins->proc_scb_info_entry = entry; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); /* register/update SCB's entries on proc */ for (i = 0; i < ins->nscb; ++i) { if (ins->scbs[i].deleted) continue; cs46xx_dsp_proc_register_scb_desc (chip, (ins->scbs + i)); } - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -905,12 +903,12 @@ int cs46xx_dsp_proc_done (struct snd_cs46xx *chip) ins->proc_task_info_entry = NULL; } - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); for (i = 0; i < ins->nscb; ++i) { if (ins->scbs[i].deleted) continue; cs46xx_dsp_proc_free_scb_desc ( (ins->scbs + i) ); } - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); if (ins->proc_dsp_dir) { snd_info_unregister (ins->proc_dsp_dir); @@ -1700,7 +1698,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip) snd_assert (ins->asynch_rx_scb == NULL,return -EINVAL); snd_assert (ins->spdif_in_src != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); if ( ! (ins->spdif_status_out & DSP_SPDIF_STATUS_INPUT_CTRL_ENABLED) ) { /* time countdown enable */ @@ -1744,7 +1742,7 @@ int cs46xx_dsp_enable_spdif_in (struct snd_cs46xx *chip) /* monitor state */ ins->spdif_status_in = 1; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1756,7 +1754,7 @@ int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip) snd_assert (ins->asynch_rx_scb != NULL, return -EINVAL); snd_assert (ins->spdif_in_src != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); /* Remove the asynchronous receiver SCB */ cs46xx_dsp_remove_scb (chip,ins->asynch_rx_scb); @@ -1766,7 +1764,7 @@ int cs46xx_dsp_disable_spdif_in (struct snd_cs46xx *chip) /* monitor state */ ins->spdif_status_in = 0; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); /* restore amplifier */ chip->active_ctrl(chip, -1); @@ -1782,10 +1780,10 @@ int cs46xx_dsp_enable_pcm_capture (struct snd_cs46xx *chip) snd_assert (ins->pcm_input == NULL,return -EINVAL); snd_assert (ins->ref_snoop_scb != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); ins->pcm_input = cs46xx_add_record_source(chip,ins->ref_snoop_scb,PCMSERIALIN_PCM_SCB_ADDR, "PCMSerialInput_Wave"); - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1796,10 +1794,10 @@ int cs46xx_dsp_disable_pcm_capture (struct snd_cs46xx *chip) snd_assert (ins->pcm_input != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); cs46xx_dsp_remove_scb (chip,ins->pcm_input); ins->pcm_input = NULL; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1811,10 +1809,10 @@ int cs46xx_dsp_enable_adc_capture (struct snd_cs46xx *chip) snd_assert (ins->adc_input == NULL,return -EINVAL); snd_assert (ins->codec_in_scb != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); ins->adc_input = cs46xx_add_record_source(chip,ins->codec_in_scb,PCMSERIALIN_SCB_ADDR, "PCMSerialInput_ADC"); - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1825,10 +1823,10 @@ int cs46xx_dsp_disable_adc_capture (struct snd_cs46xx *chip) snd_assert (ins->adc_input != NULL,return -EINVAL); - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); cs46xx_dsp_remove_scb (chip,ins->adc_input); ins->adc_input = NULL; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1875,7 +1873,7 @@ int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right) struct dsp_spos_instance * ins = chip->dsp_spos_instance; struct dsp_scb_descriptor * scb; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); /* main output */ scb = ins->master_mix_scb->sub_list_ptr; @@ -1894,7 +1892,7 @@ int cs46xx_dsp_set_dac_volume (struct snd_cs46xx * chip, u16 left, u16 right) ins->dac_volume_left = left; ins->dac_volume_right = right; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; } @@ -1903,7 +1901,7 @@ int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right) { struct dsp_spos_instance * ins = chip->dsp_spos_instance; - mutex_lock(&chip->spos_mutex); + down(&chip->spos_mutex); if (ins->asynch_rx_scb != NULL) cs46xx_dsp_scb_set_volume (chip,ins->asynch_rx_scb, @@ -1912,7 +1910,7 @@ int cs46xx_dsp_set_iec958_volume (struct snd_cs46xx * chip, u16 left, u16 right) ins->spdif_input_volume_left = left; ins->spdif_input_volume_right = right; - mutex_unlock(&chip->spos_mutex); + up(&chip->spos_mutex); return 0; }