Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757558AbYFHHYO (ORCPT ); Sun, 8 Jun 2008 03:24:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753954AbYFHHX7 (ORCPT ); Sun, 8 Jun 2008 03:23:59 -0400 Received: from mx2.suse.de ([195.135.220.15]:50913 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753947AbYFHHX6 convert rfc822-to-8bit (ORCPT ); Sun, 8 Jun 2008 03:23:58 -0400 Date: Sun, 08 Jun 2008 09:23:57 +0200 Message-ID: From: Takashi Iwai To: Thadeu Lima de Souza Cascardo Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] Correct type and description of CONFIG_AC97_POWER_SAVE_DEFAULT In-Reply-To: <20080607194006.GA9516@vespa.holoscopio.com> References: <20080607162238.GA7893@vespa.holoscopio.com> <20080607194006.GA9516@vespa.holoscopio.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta28) (fuki) (x86_64-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3287 Lines: 86 At Sat, 7 Jun 2008 16:40:07 -0300, Thadeu Lima de Souza Cascardo wrote: > > On Sat, Jun 07, 2008 at 07:48:16PM +0200, Takashi Iwai wrote: > > At Sat, 7 Jun 2008 13:22:39 -0300, > > Thadeu Lima de Souza Cascardo wrote: > > > > > > While CONFIG_HDA_POWER_SAVE_DEFAULT is used as a timeout in seconds, > > > CONFIG_AC97_POWER_SAVE_DEFAULT simply enables or disables AC97 power > > > saving. > > > > Thanks for the patch. However, I can't take this as is. The reasons > > are below: > > > > The power_save option takes indeed an integer value, and this kconfig > > is nothing but its default value. > > > > In your way, it's set always 1 if selected. This is a very bad choice > > as power_save value, because you'll turn on/off after one second. > > This may lead to too frequent click noises. > > Thus, even if we need to make it bool, a more sensitive value must be > > chosen. And, which value is sensitive is a matter of taste, and you > > cannot define it alone by yourself. > > > > As I said in my comment, that is true for CONFIG_HDA_POWER_SAVE_DEFAULT, > which is, in fact, used as a number of seconds, and I left that as is. > The static power_save variable in ac97_codec.c, however, is only used in > a macro ac97_is_power_save_mode, which, in turn, is only used in two > if's. Ah, right. It's a simply because I forgot to commit the patch mistakenly. The power_save option must take integer as its timeout value, just like for snd-hda-intel driver, as described in Documentation/sound/alsa/powersave.txt. The patch below is already applied to my git tree, thus for the next release (will be included in linux-next soon). thanks, Takashi >From 92a0a8d2fce86124451bc6d1c1e2d9ce3805df2d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Sun, 8 Jun 2008 09:17:27 +0200 Subject: [ALSA] ac97 - Fix power_save option value as time-out The power_save option was set as boot although it was meant to be a timeout value like the same option of snd-hda-intel originally. Now fixed to the same style. Signed-off-by: Takashi Iwai diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c index 45fd290..2d2f16e 100644 --- a/sound/pci/ac97/ac97_codec.c +++ b/sound/pci/ac97/ac97_codec.c @@ -49,8 +49,9 @@ MODULE_PARM_DESC(enable_loopback, "Enable AC97 ADC/DAC Loopback Control"); #ifdef CONFIG_SND_AC97_POWER_SAVE static int power_save = CONFIG_SND_AC97_POWER_SAVE_DEFAULT; -module_param(power_save, bool, 0644); -MODULE_PARM_DESC(power_save, "Enable AC97 power-saving control"); +module_param(power_save, int, 0644); +MODULE_PARM_DESC(power_save, "Automatic power-saving timeout " + "(in second, 0 = disable)."); #endif /* @@ -2362,7 +2363,7 @@ int snd_ac97_update_power(struct snd_ac97 *ac97, int reg, int powerup) * that open/close frequently) */ schedule_delayed_work(&ac97->power_work, - msecs_to_jiffies(2000)); + msecs_to_jiffies(power_save * 1000)); else { cancel_delayed_work(&ac97->power_work); update_power_regs(ac97); -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/