* [PATCH] ASoC: cs35l56: Use regmap_read_bypassed() to wake the device
@ 2024-08-07 14:27 Simon Trimmer
2024-08-08 20:56 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Simon Trimmer @ 2024-08-07 14:27 UTC (permalink / raw)
To: broonie; +Cc: linux-sound, alsa-devel, linux-kernel, patches, Simon Trimmer
Now that regmap_read_bypassed() has been added to the kernel it is
preferable to wake the device with a read rather than a write as the
utility function can be called at a time before the device has been
identified.
Signed-off-by: Simon Trimmer <simont@opensource.cirrus.com>
---
sound/soc/codecs/cs35l56-shared.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/sound/soc/codecs/cs35l56-shared.c b/sound/soc/codecs/cs35l56-shared.c
index e7e8d617da94..91b3c1c8575c 100644
--- a/sound/soc/codecs/cs35l56-shared.c
+++ b/sound/soc/codecs/cs35l56-shared.c
@@ -450,32 +450,23 @@ static const struct reg_sequence cs35l56_hibernate_seq[] = {
REG_SEQ0(CS35L56_DSP_VIRTUAL1_MBOX_1, CS35L56_MBOX_CMD_ALLOW_AUTO_HIBERNATE),
};
-static const struct reg_sequence cs35l56_hibernate_wake_seq[] = {
- REG_SEQ0(CS35L56_DSP_VIRTUAL1_MBOX_1, CS35L56_MBOX_CMD_WAKEUP),
-};
-
static void cs35l56_issue_wake_event(struct cs35l56_base *cs35l56_base)
{
+ unsigned int val;
+
/*
* Dummy transactions to trigger I2C/SPI auto-wake. Issue two
* transactions to meet the minimum required time from the rising edge
* to the last falling edge of wake.
*
- * It uses bypassed write because we must wake the chip before
+ * It uses bypassed read because we must wake the chip before
* disabling regmap cache-only.
- *
- * This can NAK on I2C which will terminate the write sequence so the
- * single-write sequence is issued twice.
*/
- regmap_multi_reg_write_bypassed(cs35l56_base->regmap,
- cs35l56_hibernate_wake_seq,
- ARRAY_SIZE(cs35l56_hibernate_wake_seq));
+ regmap_read_bypassed(cs35l56_base->regmap, CS35L56_IRQ1_STATUS, &val);
usleep_range(CS35L56_WAKE_HOLD_TIME_US, 2 * CS35L56_WAKE_HOLD_TIME_US);
- regmap_multi_reg_write_bypassed(cs35l56_base->regmap,
- cs35l56_hibernate_wake_seq,
- ARRAY_SIZE(cs35l56_hibernate_wake_seq));
+ regmap_read_bypassed(cs35l56_base->regmap, CS35L56_IRQ1_STATUS, &val);
cs35l56_wait_control_port_ready();
}
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ASoC: cs35l56: Use regmap_read_bypassed() to wake the device
2024-08-07 14:27 [PATCH] ASoC: cs35l56: Use regmap_read_bypassed() to wake the device Simon Trimmer
@ 2024-08-08 20:56 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2024-08-08 20:56 UTC (permalink / raw)
To: Simon Trimmer; +Cc: linux-sound, alsa-devel, linux-kernel, patches
On Wed, 07 Aug 2024 14:27:15 +0000, Simon Trimmer wrote:
> Now that regmap_read_bypassed() has been added to the kernel it is
> preferable to wake the device with a read rather than a write as the
> utility function can be called at a time before the device has been
> identified.
>
>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/1] ASoC: cs35l56: Use regmap_read_bypassed() to wake the device
commit: 7063a710830a09b01734be7f4ffd23f0ef72a57e
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-08 20:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-07 14:27 [PATCH] ASoC: cs35l56: Use regmap_read_bypassed() to wake the device Simon Trimmer
2024-08-08 20:56 ` Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox