Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4920151rwn; Mon, 12 Sep 2022 01:03:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR61hdB1qxcE2IT87GyaP90A2Jyuz2LuaBhr6egQ4H7PnIp877pwcR6bw21CWVDXByGsadg0 X-Received: by 2002:a05:6402:120f:b0:44e:fe1a:b968 with SMTP id c15-20020a056402120f00b0044efe1ab968mr21171948edw.127.1662969815232; Mon, 12 Sep 2022 01:03:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662969815; cv=none; d=google.com; s=arc-20160816; b=y+fHq+oLthFxv0TsUXqOP6cJTLOgQYETymXAS92XWqA0KHQTseGKDcTIVBjFcKMAnu 4FzEMr56o6kWGnmRJEguyCbfYptEZqtoBhGpiA9ZsK20n4tUE+JkF2yc6pPUrFdYT1OX xU0+ZODfc8GpV6FINUMZVy4iNLHjldm9pIJaLjuH6uwwfkWNp5PthRN88RC1kTSKhDng K/qFsFDAHolqa8JvvW+wRO7wHwau5ab0ypzsgl2jnkH+m+60RetNmfBBfrBpX11234W2 nG+0iYru1N6d0WxEa/4DslfAwj0XGb+6oUoq9umBCiRW2isfeb8fjlDAixmJOyBl1fgM 43CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature:dkim-signature; bh=7e6T9v1um99KM+Ti20fFvByqOWXnRz1VDfkPokeSp40=; b=uyic3HGJo741IJ+XJJSEh0Lclp7T0bFwWjmhmKwIc9Yq4WWynkqSXZpMtKDo1KTaF0 bsQ563D6Xfamqb/4RPtZNZDx0XvqRIceWCrTfFVMBGd5DUAuMoZ9sN1/AZ7WZD9fWCch 4dB8kEJsrc54L2XlZUdrP124FuM/TRYTd+81fupUp50wmTUXXnSyRGPeGPks5Dar1GJB JB+IoMuz+Xa4AW7LjZdOyFkPccqxXPTCYVP1H7qilh8S8NS/mnVGX6sR7FC1c/ayZ8n4 67Zc1IHeGJeZYpSFsXxjmHsQB/D8NWm9G4EbINT02vt4SCxXr/cFY6ch1uQhWWN+LsYI Bd+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CgHsDalT; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hp37-20020a1709073e2500b007413ed9efb1si6622917ejc.543.2022.09.12.01.03.09; Mon, 12 Sep 2022 01:03:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=CgHsDalT; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230044AbiILHwp (ORCPT + 99 others); Mon, 12 Sep 2022 03:52:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229988AbiILHwn (ORCPT ); Mon, 12 Sep 2022 03:52:43 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63118220F5 for ; Mon, 12 Sep 2022 00:52:42 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 111522264B; Mon, 12 Sep 2022 07:52:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662969161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7e6T9v1um99KM+Ti20fFvByqOWXnRz1VDfkPokeSp40=; b=CgHsDalTGCT+TbQku15wyHuqww2SLchgqHpAzxE6r3apUnKAkofy9i/rKtp5cp/tPdx6fv iKuJ7D3hOuZn0TOEvNxb5XNxY0FUhrnrAP05Lv7BOCdzdh4AwOQvaElNJ3cZTZVu0OyyYw Q7PfF4m8TD1Hhtq1sZ+bOCEqdTG8KwE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662969161; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=7e6T9v1um99KM+Ti20fFvByqOWXnRz1VDfkPokeSp40=; b=p36L/M5NQnKuBVPIkGYKQndefXSBQbhExbSshXw4h3RoKCey7tf1iG2wJmjniMugq/u7oW V01rSxU/VPpRyLBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id DCB7B139C8; Mon, 12 Sep 2022 07:52:40 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id sNc8NUjlHmPZGAAAMHmgww (envelope-from ); Mon, 12 Sep 2022 07:52:40 +0000 Date: Mon, 12 Sep 2022 09:52:40 +0200 Message-ID: <87pmg1hvw7.wl-tiwai@suse.de> From: Takashi Iwai To: YJ Lee Cc: Jaroslav Kysela , Takashi Iwai , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, yuhsuan@chromium.org, whalechang@chromium.org Subject: Re: [PATCH v1] ALSA: dummy: Add customizable volume min/max. In-Reply-To: <20220912072945.760949-1-yunjunlee@chromium.org> References: <20220912072945.760949-1-yunjunlee@chromium.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 Sep 2022 09:29:45 +0200, YJ Lee wrote: > > Add module parameters to support customized min/max volume leveling, > which will be useful to test devices with different volume granularity. > > Signed-off-by: YJ Lee > --- > sound/drivers/dummy.c | 34 ++++++++++++++++++++++++---------- > 1 file changed, 24 insertions(+), 10 deletions(-) > > diff --git a/sound/drivers/dummy.c b/sound/drivers/dummy.c > index 2a7fc49c1a7c5..64fb2778f1e9a 100644 > --- a/sound/drivers/dummy.c > +++ b/sound/drivers/dummy.c > @@ -42,6 +42,8 @@ MODULE_LICENSE("GPL"); > #define USE_CHANNELS_MAX 2 > #define USE_PERIODS_MIN 1 > #define USE_PERIODS_MAX 1024 > +#define USE_MIXER_VOLUME_LEVEL_MIN -50 > +#define USE_MIXER_VOLUME_LEVEL_MAX 100 > > static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ > static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ > @@ -50,6 +52,8 @@ static char *model[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = NULL}; > static int pcm_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1}; > static int pcm_substreams[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 8}; > //static int midi_devs[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2}; > +static int mixer_volume_level_min = USE_MIXER_VOLUME_LEVEL_MIN; > +static int mixer_volume_level_max = USE_MIXER_VOLUME_LEVEL_MAX; > #ifdef CONFIG_HIGH_RES_TIMERS > static bool hrtimer = 1; > #endif > @@ -69,6 +73,10 @@ module_param_array(pcm_substreams, int, NULL, 0444); > MODULE_PARM_DESC(pcm_substreams, "PCM substreams # (1-128) for dummy driver."); > //module_param_array(midi_devs, int, NULL, 0444); > //MODULE_PARM_DESC(midi_devs, "MIDI devices # (0-2) for dummy driver."); > +module_param(mixer_volume_level_min, int, 0444); I can imagine that the permission could be 0644, so that the parameters can be changed dynamically via sysfs, too. But it may skip the sanity check at probe, hence more code would be needed, OTOH. So I applied the patch as is now. thanks, Takashi