diff options
Diffstat (limited to 'sound/mips/hal2.c')
-rw-r--r-- | sound/mips/hal2.c | 38 |
1 files changed, 18 insertions, 20 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, | |||
264 | return old != new; | 264 | return old != new; |
265 | } | 265 | } |
266 | 266 | ||
267 | static struct snd_kcontrol_new hal2_ctrl_headphone = { | 267 | static const struct snd_kcontrol_new hal2_ctrl_headphone = { |
268 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 268 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
269 | .name = "Headphone Playback Volume", | 269 | .name = "Headphone Playback Volume", |
270 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | 270 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
@@ -274,7 +274,7 @@ static struct snd_kcontrol_new hal2_ctrl_headphone = { | |||
274 | .put = hal2_gain_put, | 274 | .put = hal2_gain_put, |
275 | }; | 275 | }; |
276 | 276 | ||
277 | static struct snd_kcontrol_new hal2_ctrl_mic = { | 277 | static const struct snd_kcontrol_new hal2_ctrl_mic = { |
278 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | 278 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, |
279 | .name = "Mic Capture Volume", | 279 | .name = "Mic Capture Volume", |
280 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | 280 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, |
@@ -461,15 +461,15 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec) | |||
461 | int count = H2_BUF_SIZE / H2_BLOCK_SIZE; | 461 | int count = H2_BUF_SIZE / H2_BLOCK_SIZE; |
462 | int i; | 462 | int i; |
463 | 463 | ||
464 | codec->buffer = dma_alloc_noncoherent(NULL, H2_BUF_SIZE, | 464 | codec->buffer = dma_alloc_attrs(NULL, H2_BUF_SIZE, &buffer_dma, |
465 | &buffer_dma, GFP_KERNEL); | 465 | GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); |
466 | if (!codec->buffer) | 466 | if (!codec->buffer) |
467 | return -ENOMEM; | 467 | return -ENOMEM; |
468 | desc = dma_alloc_noncoherent(NULL, count * sizeof(struct hal2_desc), | 468 | desc = dma_alloc_attrs(NULL, count * sizeof(struct hal2_desc), |
469 | &desc_dma, GFP_KERNEL); | 469 | &desc_dma, GFP_KERNEL, DMA_ATTR_NON_CONSISTENT); |
470 | if (!desc) { | 470 | if (!desc) { |
471 | dma_free_noncoherent(NULL, H2_BUF_SIZE, | 471 | dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, buffer_dma, |
472 | codec->buffer, buffer_dma); | 472 | DMA_ATTR_NON_CONSISTENT); |
473 | return -ENOMEM; | 473 | return -ENOMEM; |
474 | } | 474 | } |
475 | codec->buffer_dma = buffer_dma; | 475 | codec->buffer_dma = buffer_dma; |
@@ -490,10 +490,10 @@ static int hal2_alloc_dmabuf(struct hal2_codec *codec) | |||
490 | 490 | ||
491 | static void hal2_free_dmabuf(struct hal2_codec *codec) | 491 | static void hal2_free_dmabuf(struct hal2_codec *codec) |
492 | { | 492 | { |
493 | dma_free_noncoherent(NULL, codec->desc_count * sizeof(struct hal2_desc), | 493 | dma_free_attrs(NULL, codec->desc_count * sizeof(struct hal2_desc), |
494 | codec->desc, codec->desc_dma); | 494 | codec->desc, codec->desc_dma, DMA_ATTR_NON_CONSISTENT); |
495 | dma_free_noncoherent(NULL, H2_BUF_SIZE, codec->buffer, | 495 | dma_free_attrs(NULL, H2_BUF_SIZE, codec->buffer, codec->buffer_dma, |
496 | codec->buffer_dma); | 496 | DMA_ATTR_NON_CONSISTENT); |
497 | } | 497 | } |
498 | 498 | ||
499 | static struct snd_pcm_hardware hal2_pcm_hw = { | 499 | static struct snd_pcm_hardware hal2_pcm_hw = { |
@@ -616,10 +616,9 @@ static int hal2_playback_ack(struct snd_pcm_substream *substream) | |||
616 | struct hal2_codec *dac = &hal2->dac; | 616 | struct hal2_codec *dac = &hal2->dac; |
617 | 617 | ||
618 | dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2; | 618 | dac->pcm_indirect.hw_queue_size = H2_BUF_SIZE / 2; |
619 | snd_pcm_indirect_playback_transfer(substream, | 619 | return snd_pcm_indirect_playback_transfer(substream, |
620 | &dac->pcm_indirect, | 620 | &dac->pcm_indirect, |
621 | hal2_playback_transfer); | 621 | hal2_playback_transfer); |
622 | return 0; | ||
623 | } | 622 | } |
624 | 623 | ||
625 | static int hal2_capture_open(struct snd_pcm_substream *substream) | 624 | static int hal2_capture_open(struct snd_pcm_substream *substream) |
@@ -707,10 +706,9 @@ static int hal2_capture_ack(struct snd_pcm_substream *substream) | |||
707 | struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); | 706 | struct snd_hal2 *hal2 = snd_pcm_substream_chip(substream); |
708 | struct hal2_codec *adc = &hal2->adc; | 707 | struct hal2_codec *adc = &hal2->adc; |
709 | 708 | ||
710 | snd_pcm_indirect_capture_transfer(substream, | 709 | return snd_pcm_indirect_capture_transfer(substream, |
711 | &adc->pcm_indirect, | 710 | &adc->pcm_indirect, |
712 | hal2_capture_transfer); | 711 | hal2_capture_transfer); |
713 | return 0; | ||
714 | } | 712 | } |
715 | 713 | ||
716 | static struct snd_pcm_ops hal2_playback_ops = { | 714 | static struct snd_pcm_ops hal2_playback_ops = { |