diff options
author | Takashi Iwai <tiwai@suse.de> | 2019-05-08 10:29:31 +0200 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2019-05-08 10:29:31 +0200 |
commit | 5095c418b939186c2eac4fabf14d0036656a8ab1 (patch) | |
tree | bacd65f786f8decc42525fe411d81c687ff38f52 /sound | |
parent | ALSA: hdea/realtek - Headset fixup for System76 Gazelle (gaze14) (diff) | |
parent | ASoC: SOF: core: fix undefined nocodec reference (diff) | |
download | linux-5095c418b939186c2eac4fabf14d0036656a8ab1.tar.xz linux-5095c418b939186c2eac4fabf14d0036656a8ab1.zip |
Merge tag 'asoc-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v5.2
A bunch of driver specific fixes that came in since the initial pull
request for v5.2, mainly warning fixes for the newly added Sound Open
Firmware code which people appeared to only start looking at after I'd
sent the pull request.
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/da7219.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/max98090.c | 12 | ||||
-rw-r--r-- | sound/soc/codecs/rt5677-spi.c | 35 | ||||
-rw-r--r-- | sound/soc/rockchip/rockchip_pdm.c | 2 | ||||
-rw-r--r-- | sound/soc/sof/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/sof/core.c | 10 | ||||
-rw-r--r-- | sound/soc/sof/intel/Kconfig | 2 | ||||
-rw-r--r-- | sound/soc/sof/ipc.c | 10 | ||||
-rw-r--r-- | sound/soc/sof/ops.c | 2 | ||||
-rw-r--r-- | sound/soc/stm/stm32_spdifrx.c | 5 |
10 files changed, 43 insertions, 39 deletions
diff --git a/sound/soc/codecs/da7219.c b/sound/soc/codecs/da7219.c index cf2948c00262..7d9d1f84eed8 100644 --- a/sound/soc/codecs/da7219.c +++ b/sound/soc/codecs/da7219.c @@ -2363,7 +2363,9 @@ err_disable_reg: static void da7219_remove(struct snd_soc_component *component) { struct da7219_priv *da7219 = snd_soc_component_get_drvdata(component); +#ifdef CONFIG_COMMON_CLK int i; +#endif da7219_aad_exit(component); diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 30c242c38d99..7619ea31ab50 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1194,14 +1194,14 @@ static const struct snd_soc_dapm_widget max98090_dapm_widgets[] = { &max98090_right_rcv_mixer_controls[0], ARRAY_SIZE(max98090_right_rcv_mixer_controls)), - SND_SOC_DAPM_MUX("LINMOD Mux", M98090_REG_LOUTR_MIXER, - M98090_LINMOD_SHIFT, 0, &max98090_linmod_mux), + SND_SOC_DAPM_MUX("LINMOD Mux", SND_SOC_NOPM, 0, 0, + &max98090_linmod_mux), - SND_SOC_DAPM_MUX("MIXHPLSEL Mux", M98090_REG_HP_CONTROL, - M98090_MIXHPLSEL_SHIFT, 0, &max98090_mixhplsel_mux), + SND_SOC_DAPM_MUX("MIXHPLSEL Mux", SND_SOC_NOPM, 0, 0, + &max98090_mixhplsel_mux), - SND_SOC_DAPM_MUX("MIXHPRSEL Mux", M98090_REG_HP_CONTROL, - M98090_MIXHPRSEL_SHIFT, 0, &max98090_mixhprsel_mux), + SND_SOC_DAPM_MUX("MIXHPRSEL Mux", SND_SOC_NOPM, 0, 0, + &max98090_mixhprsel_mux), SND_SOC_DAPM_PGA("HP Left Out", M98090_REG_OUTPUT_ENABLE, M98090_HPLEN_SHIFT, 0, NULL, 0), diff --git a/sound/soc/codecs/rt5677-spi.c b/sound/soc/codecs/rt5677-spi.c index 167a02773a0b..84b6bd8b50e1 100644 --- a/sound/soc/codecs/rt5677-spi.c +++ b/sound/soc/codecs/rt5677-spi.c @@ -58,13 +58,15 @@ static DEFINE_MUTEX(spi_mutex); * RT5677_SPI_READ/WRITE_32: Transfer 4 bytes * RT5677_SPI_READ/WRITE_BURST: Transfer any multiples of 8 bytes * - * For example, reading 260 bytes at 0x60030002 uses the following commands: - * 0x60030002 RT5677_SPI_READ_16 2 bytes + * Note: + * 16 Bit writes and reads are restricted to the address range + * 0x18020000 ~ 0x18021000 + * + * For example, reading 256 bytes at 0x60030004 uses the following commands: * 0x60030004 RT5677_SPI_READ_32 4 bytes * 0x60030008 RT5677_SPI_READ_BURST 240 bytes * 0x600300F8 RT5677_SPI_READ_BURST 8 bytes * 0x60030100 RT5677_SPI_READ_32 4 bytes - * 0x60030104 RT5677_SPI_READ_16 2 bytes * * Input: * @read: true for read commands; false for write commands @@ -79,15 +81,13 @@ static u8 rt5677_spi_select_cmd(bool read, u32 align, u32 remain, u32 *len) { u8 cmd; - if (align == 2 || align == 6 || remain == 2) { - cmd = RT5677_SPI_READ_16; - *len = 2; - } else if (align == 4 || remain <= 6) { + if (align == 4 || remain <= 4) { cmd = RT5677_SPI_READ_32; *len = 4; } else { cmd = RT5677_SPI_READ_BURST; - *len = min_t(u32, remain & ~7, RT5677_SPI_BURST_LEN); + *len = (((remain - 1) >> 3) + 1) << 3; + *len = min_t(u32, *len, RT5677_SPI_BURST_LEN); } return read ? cmd : cmd + 1; } @@ -108,7 +108,7 @@ static void rt5677_spi_reverse(u8 *dst, u32 dstlen, const u8 *src, u32 srclen) } } -/* Read DSP address space using SPI. addr and len have to be 2-byte aligned. */ +/* Read DSP address space using SPI. addr and len have to be 4-byte aligned. */ int rt5677_spi_read(u32 addr, void *rxbuf, size_t len) { u32 offset; @@ -124,7 +124,7 @@ int rt5677_spi_read(u32 addr, void *rxbuf, size_t len) if (!g_spi) return -ENODEV; - if ((addr & 1) || (len & 1)) { + if ((addr & 3) || (len & 3)) { dev_err(&g_spi->dev, "Bad read align 0x%x(%zu)\n", addr, len); return -EACCES; } @@ -159,13 +159,13 @@ int rt5677_spi_read(u32 addr, void *rxbuf, size_t len) } EXPORT_SYMBOL_GPL(rt5677_spi_read); -/* Write DSP address space using SPI. addr has to be 2-byte aligned. - * If len is not 2-byte aligned, an extra byte of zero is written at the end +/* Write DSP address space using SPI. addr has to be 4-byte aligned. + * If len is not 4-byte aligned, then extra zeros are written at the end * as padding. */ int rt5677_spi_write(u32 addr, const void *txbuf, size_t len) { - u32 offset, len_with_pad = len; + u32 offset; int status = 0; struct spi_transfer t; struct spi_message m; @@ -178,22 +178,19 @@ int rt5677_spi_write(u32 addr, const void *txbuf, size_t len) if (!g_spi) return -ENODEV; - if (addr & 1) { + if (addr & 3) { dev_err(&g_spi->dev, "Bad write align 0x%x(%zu)\n", addr, len); return -EACCES; } - if (len & 1) - len_with_pad = len + 1; - memset(&t, 0, sizeof(t)); t.tx_buf = buf; t.speed_hz = RT5677_SPI_FREQ; spi_message_init_with_transfers(&m, &t, 1); - for (offset = 0; offset < len_with_pad;) { + for (offset = 0; offset < len;) { spi_cmd = rt5677_spi_select_cmd(false, (addr + offset) & 7, - len_with_pad - offset, &t.len); + len - offset, &t.len); /* Construct SPI message header */ buf[0] = spi_cmd; diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c index 6c0f242db5ef..b9c1d8ad77c1 100644 --- a/sound/soc/rockchip/rockchip_pdm.c +++ b/sound/soc/rockchip/rockchip_pdm.c @@ -158,7 +158,7 @@ static int rockchip_pdm_hw_params(struct snd_pcm_substream *substream, struct rk_pdm_dev *pdm = to_info(dai); unsigned int val = 0; unsigned int clk_rate, clk_div, samplerate; - unsigned int clk_src, clk_out; + unsigned int clk_src, clk_out = 0; unsigned long m, n; bool change; int ret; diff --git a/sound/soc/sof/Kconfig b/sound/soc/sof/Kconfig index a1a9ffe605dc..b204c65698f9 100644 --- a/sound/soc/sof/Kconfig +++ b/sound/soc/sof/Kconfig @@ -28,7 +28,7 @@ config SND_SOC_SOF_ACPI select SND_SOC_ACPI if ACPI select SND_SOC_SOF_OPTIONS select SND_SOC_SOF_INTEL_ACPI if SND_SOC_SOF_INTEL_TOPLEVEL - select IOSF_MBI if X86 + select IOSF_MBI if X86 && PCI help This adds support for ACPI enumeration. This option is required to enable Intel Haswell/Broadwell/Baytrail/Cherrytrail devices diff --git a/sound/soc/sof/core.c b/sound/soc/sof/core.c index 39cbd84ff9c8..5ddbfa8f1a28 100644 --- a/sound/soc/sof/core.c +++ b/sound/soc/sof/core.c @@ -265,11 +265,10 @@ static int sof_machine_check(struct snd_sof_dev *sdev) if (plat_data->machine) return 0; - if (!IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC)) { - dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); - return -ENODEV; - } - +#if !IS_ENABLED(CONFIG_SND_SOC_SOF_NOCODEC) + dev_err(sdev->dev, "error: no matching ASoC machine driver found - aborting probe\n"); + return -ENODEV; +#else /* fallback to nocodec mode */ dev_warn(sdev->dev, "No ASoC machine driver found - using nocodec\n"); machine = devm_kzalloc(sdev->dev, sizeof(*machine), GFP_KERNEL); @@ -284,6 +283,7 @@ static int sof_machine_check(struct snd_sof_dev *sdev) plat_data->machine = machine; return 0; +#endif } static int sof_probe_continue(struct snd_sof_dev *sdev) diff --git a/sound/soc/sof/intel/Kconfig b/sound/soc/sof/intel/Kconfig index 32ee0fabab92..603e0db4f012 100644 --- a/sound/soc/sof/intel/Kconfig +++ b/sound/soc/sof/intel/Kconfig @@ -36,7 +36,7 @@ config SND_SOC_SOF_INTEL_HIFI_EP_IPC config SND_SOC_SOF_INTEL_ATOM_HIFI_EP tristate - select SND_SOC_INTEL_COMMON + select SND_SOC_SOF_INTEL_COMMON select SND_SOC_SOF_INTEL_HIFI_EP_IPC help This option is not user-selectable but automagically handled by diff --git a/sound/soc/sof/ipc.c b/sound/soc/sof/ipc.c index ba1bb17a8d1e..f0b9d3c53f6f 100644 --- a/sound/soc/sof/ipc.c +++ b/sound/soc/sof/ipc.c @@ -567,7 +567,7 @@ static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev, size_t offset = 0; size_t msg_bytes; size_t pl_size; - int err = 0; + int err; int i; /* allocate max ipc size because we have at least one */ @@ -576,9 +576,13 @@ static int sof_set_get_large_ctrl_data(struct snd_sof_dev *sdev, return -ENOMEM; if (send) - sof_get_ctrl_copy_params(cdata->type, cdata, partdata, sparams); + err = sof_get_ctrl_copy_params(cdata->type, cdata, partdata, + sparams); else - sof_get_ctrl_copy_params(cdata->type, partdata, cdata, sparams); + err = sof_get_ctrl_copy_params(cdata->type, partdata, cdata, + sparams); + if (err < 0) + return err; msg_bytes = sparams->msg_bytes; pl_size = sparams->pl_size; diff --git a/sound/soc/sof/ops.c b/sound/soc/sof/ops.c index 80f907740b82..7a27c3b719e7 100644 --- a/sound/soc/sof/ops.c +++ b/sound/soc/sof/ops.c @@ -17,7 +17,7 @@ bool snd_sof_pci_update_bits_unlocked(struct snd_sof_dev *sdev, u32 offset, { struct pci_dev *pci = to_pci_dev(sdev->dev); unsigned int old, new; - u32 ret; + u32 ret = 0; pci_read_config_dword(pci, offset, &ret); old = ret; diff --git a/sound/soc/stm/stm32_spdifrx.c b/sound/soc/stm/stm32_spdifrx.c index b4c3d983e195..3d64200edbb5 100644 --- a/sound/soc/stm/stm32_spdifrx.c +++ b/sound/soc/stm/stm32_spdifrx.c @@ -496,7 +496,7 @@ static int stm32_spdifrx_get_ctrl_data(struct stm32_spdifrx_data *spdifrx) if (wait_for_completion_interruptible_timeout(&spdifrx->cs_completion, msecs_to_jiffies(100)) <= 0) { - dev_err(&spdifrx->pdev->dev, "Failed to get control data\n"); + dev_dbg(&spdifrx->pdev->dev, "Failed to get control data\n"); ret = -EAGAIN; } @@ -845,7 +845,8 @@ static struct snd_soc_dai_driver stm32_spdifrx_dai[] = { static const struct snd_pcm_hardware stm32_spdifrx_pcm_hw = { .info = SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP, .buffer_bytes_max = 8 * PAGE_SIZE, - .period_bytes_max = 2048, /* MDMA constraint */ + .period_bytes_min = 1024, + .period_bytes_max = 4 * PAGE_SIZE, .periods_min = 2, .periods_max = 8, }; |