diff mbox series

ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI

Message ID 20231121154419.19435-1-rf@opensource.cirrus.com (mailing list archive)
State New, archived
Headers show
Series ALSA: hda: cs35l56: Enable low-power hibernation mode on SPI | expand

Commit Message

Richard Fitzgerald Nov. 21, 2023, 3:44 p.m. UTC
SPI hibernation is now supported with the latest hibernation/wake
sequences in the shared ASoC code.

This has a functional dependency on two commits:

commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued
twice")

commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use
allow auto hibernate")

To protect against this, enabling hibernation is conditional on
CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new
hibernation sequences are available.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 sound/pci/hda/cs35l56_hda_spi.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Takashi Iwai Nov. 21, 2023, 8:36 p.m. UTC | #1
On Tue, 21 Nov 2023 16:44:19 +0100,
Richard Fitzgerald wrote:
> 
> SPI hibernation is now supported with the latest hibernation/wake
> sequences in the shared ASoC code.
> 
> This has a functional dependency on two commits:
> 
> commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued
> twice")
> 
> commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use
> allow auto hibernate")
> 
> To protect against this, enabling hibernation is conditional on
> CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new
> hibernation sequences are available.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>

Is this expected to be merged for 6.7?  Or it can be post 6.7?
I guess the former, but just to make sure.


thanks,

Takashi
Richard Fitzgerald Nov. 22, 2023, 11:04 a.m. UTC | #2
On 21/11/23 20:36, Takashi Iwai wrote:
> On Tue, 21 Nov 2023 16:44:19 +0100,
> Richard Fitzgerald wrote:
>>
>> SPI hibernation is now supported with the latest hibernation/wake
>> sequences in the shared ASoC code.
>>
>> This has a functional dependency on two commits:
>>
>> commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued
>> twice")
>>
>> commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use
>> allow auto hibernate")
>>
>> To protect against this, enabling hibernation is conditional on
>> CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new
>> hibernation sequences are available.
>>
>> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> 
> Is this expected to be merged for 6.7?  Or it can be post 6.7?
> I guess the former, but just to make sure.
>

It would be good to get it into 6.7 because it reduces the power
consumption in runtime-suspend and suspend-to-RAM. But it's not
critical (it's not a bugfix).

> 
> thanks,
> 
> Takashi
Takashi Iwai Nov. 22, 2023, 1:40 p.m. UTC | #3
On Wed, 22 Nov 2023 12:04:27 +0100,
Richard Fitzgerald wrote:
> 
> On 21/11/23 20:36, Takashi Iwai wrote:
> > On Tue, 21 Nov 2023 16:44:19 +0100,
> > Richard Fitzgerald wrote:
> >> 
> >> SPI hibernation is now supported with the latest hibernation/wake
> >> sequences in the shared ASoC code.
> >> 
> >> This has a functional dependency on two commits:
> >> 
> >> commit 3df761bdbc8b ("ASoC: cs35l56: Wake transactions need to be issued
> >> twice")
> >> 
> >> commit a47cf4dac7dc ("ASoC: cs35l56: Change hibernate sequence to use
> >> allow auto hibernate")
> >> 
> >> To protect against this, enabling hibernation is conditional on
> >> CS35L56_WAKE_HOLD_TIME_US being defined, which indicates that the new
> >> hibernation sequences are available.
> >> 
> >> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> > 
> > Is this expected to be merged for 6.7?  Or it can be post 6.7?
> > I guess the former, but just to make sure.
> > 
> 
> It would be good to get it into 6.7 because it reduces the power
> consumption in runtime-suspend and suspend-to-RAM. But it's not
> critical (it's not a bugfix).

OK, now applied to for-linus branch (for 6.7).


thanks,

Takashi
diff mbox series

Patch

diff --git a/sound/pci/hda/cs35l56_hda_spi.c b/sound/pci/hda/cs35l56_hda_spi.c
index 756aec342eab..27d7fbc56b4c 100644
--- a/sound/pci/hda/cs35l56_hda_spi.c
+++ b/sound/pci/hda/cs35l56_hda_spi.c
@@ -21,6 +21,10 @@  static int cs35l56_hda_spi_probe(struct spi_device *spi)
 		return -ENOMEM;
 
 	cs35l56->base.dev = &spi->dev;
+
+#ifdef CS35L56_WAKE_HOLD_TIME_US
+	cs35l56->base.can_hibernate = true;
+#endif
 	cs35l56->base.regmap = devm_regmap_init_spi(spi, &cs35l56_regmap_spi);
 	if (IS_ERR(cs35l56->base.regmap)) {
 		ret = PTR_ERR(cs35l56->base.regmap);