ALSA: hda - add power states information in proc
PATCH 1/1 ALSA: hda - add power states information in proc
add more power states information:
- reset status
- clock stop ok
- power states error
--- sound/pci/hda/hda_codec.h | 3 +++ sound/pci/hda/hda_proc.c | 6 ++++++ 2 files changed, 9 insertions(+)
sound/pci/hda/hda_codec.h +3 -0
@@ -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)
sound/pci/hda/hda_proc.c +6 -0
@@ -459,6 +459,12 @@ static void print_power_state(struct snd_info_buffer *buffer,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," Power state error\n" ); +if (pwr &AC_PWRST_CLK_STOP_OK ) +snd_iprintf (buffer," PS: clock stop ok\n" ); +if (pwr &AC_PWRST_SETTING_RESET ) +snd_iprintf (buffer," Power state setting reset\n" ); } static void print_unsol_cap(struct snd_info_buffer *buffer,
Signature · 1 line
1.7.9.5
At Tue, 5 Jun 2012 18:08:10 +0800,
Quoted 31 lines · Wang Xingchao
add more power states information:
- reset status
- clock stop ok
- power states errorSigned-off-by Wang Xingchao <[email protected]>--- sound/pci/hda/hda_codec.h | 3 +++ sound/pci/hda/hda_proc.c | 6 ++++++ 2 files changed, 9 insertions(+)sound/pci/hda/hda_codec.h +3
-0@@ -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)sound/pci/hda/hda_proc.c +0
-0
sound/pci/hda/hda_proc.c static void print_power_state(struct snd_info_buffer *buffer, · line 467
Quoted 9 lines
sound/pci/hda/hda_proc.c +6
-0@@ -459,6 +459,12 @@ static void print_power_state(struct snd_info_buffer *buffer,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," Power state error\n" ); +if (pwr &AC_PWRST_CLK_STOP_OK ) +snd_iprintf (buffer," PS: clock stop ok\n" ); +if (pwr &AC_PWRST_SETTING_RESET ) +snd_iprintf (buffer," Power state setting reset\n" );
I prefer keeping the format like "AAA: BBB".
Or, can these extra bits be appended "Power:" line, such as
Power: setting=D0, actual=D0, Error, Clock-stop-OK, Setting-reset
thanks,
Takashi
2012/6/5 Takashi Iwai <[email protected]>:
Quoted 46 lines
At Tue, 5 Jun 2012 18:08:10 +0800,
Quoted 32 lines · Wang Xingchao
add more power states information:
- reset status
- clock stop ok
- power states errorSigned-off-by Wang Xingchao <[email protected]>---
sound/pci/hda/hda_codec.h | 3 +++
sound/pci/hda/hda_proc.c | 6 ++++++2 files changed, 9 insertions(+)sound/pci/hda/hda_codec.h +3
-0@@ -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)sound/pci/hda/hda_proc.c +0
-0@@ -459,6 +459,12 @@ static void print_power_state(struct snd_info_buffer *buffer, get_pwr_state(pwr & AC_PWRST_SETTING),Quoted 8 lines
get_pwr_state((pwr & AC_PWRST_ACTUAL) >> AC_PWRST_ACTUAL_SHIFT));
+ if (pwr &AC_PWRST_ERROR)
+snd_iprintf(buffer, " Power state error\n");
+ if (pwr &AC_PWRST_CLK_STOP_OK)
+snd_iprintf(buffer, " PS: clock stop ok\n");
+ if (pwr &AC_PWRST_SETTING_RESET)
+snd_iprintf(buffer, " Power state setting reset\n");I prefer keeping the format like "AAA: BBB".
Or, can these extra bits be appended "Power:" line, such as
Quoted 2 lines
Power: setting=D0, actual=D0, Error, Clock-stop-OK, Setting-reset
Sure, thanks for your review, i will send out second version patch later.
thanks
--xingchao