ALSA: hda - add power states information in proc
authorWang Xingchao <xingchao.wang@intel.com>
Wed, 6 Jun 2012 05:49:44 +0000 (13:49 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 6 Jun 2012 10:12:49 +0000 (12:12 +0200)
add more power states information:
- reset status
- clock stop ok
- power states error

Output like:
Power: setting=D0, actual=D0, Error, Clock-stop-OK, Setting-reset

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/hda/hda_codec.h
sound/pci/hda/hda_proc.c

index 4fc3960c85917837508ef32b1d954737061fc926..71864cddcb9d5d888cc2d7d9003548bc54f1cbc0 100644 (file)
@@ -323,6 +323,9 @@ enum {
 #define AC_PWRST_D1                    0x01
 #define AC_PWRST_D2                    0x02
 #define AC_PWRST_D3                    0x03
+#define AC_PWRST_ERROR                  (1<<8)
+#define AC_PWRST_CLK_STOP_OK            (1<<9)
+#define AC_PWRST_SETTING_RESET          (1<<10)
 
 /* Processing capabilies */
 #define AC_PCAP_BENIGN                 (1<<0)
index e59e2f059b6ede9a21bc4d92ecf4f92a668f5ae3..fb9ef132f13b0ec3b521719dbb65ba022e0812a2 100644 (file)
@@ -455,10 +455,17 @@ static void print_power_state(struct snd_info_buffer *buffer,
                snd_iprintf(buffer, "  Power states: %s\n",
                            bits_names(sup, names, ARRAY_SIZE(names)));
 
-       snd_iprintf(buffer, "  Power: setting=%s, actual=%s\n",
+       snd_iprintf(buffer, "  Power: setting=%s, actual=%s",
                    get_pwr_state(pwr & AC_PWRST_SETTING),
                    get_pwr_state((pwr & AC_PWRST_ACTUAL) >>
                                  AC_PWRST_ACTUAL_SHIFT));
+       if (pwr & AC_PWRST_ERROR)
+               snd_iprintf(buffer, ", Error");
+       if (pwr & AC_PWRST_CLK_STOP_OK)
+               snd_iprintf(buffer, ", Clock-stop-OK");
+       if (pwr & AC_PWRST_SETTING_RESET)
+               snd_iprintf(buffer, ", Setting-reset");
+       snd_iprintf(buffer, "\n");
 }
 
 static void print_unsol_cap(struct snd_info_buffer *buffer,
This page took 0.030363 seconds and 5 git commands to generate.