Skip to content

Commit

Permalink
Merge remote-tracking branches 'asoc/fix/rt5663', 'asoc/fix/samsung',…
Browse files Browse the repository at this point in the history
… 'asoc/fix/sti', 'asoc/fix/sti-codec', 'asoc/fix/sunxi' and 'asoc/fix/tas571x' into asoc-linus
  • Loading branch information
broonie committed Nov 4, 2016
7 parents 74d01b1 + c975e39 + a451332 + 1e6d304 + 7e235de + 3716a89 + 8b0678d commit 3dfd2b6
Show file tree
Hide file tree
Showing 11 changed files with 79 additions and 86 deletions.
4 changes: 2 additions & 2 deletions sound/soc/codecs/rt5663.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,11 +1547,11 @@ static int rt5663_jack_detect(struct snd_soc_codec *codec, int jack_insert)
msleep(sleep_time[i]);
val = snd_soc_read(codec, RT5663_EM_JACK_TYPE_2) &
0x0003;
dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
__func__, val, sleep_time[i]);
i++;
if (val == 0x1 || val == 0x2 || val == 0x3)
break;
dev_dbg(codec->dev, "%s: MX-00e7 val=%x sleep %d\n",
__func__, val, sleep_time[i]);
}
dev_dbg(codec->dev, "%s val = %d\n", __func__, val);
switch (val) {
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/codecs/sti-sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ static const struct snd_soc_dai_ops stih407_dac_ops = {
static const struct regmap_config stih407_sas_regmap = {
.reg_bits = 32,
.val_bits = 32,

.fast_io = true,
.max_register = STIH407_AUDIO_DAC_CTRL,
.reg_defaults = stih407_sas_reg_defaults,
.num_reg_defaults = ARRAY_SIZE(stih407_sas_reg_defaults),
Expand Down
37 changes: 12 additions & 25 deletions sound/soc/codecs/tas571x.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,20 +341,9 @@ static int tas571x_set_bias_level(struct snd_soc_codec *codec,
return ret;
}
}

gpiod_set_value(priv->pdn_gpio, 0);
usleep_range(5000, 6000);

regcache_cache_only(priv->regmap, false);
ret = regcache_sync(priv->regmap);
if (ret)
return ret;
}
break;
case SND_SOC_BIAS_OFF:
regcache_cache_only(priv->regmap, true);
gpiod_set_value(priv->pdn_gpio, 1);

if (!IS_ERR(priv->mclk))
clk_disable_unprepare(priv->mclk);
break;
Expand Down Expand Up @@ -401,16 +390,6 @@ static const struct snd_kcontrol_new tas5711_controls[] = {
TAS571X_SOFT_MUTE_REG,
TAS571X_SOFT_MUTE_CH1_SHIFT, TAS571X_SOFT_MUTE_CH2_SHIFT,
1, 1),

SOC_DOUBLE_R_RANGE("CH1 Mixer Volume",
TAS5717_CH1_LEFT_CH_MIX_REG,
TAS5717_CH1_RIGHT_CH_MIX_REG,
16, 0, 0x80, 0),

SOC_DOUBLE_R_RANGE("CH2 Mixer Volume",
TAS5717_CH2_LEFT_CH_MIX_REG,
TAS5717_CH2_RIGHT_CH_MIX_REG,
16, 0, 0x80, 0),
};

static const struct regmap_range tas571x_readonly_regs_range[] = {
Expand Down Expand Up @@ -488,6 +467,16 @@ static const struct snd_kcontrol_new tas5717_controls[] = {
TAS571X_SOFT_MUTE_CH1_SHIFT, TAS571X_SOFT_MUTE_CH2_SHIFT,
1, 1),

SOC_DOUBLE_R_RANGE("CH1 Mixer Volume",
TAS5717_CH1_LEFT_CH_MIX_REG,
TAS5717_CH1_RIGHT_CH_MIX_REG,
16, 0, 0x80, 0),

SOC_DOUBLE_R_RANGE("CH2 Mixer Volume",
TAS5717_CH2_LEFT_CH_MIX_REG,
TAS5717_CH2_RIGHT_CH_MIX_REG,
16, 0, 0x80, 0),

/*
* The biquads are named according to the register names.
* Please note that TI's TAS57xx Graphical Development Environment
Expand Down Expand Up @@ -747,13 +736,14 @@ static int tas571x_i2c_probe(struct i2c_client *client,
/* pulse the active low reset line for ~100us */
usleep_range(100, 200);
gpiod_set_value(priv->reset_gpio, 0);
usleep_range(12000, 20000);
usleep_range(13500, 20000);
}

ret = regmap_write(priv->regmap, TAS571X_OSC_TRIM_REG, 0);
if (ret)
return ret;

usleep_range(50000, 60000);

memcpy(&priv->codec_driver, &tas571x_codec, sizeof(priv->codec_driver));
priv->codec_driver.component_driver.controls = priv->chip->controls;
Expand All @@ -770,9 +760,6 @@ static int tas571x_i2c_probe(struct i2c_client *client,
return ret;
}

regcache_cache_only(priv->regmap, true);
gpiod_set_value(priv->pdn_gpio, 1);

return snd_soc_register_codec(&client->dev, &priv->codec_driver,
&tas571x_dai, 1);
}
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/samsung/ac97.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,11 +383,6 @@ static int s3c_ac97_probe(struct platform_device *pdev)
goto err4;
}

ret = devm_snd_soc_register_component(&pdev->dev, &s3c_ac97_component,
s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai));
if (ret)
goto err5;

ret = samsung_asoc_dma_platform_register(&pdev->dev,
ac97_pdata->dma_filter,
NULL, NULL);
Expand All @@ -396,6 +391,11 @@ static int s3c_ac97_probe(struct platform_device *pdev)
goto err5;
}

ret = devm_snd_soc_register_component(&pdev->dev, &s3c_ac97_component,
s3c_ac97_dai, ARRAY_SIZE(s3c_ac97_dai));
if (ret)
goto err5;

return 0;
err5:
free_irq(irq_res->start, NULL);
Expand Down
19 changes: 10 additions & 9 deletions sound/soc/samsung/i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,14 +1237,14 @@ static int samsung_i2s_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Unable to get drvdata\n");
return -EFAULT;
}
ret = devm_snd_soc_register_component(&sec_dai->pdev->dev,
&samsung_i2s_component,
&sec_dai->i2s_dai_drv, 1);
ret = samsung_asoc_dma_platform_register(&pdev->dev,
sec_dai->filter, "tx-sec", NULL);
if (ret != 0)
return ret;

return samsung_asoc_dma_platform_register(&pdev->dev,
sec_dai->filter, "tx-sec", NULL);
return devm_snd_soc_register_component(&sec_dai->pdev->dev,
&samsung_i2s_component,
&sec_dai->i2s_dai_drv, 1);
}

pri_dai = i2s_alloc_dai(pdev, false);
Expand Down Expand Up @@ -1314,6 +1314,11 @@ static int samsung_i2s_probe(struct platform_device *pdev)
if (quirks & QUIRK_PRI_6CHAN)
pri_dai->i2s_dai_drv.playback.channels_max = 6;

ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
NULL, NULL);
if (ret < 0)
goto err_disable_clk;

if (quirks & QUIRK_SEC_DAI) {
sec_dai = i2s_alloc_dai(pdev, true);
if (!sec_dai) {
Expand Down Expand Up @@ -1353,10 +1358,6 @@ static int samsung_i2s_probe(struct platform_device *pdev)
if (ret < 0)
goto err_free_dai;

ret = samsung_asoc_dma_platform_register(&pdev->dev, pri_dai->filter,
NULL, NULL);
if (ret < 0)
goto err_free_dai;

pm_runtime_enable(&pdev->dev);

Expand Down
19 changes: 10 additions & 9 deletions sound/soc/samsung/pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -565,24 +565,25 @@ static int s3c_pcm_dev_probe(struct platform_device *pdev)
pcm->dma_capture = &s3c_pcm_stereo_in[pdev->id];
pcm->dma_playback = &s3c_pcm_stereo_out[pdev->id];

ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
NULL, NULL);
if (ret) {
dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
goto err5;
}

pm_runtime_enable(&pdev->dev);

ret = devm_snd_soc_register_component(&pdev->dev, &s3c_pcm_component,
&s3c_pcm_dai[pdev->id], 1);
if (ret != 0) {
dev_err(&pdev->dev, "failed to get register DAI: %d\n", ret);
goto err5;
}

ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
NULL, NULL);
if (ret) {
dev_err(&pdev->dev, "failed to get register DMA: %d\n", ret);
goto err5;
goto err6;
}

return 0;

err6:
pm_runtime_disable(&pdev->dev);
err5:
clk_disable_unprepare(pcm->pclk);
err4:
Expand Down
16 changes: 8 additions & 8 deletions sound/soc/samsung/s3c2412-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,19 +168,19 @@ static int s3c2412_iis_dev_probe(struct platform_device *pdev)
s3c2412_i2s_pcm_stereo_in.addr = res->start + S3C2412_IISRXD;
s3c2412_i2s_pcm_stereo_in.filter_data = pdata->dma_capture;

ret = s3c_i2sv2_register_component(&pdev->dev, -1,
&s3c2412_i2s_component,
&s3c2412_i2s_dai);
ret = samsung_asoc_dma_platform_register(&pdev->dev,
pdata->dma_filter,
NULL, NULL);
if (ret) {
pr_err("failed to register the dai\n");
pr_err("failed to register the DMA: %d\n", ret);
return ret;
}

ret = samsung_asoc_dma_platform_register(&pdev->dev,
pdata->dma_filter,
NULL, NULL);
ret = s3c_i2sv2_register_component(&pdev->dev, -1,
&s3c2412_i2s_component,
&s3c2412_i2s_dai);
if (ret)
pr_err("failed to register the DMA: %d\n", ret);
pr_err("failed to register the dai\n");

return ret;
}
Expand Down
14 changes: 7 additions & 7 deletions sound/soc/samsung/s3c24xx-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -474,18 +474,18 @@ static int s3c24xx_iis_dev_probe(struct platform_device *pdev)
s3c24xx_i2s_pcm_stereo_in.addr = res->start + S3C2410_IISFIFO;
s3c24xx_i2s_pcm_stereo_in.filter_data = pdata->dma_capture;

ret = devm_snd_soc_register_component(&pdev->dev,
&s3c24xx_i2s_component, &s3c24xx_i2s_dai, 1);
ret = samsung_asoc_dma_platform_register(&pdev->dev,
pdata->dma_filter,
NULL, NULL);
if (ret) {
pr_err("failed to register the dai\n");
pr_err("failed to register the dma: %d\n", ret);
return ret;
}

ret = samsung_asoc_dma_platform_register(&pdev->dev,
pdata->dma_filter,
NULL, NULL);
ret = devm_snd_soc_register_component(&pdev->dev,
&s3c24xx_i2s_component, &s3c24xx_i2s_dai, 1);
if (ret)
pr_err("failed to register the dma: %d\n", ret);
pr_err("failed to register the dai\n");

return ret;
}
Expand Down
19 changes: 9 additions & 10 deletions sound/soc/samsung/spdif.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,23 +416,13 @@ static int spdif_probe(struct platform_device *pdev)
goto err3;
}

dev_set_drvdata(&pdev->dev, spdif);

ret = devm_snd_soc_register_component(&pdev->dev,
&samsung_spdif_component, &samsung_spdif_dai, 1);
if (ret != 0) {
dev_err(&pdev->dev, "fail to register dai\n");
goto err4;
}

spdif_stereo_out.addr_width = 2;
spdif_stereo_out.addr = mem_res->start + DATA_OUTBUF;
filter = NULL;
if (spdif_pdata) {
spdif_stereo_out.filter_data = spdif_pdata->dma_playback;
filter = spdif_pdata->dma_filter;
}

spdif->dma_playback = &spdif_stereo_out;

ret = samsung_asoc_dma_platform_register(&pdev->dev, filter,
Expand All @@ -442,6 +432,15 @@ static int spdif_probe(struct platform_device *pdev)
goto err4;
}

dev_set_drvdata(&pdev->dev, spdif);

ret = devm_snd_soc_register_component(&pdev->dev,
&samsung_spdif_component, &samsung_spdif_dai, 1);
if (ret != 0) {
dev_err(&pdev->dev, "fail to register dai\n");
goto err4;
}

return 0;
err4:
iounmap(spdif->regs);
Expand Down
6 changes: 5 additions & 1 deletion sound/soc/sti/uniperif_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,11 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol,
iec958->status[3] = ucontrol->value.iec958.status[3];
mutex_unlock(&player->ctrl_lock);

uni_player_set_channel_status(player, NULL);
if (player->substream && player->substream->runtime)
uni_player_set_channel_status(player,
player->substream->runtime);
else
uni_player_set_channel_status(player, NULL);

return 0;
}
Expand Down
19 changes: 10 additions & 9 deletions sound/soc/sunxi/sun4i-codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -765,11 +765,11 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev)

card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL);
if (!card)
return NULL;
return ERR_PTR(-ENOMEM);

card->dai_link = sun4i_codec_create_link(dev, &card->num_links);
if (!card->dai_link)
return NULL;
return ERR_PTR(-ENOMEM);

card->dev = dev;
card->name = "sun4i-codec";
Expand Down Expand Up @@ -829,12 +829,6 @@ static int sun4i_codec_probe(struct platform_device *pdev)
return PTR_ERR(scodec->clk_module);
}

/* Enable the bus clock */
if (clk_prepare_enable(scodec->clk_apb)) {
dev_err(&pdev->dev, "Failed to enable the APB clock\n");
return -EINVAL;
}

scodec->gpio_pa = devm_gpiod_get_optional(&pdev->dev, "allwinner,pa",
GPIOD_OUT_LOW);
if (IS_ERR(scodec->gpio_pa)) {
Expand All @@ -844,6 +838,12 @@ static int sun4i_codec_probe(struct platform_device *pdev)
return ret;
}

/* Enable the bus clock */
if (clk_prepare_enable(scodec->clk_apb)) {
dev_err(&pdev->dev, "Failed to enable the APB clock\n");
return -EINVAL;
}

/* DMA configuration for TX FIFO */
scodec->playback_dma_data.addr = res->start + SUN4I_CODEC_DAC_TXDATA;
scodec->playback_dma_data.maxburst = 4;
Expand Down Expand Up @@ -876,7 +876,8 @@ static int sun4i_codec_probe(struct platform_device *pdev)
}

card = sun4i_codec_create_card(&pdev->dev);
if (!card) {
if (IS_ERR(card)) {
ret = PTR_ERR(card);
dev_err(&pdev->dev, "Failed to create our card\n");
goto err_unregister_codec;
}
Expand Down

0 comments on commit 3dfd2b6

Please sign in to comment.