···1129112911301130 count_areas = size/2;11311131 addr_area2 = addr+count_areas;11321132- count_areas--; /* max. index */11331132 snd_azf3328_dbgcodec("setdma: buffers %08lx[%u] / %08lx[%u]\n",11341133 addr, count_areas, addr_area2, count_areas);11341134+11351135+ count_areas--; /* max. index */1135113611361137 /* build combined I/O buffer length word */11371138 lengths = (count_areas << 16) | (count_areas);···17411740 .rate_max = AZF_FREQ_66200,17421741 .channels_min = 1,17431742 .channels_max = 2,17441744- .buffer_bytes_max = 65536,17451745- .period_bytes_min = 64,17461746- .period_bytes_max = 65536,17471747- .periods_min = 1,17481748- .periods_max = 1024,17431743+ .buffer_bytes_max = (64*1024),17441744+ .period_bytes_min = 1024,17451745+ .period_bytes_max = (32*1024),17461746+ /* We simply have two DMA areas (instead of a list of descriptors17471747+ such as other cards); I believe that this is a fixed hardware17481748+ attribute and there isn't much driver magic to be done to expand it.17491749+ Thus indicate that we have at least and at most 2 periods. */17501750+ .periods_min = 2,17511751+ .periods_max = 2,17491752 /* FIXME: maybe that card actually has a FIFO?17501753 * Hmm, it seems newer revisions do have one, but we still don't know17511754 * its size... */···19851980 chip = snd_timer_chip(timer);19861981 spin_lock_irqsave(&chip->reg_lock, flags);19871982 /* disable timer countdown and interrupt */19881988- /* FIXME: should we write TIMER_IRQ_ACK here? */19891989- snd_azf3328_ctrl_outb(chip, IDX_IO_TIMER_VALUE + 3, 0);19831983+ /* Hmm, should we write TIMER_IRQ_ACK here?19841984+ YES indeed, otherwise a rogue timer operation - which prompts19851985+ ALSA(?) to call repeated stop() in vain, but NOT start() -19861986+ will never end (value 0x03 is kept shown in control byte).19871987+ Simply manually poking 0x04 _once_ immediately successfully stops19881988+ the hardware/ALSA interrupt activity. */19891989+ snd_azf3328_ctrl_outb(chip, IDX_IO_TIMER_VALUE + 3, 0x04);19901990 spin_unlock_irqrestore(&chip->reg_lock, flags);19911991 snd_azf3328_dbgcallleave();19921992 return 0;
···12281228 chip->rsrc[i].start + 1,12291229 rnames[i]) == NULL) {12301230 printk(KERN_ERR "snd: can't request rsrc "12311231- " %d (%s: 0x%016llx:%016llx)\n",12321232- i, rnames[i],12331233- (unsigned long long)chip->rsrc[i].start,12341234- (unsigned long long)chip->rsrc[i].end);12311231+ " %d (%s: %pR)\n",12321232+ i, rnames[i], &chip->rsrc[i]);12351233 err = -ENODEV;12361234 goto __error;12371235 }···12541256 chip->rsrc[i].start + 1,12551257 rnames[i]) == NULL) {12561258 printk(KERN_ERR "snd: can't request rsrc "12571257- " %d (%s: 0x%016llx:%016llx)\n",12581258- i, rnames[i],12591259- (unsigned long long)chip->rsrc[i].start,12601260- (unsigned long long)chip->rsrc[i].end);12591259+ " %d (%s: %pR)\n",12601260+ i, rnames[i], &chip->rsrc[i]);12611261 err = -ENODEV;12621262 goto __error;12631263 }
+2-1
sound/soc/codecs/Kconfig
···2525 select SND_SOC_CQ0093VC if MFD_DAVINCI_VOICECODEC2626 select SND_SOC_CS42L51 if I2C2727 select SND_SOC_CS4270 if I2C2828+ select SND_SOC_CX204422829 select SND_SOC_DA7210 if I2C2929- select SND_SOC_JZ4740 if SOC_JZ47403030+ select SND_SOC_JZ4740_CODEC if SOC_JZ47403031 select SND_SOC_MAX98088 if I2C3132 select SND_SOC_MAX9877 if I2C3233 select SND_SOC_PCM3008
+26-10
sound/soc/codecs/tlv320dac33.c
···5858 (1000000000 / ((rate * 1000) / samples))59596060#define US_TO_SAMPLES(rate, us) \6161- (rate / (1000000 / us))6161+ (rate / (1000000 / (us < 1000000 ? us : 1000000)))62626363#define UTHR_FROM_PERIOD_SIZE(samples, playrate, burstrate) \6464 ((samples * 5000) / ((burstrate * 5000) / (burstrate - playrate)))···200200 u8 *value)201201{202202 struct tlv320dac33_priv *dac33 = snd_soc_codec_get_drvdata(codec);203203- int val;203203+ int val, ret = 0;204204205205 *value = reg & 0xff;206206···210210 if (val < 0) {211211 dev_err(codec->dev, "Read failed (%d)\n", val);212212 value[0] = dac33_read_reg_cache(codec, reg);213213+ ret = val;213214 } else {214215 value[0] = val;215216 dac33_write_reg_cache(codec, reg, val);···219218 value[0] = dac33_read_reg_cache(codec, reg);220219 }221220222222- return 0;221221+ return ret;223222}224223225224static int dac33_write(struct snd_soc_codec *codec, unsigned int reg,···330329 dac33_read_reg_cache(codec, DAC33_LINER_TO_RLO_VOL));331330}332331333333-static inline void dac33_read_id(struct snd_soc_codec *codec)332332+static inline int dac33_read_id(struct snd_soc_codec *codec)334333{334334+ int i, ret = 0;335335 u8 reg;336336337337- dac33_read(codec, DAC33_DEVICE_ID_MSB, ®);338338- dac33_read(codec, DAC33_DEVICE_ID_LSB, ®);339339- dac33_read(codec, DAC33_DEVICE_REV_ID, ®);337337+ for (i = 0; i < 3; i++) {338338+ ret = dac33_read(codec, DAC33_DEVICE_ID_MSB + i, ®);339339+ if (ret < 0)340340+ break;341341+ }342342+343343+ return ret;340344}341345342346static inline void dac33_soft_power(struct snd_soc_codec *codec, int power)···10821076 /* Number of samples under i2c latency */10831077 dac33->alarm_threshold = US_TO_SAMPLES(rate,10841078 dac33->mode1_latency);10791079+ nsample_limit = DAC33_BUFFER_SIZE_SAMPLES -10801080+ dac33->alarm_threshold;10811081+10851082 if (dac33->auto_fifo_config) {10861083 if (period_size <= dac33->alarm_threshold)10871084 /*···10951086 ((dac33->alarm_threshold / period_size) +10961087 (dac33->alarm_threshold % period_size ?10971088 1 : 0));10891089+ else if (period_size > nsample_limit)10901090+ dac33->nsample = nsample_limit;10981091 else10991092 dac33->nsample = period_size;11001093 } else {···11081097 */11091098 dac33->nsample_max = substream->runtime->buffer_size -11101099 period_size;11111111- nsample_limit = DAC33_BUFFER_SIZE_SAMPLES -11121112- dac33->alarm_threshold;11001100+11131101 if (dac33->nsample_max > nsample_limit)11141102 dac33->nsample_max = nsample_limit;11151103···14241414 dev_err(codec->dev, "Failed to power up codec: %d\n", ret);14251415 goto err_power;14261416 }14271427- dac33_read_id(codec);14171417+ ret = dac33_read_id(codec);14281418 dac33_hard_power(codec, 0);14191419+14201420+ if (ret < 0) {14211421+ dev_err(codec->dev, "Failed to read chip ID: %d\n", ret);14221422+ ret = -ENODEV;14231423+ goto err_power;14241424+ }1429142514301426 /* Check if the IRQ number is valid and request it */14311427 if (dac33->irq >= 0) {
+3-3
sound/soc/codecs/tpa6130a2.c
···119119{120120 struct tpa6130a2_data *data;121121 u8 val;122122- int ret;122122+ int ret = 0;123123124124 BUG_ON(tpa6130a2_client == NULL);125125 data = i2c_get_clientdata(tpa6130a2_client);126126127127 mutex_lock(&data->mutex);128128- if (power) {128128+ if (power && !data->power_state) {129129 /* Power on */130130 if (data->power_gpio >= 0)131131 gpio_set_value(data->power_gpio, 1);···153153 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);154154 val &= ~TPA6130A2_SWS;155155 tpa6130a2_i2c_write(TPA6130A2_REG_CONTROL, val);156156- } else {156156+ } else if (!power && data->power_state) {157157 /* set SWS */158158 val = tpa6130a2_read(TPA6130A2_REG_CONTROL);159159 val |= TPA6130A2_SWS;
-6
sound/soc/codecs/wm8900.c
···186186{187187 switch (reg) {188188 case WM8900_REG_ID:189189- case WM8900_REG_POWER1:190189 return 1;191190 default:192191 return 0;···11981199 dev_err(codec->dev, "Device is not a WM8900 - ID %x\n", reg);11991200 return -ENODEV;12001201 }12011201-12021202- /* Read back from the chip */12031203- reg = snd_soc_read(codec, WM8900_REG_POWER1);12041204- reg = (reg >> 12) & 0xf;12051205- dev_info(codec->dev, "WM8900 revision %d\n", reg);1206120212071203 wm8900_reset(codec);12081204
···7979static int tosa_startup(struct snd_pcm_substream *substream)8080{8181 struct snd_soc_pcm_runtime *rtd = substream->private_data;8282- struct snd_soc_codec *codec = rtd->card->codec;8282+ struct snd_soc_codec *codec = rtd->codec;83838484 /* check the jack status at stream startup */8585 tosa_ext_control(codec);
+4-1
sound/soc/soc-core.c
···165165{166166 struct snd_soc_pcm_runtime *rtd =167167 container_of(dev, struct snd_soc_pcm_runtime, dev);168168+ int ret;168169169169- strict_strtol(buf, 10, &rtd->pmdown_time);170170+ ret = strict_strtol(buf, 10, &rtd->pmdown_time);171171+ if (ret)172172+ return ret;170173171174 return count;172175}
+1-1
sound/spi/at73c213.c
···155155 if (max_tries < 1)156156 max_tries = 1;157157158158- /* ssc_div must be a power of 2. */158158+ /* ssc_div must be even. */159159 ssc_div = (ssc_div + 1) & ~1UL;160160161161 if ((ssc_rate / (ssc_div * 2 * 16)) < BITRATE_MIN) {