diff --git a/sound/soc/apple/t8020-speakers.c b/sound/soc/apple/t8020-speakers.c index dbd1f43be04ada..21a013de6d2ab0 100644 --- a/sound/soc/apple/t8020-speakers.c +++ b/sound/soc/apple/t8020-speakers.c @@ -204,6 +204,8 @@ static int t8020_mic_links(struct device *dev, struct t8020_speakers *sp) fe->init = t8020_mic_fe_init; fe->ops = &t8020_speakers_fe_ops; fe->trigger[1] = SND_SOC_DPCM_TRIGGER_POST; + /* offer only the sample formats the codec sends (24 bits in 32) */ + fe->dpcm_merged_format = 1; be->name = "Microphone Codec"; be->cpus = &mic->be_cpu; @@ -318,6 +320,8 @@ static int t8020_speakers_probe(struct platform_device *pdev) fe->init = t8020_speakers_fe_init; fe->ops = &t8020_speakers_fe_ops; fe->trigger[0] = SND_SOC_DPCM_TRIGGER_POST; + /* offer only the sample formats the amplifiers take (16 and 24 bits) */ + fe->dpcm_merged_format = 1; be = &sp->links[1]; be->name = "Speaker Amplifiers"; diff --git a/sound/soc/codecs/cs42l75.c b/sound/soc/codecs/cs42l75.c index 6f24a89cef00d5..8d77fb007569b5 100644 --- a/sound/soc/codecs/cs42l75.c +++ b/sound/soc/codecs/cs42l75.c @@ -725,7 +725,11 @@ static struct snd_soc_dai_driver cs42l75_dai = { .channels_min = 1, .channels_max = 4, .rates = SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FMTBIT_S24_LE | SNDRV_PCM_FMTBIT_S32_LE, + /* + * The codec sends 24 bits; the A12's MCA receives only their top 16 + * correctly so far (24 and 32-bit captures came out as garbage). + */ + .formats = SNDRV_PCM_FMTBIT_S16_LE, }, }; @@ -760,23 +764,28 @@ static int cs42l75_probe(struct spi_device *spi) * The speaker path runs through the CLP, which drives ASP1, the * amplifiers' bus; it takes its firmware once the codec runs on MCLK * with its power up. Right after boot the codec has been seen to lose - * the bus as it leaves its oscillator for MCLK; a reset and a second - * start bring it up. + * the bus as it leaves its oscillator for MCLK, and the CLP not to + * boot (state 08) when the codec starts right after the AOP, whose + * MCLK2 it needs: a reset and another start bring both up. */ for (try = 0; try < 3; try++) { + if (try) + msleep(200); ret = cs42l75_wake(cs); if (ret) return dev_err_probe(dev, ret, "no CS42L75\n"); ret = cs42l75_run(cs, cs42l75_power_ops, ARRAY_SIZE(cs42l75_power_ops)); - if (!ret) + if (ret) { + dev_dbg(dev, "codec start failed (%d), starting again\n", ret); + continue; + } + ret = cs42l75_clp_boot(cs); + if (ret != -ETIMEDOUT) break; - msleep(50); + dev_info(dev, "CLP did not boot, starting the codec again\n"); } if (ret) - return dev_err_probe(dev, ret, "codec start\n"); - ret = cs42l75_clp_boot(cs); - if (ret) - return dev_err_probe(dev, ret, "CLP (%s)\n", CLP_FW_NAME); + return dev_err_probe(dev, ret, "codec start (%s)\n", CLP_FW_NAME); ret = cs42l75_run(cs, cs42l75_speaker_ops, ARRAY_SIZE(cs42l75_speaker_ops)); if (ret) return dev_err_probe(dev, ret, "speaker path\n");