mirror of https://gitee.com/openkylin/linux.git
Merge branch 'for-5.2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.3
This commit is contained in:
commit
a41016e403
|
@ -304,7 +304,10 @@ static int ak4458_rstn_control(struct snd_soc_component *component, int bit)
|
|||
AK4458_00_CONTROL1,
|
||||
AK4458_RSTN_MASK,
|
||||
0x0);
|
||||
return ret;
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ak4458_hw_params(struct snd_pcm_substream *substream,
|
||||
|
@ -536,9 +539,10 @@ static void ak4458_power_on(struct ak4458_priv *ak4458)
|
|||
}
|
||||
}
|
||||
|
||||
static void ak4458_init(struct snd_soc_component *component)
|
||||
static int ak4458_init(struct snd_soc_component *component)
|
||||
{
|
||||
struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
|
||||
int ret;
|
||||
|
||||
/* External Mute ON */
|
||||
if (ak4458->mute_gpiod)
|
||||
|
@ -546,21 +550,21 @@ static void ak4458_init(struct snd_soc_component *component)
|
|||
|
||||
ak4458_power_on(ak4458);
|
||||
|
||||
snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
|
||||
ret = snd_soc_component_update_bits(component, AK4458_00_CONTROL1,
|
||||
0x80, 0x80); /* ACKS bit = 1; 10000000 */
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ak4458_rstn_control(component, 1);
|
||||
return ak4458_rstn_control(component, 1);
|
||||
}
|
||||
|
||||
static int ak4458_probe(struct snd_soc_component *component)
|
||||
{
|
||||
struct ak4458_priv *ak4458 = snd_soc_component_get_drvdata(component);
|
||||
|
||||
ak4458_init(component);
|
||||
|
||||
ak4458->fs = 48000;
|
||||
|
||||
return 0;
|
||||
return ak4458_init(component);
|
||||
}
|
||||
|
||||
static void ak4458_remove(struct snd_soc_component *component)
|
||||
|
|
|
@ -60,7 +60,7 @@ static const struct reg_default cs4265_reg_defaults[] = {
|
|||
static bool cs4265_readable_register(struct device *dev, unsigned int reg)
|
||||
{
|
||||
switch (reg) {
|
||||
case CS4265_CHIP_ID ... CS4265_SPDIF_CTL2:
|
||||
case CS4265_CHIP_ID ... CS4265_MAX_REGISTER:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
|
|
@ -569,6 +569,7 @@ static int cs42xx8_runtime_resume(struct device *dev)
|
|||
msleep(5);
|
||||
|
||||
regcache_cache_only(cs42xx8->regmap, false);
|
||||
regcache_mark_dirty(cs42xx8->regmap);
|
||||
|
||||
ret = regcache_sync(cs42xx8->regmap);
|
||||
if (ret) {
|
||||
|
|
|
@ -103,7 +103,7 @@ static void rt5677_spi_reverse(u8 *dst, u32 dstlen, const u8 *src, u32 srclen)
|
|||
u32 word_size = min_t(u32, dstlen, 8);
|
||||
|
||||
for (w = 0; w < dstlen; w += word_size) {
|
||||
for (i = 0; i < word_size; i++) {
|
||||
for (i = 0; i < word_size && i + w < dstlen; i++) {
|
||||
si = w + word_size - i - 1;
|
||||
dst[w + i] = si < srclen ? src[si] : 0;
|
||||
}
|
||||
|
@ -154,8 +154,9 @@ int rt5677_spi_read(u32 addr, void *rxbuf, size_t len)
|
|||
status |= spi_sync(g_spi, &m);
|
||||
mutex_unlock(&spi_mutex);
|
||||
|
||||
|
||||
/* Copy data back to caller buffer */
|
||||
rt5677_spi_reverse(cb + offset, t[1].len, body, t[1].len);
|
||||
rt5677_spi_reverse(cb + offset, len - offset, body, t[1].len);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
|
|
@ -311,8 +311,8 @@ static int fsl_asrc_config_pair(struct fsl_asrc_pair *pair)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if ((outrate > 8000 && outrate < 30000) &&
|
||||
(outrate/inrate > 24 || inrate/outrate > 8)) {
|
||||
if ((outrate >= 8000 && outrate <= 30000) &&
|
||||
(outrate > 24 * inrate || inrate > 8 * outrate)) {
|
||||
pair_err("exceed supported ratio range [1/24, 8] for \
|
||||
inrate/outrate: %d/%d\n", inrate, outrate);
|
||||
return -EINVAL;
|
||||
|
|
|
@ -283,11 +283,6 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
|
|||
codec_dai =
|
||||
dai_props->codec_dai = &priv->dais[li->dais++];
|
||||
|
||||
ret = asoc_simple_parse_daifmt(dev, node, codec,
|
||||
prefix, &dai_link->dai_fmt);
|
||||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
||||
simple_parse_mclk_fs(top, cpu, codec, dai_props, prefix);
|
||||
|
||||
ret = asoc_simple_parse_cpu(cpu, dai_link, &single_cpu);
|
||||
|
@ -298,6 +293,11 @@ static int simple_dai_link_of(struct asoc_simple_priv *priv,
|
|||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
||||
ret = asoc_simple_parse_daifmt(dev, node, dai_link->codecs->of_node,
|
||||
prefix, &dai_link->dai_fmt);
|
||||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
||||
ret = asoc_simple_parse_platform(plat, dai_link);
|
||||
if (ret < 0)
|
||||
goto dai_link_of_err;
|
||||
|
|
|
@ -29,9 +29,10 @@
|
|||
#define SOF_RT5682_MCLK_EN BIT(3)
|
||||
#define SOF_RT5682_MCLK_24MHZ BIT(4)
|
||||
#define SOF_SPEAKER_AMP_PRESENT BIT(5)
|
||||
#define SOF_RT5682_SSP_AMP(quirk) ((quirk) & GENMASK(8, 6))
|
||||
#define SOF_RT5682_SSP_AMP_MASK (GENMASK(8, 6))
|
||||
#define SOF_RT5682_SSP_AMP_SHIFT 6
|
||||
#define SOF_RT5682_SSP_AMP_MASK (GENMASK(8, 6))
|
||||
#define SOF_RT5682_SSP_AMP(quirk) \
|
||||
(((quirk) << SOF_RT5682_SSP_AMP_SHIFT) & SOF_RT5682_SSP_AMP_MASK)
|
||||
|
||||
/* Default: MCLK on, MCLK 19.2M, SSP0 */
|
||||
static unsigned long sof_rt5682_quirk = SOF_RT5682_MCLK_EN |
|
||||
|
@ -144,9 +145,9 @@ static int sof_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
|
|||
jack = &ctx->sof_headset;
|
||||
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
|
||||
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
|
||||
ret = snd_soc_component_set_jack(component, jack, NULL);
|
||||
|
||||
if (ret) {
|
||||
|
|
|
@ -28,12 +28,6 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
|
|||
.sof_fw_filename = "sof-cnl.ri",
|
||||
.sof_tplg_filename = "sof-cnl-rt274.tplg",
|
||||
},
|
||||
{
|
||||
.id = "10EC5682",
|
||||
.drv_name = "sof_rt5682",
|
||||
.sof_fw_filename = "sof-cnl.ri",
|
||||
.sof_tplg_filename = "sof-cml-rt5682.tplg",
|
||||
},
|
||||
{
|
||||
.id = "MX98357A",
|
||||
.drv_name = "sof_rt5682",
|
||||
|
@ -41,6 +35,12 @@ struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_machines[] = {
|
|||
.sof_fw_filename = "sof-cnl.ri",
|
||||
.sof_tplg_filename = "sof-cml-rt5682-max98357a.tplg",
|
||||
},
|
||||
{
|
||||
.id = "10EC5682",
|
||||
.drv_name = "sof_rt5682",
|
||||
.sof_fw_filename = "sof-cnl.ri",
|
||||
.sof_tplg_filename = "sof-cml-rt5682.tplg",
|
||||
},
|
||||
|
||||
{},
|
||||
};
|
||||
|
|
|
@ -3831,8 +3831,8 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
|
|||
ret);
|
||||
goto out;
|
||||
}
|
||||
source->active++;
|
||||
}
|
||||
source->active++;
|
||||
ret = soc_dai_hw_params(&substream, params, source);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
@ -3853,8 +3853,8 @@ static int snd_soc_dai_link_event(struct snd_soc_dapm_widget *w,
|
|||
ret);
|
||||
goto out;
|
||||
}
|
||||
sink->active++;
|
||||
}
|
||||
sink->active++;
|
||||
ret = soc_dai_hw_params(&substream, params, sink);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
|
|
@ -2495,7 +2495,8 @@ int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream)
|
|||
|
||||
if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) &&
|
||||
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP) &&
|
||||
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND))
|
||||
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_SUSPEND) &&
|
||||
(be->dpcm[stream].state != SND_SOC_DPCM_STATE_PAUSED))
|
||||
continue;
|
||||
|
||||
dev_dbg(be->dev, "ASoC: prepare BE %s\n",
|
||||
|
|
|
@ -44,7 +44,10 @@ config SND_SOC_SOF_OPTIONS
|
|||
if SND_SOC_SOF_OPTIONS
|
||||
|
||||
config SND_SOC_SOF_NOCODEC
|
||||
tristate "SOF nocodec mode Support"
|
||||
tristate
|
||||
|
||||
config SND_SOC_SOF_NOCODEC_SUPPORT
|
||||
bool "SOF nocodec mode support"
|
||||
help
|
||||
This adds support for a dummy/nocodec machine driver fallback
|
||||
option if no known codec is detected. This is typically only
|
||||
|
@ -80,7 +83,7 @@ if SND_SOC_SOF_DEBUG
|
|||
|
||||
config SND_SOC_SOF_FORCE_NOCODEC_MODE
|
||||
bool "SOF force nocodec Mode"
|
||||
depends on SND_SOC_SOF_NOCODEC
|
||||
depends on SND_SOC_SOF_NOCODEC_SUPPORT
|
||||
help
|
||||
This forces SOF to use dummy/nocodec as machine driver, even
|
||||
though there is a codec detected on the real platform. This is
|
||||
|
@ -135,6 +138,7 @@ endif ## SND_SOC_SOF_OPTIONS
|
|||
config SND_SOC_SOF
|
||||
tristate
|
||||
select SND_SOC_TOPOLOGY
|
||||
select SND_SOC_SOF_NOCODEC if SND_SOC_SOF_NOCODEC_SUPPORT
|
||||
help
|
||||
This option is not user-selectable but automagically handled by
|
||||
'select' statements at a higher level
|
||||
|
|
|
@ -115,7 +115,7 @@ static void ipc_log_header(struct device *dev, u8 *text, u32 cmd)
|
|||
}
|
||||
break;
|
||||
case SOF_IPC_GLB_COMP_MSG:
|
||||
str = "GLB_COMP_MSG: SET_VALUE";
|
||||
str = "GLB_COMP_MSG";
|
||||
switch (type) {
|
||||
case SOF_IPC_COMP_SET_VALUE:
|
||||
str2 = "SET_VALUE"; break;
|
||||
|
|
|
@ -372,6 +372,8 @@ int snd_sof_run_firmware(struct snd_sof_dev *sdev)
|
|||
msecs_to_jiffies(sdev->boot_timeout));
|
||||
if (ret == 0) {
|
||||
dev_err(sdev->dev, "error: firmware boot failure\n");
|
||||
/* after this point FW_READY msg should be ignored */
|
||||
sdev->boot_complete = true;
|
||||
snd_sof_dsp_dbg_dump(sdev, SOF_DBG_REGS | SOF_DBG_MBOX |
|
||||
SOF_DBG_TEXT | SOF_DBG_PCI);
|
||||
return -EIO;
|
||||
|
|
Loading…
Reference in New Issue