ASoC: cs35l56: Update hibernate/wake sequences and enable hibernation
Subsystems (3)
Richard Fitzgerald
maintainercover ASoC: cs35l56: Update hibernate/wake sequences and enable hibernation
Update the hibernate and wake command sequences to meet the latest datasheet specification and enable hibernation for I2C and SPI control interfaces.
Richard Fitzgerald (1):
ASoC: cs35l56: Enable low-power hibernation mode on SPI
Simon Trimmer (3):
ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate
ASoC: cs35l56: Wake transactions need to be issued twice
ASoC: cs35l56: Enable low-power hibernation mode on i2c
include/sound/cs35l56.h | 1 + sound/soc/codecs/cs35l56-i2c.c | 1 + sound/soc/codecs/cs35l56-shared.c | 66 +++++++++++++++++++------------ sound/soc/codecs/cs35l56-spi.c | 1 + 4 files changed, 43 insertions(+), 26 deletions(-)
Signature · 1 line
2.30.2
Richard Fitzgerald
maintainerPATCH 1/4 ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate
From: Simon Trimmer <[email protected]>
If the hardware uses SPI_MOSI, I2C_SCL or I2C_SDA as the wake source the bus activity of sending HIBERNATE_NOW will wake up the amps that were already put into hibernate.
ALLOW_AUTO_HIBERNATE tells the firmware to hibernate itself after a timeout of a few seconds, giving the driver instances time to send this before any amps have gone into hibernate.
--- sound/soc/codecs/cs35l56-shared.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-)
sound/soc/codecs/cs35l56-shared.c +5 -10
@@ -439,7 +439,7 @@ EXPORT_SYMBOL_NS_GPL(cs35l56_is_fw_reload_needed, SND_SOC_CS35L56_SHARED);static const struct reg_sequence cs35l56_hibernate_seq[] = {/* This must be the last register access */ -REG_SEQ0 (CS35L56_DSP_VIRTUAL1_MBOX_1 ,CS35L56_MBOX_CMD_HIBERNATE_NOW ), +REG_SEQ0 (CS35L56_DSP_VIRTUAL1_MBOX_1 ,CS35L56_MBOX_CMD_ALLOW_AUTO_HIBERNATE ), };static const struct reg_sequence cs35l56_hibernate_wake_seq[] = {
@@ -473,12 +473,6 @@ int cs35l56_runtime_suspend_common(struct cs35l56_base *cs35l56_base)return 0 ; } -/* -* Enable auto-hibernate. If it is woken by some other wake source -* it will automatically return to hibernate. -*/ -cs35l56_mbox_send (cs35l56_base,CS35L56_MBOX_CMD_ALLOW_AUTO_HIBERNATE ); -/* * Must enter cache-only first so there can't be any more register * accesses other than the controlled hibernate sequence below.
@@ -545,11 +539,12 @@ int cs35l56_runtime_resume_common(struct cs35l56_base *cs35l56_base, bool is_soureturn 0 ; err: -regmap_write (cs35l56_base->regmap,CS35L56_DSP_VIRTUAL1_MBOX_1 , -CS35L56_MBOX_CMD_HIBERNATE_NOW ); -regcache_cache_only (cs35l56_base->regmap, true); +regmap_multi_reg_write_bypassed (cs35l56_base->regmap, + cs35l56_hibernate_seq, +ARRAY_SIZE (cs35l56_hibernate_seq)); +return ret; }EXPORT_SYMBOL_NS_GPL (cs35l56_runtime_resume_common,SND_SOC_CS35L56_SHARED );
Signature · 1 line
2.30.2
Richard Fitzgerald
maintainerPATCH 2/4 ASoC: cs35l56: Wake transactions need to be issued twice
In reply to Richard FitzgeraldFrom: Simon Trimmer <[email protected]>
As the dummy wake is a toggling signal (either I2C or SPI activity) it is not guaranteed to meet the minimum asserted hold time for a wake signal. In this case the wake must guarantee rising edges separated by at least the minimum hold time.
--- include/sound/cs35l56.h | 1 + sound/soc/codecs/cs35l56-shared.c | 51 +++++++++++++++++++++---------- 2 files changed, 36 insertions(+), 16 deletions(-)
include/sound/cs35l56.h +1 -0
@@ -243,6 +243,7 @@#define CS35L56_HALO_STATE_POLL_US 1000#define CS35L56_HALO_STATE_TIMEOUT_US 50000#define CS35L56_RESET_PULSE_MIN_US 1100 +#define CS35L56_WAKE_HOLD_TIME_US 1000#define CS35L56_SDW1_PLAYBACK_PORT 1#define CS35L56_SDW1_CAPTURE_PORT 3
sound/soc/codecs/cs35l56-shared.c +35 -16
71 lines not on this page · raw message
Signature · 1 line
2.30.2
Richard Fitzgerald
maintainerPATCH 3/4 ASoC: cs35l56: Enable low-power hibernation mode on i2c
In reply to Richard FitzgeraldFrom: Simon Trimmer <[email protected]>
This can now be re-enabled as the sequence to reliably wake the device has been implemented in the shared code.
--- sound/soc/codecs/cs35l56-i2c.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/cs35l56-i2c.c +1 -0
@@ -27,6 +27,7 @@ static int cs35l56_i2c_probe(struct i2c_client *client)return -ENOMEM ; cs35l56->base.dev = dev; + cs35l56->base.can_hibernate = true;i2c_set_clientdata (client, cs35l56); cs35l56->base.regmap =devm_regmap_init_i2c (client, regmap_config);
Signature · 1 line
2.30.2
Richard Fitzgerald
maintainerPATCH 4/4 ASoC: cs35l56: Enable low-power hibernation mode on SPI
In reply to Richard FitzgeraldHibernation can be enabled on SPI-connected devices now that the hibernate and wake sequences have been updated to work with wake-on-MOSI.
--- sound/soc/codecs/cs35l56-spi.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/cs35l56-spi.c +1 -0
@@ -32,6 +32,7 @@ static int cs35l56_spi_probe(struct spi_device *spi) } cs35l56->base.dev = &spi->dev; + cs35l56->base.can_hibernate = true; ret =cs35l56_common_probe (cs35l56);if (ret !=0 )
Signature · 1 line
2.30.2
Mark Brown
maintainerQuoted 8 lines · Richard Fitzgerald
Update the hibernate and wake command sequences to meet the latest datasheet specification and enable hibernation for I2C and SPI control interfaces.
Richard Fitzgerald (1):
ASoC: cs35l56: Enable low-power hibernation mode on SPI[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: cs35l56: Change hibernate sequence to use allow auto hibernate
commit: a47cf4dac7dcc43ef25d009ca0ad28fc86ba0eef
[2/4] ASoC: cs35l56: Wake transactions need to be issued twice
commit: 3df761bdbc8bc1bb679b5a4d4e068728d930a552
[3/4] ASoC: cs35l56: Enable low-power hibernation mode on i2c
commit: 79b101947a829a1c4c3eca4b6365093d2b534cf4
[4/4] ASoC: cs35l56: Enable low-power hibernation mode on SPI
commit: 634ed138d80b1cc8a903edb226458ea203c44abdAll 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