mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
77bf613f0b
Enabling the active/passive shared boosts requires setting SYNC_EN, but
*not* before receiving the PLL Lock signal.
Due to improper error handling, it was not obvious that waiting for the
completion operation times out and, consequently, the shared boost is
never activated.
Further investigations revealed the signal is triggered while
snd_pcm_start() is executed, right after receiving the
SNDRV_PCM_TRIGGER_START command, which happens long after the
SND_SOC_DAPM_PRE_PMU event handler is invoked as part of
snd_pcm_prepare(). That is where cs35l41_global_enable() is called
from.
Increasing the wait duration doesn't help, as it only causes an
unnecessary delay in the invocation of snd_pcm_start(). Moving the wait
and the subsequent regmap operations to the SNDRV_PCM_TRIGGER_START
callback is not a solution either, since they would be executed in an
IRQ-off atomic context.
Solve the issue by setting the SYNC_EN bit in PWR_CTRL3 register right
after receiving the PLL Lock interrupt.
Additionally, drop the unnecessary writes to PWR_CTRL1 register, part of
the original mdsync_up_seq, which would have toggled GLOBAL_EN with
unwanted consequences on PLL locking behavior.
Fixes: f503056493
("ALSA: cs35l41: Add shared boost feature")
Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Reviewed-by: David Rhodes <david.rhodes@cirrus.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20230907171010.1447274-5-cristian.ciocaltea@collabora.com
Signed-off-by: Mark Brown <broonie@kernel.org>
42 lines
1.1 KiB
C
42 lines
1.1 KiB
C
/* SPDX-License-Identifier: GPL-2.0
|
|
*
|
|
* cs35l41.h -- CS35L41 ALSA SoC audio driver
|
|
*
|
|
* Copyright 2017-2021 Cirrus Logic, Inc.
|
|
*
|
|
* Author: David Rhodes <david.rhodes@cirrus.com>
|
|
*/
|
|
|
|
#ifndef __CS35L41_H__
|
|
#define __CS35L41_H__
|
|
|
|
#include <linux/gpio/consumer.h>
|
|
#include <linux/regulator/consumer.h>
|
|
#include <linux/firmware.h>
|
|
#include <sound/core.h>
|
|
#include <sound/cs35l41.h>
|
|
|
|
#include "wm_adsp.h"
|
|
|
|
#define CS35L41_RX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
|
|
#define CS35L41_TX_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE)
|
|
|
|
extern const struct dev_pm_ops cs35l41_pm_ops;
|
|
|
|
struct cs35l41_private {
|
|
struct wm_adsp dsp; /* needs to be first member */
|
|
struct snd_soc_codec *codec;
|
|
struct cs35l41_hw_cfg hw_cfg;
|
|
struct device *dev;
|
|
struct regmap *regmap;
|
|
struct regulator_bulk_data supplies[CS35L41_NUM_SUPPLIES];
|
|
int irq;
|
|
/* GPIO for /RST */
|
|
struct gpio_desc *reset_gpio;
|
|
};
|
|
|
|
int cs35l41_probe(struct cs35l41_private *cs35l41, const struct cs35l41_hw_cfg *hw_cfg);
|
|
void cs35l41_remove(struct cs35l41_private *cs35l41);
|
|
|
|
#endif /*__CS35L41_H__*/
|