Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp3614138rwi; Sun, 16 Oct 2022 14:45:57 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5shZNCU2qlwZ6OW1ihZES2f3o/iZ34XMiXnMMBjUNeKzMoE9e/dnjshjsiylvPy9GOMoMP X-Received: by 2002:a63:111f:0:b0:452:bab4:dc54 with SMTP id g31-20020a63111f000000b00452bab4dc54mr7622011pgl.344.1665956757424; Sun, 16 Oct 2022 14:45:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665956757; cv=none; d=google.com; s=arc-20160816; b=DaQdBg1LzNdCD6u+yO+I7mlqOe/JAANGftuu0ERBREFf45hC1unXnzE51KP8lKNnYb mkdM6epqKPhVQdZTpnbiCPc7Rg0nIs7fR2p6A3vjOtUMCz+RX479C9G0Wx/iPcKZBHoU HG0DKus/F9AvcBVWT9z+A5V9z8lK+h4KZ/vg3y8j8U3sXZ137GrtdMLEWu96X5GlyW0K 1c8GRAZz7pCpupc4hG2JZvjlcfsgDMPKCAdcBeVmT05EKqnSVux87PPGHTElUYyguS7z nQpCJ/TMfjk48uF1dRwM0hjQSfrL7KhCnOhU/O/wP26Q+7/qaibSF1xJAlmgELuJWyT6 26PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=Jw3SRjHyjBGRsfvoZL0lgmjRudcczBPIS3+Dc3d/97E=; b=FdVsLeBVt2u+W4zz39Z5lfR27aMj3mHrL1tAmNxXMBHZ/XIh+4nR7s3J2CSUdT8WIA RLzGBKWx4ryES7Vqzzz40VdNzbfmcaWJkmT4BKI7TNpALQNMRfLOjuIDLkdaY0IdikQy tHERf4Gomb++GCnqLsWVG4Z2LtJ19FRBv17u5gr+HZ0+2zwTHnpatI6C4YG5ey6Nezt9 i5l1z4FqzGkcZpGDyhkmXPHF3738JNYoor6wDxR8fWj+/w8lLxUSu1XcbTkdXN/aC321 azlFQhTd2BgVqEI9907ZA5oU3PZMlA47CgbR/0xrsYGSnGvUzXHiz3bgrRNPRicxVqzD QJbA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x21-20020a633115000000b00434c1a920a9si9982848pgx.520.2022.10.16.14.45.25; Sun, 16 Oct 2022 14:45:57 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229669AbiJPVdX (ORCPT + 99 others); Sun, 16 Oct 2022 17:33:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48540 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbiJPVdW (ORCPT ); Sun, 16 Oct 2022 17:33:22 -0400 Received: from sonata.ens-lyon.org (sonata.ens-lyon.org [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ABF411829 for ; Sun, 16 Oct 2022 14:33:21 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id 5F3AF2015F; Sun, 16 Oct 2022 23:33:19 +0200 (CEST) Received: from sonata.ens-lyon.org ([127.0.0.1]) by localhost (sonata.ens-lyon.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lNgpmwb1JskA; Sun, 16 Oct 2022 23:33:19 +0200 (CEST) Received: from begin (lfbn-bor-1-376-208.w109-215.abo.wanadoo.fr [109.215.91.208]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by sonata.ens-lyon.org (Postfix) with ESMTPSA id C2BAF20158; Sun, 16 Oct 2022 23:33:18 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1okBG2-004C2j-1S; Sun, 16 Oct 2022 23:33:18 +0200 Date: Sun, 16 Oct 2022 23:33:18 +0200 From: Samuel Thibault To: Osama Muhammad Cc: gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3] Accessiblity: speakup: specifying the default driver parameters among the module params Message-ID: <20221016213318.zrvywwm5bbfj3r5j@begin> Mail-Followup-To: Samuel Thibault , Osama Muhammad , gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org References: <20221016203936.5264-1-osmtendev@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221016203936.5264-1-osmtendev@gmail.com> Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 Osama Muhammad, le lun. 17 oct. 2022 01:39:36 +0500, a ecrit: > This is an enhancement which allows to specify the default driver > parameters among the module parameters. > > Adding default variables to the speakup_soft module > allows to easily set that at boot, rather than > setting the sys variables after boot. > More details can be found here: > https://github.com/linux-speakup/speakup/issues/7 > > Signed-off-by: Osama Muhammad Reviewed-by: Samuel Thibault Thanks! (it'd be useful to perform it on other drivers as well) > > --- > Changes since v2: > - Removed an unnecessary comment. > > Changes since v1: > - Added NB_ID as the last member of enum default_vars_id. > - Added NB_ID as the size of array vars. > - Made sure that that the enteries in vars are in correct order. > --- > drivers/accessibility/speakup/speakup_soft.c | 59 ++++++++++++++------ > 1 file changed, 43 insertions(+), 16 deletions(-) > > diff --git a/drivers/accessibility/speakup/speakup_soft.c b/drivers/accessibility/speakup/speakup_soft.c > index 28c8f60370cf..6d446824677b 100644 > --- a/drivers/accessibility/speakup/speakup_soft.c > +++ b/drivers/accessibility/speakup/speakup_soft.c > @@ -33,21 +33,30 @@ static struct miscdevice synth_device, synthu_device; > static int init_pos; > static int misc_registered; > > -static struct var_t vars[] = { > - /* DIRECT is put first so that module_param_named can access it easily */ > - { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > - > - { CAPS_START, .u.s = {"\x01+3p" } }, > - { CAPS_STOP, .u.s = {"\x01-3p" } }, > - { PAUSE, .u.n = {"\x01P" } }, > - { RATE, .u.n = {"\x01%ds", 2, 0, 9, 0, 0, NULL } }, > - { PITCH, .u.n = {"\x01%dp", 5, 0, 9, 0, 0, NULL } }, > - { INFLECTION, .u.n = {"\x01%dr", 5, 0, 9, 0, 0, NULL } }, > - { VOL, .u.n = {"\x01%dv", 5, 0, 9, 0, 0, NULL } }, > - { TONE, .u.n = {"\x01%dx", 1, 0, 2, 0, 0, NULL } }, > - { PUNCT, .u.n = {"\x01%db", 0, 0, 3, 0, 0, NULL } }, > - { VOICE, .u.n = {"\x01%do", 0, 0, 7, 0, 0, NULL } }, > - { FREQUENCY, .u.n = {"\x01%df", 5, 0, 9, 0, 0, NULL } }, > + > +enum default_vars_id { > + DIRECT_ID = 0, CAPS_START_ID, CAPS_STOP_ID, > + PAUSE_ID, RATE_ID, PITCH_ID, INFLECTION_ID, > + VOL_ID, TONE_ID, PUNCT_ID, VOICE_ID, > + FREQUENCY_ID, V_LAST_VAR_ID, > + NB_ID > +}; > + > + > +static struct var_t vars[NB_ID] = { > + > + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x01+3p" } }, > + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x01-3p" } }, > + [PAUSE_ID] = { PAUSE, .u.n = {"\x01P" } }, > + [RATE_ID] = { RATE, .u.n = {"\x01%ds", 2, 0, 9, 0, 0, NULL } }, > + [PITCH_ID] = { PITCH, .u.n = {"\x01%dp", 5, 0, 9, 0, 0, NULL } }, > + [INFLECTION_ID] = { INFLECTION, .u.n = {"\x01%dr", 5, 0, 9, 0, 0, NULL } }, > + [VOL_ID] = { VOL, .u.n = {"\x01%dv", 5, 0, 9, 0, 0, NULL } }, > + [TONE_ID] = { TONE, .u.n = {"\x01%dx", 1, 0, 2, 0, 0, NULL } }, > + [PUNCT_ID] = { PUNCT, .u.n = {"\x01%db", 0, 0, 3, 0, 0, NULL } }, > + [VOICE_ID] = { VOICE, .u.n = {"\x01%do", 0, 0, 7, 0, 0, NULL } }, > + [FREQUENCY_ID] = { FREQUENCY, .u.n = {"\x01%df", 5, 0, 9, 0, 0, NULL } }, > V_LAST_VAR > }; > > @@ -451,10 +460,28 @@ static int softsynth_adjust(struct spk_synth *synth, struct st_var_header *var) > } > > module_param_named(start, synth_soft.startup, short, 0444); > -module_param_named(direct, vars[0].u.n.default_val, int, 0444); > +module_param_named(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); > +module_param_named(rate, vars[RATE_ID].u.n.default_val, int, 0444); > +module_param_named(pitch, vars[PITCH_ID].u.n.default_val, int, 0444); > +module_param_named(inflection, vars[INFLECTION_ID].u.n.default_val, int, 0444); > +module_param_named(vol, vars[VOL_ID].u.n.default_val, int, 0444); > +module_param_named(tone, vars[TONE_ID].u.n.default_val, int, 0444); > +module_param_named(punct, vars[PUNCT_ID].u.n.default_val, int, 0444); > +module_param_named(voice, vars[VOICE_ID].u.n.default_val, int, 0444); > +module_param_named(frequency, vars[FREQUENCY_ID].u.n.default_val, int, 0444); > + > + > > MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded."); > MODULE_PARM_DESC(direct, "Set the direct variable on load."); > +MODULE_PARM_DESC(rate, "Sets the rate of the synthesizer."); > +MODULE_PARM_DESC(pitch, "Sets the pitch of the synthesizer."); > +MODULE_PARM_DESC(inflection, "Sets the inflection of the synthesizer."); > +MODULE_PARM_DESC(vol, "Sets the volume of the speech synthesizer."); > +MODULE_PARM_DESC(tone, "Sets the tone of the speech synthesizer."); > +MODULE_PARM_DESC(punct, "Sets the amount of punctuation spoken by the synthesizer."); > +MODULE_PARM_DESC(voice, "Sets the voice used by the synthesizer."); > +MODULE_PARM_DESC(frequency, "Sets the frequency of speech synthesizer."); > > module_spk_synth(synth_soft); > > -- > 2.25.1 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.