Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp4288358rwi; Sat, 22 Oct 2022 07:50:35 -0700 (PDT) X-Google-Smtp-Source: AMsMyM72oXAtWNtEXViejynDPJ5YEFnfRrbrO1R1NxjrsNlKf9+JgNE3Mz4DmqqBRDqpciQG62O+ X-Received: by 2002:a17:90b:1e0a:b0:212:c44b:fffb with SMTP id pg10-20020a17090b1e0a00b00212c44bfffbmr13021006pjb.113.1666450235654; Sat, 22 Oct 2022 07:50:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666450235; cv=none; d=google.com; s=arc-20160816; b=0yuvu+fN22MGHWXjQD5KMIi5YkOnJd3Vt4S9LrAfXjfp1Dtg6+l6ZTUCyCQ29lPLva RXrjjzdas3x2l53pzQ4fYEdxR/bnx+ARpWhvmOsne5bmA+AABbfg0UVYZbi4QEyGDwCw ZLEkObDehCBKhgM4vvj96WWrHG4bBJ2mWfoEzXO/WSbBUZd15vHjOdQcSEbsAlr6HhzA SN7b5d5cN2TnpfhBSJ7Vjj1bklDOuVLeERZqlJk6xb87Drl4UXFkv+ScflHpBuHF3drL kCxy4tneP+y1Cy8JntvXJv2+kmkVtG2h2Mnq2nkWavk5Md+106D9Ix6FGDgyNUR4VaYC aDFA== 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=bdveSHTZR7rMTd74dH97Qj/dewlTLrrohKrMTmj28+A=; b=HAG7kp5w6US1k3iam97+Ksh0fbRkwGuYTj/7Ttnz6K4OQCDHi1lUfk1y3wgO5Om5rt EUEYJktneDVsQ8z84Pv1g8OuBeVteqUT1zriHY03g+/mB0gxNPzl79V34EMINCluQ3pP eqVcTq1UBYCLNy4BOVuxWxog0zPvwb+eTQ6Xc/3dfUg81CMhkNJkI1o8LwDlcOFUmw52 w5GgeyB/pINB4gLQoax2xR/wrO3daN7HOMOrGGtQ9OL/30xsX/aT5eGQDOO5WZcvDbJZ R6j71MBRwBX9EkQIaju52WVZk/zQL25XZDhXWfz1oaoaPjerWbkgq8YF6c5YWHMq3oP5 9H+Q== 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 z17-20020a170902d55100b00182c51058ffsi28900004plf.201.2022.10.22.07.50.20; Sat, 22 Oct 2022 07:50: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; 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 S229795AbiJVO3x (ORCPT + 99 others); Sat, 22 Oct 2022 10:29:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiJVO3v (ORCPT ); Sat, 22 Oct 2022 10:29:51 -0400 Received: from sonata.ens-lyon.org (domu-toccata.ens-lyon.fr [140.77.166.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3063474E6 for ; Sat, 22 Oct 2022 07:29:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by sonata.ens-lyon.org (Postfix) with ESMTP id E3F432011C; Sat, 22 Oct 2022 16:29:45 +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 K9fSlhhzi-8E; Sat, 22 Oct 2022 16:29:45 +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 6A61A2011A; Sat, 22 Oct 2022 16:29:45 +0200 (CEST) Received: from samy by begin with local (Exim 4.96) (envelope-from ) id 1omFVQ-0001qz-33; Sat, 22 Oct 2022 16:29:44 +0200 Date: Sat, 22 Oct 2022 16:29:44 +0200 From: Samuel Thibault To: Osama Muhammad Cc: gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org, okash.khawaja@gmail.com Subject: Re: [PATCH] Accessiblity: speakup_apollo: specifying the default driver parameters among the module params Message-ID: <20221022142944.fy5t3fq7qauxcosq@begin> Mail-Followup-To: Samuel Thibault , Osama Muhammad , gregkh@linuxfoundation.org, speakup@linux-speakup.org, linux-kernel@vger.kernel.org, okash.khawaja@gmail.com References: <20221021135216.249406-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: <20221021135216.249406-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 ven. 21 oct. 2022 18:52:16 +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_apollo 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! > --- > .../accessibility/speakup/speakup_apollo.c | 46 +++++++++++++++---- > 1 file changed, 37 insertions(+), 9 deletions(-) > > diff --git a/drivers/accessibility/speakup/speakup_apollo.c b/drivers/accessibility/speakup/speakup_apollo.c > index c84a7e0864b7..d2fbb3f57221 100644 > --- a/drivers/accessibility/speakup/speakup_apollo.c > +++ b/drivers/accessibility/speakup/speakup_apollo.c > @@ -24,15 +24,28 @@ > > static void do_catch_up(struct spk_synth *synth); > > -static struct var_t vars[] = { > - { CAPS_START, .u.s = {"cap, " } }, > - { CAPS_STOP, .u.s = {"" } }, > - { RATE, .u.n = {"@W%d", 6, 1, 9, 0, 0, NULL } }, > - { PITCH, .u.n = {"@F%x", 10, 0, 15, 0, 0, NULL } }, > - { VOL, .u.n = {"@A%x", 10, 0, 15, 0, 0, NULL } }, > - { VOICE, .u.n = {"@V%d", 1, 1, 6, 0, 0, NULL } }, > - { LANG, .u.n = {"@=%d,", 1, 1, 4, 0, 0, NULL } }, > - { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > + > + > +enum default_vars_id { > + CAPS_START_ID = 0, CAPS_STOP_ID, > + RATE_ID, PITCH_ID, > + VOL_ID, VOICE_ID, LANG_ID, > + DIRECT_ID, V_LAST_VAR_ID, > + NB_ID > +}; > + > + > + > + > +static struct var_t vars[NB_ID] = { > + [CAPS_START_ID] = { CAPS_START, .u.s = {"cap, " } }, > + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"" } }, > + [RATE_ID] = { RATE, .u.n = {"@W%d", 6, 1, 9, 0, 0, NULL } }, > + [PITCH_ID] = { PITCH, .u.n = {"@F%x", 10, 0, 15, 0, 0, NULL } }, > + [VOL_ID] = { VOL, .u.n = {"@A%x", 10, 0, 15, 0, 0, NULL } }, > + [VOICE_ID] = { VOICE, .u.n = {"@V%d", 1, 1, 6, 0, 0, NULL } }, > + [LANG_ID] = { LANG, .u.n = {"@=%d,", 1, 1, 4, 0, 0, NULL } }, > + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, > V_LAST_VAR > }; > > @@ -193,10 +206,25 @@ static void do_catch_up(struct spk_synth *synth) > module_param_named(ser, synth_apollo.ser, int, 0444); > module_param_named(dev, synth_apollo.dev_name, charp, 0444); > module_param_named(start, synth_apollo.startup, short, 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(vol, vars[VOL_ID].u.n.default_val, int, 0444); > +module_param_named(voice, vars[VOICE_ID].u.n.default_val, int, 0444); > +module_param_named(lang, vars[LANG_ID].u.n.default_val, int, 0444); > +module_param_named(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); > + > > MODULE_PARM_DESC(ser, "Set the serial port for the synthesizer (0-based)."); > MODULE_PARM_DESC(dev, "Set the device e.g. ttyUSB0, for the synthesizer."); > MODULE_PARM_DESC(start, "Start the synthesizer once it is loaded."); > +MODULE_PARM_DESC(rate, "Set the rate variable on load."); > +MODULE_PARM_DESC(pitch, "Set the pitch variable on load."); > +MODULE_PARM_DESC(vol, "Set the vol variable on load."); > +MODULE_PARM_DESC(voice, "Set the voice variable on load."); > +MODULE_PARM_DESC(lang, "Set the lang variable on load."); > +MODULE_PARM_DESC(direct, "Set the direct variable on load."); > + > + > > module_spk_synth(synth_apollo); > > -- > 2.25.1 > -- Samuel --- Pour une évaluation indépendante, transparente et rigoureuse ! Je soutiens la Commission d'Évaluation de l'Inria.