* [PATCH] ALSA: hda - print power state for AFG node in proc file @ 2013-01-08 14:01 David Henningsson 2013-01-08 14:11 ` Takashi Iwai 0 siblings, 1 reply; 4+ messages in thread From: David Henningsson @ 2013-01-08 14:01 UTC (permalink / raw) To: tiwai, alsa-devel; +Cc: David Henningsson It seems useful, and power states are required for AFG nodes, so I see no reason not to print it. As a bonus, also print the AFG nid. Signed-off-by: David Henningsson <david.henningsson@canonical.com> --- sound/pci/hda/hda_proc.c | 2 ++ 1 file changed, 2 insertions(+) (Feel free to rephrase "State of AFG node 0x%02x:\n" if you like.) diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c index 045e5d3..d6c8416 100644 --- a/sound/pci/hda/hda_proc.c +++ b/sound/pci/hda/hda_proc.c @@ -603,6 +603,8 @@ static void print_codec_info(struct snd_info_entry *entry, print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); snd_iprintf(buffer, "Default Amp-Out caps: "); print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); + snd_iprintf(buffer, "State of AFG node 0x%02x:\n", codec->afg); + print_power_state(buffer, codec, codec->afg); nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); if (! nid || nodes < 0) { -- 1.7.9.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda - print power state for AFG node in proc file 2013-01-08 14:01 [PATCH] ALSA: hda - print power state for AFG node in proc file David Henningsson @ 2013-01-08 14:11 ` Takashi Iwai 2013-01-08 14:26 ` David Henningsson 0 siblings, 1 reply; 4+ messages in thread From: Takashi Iwai @ 2013-01-08 14:11 UTC (permalink / raw) To: David Henningsson; +Cc: alsa-devel At Tue, 8 Jan 2013 15:01:18 +0100, David Henningsson wrote: > > It seems useful, and power states are required for AFG nodes, > so I see no reason not to print it. Hmm... when the codec proc file is output, the codec gets awake. So it should print only D0 there. Or did you get other power state? > As a bonus, also print the > AFG nid. Yeah, this is a good thing. thanks, Takashi > Signed-off-by: David Henningsson <david.henningsson@canonical.com> > --- > sound/pci/hda/hda_proc.c | 2 ++ > 1 file changed, 2 insertions(+) > > (Feel free to rephrase "State of AFG node 0x%02x:\n" if you like.) > > diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c > index 045e5d3..d6c8416 100644 > --- a/sound/pci/hda/hda_proc.c > +++ b/sound/pci/hda/hda_proc.c > @@ -603,6 +603,8 @@ static void print_codec_info(struct snd_info_entry *entry, > print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); > snd_iprintf(buffer, "Default Amp-Out caps: "); > print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); > + snd_iprintf(buffer, "State of AFG node 0x%02x:\n", codec->afg); > + print_power_state(buffer, codec, codec->afg); > > nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); > if (! nid || nodes < 0) { > -- > 1.7.9.5 > ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda - print power state for AFG node in proc file 2013-01-08 14:11 ` Takashi Iwai @ 2013-01-08 14:26 ` David Henningsson 2013-01-08 14:37 ` Takashi Iwai 0 siblings, 1 reply; 4+ messages in thread From: David Henningsson @ 2013-01-08 14:26 UTC (permalink / raw) To: Takashi Iwai; +Cc: alsa-devel On 01/08/2013 03:11 PM, Takashi Iwai wrote: > At Tue, 8 Jan 2013 15:01:18 +0100, > David Henningsson wrote: >> >> It seems useful, and power states are required for AFG nodes, >> so I see no reason not to print it. > > Hmm... when the codec proc file is output, the codec gets awake. > So it should print only D0 there. Or did you get other power state? I added it to debug something, to verify that I actually did get D0. And yes, I did get D0. But there is a possibility not to get D0; I mean, we try ten times to set it (and wait 500 ms for each try!) and maybe, some codecs might need it to be set eleven times...or something. And it also prints out available power states, e g whether the AFG supports EPSS etc. Do you think it would be more useful to move it above snd_hda_power_up? > >> As a bonus, also print the >> AFG nid. > > Yeah, this is a good thing. > > > thanks, > > Takashi > >> Signed-off-by: David Henningsson <david.henningsson@canonical.com> >> --- >> sound/pci/hda/hda_proc.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> (Feel free to rephrase "State of AFG node 0x%02x:\n" if you like.) >> >> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c >> index 045e5d3..d6c8416 100644 >> --- a/sound/pci/hda/hda_proc.c >> +++ b/sound/pci/hda/hda_proc.c >> @@ -603,6 +603,8 @@ static void print_codec_info(struct snd_info_entry *entry, >> print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); >> snd_iprintf(buffer, "Default Amp-Out caps: "); >> print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); >> + snd_iprintf(buffer, "State of AFG node 0x%02x:\n", codec->afg); >> + print_power_state(buffer, codec, codec->afg); >> >> nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); >> if (! nid || nodes < 0) { >> -- >> 1.7.9.5 >> > -- David Henningsson, Canonical Ltd. https://launchpad.net/~diwic ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ALSA: hda - print power state for AFG node in proc file 2013-01-08 14:26 ` David Henningsson @ 2013-01-08 14:37 ` Takashi Iwai 0 siblings, 0 replies; 4+ messages in thread From: Takashi Iwai @ 2013-01-08 14:37 UTC (permalink / raw) To: David Henningsson; +Cc: alsa-devel At Tue, 08 Jan 2013 15:26:03 +0100, David Henningsson wrote: > > On 01/08/2013 03:11 PM, Takashi Iwai wrote: > > At Tue, 8 Jan 2013 15:01:18 +0100, > > David Henningsson wrote: > >> > >> It seems useful, and power states are required for AFG nodes, > >> so I see no reason not to print it. > > > > Hmm... when the codec proc file is output, the codec gets awake. > > So it should print only D0 there. Or did you get other power state? > > I added it to debug something, to verify that I actually did get D0. And > yes, I did get D0. > > But there is a possibility not to get D0; I mean, we try ten times to > set it (and wait 500 ms for each try!) and maybe, some codecs might need > it to be set eleven times...or something. No chance, because the codec is always woken up by reading a value :) The driver does explicit power up while accessing the codec via snd_hda_codec_read/write(). > And it also prints out available power states, e g whether the AFG > supports EPSS etc. Yes, it's a good point. > Do you think it would be more useful to move it above snd_hda_power_up? It doesn't help, because the call of snd_hda_codec_read() or snd_hda_parm_read() itself wakes up the codec. In anyway I'm going to apply your patch as is. thanks, Takashi > >> As a bonus, also print the > >> AFG nid. > > > > Yeah, this is a good thing. > > > > > > thanks, > > > > Takashi > > > >> Signed-off-by: David Henningsson <david.henningsson@canonical.com> > >> --- > >> sound/pci/hda/hda_proc.c | 2 ++ > >> 1 file changed, 2 insertions(+) > >> > >> (Feel free to rephrase "State of AFG node 0x%02x:\n" if you like.) > >> > >> diff --git a/sound/pci/hda/hda_proc.c b/sound/pci/hda/hda_proc.c > >> index 045e5d3..d6c8416 100644 > >> --- a/sound/pci/hda/hda_proc.c > >> +++ b/sound/pci/hda/hda_proc.c > >> @@ -603,6 +603,8 @@ static void print_codec_info(struct snd_info_entry *entry, > >> print_amp_caps(buffer, codec, codec->afg, HDA_INPUT); > >> snd_iprintf(buffer, "Default Amp-Out caps: "); > >> print_amp_caps(buffer, codec, codec->afg, HDA_OUTPUT); > >> + snd_iprintf(buffer, "State of AFG node 0x%02x:\n", codec->afg); > >> + print_power_state(buffer, codec, codec->afg); > >> > >> nodes = snd_hda_get_sub_nodes(codec, codec->afg, &nid); > >> if (! nid || nodes < 0) { > >> -- > >> 1.7.9.5 > >> > > > > > > -- > David Henningsson, Canonical Ltd. > https://launchpad.net/~diwic > ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-01-08 14:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-01-08 14:01 [PATCH] ALSA: hda - print power state for AFG node in proc file David Henningsson 2013-01-08 14:11 ` Takashi Iwai 2013-01-08 14:26 ` David Henningsson 2013-01-08 14:37 ` Takashi Iwai
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.