Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/fix/mtk', 'asoc/fix/psc', 'asoc/…
Browse files Browse the repository at this point in the history
…fix/pxa', 'asoc/fix/spear', 'asoc/fix/sti' and 'asoc/fix/wm0010' into asoc-linus
  • Loading branch information
Mark Brown committed Sep 23, 2015
7 parents 312e0bc + e4fba9b + 921e546 + 8811191 + 4261786 + 3a0e27d + f072f91 commit d86a2fe
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 32 deletions.
15 changes: 8 additions & 7 deletions sound/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ menuconfig SND_ARM
Drivers that are implemented on ASoC can be found in
"ALSA for SoC audio support" section.

config SND_PXA2XX_LIB
tristate
select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97
select SND_DMAENGINE_PCM

config SND_PXA2XX_LIB_AC97
bool

if SND_ARM

config SND_ARMAACI
Expand All @@ -21,13 +29,6 @@ config SND_PXA2XX_PCM
tristate
select SND_PCM

config SND_PXA2XX_LIB
tristate
select SND_AC97_CODEC if SND_PXA2XX_LIB_AC97

config SND_PXA2XX_LIB_AC97
bool

config SND_PXA2XX_AC97
tristate "AC97 driver for the Intel PXA2xx chip"
depends on ARCH_PXA
Expand Down
1 change: 0 additions & 1 deletion sound/soc/au1x/psc-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,6 @@ static int au1xpsc_i2s_drvprobe(struct platform_device *pdev)
{
struct resource *iores, *dmares;
unsigned long sel;
int ret;
struct au1xpsc_audio_data *wd;

wd = devm_kzalloc(&pdev->dev, sizeof(struct au1xpsc_audio_data),
Expand Down
23 changes: 9 additions & 14 deletions sound/soc/codecs/wm0010.c
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
struct wm0010_priv *wm0010 = snd_soc_codec_get_drvdata(codec);
unsigned long flags;
int ret;
const struct firmware *fw;
struct spi_message m;
struct spi_transfer t;
struct dfw_pllrec pll_rec;
Expand Down Expand Up @@ -623,14 +622,6 @@ static int wm0010_boot(struct snd_soc_codec *codec)
wm0010->state = WM0010_OUT_OF_RESET;
spin_unlock_irqrestore(&wm0010->irq_lock, flags);

/* First the bootloader */
ret = request_firmware(&fw, "wm0010_stage2.bin", codec->dev);
if (ret != 0) {
dev_err(codec->dev, "Failed to request stage2 loader: %d\n",
ret);
goto abort;
}

if (!wait_for_completion_timeout(&wm0010->boot_completion,
msecs_to_jiffies(20)))
dev_err(codec->dev, "Failed to get interrupt from DSP\n");
Expand Down Expand Up @@ -673,7 +664,7 @@ static int wm0010_boot(struct snd_soc_codec *codec)

img_swap = kzalloc(len, GFP_KERNEL | GFP_DMA);
if (!img_swap)
goto abort;
goto abort_out;

/* We need to re-order for 0010 */
byte_swap_64((u64 *)&pll_rec, img_swap, len);
Expand All @@ -688,16 +679,16 @@ static int wm0010_boot(struct snd_soc_codec *codec)
spi_message_add_tail(&t, &m);

ret = spi_sync(spi, &m);
if (ret != 0) {
if (ret) {
dev_err(codec->dev, "First PLL write failed: %d\n", ret);
goto abort;
goto abort_swap;
}

/* Use a second send of the message to get the return status */
ret = spi_sync(spi, &m);
if (ret != 0) {
if (ret) {
dev_err(codec->dev, "Second PLL write failed: %d\n", ret);
goto abort;
goto abort_swap;
}

p = (u32 *)out;
Expand Down Expand Up @@ -730,6 +721,10 @@ static int wm0010_boot(struct snd_soc_codec *codec)

return 0;

abort_swap:
kfree(img_swap);
abort_out:
kfree(out);
abort:
/* Put the chip back into reset */
wm0010_halt(codec);
Expand Down
17 changes: 17 additions & 0 deletions sound/soc/mediatek/mtk-afe-pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,23 @@ static int mtk_afe_dais_startup(struct snd_pcm_substream *substream,
memif->substream = substream;

snd_soc_set_runtime_hwparams(substream, &mtk_afe_hardware);

/*
* Capture cannot use ping-pong buffer since hw_ptr at IRQ may be
* smaller than period_size due to AFE's internal buffer.
* This easily leads to overrun when avail_min is period_size.
* One more period can hold the possible unread buffer.
*/
if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) {
ret = snd_pcm_hw_constraint_minmax(runtime,
SNDRV_PCM_HW_PARAM_PERIODS,
3,
mtk_afe_hardware.periods_max);
if (ret < 0) {
dev_err(afe->dev, "hw_constraint_minmax failed\n");
return ret;
}
}
ret = snd_pcm_hw_constraint_integer(runtime,
SNDRV_PCM_HW_PARAM_PERIODS);
if (ret < 0)
Expand Down
2 changes: 0 additions & 2 deletions sound/soc/pxa/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
config SND_PXA2XX_SOC
tristate "SoC Audio for the Intel PXA2xx chip"
depends on ARCH_PXA
select SND_ARM
select SND_PXA2XX_LIB
help
Say Y or M if you want to add support for codecs attached to
Expand All @@ -25,7 +24,6 @@ config SND_PXA2XX_AC97
config SND_PXA2XX_SOC_AC97
tristate
select AC97_BUS
select SND_ARM
select SND_PXA2XX_LIB_AC97
select SND_SOC_AC97_BUS

Expand Down
4 changes: 2 additions & 2 deletions sound/soc/pxa/pxa2xx-ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ static struct snd_ac97_bus_ops pxa2xx_ac97_ops = {
.reset = pxa2xx_ac97_cold_reset,
};

static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 12;
static unsigned long pxa2xx_ac97_pcm_stereo_in_req = 11;
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_in = {
.addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
.maxburst = 32,
.filter_data = &pxa2xx_ac97_pcm_stereo_in_req,
};

static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 11;
static unsigned long pxa2xx_ac97_pcm_stereo_out_req = 12;
static struct snd_dmaengine_dai_dma_data pxa2xx_ac97_pcm_stereo_out = {
.addr = __PREG(PCDR),
.addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES,
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/spear/Kconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
config SND_SPEAR_SOC
tristate
select SND_DMAENGINE_PCM
select SND_SOC_GENERIC_DMAENGINE_PCM

config SND_SPEAR_SPDIF_OUT
tristate
Expand Down
14 changes: 10 additions & 4 deletions sound/soc/sti/uniperif_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -989,19 +989,25 @@ static int uni_player_parse_dt(struct platform_device *pdev,
if (!info)
return -ENOMEM;

of_property_read_u32(pnode, "version", &player->ver);
if (player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
if (of_property_read_u32(pnode, "version", &player->ver) ||
player->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
dev_err(dev, "Unknown uniperipheral version ");
return -EINVAL;
}
/* Underflow recovery is only supported on later ip revisions */
if (player->ver >= SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
info->underflow_enabled = 1;

of_property_read_u32(pnode, "uniperiph-id", &info->id);
if (of_property_read_u32(pnode, "uniperiph-id", &info->id)) {
dev_err(dev, "uniperipheral id not defined");
return -EINVAL;
}

/* Read the device mode property */
of_property_read_string(pnode, "mode", &mode);
if (of_property_read_string(pnode, "mode", &mode)) {
dev_err(dev, "uniperipheral mode not defined");
return -EINVAL;
}

if (strcasecmp(mode, "hdmi") == 0)
info->player_type = SND_ST_UNIPERIF_PLAYER_TYPE_HDMI;
Expand Down
6 changes: 5 additions & 1 deletion sound/soc/sti/uniperif_reader.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,11 @@ static int uni_reader_parse_dt(struct platform_device *pdev,
if (!info)
return -ENOMEM;

of_property_read_u32(node, "version", &reader->ver);
if (of_property_read_u32(node, "version", &reader->ver) ||
reader->ver == SND_ST_UNIPERIF_VERSION_UNKNOWN) {
dev_err(&pdev->dev, "Unknown uniperipheral version ");
return -EINVAL;
}

/* Save the info structure */
reader->info = info;
Expand Down

0 comments on commit d86a2fe

Please sign in to comment.