mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
ASoC: Fixes for v7.2
A fairly standard collection of device specific fixes and quirks, nothing particularly remarkable. -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpZCbcACgkQJNaLcl1U h9CeFAf/T3Ii6Pe4rhJE1WRD4TEsRRFgtjnSiaU8mLosmR5aw1M35eN4Cz67gG9s I4Y0yp7dqYEsvB1rk0fpsvffPWdRmaD297e8IfT9cO0gysEPaiJkTwjWpNv7U1Jx oH/Bt8DPWRinhReRkNLnuSciMMcoqKPAwDA0ruVXsO4aYDD5Y1aNJbvRBI/Qx1i+ a//kM0RVA6/SbnQbhHYlXXWpC6NrWMZaX3m7zx/+4WoPQpNkA1Jw57kW+H7YDvpq LM6+0lQiVPOUO7+Dt6uIYmHUJ5gK9Z9P3g7lRrSKk9zOUA0i1gPySn2pykkb4vUG 1WAw/XXnOAxFYBZMaUcriLwoL5kWew== =QT3F -----END PGP SIGNATURE----- Merge tag 'asoc-fix-v7.2-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Fixes for v7.2 A fairly standard collection of device specific fixes and quirks, nothing particularly remarkable.
This commit is contained in:
commit
2eb79cb87b
|
|
@ -44,6 +44,18 @@ static const struct dmi_system_id acp70_acpi_flag_override_table[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "83W5"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "TUF Gaming A14 FA401EA"),
|
||||
},
|
||||
},
|
||||
{
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC"),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Vivobook 18 M1807GA"),
|
||||
},
|
||||
},
|
||||
{}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -521,6 +521,13 @@ static const struct dmi_system_id yc_acp_quirk_table[] = {
|
|||
DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WHG"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
DMI_MATCH(DMI_BOARD_VENDOR, "Micro-Star International Co., Ltd."),
|
||||
DMI_MATCH(DMI_PRODUCT_NAME, "Vector A16 HX A8WIG"),
|
||||
}
|
||||
},
|
||||
{
|
||||
.driver_data = &acp6x_card,
|
||||
.matches = {
|
||||
|
|
|
|||
|
|
@ -17,11 +17,17 @@ static const struct snd_soc_dapm_widget bt_sco_widgets[] = {
|
|||
SND_SOC_NOPM, 0, 0),
|
||||
SND_SOC_DAPM_AIF_OUT("BT_SCO_TX", "Capture", 0,
|
||||
SND_SOC_NOPM, 0, 0),
|
||||
SND_SOC_DAPM_AIF_IN("BT_SCO_RX_WB", "WB Playback", 0,
|
||||
SND_SOC_NOPM, 0, 0),
|
||||
SND_SOC_DAPM_AIF_OUT("BT_SCO_TX_WB", "WB Capture", 0,
|
||||
SND_SOC_NOPM, 0, 0),
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_route bt_sco_routes[] = {
|
||||
{ "BT_SCO_TX", NULL, "RX" },
|
||||
{ "TX", NULL, "BT_SCO_RX" },
|
||||
{ "BT_SCO_TX_WB", NULL, "RX" },
|
||||
{ "TX", NULL, "BT_SCO_RX_WB" },
|
||||
};
|
||||
|
||||
static struct snd_soc_dai_driver bt_sco_dai[] = {
|
||||
|
|
@ -45,14 +51,14 @@ static struct snd_soc_dai_driver bt_sco_dai[] = {
|
|||
{
|
||||
.name = "bt-sco-pcm-wb",
|
||||
.playback = {
|
||||
.stream_name = "Playback",
|
||||
.stream_name = "WB Playback",
|
||||
.channels_min = 1,
|
||||
.channels_max = 1,
|
||||
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
|
||||
.formats = SNDRV_PCM_FMTBIT_S16_LE,
|
||||
},
|
||||
.capture = {
|
||||
.stream_name = "Capture",
|
||||
.stream_name = "WB Capture",
|
||||
.channels_min = 1,
|
||||
.channels_max = 1,
|
||||
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000,
|
||||
|
|
|
|||
|
|
@ -55,9 +55,7 @@ static int cs35l56_i2c_probe(struct i2c_client *client)
|
|||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
ret = cs35l56_init(cs35l56);
|
||||
if (ret == 0)
|
||||
ret = cs35l56_irq_request(&cs35l56->base, client->irq);
|
||||
ret = cs35l56_irq_request(&cs35l56->base, client->irq);
|
||||
if (ret < 0)
|
||||
cs35l56_remove(cs35l56);
|
||||
|
||||
|
|
|
|||
|
|
@ -44,9 +44,7 @@ static int cs35l56_spi_probe(struct spi_device *spi)
|
|||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
ret = cs35l56_init(cs35l56);
|
||||
if (ret == 0)
|
||||
ret = cs35l56_irq_request(&cs35l56->base, spi->irq);
|
||||
ret = cs35l56_irq_request(&cs35l56->base, spi->irq);
|
||||
if (ret < 0)
|
||||
cs35l56_remove(cs35l56);
|
||||
|
||||
|
|
|
|||
|
|
@ -2008,6 +2008,16 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
|
|||
goto err;
|
||||
}
|
||||
|
||||
/*
|
||||
* On SoundWire the cs35l56_init() cannot be run until after the
|
||||
* device has been enumerated by the SoundWire core.
|
||||
*/
|
||||
if (!cs35l56->sdw_peripheral) {
|
||||
ret = cs35l56_init(cs35l56);
|
||||
if (ret)
|
||||
goto err_remove_wm_adsp;
|
||||
}
|
||||
|
||||
ret = snd_soc_register_component(cs35l56->base.dev,
|
||||
&soc_component_dev_cs35l56,
|
||||
cs35l56_dai, ARRAY_SIZE(cs35l56_dai));
|
||||
|
|
@ -2022,6 +2032,11 @@ int cs35l56_common_probe(struct cs35l56_private *cs35l56)
|
|||
wm_adsp2_remove(&cs35l56->dsp);
|
||||
|
||||
err:
|
||||
if (pm_runtime_enabled(cs35l56->base.dev)) {
|
||||
pm_runtime_dont_use_autosuspend(cs35l56->base.dev);
|
||||
pm_runtime_disable(cs35l56->base.dev);
|
||||
}
|
||||
|
||||
gpiod_set_value_cansleep(cs35l56->base.reset_gpio, 0);
|
||||
regulator_bulk_disable(ARRAY_SIZE(cs35l56->supplies), cs35l56->supplies);
|
||||
|
||||
|
|
@ -2108,7 +2123,7 @@ int cs35l56_init(struct cs35l56_private *cs35l56)
|
|||
return dev_err_probe(cs35l56->base.dev, ret, "Failed to write ASP1_CONTROL3\n");
|
||||
|
||||
cs35l56->base.init_done = true;
|
||||
complete(&cs35l56->init_completion);
|
||||
complete_all(&cs35l56->init_completion);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -607,6 +607,7 @@ static int fs210x_init_chip(struct fs210x_priv *fs210x)
|
|||
|
||||
regcache_cache_bypass(fs210x->regmap, false);
|
||||
if (!ret) {
|
||||
regcache_cache_only(fs210x->regmap, false);
|
||||
regcache_mark_dirty(fs210x->regmap);
|
||||
regcache_sync(fs210x->regmap);
|
||||
fs210x->is_inited = true;
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
#include <linux/i2c.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/limits.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/of.h>
|
||||
#include <linux/of_irq.h>
|
||||
|
|
@ -1100,13 +1101,42 @@ static int tasdevice_load_block_kernel(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int tasdevice_fw_strnlen(const struct firmware *fmw, int offset)
|
||||
{
|
||||
const u8 *start;
|
||||
const u8 *nul;
|
||||
size_t remaining;
|
||||
size_t len;
|
||||
|
||||
if (offset < 0 || offset >= fmw->size)
|
||||
return -EINVAL;
|
||||
|
||||
start = fmw->data + offset;
|
||||
remaining = fmw->size - offset;
|
||||
nul = memchr(start, '\0', remaining);
|
||||
if (!nul)
|
||||
return -EINVAL;
|
||||
|
||||
len = nul - start;
|
||||
if (len > INT_MAX)
|
||||
return -EOVERFLOW;
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static int fw_parse_variable_hdr(struct tasdevice_priv
|
||||
*tas_priv, struct tasdevice_dspfw_hdr *fw_hdr,
|
||||
const struct firmware *fmw, int offset)
|
||||
{
|
||||
const unsigned char *buf = fmw->data;
|
||||
int len = strlen((char *)&buf[offset]);
|
||||
int len;
|
||||
|
||||
len = tasdevice_fw_strnlen(fmw, offset);
|
||||
if (len < 0) {
|
||||
dev_err(tas_priv->dev, "%s: Description error\n", __func__);
|
||||
offset = len;
|
||||
goto out;
|
||||
}
|
||||
len++;
|
||||
|
||||
if (offset + len + 8 > fmw->size) {
|
||||
|
|
@ -1238,7 +1268,12 @@ static int fw_parse_data(struct tasdevice_fw *tas_fmw,
|
|||
memcpy(img_data->name, &data[offset], 64);
|
||||
offset += 64;
|
||||
|
||||
n = strlen((char *)&data[offset]);
|
||||
n = tasdevice_fw_strnlen(fmw, offset);
|
||||
if (n < 0) {
|
||||
dev_err(tas_fmw->dev, "%s: Description error\n", __func__);
|
||||
offset = n;
|
||||
goto out;
|
||||
}
|
||||
n++;
|
||||
if (offset + n + 2 > fmw->size) {
|
||||
dev_err(tas_fmw->dev, "%s: Description error\n", __func__);
|
||||
|
|
@ -1309,7 +1344,12 @@ static int fw_parse_program_data(struct tasdevice_priv *tas_priv,
|
|||
}
|
||||
offset += 64;
|
||||
|
||||
n = strlen((char *)&buf[offset]);
|
||||
n = tasdevice_fw_strnlen(fmw, offset);
|
||||
if (n < 0) {
|
||||
dev_err(tas_priv->dev, "Description err\n");
|
||||
offset = n;
|
||||
goto out;
|
||||
}
|
||||
/* skip '\0' and 5 unused bytes */
|
||||
n += 6;
|
||||
if (offset + n > fmw->size) {
|
||||
|
|
@ -1372,7 +1412,12 @@ static int fw_parse_configuration_data(
|
|||
memcpy(config->name, &data[offset], 64);
|
||||
offset += 64;
|
||||
|
||||
n = strlen((char *)&data[offset]);
|
||||
n = tasdevice_fw_strnlen(fmw, offset);
|
||||
if (n < 0) {
|
||||
dev_err(tas_priv->dev, "Description err\n");
|
||||
offset = n;
|
||||
goto out;
|
||||
}
|
||||
n += 15;
|
||||
if (offset + n > fmw->size) {
|
||||
dev_err(tas_priv->dev, "Description err\n");
|
||||
|
|
@ -2134,7 +2179,8 @@ static int fw_parse_calibration_data(struct tasdevice_priv *tas_priv,
|
|||
{
|
||||
struct tasdevice_calibration *calibration;
|
||||
unsigned char *data = (unsigned char *)fmw->data;
|
||||
unsigned int i, n;
|
||||
unsigned int i;
|
||||
int n;
|
||||
|
||||
if (offset + 2 > fmw->size) {
|
||||
dev_err(tas_priv->dev, "%s: Calibrations error\n", __func__);
|
||||
|
|
@ -2166,7 +2212,12 @@ static int fw_parse_calibration_data(struct tasdevice_priv *tas_priv,
|
|||
calibration = &(tas_fmw->calibrations[i]);
|
||||
offset += 64;
|
||||
|
||||
n = strlen((char *)&data[offset]);
|
||||
n = tasdevice_fw_strnlen(fmw, offset);
|
||||
if (n < 0) {
|
||||
dev_err(tas_priv->dev, "Description err\n");
|
||||
offset = n;
|
||||
goto out;
|
||||
}
|
||||
/* skip '\0' and 2 unused bytes */
|
||||
n += 3;
|
||||
if (offset + n > fmw->size) {
|
||||
|
|
|
|||
|
|
@ -808,6 +808,8 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream,
|
|||
struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai);
|
||||
bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
|
||||
unsigned int ofs = sai->soc_data->reg_offset;
|
||||
int adir = tx ? RX : TX;
|
||||
int dir = tx ? TX : RX;
|
||||
|
||||
/* Clear xMR to avoid channel swap with mclk_with_tere enabled case */
|
||||
regmap_write(sai->regmap, FSL_SAI_xMR(tx), 0);
|
||||
|
|
@ -815,10 +817,29 @@ static int fsl_sai_hw_free(struct snd_pcm_substream *substream,
|
|||
regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx, ofs),
|
||||
FSL_SAI_CR3_TRCE_MASK, 0);
|
||||
|
||||
if (!sai->is_consumer_mode[tx] &&
|
||||
sai->mclk_streams & BIT(substream->stream)) {
|
||||
clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[tx]]);
|
||||
sai->mclk_streams &= ~BIT(substream->stream);
|
||||
if (!sai->is_consumer_mode[tx]) {
|
||||
bool adir_active = !!(sai->mclk_streams & BIT(!substream->stream));
|
||||
/*
|
||||
* If opposite stream provides clocks for synchronous mode and
|
||||
* it is inactive, Clear BYP and BCI
|
||||
*/
|
||||
if (fsl_sai_dir_is_synced(sai, adir) && !adir_active)
|
||||
regmap_update_bits(sai->regmap, FSL_SAI_xCR2(!tx, ofs),
|
||||
FSL_SAI_CR2_BCI | FSL_SAI_CR2_BYP, 0);
|
||||
/*
|
||||
* Clear BYP and BCI of current stream if either of:
|
||||
* 1. current stream doesn't provide clocks for synchronous mode
|
||||
* 2. current stream provides clocks for synchronous mode but no
|
||||
* more stream is active.
|
||||
*/
|
||||
if (!fsl_sai_dir_is_synced(sai, dir) || !adir_active)
|
||||
regmap_update_bits(sai->regmap, FSL_SAI_xCR2(tx, ofs),
|
||||
FSL_SAI_CR2_BCI | FSL_SAI_CR2_BYP, 0);
|
||||
|
||||
if (sai->mclk_streams & BIT(substream->stream)) {
|
||||
clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[tx]]);
|
||||
sai->mclk_streams &= ~BIT(substream->stream);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -496,11 +496,15 @@ static void imx_aif_shutdown(struct snd_pcm_substream *substream)
|
|||
struct snd_soc_dai *codec_dai;
|
||||
int i;
|
||||
|
||||
for_each_rtd_cpu_dais(rtd, i, cpu_dai)
|
||||
snd_soc_dai_set_sysclk(cpu_dai, 0, 0, SND_SOC_CLOCK_OUT);
|
||||
for_each_rtd_cpu_dais(rtd, i, cpu_dai) {
|
||||
if (!snd_soc_dai_active(cpu_dai))
|
||||
snd_soc_dai_set_sysclk(cpu_dai, 0, 0, SND_SOC_CLOCK_OUT);
|
||||
}
|
||||
|
||||
for_each_rtd_codec_dais(rtd, i, codec_dai)
|
||||
snd_soc_dai_set_sysclk(codec_dai, 0, 0, SND_SOC_CLOCK_IN);
|
||||
for_each_rtd_codec_dais(rtd, i, codec_dai) {
|
||||
if (!snd_soc_dai_active(codec_dai))
|
||||
snd_soc_dai_set_sysclk(codec_dai, 0, 0, SND_SOC_CLOCK_IN);
|
||||
}
|
||||
}
|
||||
|
||||
static const struct snd_soc_ops imx_aif_ops = {
|
||||
|
|
|
|||
|
|
@ -849,6 +849,8 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = {
|
|||
};
|
||||
|
||||
static const struct snd_pci_quirk sof_sdw_ssid_quirk_table[] = {
|
||||
SND_PCI_QUIRK(0x1028, 0x0e53, "Dell XPS WCL", SOC_SDW_SIDECAR_AMPS),
|
||||
SND_PCI_QUIRK(0x1028, 0x0e54, "Dell XPS PTL", SOC_SDW_SIDECAR_AMPS),
|
||||
SND_PCI_QUIRK(0x1043, 0x1e13, "ASUS Zenbook S14", SOC_SDW_CODEC_MIC),
|
||||
SND_PCI_QUIRK(0x1043, 0x1f43, "ASUS Zenbook S16", SOC_SDW_CODEC_MIC),
|
||||
SND_PCI_QUIRK(0x17aa, 0x2347, "Lenovo P16", SOC_SDW_CODEC_MIC),
|
||||
|
|
|
|||
|
|
@ -2237,6 +2237,7 @@ static const struct sun4i_codec_quirks sun50i_h616_codec_quirks = {
|
|||
.reg_dac_fifoc = REG_FIELD(SUN50I_H616_CODEC_DAC_FIFOC, 0, 31),
|
||||
.reg_dac_txdata = SUN8I_H3_CODEC_DAC_TXDATA,
|
||||
.has_reset = true,
|
||||
.playback_only = true,
|
||||
.dma_max_burst = SUN4I_DMA_MAX_BURST,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user