From: Takashi Iwai Subject: Re: [PATCH 14/15] ALSA: asihpi - Add volume mute controls Date: Fri, 22 Jul 2011 08:01:26 +0200 Message-ID: References: <1311306785-23116-1-git-send-email-linux@audioscience.com> <1311306785-23116-29-git-send-email-linux@audioscience.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 4717D24543 for ; Fri, 22 Jul 2011 08:01:32 +0200 (CEST) In-Reply-To: <1311306785-23116-29-git-send-email-linux@audioscience.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: linux@audioscience.com Cc: Eliot Blennerhassett , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Fri, 22 Jul 2011 15:53:03 +1200, linux@audioscience.com wrote: > > diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c > index 8033d85..47366fb 100644 > --- a/sound/pci/asihpi/asihpi.c > +++ b/sound/pci/asihpi/asihpi.c > @@ -1486,11 +1486,48 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, > > static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0); > > +static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol, > + struct snd_ctl_elem_info *uinfo) > +{ > + uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; > + uinfo->count = 1; > + uinfo->value.integer.min = 0; > + uinfo->value.integer.max = 1; > + return 0; > +} snd_ctl_boolean_mono_info() is provided just for this type. I applied the patch below in addition. Takashi --- From: Takashi Iwai Subject: [PATCH] ALSA: asihpi - Replace with snd_ctl_boolean_mono_info() Signed-off-by: Takashi Iwai --- sound/pci/asihpi/asihpi.c | 10 +--------- 1 files changed, 1 insertions(+), 9 deletions(-) diff --git a/sound/pci/asihpi/asihpi.c b/sound/pci/asihpi/asihpi.c index f2b35e1..cc809ac 100644 --- a/sound/pci/asihpi/asihpi.c +++ b/sound/pci/asihpi/asihpi.c @@ -1487,15 +1487,7 @@ static int snd_asihpi_volume_put(struct snd_kcontrol *kcontrol, static const DECLARE_TLV_DB_SCALE(db_scale_100, -10000, VOL_STEP_mB, 0); -static int snd_asihpi_volume_mute_info(struct snd_kcontrol *kcontrol, - struct snd_ctl_elem_info *uinfo) -{ - uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; - uinfo->count = 1; - uinfo->value.integer.min = 0; - uinfo->value.integer.max = 1; - return 0; -} +#define snd_asihpi_volume_mute_info snd_ctl_boolean_mono_info static int snd_asihpi_volume_mute_get(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) -- 1.7.6