Merge branch 'fix/misc' into topic/misc
authorTakashi Iwai <tiwai@suse.de>
Tue, 1 Dec 2009 07:36:05 +0000 (08:36 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 1 Dec 2009 07:36:05 +0000 (08:36 +0100)
1  2 
sound/arm/aaci.c
sound/soc/codecs/tlv320aic23.c

diff --combined sound/arm/aaci.c
index a03fe80a7a731dfe5afef7b6ea6d88f07eb76528,6c160a038b239a7c9e2baa0d3f941c68c7d68398..eb715e73210632629d4411e46879dab826b6ae65
  #include <linux/interrupt.h>
  #include <linux/err.h>
  #include <linux/amba/bus.h>
 -
 -#include <asm/io.h>
 -#include <asm/irq.h>
 -#include <asm/sizes.h>
 +#include <linux/io.h>
  
  #include <sound/core.h>
  #include <sound/initval.h>
@@@ -501,6 -504,10 +501,10 @@@ static int aaci_pcm_hw_params(struct sn
        int err;
  
        aaci_pcm_hw_free(substream);
+       if (aacirun->pcm_open) {
+               snd_ac97_pcm_close(aacirun->pcm);
+               aacirun->pcm_open = 0;
+       }
  
        err = devdma_hw_alloc(NULL, substream,
                              params_buffer_bytes(params));
        else
                err = snd_ac97_pcm_open(aacirun->pcm, params_rate(params),
                                        params_channels(params),
-                                       aacirun->pcm->r[1].slots);
+                                       aacirun->pcm->r[0].slots);
  
        if (err)
                goto out;
@@@ -531,7 -538,7 +535,7 @@@ static int aaci_pcm_prepare(struct snd_
        struct aaci_runtime *aacirun = runtime->private_data;
  
        aacirun->start  = (void *)runtime->dma_area;
 -      aacirun->end    = aacirun->start + runtime->dma_bytes;
 +      aacirun->end    = aacirun->start + snd_pcm_lib_buffer_bytes(substream);
        aacirun->ptr    = aacirun->start;
        aacirun->period =
        aacirun->bytes  = frames_to_bytes(runtime, runtime->period_size);
index 35606ae60868bc964ded7236ae0890d8098682c8,90a0264f75389f49e4c9ed544787ba0375f00c7f..58ffb6de400f90d4a5c99cbadf12be7ee0b6fc55
@@@ -85,7 -85,7 +85,7 @@@ static int tlv320aic23_write(struct snd
         * of data into val
         */
  
 -      if ((reg < 0 || reg > 9) && (reg != 15)) {
 +      if (reg > 9 && reg != 15) {
                printk(KERN_WARNING "%s Invalid register R%u\n", __func__, reg);
                return -1;
        }
@@@ -265,8 -265,8 +265,8 @@@ static const int bosr_usb_divisor_table
  #define UPPER_GROUP ((1<<8) | (1<<9) | (1<<10) | (1<<11)        | (1<<15))
  static const unsigned short sr_valid_mask[] = {
        LOWER_GROUP|UPPER_GROUP,        /* Normal, bosr - 0*/
-       LOWER_GROUP|UPPER_GROUP,        /* Normal, bosr - 1*/
        LOWER_GROUP,                    /* Usb, bosr - 0*/
+       LOWER_GROUP|UPPER_GROUP,        /* Normal, bosr - 1*/
        UPPER_GROUP,                    /* Usb, bosr - 1*/
  };
  /*
@@@ -625,11 -625,10 +625,10 @@@ static int tlv320aic23_resume(struct pl
  {
        struct snd_soc_device *socdev = platform_get_drvdata(pdev);
        struct snd_soc_codec *codec = socdev->card->codec;
-       int i;
        u16 reg;
  
        /* Sync reg_cache with the hardware */
-       for (reg = 0; reg < ARRAY_SIZE(tlv320aic23_reg); i++) {
+       for (reg = 0; reg < TLV320AIC23_RESET; reg++) {
                u16 val = tlv320aic23_read_reg_cache(codec, reg);
                tlv320aic23_write(codec, reg, val);
        }