diff options
Diffstat (limited to 'sound/mips')
-rw-r--r-- | sound/mips/hal2.c | 38 | ||||
-rw-r--r-- | sound/mips/sgio2audio.c | 14 |
2 files changed, 25 insertions, 27 deletions
diff --git a/sound/mips/hal2.c b/sound/mips/hal2.c index 00fc9241d266..3318c15e324a 100644 --- a/sound/mips/hal2.c +++ b/sound/mips/hal2.c @@ -264,7 +264,7 @@ static int hal2_gain_put(struct snd_kcontrol *kcontrol, return old != new; } -static struct snd_kcontrol_new hal2_ctrl_headphone = { +static const struct snd_kcontrol_new hal2_ctrl_headphone = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Headphone Playback Volume", .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, @@ -274,7 +274,7 @@ static struct snd_kcontrol_new hal2_ctrl_headphone = { .put = hal2_gain_put, }; -static struct snd_kcontrol_new hal2_ctrl_mic = { +static const struct snd_kcontrol_new hal2_ctrl_mic = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Capture Volume", .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, @@ -461,15 +461,15 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec) int count = H2_BUF_SIZE / H2_BLOCK_SIZE; int i; - codec->buffer = dma_alloc_noncoherent(NULL, H2_BUF_SIZE, - &buffer_dma, GFP_KERNEL); + codec->buffer = dma_alloc_attrs(NULL, H2_BUF_SIZE, &buffer_dma, + GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); if (!codec->buffer) return -ENOMEM; - desc = dma_alloc_noncoherent(NULL, count * sizeof(struct hal2_desc), - &desc_dma, GFP_KERNEL); + desc = dma_alloc_attrs(NULL, count * sizeof(struct hal2_desc), + &desc_dma, GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); if (!desc) { - dma_free_noncoherent(NULL, H2_BUF_SIZE, - codec->buffer, buffer_dma); + dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, buffer_dma, + DMA_ATTR_NON_CONSISTENT); return -ENOMEM; } codec->buffer_dma = buffer_dma; @@ -490,10 +490,10 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec) static void hal2_free_dmabuf(struct hal2_codec *codec) { - dma_free_noncoherent(NULL, codec->desc_count * sizeof(struct hal2_desc), - codec->desc, codec->desc_dma); - dma_free_noncoherent(NULL, H2_BUF_SIZE, codec->buffer, - codec->buffer_dma); + dma_free_attrs(NULL, codec->desc_count * sizeof(struct hal2_desc), + codec->desc, codec->desc_dma, DMA_ATTR_NON_CONSISTENT); + dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, codec->buffer_dma, + DMA_ATTR_NON_CONSISTENT); } static struct snd_pcm_hardware hal2_pcm_hw = { @@ -616,10 +616,9 @@ static int hal2_playback_ack(struct snd_pcm_substream *substream) struct hal2_codec *dac = &hal2->dac; dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2; - snd_pcm_indirect_playback_transfer(substream, - &dac->pcm_indirect, - hal2_playback_transfer); - return 0; + return snd_pcm_indirect_playback_transfer(substream, + &dac->pcm_indirect, + hal2_playback_transfer); } static int hal2_capture_open(struct snd_pcm_substream *substream) @@ -707,10 +706,9 @@ static int hal2_capture_ack(struct snd_pcm_substream *substream) struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); struct hal2_codec *adc = &hal2->adc; - snd_pcm_indirect_capture_transfer(substream, - &adc->pcm_indirect, - hal2_capture_transfer); - return 0; + return snd_pcm_indirect_capture_transfer(substream, + &adc->pcm_indirect, + hal2_capture_transfer); } static struct snd_pcm_ops hal2_playback_ops = { diff --git a/sound/mips/sgio2audio.c b/sound/mips/sgio2audio.c index f07aa3993f83..0ebc1c3727df 100644 --- a/sound/mips/sgio2audio.c +++ b/sound/mips/sgio2audio.c @@ -230,7 +230,7 @@ static int sgio2audio_source_put(struct snd_kcontrol *kcontrol, } /* dac1/pcm0 mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_pcm0 = { +static const struct snd_kcontrol_new sgio2audio_ctrl_pcm0 = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", .index = 0, @@ -242,7 +242,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_pcm0 = { }; /* dac2/pcm1 mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_pcm1 = { +static const struct snd_kcontrol_new sgio2audio_ctrl_pcm1 = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "PCM Playback Volume", .index = 1, @@ -254,7 +254,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_pcm1 = { }; /* record level mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_reclevel = { +static const struct snd_kcontrol_new sgio2audio_ctrl_reclevel = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Capture Volume", .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, @@ -265,7 +265,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_reclevel = { }; /* record level source control */ -static struct snd_kcontrol_new sgio2audio_ctrl_recsource = { +static const struct snd_kcontrol_new sgio2audio_ctrl_recsource = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Capture Source", .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, @@ -275,7 +275,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_recsource = { }; /* line mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_line = { +static const struct snd_kcontrol_new sgio2audio_ctrl_line = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Line Playback Volume", .index = 0, @@ -287,7 +287,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_line = { }; /* cd mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_cd = { +static const struct snd_kcontrol_new sgio2audio_ctrl_cd = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Line Playback Volume", .index = 1, @@ -299,7 +299,7 @@ static struct snd_kcontrol_new sgio2audio_ctrl_cd = { }; /* mic mixer control */ -static struct snd_kcontrol_new sgio2audio_ctrl_mic = { +static const struct snd_kcontrol_new sgio2audio_ctrl_mic = { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = "Mic Playback Volume", .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |