Skip to content

Commit

Permalink
Merge tag 'asoc-v5.2-2' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
tiwai committed May 8, 2019
2 parents 80a5052 + ce38a75 commit 5095c41
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 39 deletions.
2 changes: 2 additions & 0 deletions sound/soc/codecs/da7219.c
Original file line number Diff line number Diff line change
Expand Up @@ -2363,7 +2363,9 @@ static int da7219_probe(struct snd_soc_component *component)
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);

Expand Down
12 changes: 6 additions & 6 deletions sound/soc/codecs/max98090.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
35 changes: 16 additions & 19 deletions sound/soc/codecs/rt5677-spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/rockchip/rockchip_pdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions sound/soc/sof/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/intel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions sound/soc/sof/ipc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion sound/soc/sof/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 3 additions & 2 deletions sound/soc/stm/stm32_spdifrx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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,
};
Expand Down

0 comments on commit 5095c41

Please sign in to comment.