Skip to contentSkip to conversation

ALSA: hda - modem function group wake on ring support

PATCH In review Wang Xingchao 3 participants 4 messages Jun 7, 2012 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ALSA: hda - modem function group wake on ring support

D2 allows for the lowest possible power consuming state from which it can return to "fully on" state D0 within 2ms. For modems, it's the "wake on ring" power state.

---
 sound/pci/hda/hda_codec.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
sound/pci/hda/hda_codec.c +12 -0
index 2737fe7..d0ca370 100644
@@ -3542,6 +3542,18 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
 	snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
 }
 
+/* modem wake on ring: transition from D2 to D0 in less than 2ms. For modems,
+ * this is the wake-on-ring power state  */
+static void hda_modem_wake_on_ring(struct hda_codec *codec, bool enter)
+{
+	if (codec->mfg) {
+		if (enter)
+			hda_set_power_state(codec, codec->mfg, AC_PWRST_D2);
+		else
+			hda_set_power_state(codec, codec->mfg, AC_PWRST_D0);
+	}
+}
+
 #ifdef CONFIG_SND_HDA_HWDEP
 /* execute additional init verbs */
 static void hda_exec_init_verbs(struct hda_codec *codec)
Signature · 1 line
1.7.9.5
#1 lore raw

At Thu, 7 Jun 2012 16:52:33 +0800,

Quoted 23 lines · Wang Xingchao

D2 allows for the lowest possible power consuming state from which it can return to "fully on" state D0 within 2ms. For modems, it's the "wake on ring" power state.

---
 sound/pci/hda/hda_codec.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)
sound/pci/hda/hda_codec.c +5 -0
index 2737fe7..d0ca370 100644
@@ -3542,6 +3542,18 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
 	snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
 }
 
+/* modem wake on ring: transition from D2 to D0 in less than 2ms. For modems,
+ * this is the wake-on-ring power state  */
+static void hda_modem_wake_on_ring(struct hda_codec *codec, bool enter)
+{
+	if (codec->mfg) {

sound/pci/hda/hda_codec.c static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, · line 3559

Quoted 10 lines
sound/pci/hda/hda_codec.c +7 -0
+		if (enter)
+			hda_set_power_state(codec, codec->mfg, AC_PWRST_D2);
+		else
+			hda_set_power_state(codec, codec->mfg, AC_PWRST_D0);
+	}
+}
+
 #ifdef CONFIG_SND_HDA_HWDEP
 /* execute additional init verbs */
 static void hda_exec_init_verbs(struct hda_codec *codec)

No caller of the new function? Otherwise it's useless...

Takashi

#2 lore raw

2012/6/7 Takashi Iwai <[email protected]>:

Quoted 29 lines

At Thu,  7 Jun 2012 16:52:33 +0800,

Quoted 27 lines · Wang Xingchao

 D2 allows for the lowest possible power consuming state from which it can return to "fully on" state D0 within 2ms. For modems, it's the "wake on ring" power state.

---
 sound/pci/hda/hda_codec.c |   12 ++++++++++++

 1 file changed, 12 insertions(+)
sound/pci/hda/hda_codec.c +9 -0
index 2737fe7..d0ca370 100644
@@ -3542,6 +3542,18 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
       snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
  }
 
+/* modem wake on ring: transition from D2 to D0 in less than 2ms. For modems,
+ * this is the wake-on-ring power state  */
+static void hda_modem_wake_on_ring(struct hda_codec *codec, bool enter)
+{
+     if (codec->mfg) {
+             if (enter)
+                     hda_set_power_state(codec, codec->mfg, AC_PWRST_D2);
+             else
+                     hda_set_power_state(codec, codec->mfg, AC_PWRST_D0);
Quoted 9 lines

sound/pci/hda/hda_codec.c static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, · line 3559

Quoted 6 lines
sound/pci/hda/hda_codec.c +3 -0
+     }
+}
+
  #ifdef CONFIG_SND_HDA_HWDEP
  /* execute additional init verbs */
  static void hda_exec_init_verbs(struct hda_codec *codec)

No caller of the new function?  Otherwise it's useless...

Hi Takashi,

I have not see codec indicates "Modem function group" yet, do you know which codec on HDA as Modem type and i could search whether it need such "wake on ring" feature.

This patch should bring codec out of D2 states in less than 2ms. It should help modem save power with "wake-on-ring" feature.

thanks
--xingchao

#3 lore raw

At Thu, 7 Jun 2012 18:09:28 +0800,

Quoted 40 lines · Wang Xingchao

2012/6/7 Takashi Iwai <[email protected]>:

Quoted 29 lines

At Thu,  7 Jun 2012 16:52:33 +0800,

Quoted 27 lines · Wang Xingchao

 D2 allows for the lowest possible power consuming state from which it can return to "fully on" state D0 within 2ms. For modems, it's the "wake on ring" power state.

---
 sound/pci/hda/hda_codec.c |   12 ++++++++++++

 1 file changed, 12 insertions(+)
sound/pci/hda/hda_codec.c +9 -0
index 2737fe7..d0ca370 100644
@@ -3542,6 +3542,18 @@ static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg,
       snd_hda_codec_set_power_to_all(codec, fg, power_state, true);
  }
 
+/* modem wake on ring: transition from D2 to D0 in less than 2ms. For modems,
+ * this is the wake-on-ring power state  */
+static void hda_modem_wake_on_ring(struct hda_codec *codec, bool enter)
+{
+     if (codec->mfg) {
+             if (enter)
+                     hda_set_power_state(codec, codec->mfg, AC_PWRST_D2);
+             else
+                     hda_set_power_state(codec, codec->mfg, AC_PWRST_D0);
Quoted 9 lines

sound/pci/hda/hda_codec.c static void hda_set_power_state(struct hda_codec *codec, hda_nid_t fg, · line 3559

Quoted 6 lines
sound/pci/hda/hda_codec.c +3 -0
+     }
+}
+
  #ifdef CONFIG_SND_HDA_HWDEP
  /* execute additional init verbs */
  static void hda_exec_init_verbs(struct hda_codec *codec)

No caller of the new function?  Otherwise it's useless...

Quoted 8 lines

Hi Takashi,

I have not see codec indicates "Modem function group" yet, do you know which codec on HDA as Modem type and i could search whether it need such "wake on ring" feature.

This patch should bring codec out of D2 states in less than 2ms. It should help modem save power with "wake-on-ring" feature.

But you added only a function definition that is called from nowhere?

Takashi

Quoted 4 lines

thanks
--xingchao

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel