From patchwork Wed Nov 9 21:50:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17837 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578510wru; Wed, 9 Nov 2022 13:52:34 -0800 (PST) X-Google-Smtp-Source: AMsMyM5AViVEmFd5NYjgYzltfgI4nXFT3LaLEQah/Yc1FvdehIxt7ywHxwZuCyuRNh4xdjI+rEkz X-Received: by 2002:a17:906:6155:b0:79f:e0b3:3b9b with SMTP id p21-20020a170906615500b0079fe0b33b9bmr1791887ejl.378.1668030754443; Wed, 09 Nov 2022 13:52:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030754; cv=none; d=google.com; s=arc-20160816; b=NMX3XyUWKNCRSZQHlH9Cumkw87sb7SSXwEVZz6Isb/W7D3YZcZMKQjDm0ptCTI1spu dztOtluNnoMvVoYFegYpy89k9W4v3ahR/yad3IbQJsiaVQCdDdq/4yKfgqnsOJcaBPFJ /v+Fj98rd6nBJu5GkAmEy22gISV14stwbmgiCpurdSZisDRFZSKkG0FhBH1/+ZGVnxoD oCf4D7eicJt1jfEWze8oVXMWHfaSc78sS6xGhEOR0VhXsLdhGrsXkGOIa8cuRv7sgNTK /5gozyecHZ9eQfZs6IuoaGZ7caBBZtRWopTUhqixrkJg6cY/PISmZ0RO5UjvcXD6xWge dOSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ydGTLGal/xbxjBKCjE1wDszyUaLZwuor5HRFhrv26Vo=; b=duamk9mWflr0FKX7ldEcU9TCsof5sRQDQtKt1sWOQD2gnHBVtOylLzew67lP9dvBSo X/LaF3mNrupi5ZyG9xclZqr/Pvl3LmZfFsOywTMaguAnbhZzYxBk6IXQFR/5fep9F8aq /OlMlWZ/sbnbU2hY9Bqi3fIxyDnVxEEy62j7gofzxhLqKMtR4j+mgxc9PbufzJjGF4HS tc3/DQgrn3oCxcWiXfUWjMgwZEJgli6hGB7s4H2MomWG+AczMZUJiLniNZbG9uYT6IBf gYkyEbwYcZ2p21RYdGwzBI5Q1RaFTgmUJRHKa9aE5MGVgHJ8g6Vs4BdyOJaxPP1hwRMH 8dsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VgvLajr7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a4-20020a05640213c400b00456cc6e1017si13823376edx.109.2022.11.09.13.52.10; Wed, 09 Nov 2022 13:52:34 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=VgvLajr7; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbiKIVvw (ORCPT + 99 others); Wed, 9 Nov 2022 16:51:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231890AbiKIVvs (ORCPT ); Wed, 9 Nov 2022 16:51:48 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59F4F30F4D for ; Wed, 9 Nov 2022 13:51:47 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id g12so27837017wrs.10 for ; Wed, 09 Nov 2022 13:51:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ydGTLGal/xbxjBKCjE1wDszyUaLZwuor5HRFhrv26Vo=; b=VgvLajr7dXYR1Nk+621wPaHRjCVDQ2KFLzmxQL/dtzx2Lq8CO5tsDNsKRxw63R0inJ jCfGUjK2qNDu2b+XrA9WnfQXg2utryB15vnyPXe1uit8TkF0FLHkO1rY8345uJNnyy4w XmCglTRPjETlRUH8u3YX+cVR8IxXdvU7srIhGlO4zu/cTi3yalsbb3zk7LJefQ8R8P+i 9F36YBUvWTqVZXWePNU4RSeSzhLKJpNPoyYq622w5HrTxK4uCchzdBhezTmi3dKATkqV o0ivqfnWjl5I6BEOqJI1X6BvFmanSYpeo8fdnF2lKyBok41FMMiI+wtiApqsjZDiCaOb LSEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ydGTLGal/xbxjBKCjE1wDszyUaLZwuor5HRFhrv26Vo=; b=1IkU4dTisAABecsuic+ytzB8+dzei9sR6lYxVidUZYJhhbiD0cBoIDU39i2cMUYA7f Kw4UUQlIhzYP6QRC1czkxvO70roukQ34JQf7qpPkbNFPUDpKeT+ed3hJ9lFz6E5GKqum CMMNMTYgdgGP8G89GYB2o76je4JLBskPq5ipzCJErkYrzWlsuqII3HgOjw92/ChtGmfo pDEpYqMZNn5z2vGIZUV1uL8wj3s+nSc0x0BqK3/XTFHKeLwbwJWsr5O6rQWY6yjraxJt zXHEsFMKOynFp+0+hSXj100TEL5/J5H+39nk9VbDp1LXiTt9akk0Fl1WvBkco454GPpe CaFQ== X-Gm-Message-State: ACrzQf17pX36uXplgXXNiV8GLL2rmtfj0rwGGTguUcV8RcrEo0KrpqMM x76+6LymH8TSszTFRRxxmYM= X-Received: by 2002:adf:f8c2:0:b0:236:9cd1:6748 with SMTP id f2-20020adff8c2000000b002369cd16748mr38233993wrq.283.1668030705883; Wed, 09 Nov 2022 13:51:45 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:45 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 01/15] Accessiblity: speakup_soft: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:54 +0500 Message-Id: <20221109215108.7933-2-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057016686920361?= X-GMAIL-MSGID: =?utf-8?q?1749057016686920361?= 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 --- 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); From patchwork Wed Nov 9 21:50:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17838 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578599wru; Wed, 9 Nov 2022 13:52:45 -0800 (PST) X-Google-Smtp-Source: AMsMyM7Wn8/9MNSRnExcissTpoeRlyDpQU0kVafieFs9CrQzHqVB9y/9Iw/O/OqWHrseW4CONksR X-Received: by 2002:a17:906:c40b:b0:7aa:40ea:faae with SMTP id u11-20020a170906c40b00b007aa40eafaaemr1807816ejz.551.1668030765609; Wed, 09 Nov 2022 13:52:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030765; cv=none; d=google.com; s=arc-20160816; b=I278Xu1U73l8b3KfLnFDmGWzSXqU+7g7tgRguX66befYMAgcPASdcoUhqo1fg4F6y6 95qe7fyfjEjwMYv1q+PQZz9zAkb+RmcQ7B+DrbRrPKZuAP9RbYB9YoeI2ZlgF+5txta4 7ya+Z6WPv4qTrGcmAL88UQQrH1P1ZE9nbXKEGPEKPMTxJo/b1MNz1uDuM6cg/rkUjb1A FREXy+gjLnEmNnPQiO+4wpZ1+JXHNWztyJ2XFvnhf9o1u2w5JU05hBBaygoDOsc8DTU/ LmQh23ybPEEt4IfrYZoJnVyKziC8VK5BPLc8R7Nl0XiJiwHlVGd4SS6S7FT8UPxUzEM7 VTmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rQRstknxPu8NJsilcRcfIhqLjWZkDyWSxLfboGibmPc=; b=M9H3pRh4qITVv2woPdRtbDWL1W9h7oEKxhH4/NBRIPRaV1aX5YJwKjN1H8Y+oKQkpn EYMp0BbnlbNW9rXKiN1Jhk3dBGSpMJRsOxgCFUL3gQPuZ3+0hXEpjGmymfFy2AxIhytI /0DYcwtVbjcmDBSlJU1oZP8gML1Ai32WCO4BT0qMgRJsddxLlCzbWdIsQXovkeD/4ePK Mkcymi8T3acL1qKeoDM8pfm5jbCcemGG4Y7tHs1ojwdaqkCRbTbohAQ0SaDkfNh7n+OM yZuHTd3hRF6wdD1rUDOAzoWnnANgWiUFC9/bYIr4tmfq6ViUldoDFYGEl9jVrLqg1XuT CMBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=XFGrgBKd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a50d0d4000000b00463a61c257dsi13720136edf.524.2022.11.09.13.52.21; Wed, 09 Nov 2022 13:52:45 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=XFGrgBKd; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231906AbiKIVv7 (ORCPT + 99 others); Wed, 9 Nov 2022 16:51:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231843AbiKIVvv (ORCPT ); Wed, 9 Nov 2022 16:51:51 -0500 Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8EFE031222 for ; Wed, 9 Nov 2022 13:51:49 -0800 (PST) Received: by mail-wr1-x433.google.com with SMTP id bs21so27887431wrb.4 for ; Wed, 09 Nov 2022 13:51:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rQRstknxPu8NJsilcRcfIhqLjWZkDyWSxLfboGibmPc=; b=XFGrgBKd1IHPUyy1nS5cRLwL2RYAWv8/vcd9NuQd8q5w+vBibFqqrxoTIL1sDyJj/+ yMVh9h7THXkIfrsBuCkzk7jYOYKxa9BanUVoeqX4SIQ68bLqxLQ6yKU8SQFnUDyc9zLf HyqYuOFKwvGJCKNET9ox4qOXzZhqMCVKRwkmIzyPOckYvuzcRbjQE0MVmp3sFVrLID5u 7t2KdQ7d/CRBwadcsmyc5azZsZfKVh11b2THeBkcujZPFHIwfQn5B/gM2Ys/d5UD3rjH obUCQ2xDKXfRrNhMsR1WHmPH00DBzcXCO9atB+jv7p/lXVNnB165U0ytfCGxiZEjb6rG qZ7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rQRstknxPu8NJsilcRcfIhqLjWZkDyWSxLfboGibmPc=; b=ATgiTjAo9kRUQBq1IVA01rsD6fDOHkmK6cFCs/JZIZmjJtXBW2IBbx9WToAeff99OU ipYJ1rKUZgh7/lhpJwZLAHXT/0L2i1L+w58vZfxQ6qJ++rgp4a5SowMnVp2BAIc0LFEq 2BGt2UgPaL9tcfjCgGsqbIYKKHCyErscMEOYaTtE3ukqAH1ySYftPGF8H9Mq1UoYcOHi Kzz3PY9eom0aEOPcVwMsB7DYu/RaUdweaqhmnd8JuIeAmw6uBtS++RFAgaVwMiKHeAjU dYX6pUFtU4LZYSM3+Nxt//GwtqBntSN6LMlOnbp55s4MBsGfPsxNQUUT+vYuxlML+mX6 7aJA== X-Gm-Message-State: ACrzQf1n+zgnUDCFobt7jsAVb3JuguoebpNUoCYwxbKF45/SQ/gnf0Vp 1zCaNbkMeXaNrEArJz27g+w= X-Received: by 2002:adf:f411:0:b0:236:e5a2:4f64 with SMTP id g17-20020adff411000000b00236e5a24f64mr29054487wro.182.1668030708138; Wed, 09 Nov 2022 13:51:48 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:47 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 02/15] Accessiblity: speakup_apollo: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:55 +0500 Message-Id: <20221109215108.7933-3-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057028362788446?= X-GMAIL-MSGID: =?utf-8?q?1749057028362788446?= 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 --- .../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); From patchwork Wed Nov 9 21:50:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17839 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578658wru; Wed, 9 Nov 2022 13:52:54 -0800 (PST) X-Google-Smtp-Source: AA0mqf67FS5dP1sfoPSvQeICJkVDW6I+dedP/GJRrpbhO/UcOY9tqiwZtpGDCpzkCt3NgPGHPhuG X-Received: by 2002:a50:8d0d:0:b0:466:97ad:c686 with SMTP id s13-20020a508d0d000000b0046697adc686mr10631546eds.240.1668030774091; Wed, 09 Nov 2022 13:52:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030774; cv=none; d=google.com; s=arc-20160816; b=lZEJy0qNopsCE8QGWNx+LMjDHVHRU2fT4Vaft1SpOEHSDQwJyslLpKB1S79pOX2Jqg oHw9hdUISAAjS4+NBvH+BPokAE2p4o4En1TRhduZ9TIApk4zbVPB6ROuP6z/DTpcYL5/ AbK51PjlqnfubXSiYQ9uLZMMegQD9IzTivcqDTbxiB1uLZj2XR0jfagmiC+vMeh8xz9+ DkATKQW90/t6BGwhlPNP7MEWl5RlED9LSXAoqHivMiTMFlAZn24LiQ/oFAqOAOZTw7MS FbKD8ZmMYYXJAVUeUg39hExEPfkHkDwHyd9HPWP37KiY6J+Yz0qlXIKkBnf4IoNvMt5Y /37w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=fwFfJkgLBMsG8X68BTthTYj/FVRMJ4sv5Wum1nW3dsU=; b=ABdeCjfWXIJuza/f9L9tvjjQ37Un3rTuzFJHXTfHDQitmt+Aj/PZVAiyMgHSLCy31b RxtE5uvCZecWOecVSU4qkdwVHTdY16pzAmForO+D6JVLbgW2zSQWdZCdauc/WPheIMJK 5DQBcWzbd/V8c5zeIL7TLp6vZn0iBsxya4XEzXOlIwghYbAQTbFlgung7CuycLtxUu5n TG5fi2PUSL+taDDx4qvSXE7qgSZQ+JwzuO6DkVxvWxHcnTg97noZER+viT3EdDGVs81B H90JEuQep8NV+XdIv5O43xIU3o6+bRb3/3784/mO33CxtHeSWr5HEqkdGynZjdEqfVKt QBjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=HptzlRgo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ne40-20020a1709077ba800b007adb388df38si17730890ejc.706.2022.11.09.13.52.29; Wed, 09 Nov 2022 13:52:54 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=HptzlRgo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231808AbiKIVwD (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231909AbiKIVvx (ORCPT ); Wed, 9 Nov 2022 16:51:53 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F9C62FFE3 for ; Wed, 9 Nov 2022 13:51:52 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id bk15so27814995wrb.13 for ; Wed, 09 Nov 2022 13:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fwFfJkgLBMsG8X68BTthTYj/FVRMJ4sv5Wum1nW3dsU=; b=HptzlRgoLjPgDZhtwo5vAmPxJU0r+CbQBAxr4NnD1htXFtLC2WCPTPDZ2NJbk607B4 XhLjIl11DtQPIYvLrrceO1EQLt3rUBC2pa1/HR9DrVGHlE4SYV5tDUb93nwIuLawJFJB YhKLGP6Yj/R18FxRdwoNme1ZE7dArYcz3W/J533AOeaTEqdmEg8JnnJUA8HfXYGaCU1m kJhpr6veI63/V22VzG9qpOVOI3x09XpW2vKPDmSHaIk0xDLb/5mlqzNX3jBbQTjjIjZu w8L1CPOWPtD+JTv5o3AMRQJYRjhbLT5qQp0JGJ4NG8Nk4M6q8cUFeZTXJEFNUBeURbvB CEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fwFfJkgLBMsG8X68BTthTYj/FVRMJ4sv5Wum1nW3dsU=; b=knx4IsfN8UB2W6OnR2vue4HSDaMPt/a1dh+bONSPu5AvEVaJ+Ao7otnAjuFiuWvGNE JW/wC5tnFtYDXd0RVM+cK/cowcj0yJKsL+rWjScmhM3ndBNCndxfk3AGhTZXVkKM1MiT nJSiYnGTnh/bkGHyS03Kr4BZu51/lX2BxT02zumlDf4xx/uKDA5NiH0mrOIU735OXjDJ LolO1ISdw9pZlyWtBS2gfQZxqU9IppiwLtmSXDLrMiV/8HV9wRmlC5NcMztGR12Zx44u D9e9a5avcTwAWX2HqygO+iCeG0xHtZ32LUJiq7n2a3b+NUq2giRkThWl6f0xHJQVVDQA I6OQ== X-Gm-Message-State: ACrzQf0ZoTZo1hfvhWQP1ZiuBb4G7Hi0GVgZ9Wa8FdkFHZVGobRkjTTt FXzUarzUnxGe6jsAPoHJGGY= X-Received: by 2002:adf:ec8b:0:b0:236:6f30:924f with SMTP id z11-20020adfec8b000000b002366f30924fmr40045465wrn.230.1668030710817; Wed, 09 Nov 2022 13:51:50 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:50 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 03/15] Accessiblity: speakup_audptr: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:56 +0500 Message-Id: <20221109215108.7933-4-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057037109015476?= X-GMAIL-MSGID: =?utf-8?q?1749057037109015476?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding a default variables to the speakup_audptr 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 --- .../accessibility/speakup/speakup_audptr.c | 42 +++++++++++++++---- 1 file changed, 33 insertions(+), 9 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_audptr.c b/drivers/accessibility/speakup/speakup_audptr.c index 4d16d60db9b2..55813f3e40ff 100644 --- a/drivers/accessibility/speakup/speakup_audptr.c +++ b/drivers/accessibility/speakup/speakup_audptr.c @@ -19,15 +19,24 @@ static int synth_probe(struct spk_synth *synth); static void synth_flush(struct spk_synth *synth); -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x05[f99]" } }, - { CAPS_STOP, .u.s = {"\x05[f80]" } }, - { RATE, .u.n = {"\x05[r%d]", 10, 0, 20, 100, -10, NULL } }, - { PITCH, .u.n = {"\x05[f%d]", 80, 39, 4500, 0, 0, NULL } }, - { VOL, .u.n = {"\x05[g%d]", 21, 0, 40, 0, 0, NULL } }, - { TONE, .u.n = {"\x05[s%d]", 9, 0, 63, 0, 0, NULL } }, - { PUNCT, .u.n = {"\x05[A%c]", 0, 0, 3, 0, 0, "nmsa" } }, - { 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, TONE_ID, PUNCT_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x05[f99]" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x05[f80]" } }, + [RATE_ID] = { RATE, .u.n = {"\x05[r%d]", 10, 0, 20, 100, -10, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x05[f%d]", 80, 39, 4500, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\x05[g%d]", 21, 0, 40, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\x05[s%d]", 9, 0, 63, 0, 0, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"\x05[A%c]", 0, 0, 3, 0, 0, "nmsa" } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -158,10 +167,25 @@ static int synth_probe(struct spk_synth *synth) module_param_named(ser, synth_audptr.ser, int, 0444); module_param_named(dev, synth_audptr.dev_name, charp, 0444); module_param_named(start, synth_audptr.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(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(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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_audptr); From patchwork Wed Nov 9 21:50:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17840 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578687wru; Wed, 9 Nov 2022 13:52:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM4oAoHDAzhuUg+9fJO9Ml7twPTN9+MHybc9EEuNAgz/mOGCoVZQ6DCTtq6jhpspMEbs7dz4 X-Received: by 2002:a17:906:cc5b:b0:7a9:e58d:bad9 with SMTP id mm27-20020a170906cc5b00b007a9e58dbad9mr58158517ejb.237.1668030779396; Wed, 09 Nov 2022 13:52:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030779; cv=none; d=google.com; s=arc-20160816; b=dNNjRdIpQxnkTIHHh4C+79Vm0VfENi5AdnvvADh2CYnMenw9veIHIdNy8wvYhiWAGO ZUpQunk6uqmXrlVr45vSXlb+p5IBmhA3WyoVCoQQvKe7lQWONUiRcicDVTnM2MhZVrZa mqmx/tZ/rR3Rn/UeJLngGS+JFeR3ERPbteE+arS2620oV/RkQPI3Xb84DvlrgV6T1Qvt fD2ScTeaYVOzzB+PjbLvLiuY1wAxSGL0gss+rb6RlAKjdgOletTIYOJ1R5oGZzAvZqyp bmKbBkko8zM0fvNDCVpE/PiVpBNpn2OT1Nv/XS8K3kOIVU4TyqMgOse1t7UlLjvO13xN mjyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=HMmKnPb8bt9RPUpP3Rhq8TeODQK24exw4CBcMlQiVXI=; b=SJi5kuwdkgCBbELpX0pWVHDLEUJ+1v4wv/lzp47lQWYzNDq61jWJ5OvcVQEzmNyXAO vTKmcKfufW8ewUpwQMb+gOmjGnyOQxxyzqXtpdqiyfnsa5fjL2A+dWODbpR983hernLJ S0IcqHnGzYXlmfVHRhEC2nwwiElwxk1O0zudKasTUD6R5ZPg5wh29+7mPNtC4W2NE215 di2eEjtbD/1rR5f47N3lOgGW3dj0OYNK3H7Nyb8Xz0hH97RS3O3v3sFZECpb+neSQdsz Cjy7S252+usTg4Phsw3wYifQqxh5/W32W0ZHyqUAfRETXUnwdYhsBkop4BiRSY/B+PVw nFnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NOF0QBqZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm20-20020a170907949400b00783b75ec298si16734867ejc.395.2022.11.09.13.52.34; Wed, 09 Nov 2022 13:52:59 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=NOF0QBqZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231964AbiKIVwH (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49768 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231945AbiKIVv4 (ORCPT ); Wed, 9 Nov 2022 16:51:56 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601E631222 for ; Wed, 9 Nov 2022 13:51:54 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id j15so27885605wrq.3 for ; Wed, 09 Nov 2022 13:51:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=HMmKnPb8bt9RPUpP3Rhq8TeODQK24exw4CBcMlQiVXI=; b=NOF0QBqZzXe7QsCM/BHH3UTr2iNqFkh300w5qy7vlsZDVd6DT9cU/oZ0jth3K3ugHk jSf+6x223xwxz0KZ8tYA3RbVjjFyrlM7cmAUzxFsrAelkgM2g0feF+k4BpUhvyqQe2aG NPOzUPBA02X6r1KQ3n5IukbNAFz09/JuG7gtqit+PLYx3ynBLEu39EPnn6yKSMwYryhM +GTXNMTWJPEsWjKQU6aZ5HHT209A38tWbUW3uDQ/lRoKoBPAWDzWvvYNbGbmj8gmXg3O g5wI4Pq8Gj3gh1Tqf0BVI5vkQ6LsABS+AqznUqgRreDWfj9zAJ09aWMV2VoCwVaCCCF0 j4zA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HMmKnPb8bt9RPUpP3Rhq8TeODQK24exw4CBcMlQiVXI=; b=79NTbg8zRtzOO444+eg26V0hhp/raPzAeqh9S4X9JPAbOhv/TDX+T7Qu8o1yZrlM4n DKJjkbdd6nDkqgQKKDcima6jKA8fk/kZQTcWp8JY2tNAh2eg/UemY4Q+zlQQQ9qs8txg /ccv6YtaoxNaHh1qd9dSEqlqDYyi4zSFFMpKtVzWywEu2D1iCrnXV+/mT5doenCGCl0r O6bnrsMDcL4ZvQC1PND3PKGrhcG0OnjfvYViLPlK0crt1Eayd2ubQ2zMXoB5pRKOGKyW MVHta0WW6kZjHC6gzoljJhXL70OW8uUZcTl7yJzy3xjamKrUFFtkKWHy70errXGner36 JimQ== X-Gm-Message-State: ACrzQf1MhQlbvn1WJkcUqj+fpiAXVm4ApkraZ09ZqAHYv4GzhLT5pSly jhZtpE/NK/olFGWGYlaAqHI= X-Received: by 2002:a5d:6112:0:b0:236:740e:5938 with SMTP id v18-20020a5d6112000000b00236740e5938mr38970214wrt.155.1668030712911; Wed, 09 Nov 2022 13:51:52 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:52 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 04/15] Accessiblity: speakup_bns: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:57 +0500 Message-Id: <20221109215108.7933-5-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057042165733845?= X-GMAIL-MSGID: =?utf-8?q?1749057042165733845?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_bns 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 --- drivers/accessibility/speakup/speakup_bns.c | 36 ++++++++++++++++----- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_bns.c b/drivers/accessibility/speakup/speakup_bns.c index b8103eb117b8..60507756499c 100644 --- a/drivers/accessibility/speakup/speakup_bns.c +++ b/drivers/accessibility/speakup/speakup_bns.c @@ -16,14 +16,23 @@ #define SYNTH_CLEAR 0x18 #define PROCSPEECH '\r' -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x05\x31\x32P" } }, - { CAPS_STOP, .u.s = {"\x05\x38P" } }, - { RATE, .u.n = {"\x05%dE", 8, 1, 16, 0, 0, NULL } }, - { PITCH, .u.n = {"\x05%dP", 8, 0, 16, 0, 0, NULL } }, - { VOL, .u.n = {"\x05%dV", 8, 0, 16, 0, 0, NULL } }, - { TONE, .u.n = {"\x05%dT", 8, 0, 16, 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, TONE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x05\x31\x32P" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x05\x38P" } }, + [RATE_ID] = { RATE, .u.n = {"\x05%dE", 8, 1, 16, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x05%dP", 8, 0, 16, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\x05%dV", 8, 0, 16, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\x05%dT", 8, 0, 16, 0, 0, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -113,10 +122,21 @@ static struct spk_synth synth_bns = { module_param_named(ser, synth_bns.ser, int, 0444); module_param_named(dev, synth_bns.dev_name, charp, 0444); module_param_named(start, synth_bns.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(tone, vars[TONE_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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); module_spk_synth(synth_bns); From patchwork Wed Nov 9 21:50:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17841 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578826wru; Wed, 9 Nov 2022 13:53:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM6EpBH/erQP0LcOFr7C2IFjQZ/lDPq0AyWOUVar8frNKM8WJbtNQlTtRQLGolGSU4ETUrhS X-Received: by 2002:a17:907:25cd:b0:77b:9672:38e7 with SMTP id ae13-20020a17090725cd00b0077b967238e7mr60328516ejc.10.1668030798014; Wed, 09 Nov 2022 13:53:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030798; cv=none; d=google.com; s=arc-20160816; b=jQvObEqNZ3LgEXMxcJr9F36IOheGIKZlUKI0CBgHYSmz+pRuPjV/OKBdhUc7Cmdlek NLRwaT8gpyMCuHS8hbIpwfXNqa5NQgsOwSDqIL26bSXXZIaGQku5dCUOgjOCO9Lyo8JT KZSyDgs2z255q4JaKwfsNOo4X6XD1+IczaszjTQiX7f0jKcCA8XkzX6FywhaccifZ226 ZpLA7FBBXK3DFm/sTsmm/YOnXTw8PrkjiIHpSi6lMnn6bwq2JXz5+rshJtSDbxAiruHi N9Tvryj4fCui57XWigrDXfz5onyszFboDk8xovvVhcx3AfILfXyE4/w0STE2uuKhs4kN OXgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=boS8HxlGzsxbChOlGkq0DtRPYDF6UJD8zMl47kQ+4w8=; b=MXzc6iSsT/SpbX4lJV89nM+xLT9XvWk+MaW/EXTzpRSKXEnX4LJpexhXR2Rn7B5fZI j/wWZiuSi/a9C2PKWy56HrbuYv4N4xqhCu+kmtORwvJX9LhXnGBXPTWmSho7kiY7MOFK SHFR663O0S6IgbMS3GGqYO38GYltJQS67sjuc/aRnrcjL60PMhbw0TBjh9OGz6UvPjN7 Uq7xOtJNE46heRt5HKPDkgI+uscvVC7o66LkEK9miL9k3ZE/+xy/cqM9CJfZO5b6Dcs+ tlBA9i0ps62EMbNl/G91tjiQygmQ8CW1BiIskzza1545gZ5lAy4q0Aj/krWnzz40oYRk /Tpw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=q2m7GOjb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn35-20020a1709070d2300b0078e11a20640si18281478ejc.2.2022.11.09.13.52.54; Wed, 09 Nov 2022 13:53:18 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=q2m7GOjb; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231982AbiKIVwK (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231961AbiKIVv5 (ORCPT ); Wed, 9 Nov 2022 16:51:57 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAAED2F669 for ; Wed, 9 Nov 2022 13:51:56 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id t1so14275wmi.4 for ; Wed, 09 Nov 2022 13:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=boS8HxlGzsxbChOlGkq0DtRPYDF6UJD8zMl47kQ+4w8=; b=q2m7GOjbfSAJCsCJFJph4h9NzEm5tzLu0ryTihhMhGPt8XNnd5btRZCn8nSBnozhWf pzDfJZF0pZamAZJF3P4zGcNYGdIi8vMVfOFenmAx4unShlzfb/H6cPm19uVQZF5iZ8Yz bgsSWFN+BJmheJJtcxw6sNEW+ZbpPW9Lp+MqwZY4axyMU6wy5STiVsNVJluSWFR0Zz6M QpboX8hM5Kt+h4s83aGzZoJxHhgH3fhTRzL0Uxb6K1JexxGi9ybCPb+filwmIFkrcx3J 2WQNDCwe3xNeAv5NrU9Msl6yoTCoU3f8caPWQK21YtckvAWHQ1pDlzIvXyWHfRrZX3WH I4yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=boS8HxlGzsxbChOlGkq0DtRPYDF6UJD8zMl47kQ+4w8=; b=y3lxMX+ww3XgEOERv2UIE86tURmpFPA3PoikKcrGd6nheJne2KBTXZJDr6sq6UNQWz UNASRyg036HzQpoO3tQAucQ8YW6FTol/YZo1H1Od/9bkvcUnohQ8O7EQjjUMSx+mj2eu yxhc1+JmLi1xMkeGAFHWpRBpDIBCFUDrUQjq+m58f0JsWn2GLe7haagS4JcZ30pmH1+v Zfqfh5+BZpMWeiKxGqwb75IFWJz4AMhTietJxJ3h9xq/w7MXgoY8j7FSpQFTRAe84ARc 3y4BCfrEq7xm9L/x8wvL0e55aCN8BnJL7YvRgUzMZC3eVEiXHbZzi2W2RUGoBljtZ5pW weyw== X-Gm-Message-State: ACrzQf2rN9ur3Ks5EwZF1HfySJsBHqGwYi7c0QtDbF2MSzP0MI3SDOAU ooYbTiLwAz8ZAQQV9OBb3v4= X-Received: by 2002:a1c:7418:0:b0:3cf:703a:4f0c with SMTP id p24-20020a1c7418000000b003cf703a4f0cmr36462888wmc.63.1668030715200; Wed, 09 Nov 2022 13:51:55 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:54 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 05/15] Accessiblity: speakup_decext: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:58 +0500 Message-Id: <20221109215108.7933-6-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057062194466891?= X-GMAIL-MSGID: =?utf-8?q?1749057062194466891?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding a default variables to the speakup_decext 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 --- .../accessibility/speakup/speakup_decext.c | 44 ++++++++++++++----- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_decext.c b/drivers/accessibility/speakup/speakup_decext.c index eaebf62300a4..271bcf279bf9 100644 --- a/drivers/accessibility/speakup/speakup_decext.c +++ b/drivers/accessibility/speakup/speakup_decext.c @@ -38,16 +38,25 @@ static void synth_flush(struct spk_synth *synth); static int in_escape; -static struct var_t vars[] = { - { CAPS_START, .u.s = {"[:dv ap 222]" } }, - { CAPS_STOP, .u.s = {"[:dv ap 100]" } }, - { RATE, .u.n = {"[:ra %d]", 7, 0, 9, 150, 25, NULL } }, - { PITCH, .u.n = {"[:dv ap %d]", 100, 0, 100, 0, 0, NULL } }, - { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, - { VOL, .u.n = {"[:dv gv %d]", 13, 0, 16, 0, 5, NULL } }, - { PUNCT, .u.n = {"[:pu %c]", 0, 0, 2, 0, 0, "nsa" } }, - { VOICE, .u.n = {"[:n%c]", 0, 0, 9, 0, 0, "phfdburwkv" } }, - { 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, INFLECTION_ID, + VOL_ID, PUNCT_ID, VOICE_ID, + DIRECT_ID, V_LAST_ID, + NB_ID, +}; + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"[:dv ap 222]" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"[:dv ap 100]" } }, + [RATE_ID] = { RATE, .u.n = {"[:ra %d]", 7, 0, 9, 150, 25, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"[:dv ap %d]", 100, 0, 100, 0, 0, NULL } }, + [INFLECTION_ID] = { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"[:dv gv %d]", 13, 0, 16, 0, 5, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"[:pu %c]", 0, 0, 2, 0, 0, "nsa" } }, + [VOICE_ID] = { VOICE, .u.n = {"[:n%c]", 0, 0, 9, 0, 0, "phfdburwkv" } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -225,10 +234,25 @@ static void synth_flush(struct spk_synth *synth) module_param_named(ser, synth_decext.ser, int, 0444); module_param_named(dev, synth_decext.dev_name, charp, 0444); module_param_named(start, synth_decext.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(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(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(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(inflection, "Set the inflection variable on load."); +MODULE_PARM_DESC(vol, "Set the vol variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(voice, "Set the voice variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); module_spk_synth(synth_decext); From patchwork Wed Nov 9 21:50:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17842 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578842wru; Wed, 9 Nov 2022 13:53:21 -0800 (PST) X-Google-Smtp-Source: AMsMyM4FAtoZ1hV8oYPYj47DU0ak6ysnS9lYepZ+zFazzWPjiqwxBOcjxxNJ2MMKzqOE/EESSo9g X-Received: by 2002:a17:906:d555:b0:7ae:fdd:d0b4 with SMTP id cr21-20020a170906d55500b007ae0fddd0b4mr35178623ejc.185.1668030800968; Wed, 09 Nov 2022 13:53:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030800; cv=none; d=google.com; s=arc-20160816; b=I6kkLP2HjZRJg6tOJG+L4lrPEHZvotY++Ake2MNDoFWv/WlAse4cHpxFJkceGzabjZ 0t81MzsdDCfdslboAw1TPITrQvLuu7fTkSk5MMF7UHzRZPrTdUcyuxhUJYxnObxf2+BG cSULnkRLUaR4iiuzszamTzPXs0YNWzYY4bnvAUkOF/vjCVeyDgchJ5sM65TAtlQAsfnK 3GE+akym1P9FX+KUmkgpUX9+yVNRlBJ1CFGqBWEZAoSyj7pbbMFTky3N51VW2Rl0ci7x ijMkbNHJI96IKNMQokmThvqDU8/aWegEYPtuj8J9Pe3nNLV4ObD+Fb0HVUyx2e/eUWwF Zn8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AIKdefUvpamOxQzyWfL+FnFUN2x2wOfn4PYXf6UxhbI=; b=rm7IP6U8raziGFrQM1MJrLikdaRUvAqptEpnE+GW15R/zN0PStmpVJj9ATMqpwr21s J70JnT6NHUChnfU6x5Kn7ejpY0kahSkdCi7Y2zDuXmExZBYjfcj2Xq1qntln7Nxg+z2f 0Bf4izL+z0Nvztn1QqGlJas1EC0VoUz7ml3hg1LrQ9TlIlBSFvk6f9yJZnEeqqULs+bs /MmDahGdfcUEVNyAGEwDPCla3/jBVy5Xp9cNt3AXy+ksa4dfJCzz+CUiIQCsGiEoNQs/ lQ15hyg7kBGOyHzHauTayUjwVNJ2BeiS/Oafl9XIsQdtL6dMbDKvrEuXojIiwfn6FfO8 nviQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=NP3BGlaL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id go37-20020a1709070da500b0079fe11e92ddsi18546535ejc.906.2022.11.09.13.52.57; Wed, 09 Nov 2022 13:53:20 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=NP3BGlaL; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbiKIVwP (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231942AbiKIVwB (ORCPT ); Wed, 9 Nov 2022 16:52:01 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62AA1317C3 for ; Wed, 9 Nov 2022 13:51:59 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id o4so27905627wrq.6 for ; Wed, 09 Nov 2022 13:51:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=AIKdefUvpamOxQzyWfL+FnFUN2x2wOfn4PYXf6UxhbI=; b=NP3BGlaLmUEUrmAc4CxyChQP0QWSp7qtSi4q9oSvvXr4Os66YA2w83efez8movF5lI eud7vlZ2aMVuQDRWHKRH5TvlHk9u2h2L+kocOZ+7KxkWQ3qLS20qroexYBR85MLxZaZb yiFcNrQAH9a45aErWebMoHs+GKEwvJrqV3gHaKR0mLuwwQxJ6uQLgG1DCAldAn6YqK2N 3IpkuTV6aFyrka9pdKpzV7Lj3+0uPvVlPDUXyi1PyWB1ZPyaNEbaFzrfNiVZR5DjWp+l nyEn+rvs4vTMule1NkA1ZbFaKBmLBeCwFihpCED8LzeA+hKe97VdrofMVI9tftCsGZwt oqxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=AIKdefUvpamOxQzyWfL+FnFUN2x2wOfn4PYXf6UxhbI=; b=SBxUW1XT4VnAarmTg1nVzaTUOavIjBZl4F6jE8B7ugzlPyShcllX/PweVdiC5gS0Mw 0/HqureyHPLIM/TqqphfEf+SIbONSr+1puc/ub1RHZ8WLBZfC91ZrfaT2FttdjCUD0zZ Yalwgg1dfots0vzLErq1TdY1Zr9BNxqEMblO/z4Tl823HOqZpZGdZGu6RiiuXcZ/uCKo QStwSCDGEFL1whVRk9Tu+aN+kOefbGYqulKEely/8JJi7KpTZraMeSQYOMyuBkLqdQ66 +ldKaegnGPGdTtUURww5pg27dyxlwZCvQPPRU9Z7ojtyX1KW4DVkC19SGm4XE00KTX2f yw9w== X-Gm-Message-State: ACrzQf2XvIF/Wk/YBBxkjlzcBXkVs5TGNRI1qcE8j2kUN9oDRp72deuH KyjCRYXsMVsIyRW9mDZDFeXYuVehY5g= X-Received: by 2002:a05:6000:1f16:b0:238:3fc8:1f11 with SMTP id bv22-20020a0560001f1600b002383fc81f11mr22934411wrb.9.1668030717900; Wed, 09 Nov 2022 13:51:57 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:51:57 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 06/15] Accessiblity: speakup_decpc: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:50:59 +0500 Message-Id: <20221109215108.7933-7-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057065277944017?= X-GMAIL-MSGID: =?utf-8?q?1749057065277944017?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_decpc 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 --- drivers/accessibility/speakup/speakup_decpc.c | 48 +++++++++++++++---- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_decpc.c b/drivers/accessibility/speakup/speakup_decpc.c index dec314dee214..083ca9265805 100644 --- a/drivers/accessibility/speakup/speakup_decpc.c +++ b/drivers/accessibility/speakup/speakup_decpc.c @@ -134,16 +134,27 @@ static int synth_portlist[] = { 0x340, 0x350, 0x240, 0x250, 0 }; static int in_escape, is_flushing; static int dt_stat, dma_state; -static struct var_t vars[] = { - { CAPS_START, .u.s = {"[:dv ap 200]" } }, - { CAPS_STOP, .u.s = {"[:dv ap 100]" } }, - { RATE, .u.n = {"[:ra %d]", 9, 0, 18, 150, 25, NULL } }, - { PITCH, .u.n = {"[:dv ap %d]", 80, 0, 100, 20, 0, NULL } }, - { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, - { VOL, .u.n = {"[:vo se %d]", 5, 0, 9, 5, 10, NULL } }, - { PUNCT, .u.n = {"[:pu %c]", 0, 0, 2, 0, 0, "nsa" } }, - { VOICE, .u.n = {"[:n%c]", 0, 0, 9, 0, 0, "phfdburwkv" } }, - { 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, INFLECTION_ID, + VOL_ID, PUNCT_ID, VOICE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID, +}; + + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"[:dv ap 200]" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"[:dv ap 100]" } }, + [RATE_ID] = { RATE, .u.n = {"[:ra %d]", 9, 0, 18, 150, 25, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"[:dv ap %d]", 80, 0, 100, 20, 0, NULL } }, + [INFLECTION_ID] = { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"[:vo se %d]", 5, 0, 9, 5, 10, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"[:pu %c]", 0, 0, 2, 0, 0, "nsa" } }, + [VOICE_ID] = { VOICE, .u.n = {"[:n%c]", 0, 0, 9, 0, 0, "phfdburwkv" } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -483,8 +494,25 @@ static void dtpc_release(struct spk_synth *synth) } module_param_named(start, synth_dec_pc.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(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(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(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); + + + 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(inflection, "Set the inflection variable on load."); +MODULE_PARM_DESC(vol, "Set the vol variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(voice, "Set the voice variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); module_spk_synth(synth_dec_pc); From patchwork Wed Nov 9 21:51:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17843 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578874wru; Wed, 9 Nov 2022 13:53:24 -0800 (PST) X-Google-Smtp-Source: AMsMyM4bRTwrImQAo5ovrFFLZdAt4p8m7DN6WAWn08Osv/g0o+7Q1RrsvbOsXvyQW3kP5rE4fBYW X-Received: by 2002:a17:907:a4e:b0:77d:94d:8148 with SMTP id be14-20020a1709070a4e00b0077d094d8148mr55993090ejc.607.1668030804512; Wed, 09 Nov 2022 13:53:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030804; cv=none; d=google.com; s=arc-20160816; b=Pff3etZ9EbD+quVfNGZovzg+R2S9pZ7ZA1C34kO0ISHkWAxzx9Xjo561hy28EWdtw8 +1hLg9OGzLUr8bHr78Af73bbiBC3dNRXhXmCxhM2de1SvIVhKKNyZ5GEPcDWaj88I8lq QT5omae8bRSSq46jnpfZ7RUywdNO4PvRZeRoT5YQqUuIu6dr/GajaV+zFp5/zRDBAc/1 sZxkTkC7NJA/eFeMRF2faBg5O7AmO+0n+AW0ibWCt4SCivy6RAac/5NVSjeVGAme7jkf 2MmPo0+Mwklj65W+nySmQrHVbl9eZ+Gms4FR1UYifrSk90pGNgvw//KwGxa+1h1+7ybI Gkgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=w++/tXblOqGFmx3bqppileXsaaO1BbiJ5A3Ui/Ogtio=; b=gVwqSIZVJzA+S2G7wvsrt1UQRZqGWV8rPfVMEjjWpHvV+SAsiQZ3wAtd2rYb9EuLeG GzXIaqOH3SxQd0Tu4busr496Uo8qNHPwkWung/vI7nbK0khQsoimrfHrBqjexUVkuvs+ X6dpjousaOYlu3fCczkhLZ9M3jQIWG4fbl4ySyRzCwfMYweWTTzfkL7D7enMS3uQEQvp VPeB8bu4uN3JJCJ9Fq0T5CoVQgokpBqXDMmMHMVraHjTOQ5Z4829F0KdnOREjWyCJ44M kQdQGWKGJ4703PPXg8TaE7IZ8GAs+OHYdYVbuNK6ZKJom1Xal5agqWkx+u3Oy4HPoKDP 7CEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VFzInThI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l3-20020a056402344300b004513abe8f74si13586124edc.249.2022.11.09.13.53.00; Wed, 09 Nov 2022 13:53:24 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=VFzInThI; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232009AbiKIVwS (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231916AbiKIVwD (ORCPT ); Wed, 9 Nov 2022 16:52:03 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22CE831369 for ; Wed, 9 Nov 2022 13:52:02 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id v124-20020a1cac82000000b003cf7a4ea2caso2167313wme.5 for ; Wed, 09 Nov 2022 13:52:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=w++/tXblOqGFmx3bqppileXsaaO1BbiJ5A3Ui/Ogtio=; b=VFzInThIOnxnwzogl29fhAmjdZ8YH+KjpjDxYXtEEfDvB7NowUS8kvqaIaFIUZN3iZ 8KR1VglFfcrh1AaURIy48JIa3lvP+MiZ5QM8Hc/kqrumj7Da4PEgiDsE8ba03GJT5HyS WoUXyGWjvRHHVAJ3m54hS9UgSxrmvXWHvY4NODj5h5XshQVQYpw3+tgN/A37S5kmXyNO FxXMed8QTT8Udaghjj28Uv8LSQ+x1AtS3ksDqt6R5+i/2OEXiO5ArnCFxuZPc3xV7W3V silH+h85OumthKLoaT4kkzBRSTmT6kWmUkeGQeUtl/xkmVWfkaFg8eD88860pZ9HQGMQ 30UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=w++/tXblOqGFmx3bqppileXsaaO1BbiJ5A3Ui/Ogtio=; b=gHrkYH47eJvvh0uUlEyaSwPvOeznm/8e4MfR5/RWwI32TqhRv05B6hHpGbziwKCVOG a98GDygsLZ5h83aeC3qy8DV/Vl/eKsOiIh/qm4N1GoCOd2fb3d25UQqLPdl7Iuo6MAP1 P/LnXz2NVRGGv98UXNYNBPGgbQqbrMQpgsyZBqRhB2PPEZ+dL23EeCGiicl0WiFpCnwr e96h+yxWqGhf7Fiqz+FPQ7dRhibYC4C7Qart/l7bFb94z5dxAIC/CnOpSAASvTUxQX9h alyzTK9eKTmSvMeDP+tUxNdVefzSO0k/s9ze0zzwj8U4if7rQbW7vntcC45fBp/M35X7 uR8Q== X-Gm-Message-State: ANoB5plu9eT4kd2Fvyze2dWfevXBqqIcblCPSWcRRMi4Q1bU8kyXpq/t efVWqh4KsXG/+zcN+PI2Wk5/qUoIeZc= X-Received: by 2002:a1c:f710:0:b0:3cf:b079:df13 with SMTP id v16-20020a1cf710000000b003cfb079df13mr10402799wmh.16.1668030720711; Wed, 09 Nov 2022 13:52:00 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:00 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 07/15] Accessiblity: speakup_dectlk: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:00 +0500 Message-Id: <20221109215108.7933-8-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057069053464645?= X-GMAIL-MSGID: =?utf-8?q?1749057069053464645?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding a default variables to the speakup_dectlk 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 --- .../accessibility/speakup/speakup_dectlk.c | 45 ++++++++++++++----- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_dectlk.c b/drivers/accessibility/speakup/speakup_dectlk.c index 2a7e8d727904..56334405d865 100644 --- a/drivers/accessibility/speakup/speakup_dectlk.c +++ b/drivers/accessibility/speakup/speakup_dectlk.c @@ -40,16 +40,24 @@ static int is_flushing; static DEFINE_SPINLOCK(flush_lock); static DECLARE_WAIT_QUEUE_HEAD(flush); -static struct var_t vars[] = { - { CAPS_START, .u.s = {"[:dv ap 160] " } }, - { CAPS_STOP, .u.s = {"[:dv ap 100 ] " } }, - { RATE, .u.n = {"[:ra %d] ", 180, 75, 650, 0, 0, NULL } }, - { PITCH, .u.n = {"[:dv ap %d] ", 122, 50, 350, 0, 0, NULL } }, - { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, - { VOL, .u.n = {"[:dv g5 %d] ", 86, 60, 86, 0, 0, NULL } }, - { PUNCT, .u.n = {"[:pu %c] ", 0, 0, 2, 0, 0, "nsa" } }, - { VOICE, .u.n = {"[:n%c] ", 0, 0, 9, 0, 0, "phfdburwkv" } }, - { 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, INFLECTION_ID, + VOL_ID, PUNCT_ID, VOICE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID, +}; + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"[:dv ap 160] " } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"[:dv ap 100 ] " } }, + [RATE_ID] = { RATE, .u.n = {"[:ra %d] ", 180, 75, 650, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"[:dv ap %d] ", 122, 50, 350, 0, 0, NULL } }, + [INFLECTION_ID] = { INFLECTION, .u.n = {"[:dv pr %d] ", 100, 0, 10000, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"[:dv g5 %d] ", 86, 60, 86, 0, 0, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"[:pu %c] ", 0, 0, 2, 0, 0, "nsa" } }, + [VOICE_ID] = { VOICE, .u.n = {"[:n%c] ", 0, 0, 9, 0, 0, "phfdburwkv" } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -306,10 +314,27 @@ static void synth_flush(struct spk_synth *synth) module_param_named(ser, synth_dectlk.ser, int, 0444); module_param_named(dev, synth_dectlk.dev_name, charp, 0444); module_param_named(start, synth_dectlk.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(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(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(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(inflection, "Set the inflection variable on load."); +MODULE_PARM_DESC(vol, "Set the vol variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(voice, "Set the voice variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_dectlk); From patchwork Wed Nov 9 21:51:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17844 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp578958wru; Wed, 9 Nov 2022 13:53:36 -0800 (PST) X-Google-Smtp-Source: AMsMyM6KzNndonyE5CKcuK3exmE11g3wwP/r0Jn6YVHaHCHtxuNtVy6aOp++FZ2tz7IhMNpcxftw X-Received: by 2002:a17:906:3a4d:b0:7aa:493b:679 with SMTP id a13-20020a1709063a4d00b007aa493b0679mr1835756ejf.320.1668030815954; Wed, 09 Nov 2022 13:53:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030815; cv=none; d=google.com; s=arc-20160816; b=sXjxaPBxX08l5EAsQC0HnUAxM0zTzXEE1ExuC1xAOM8lqXp66Eo3yOQn2sa1ANMOHo 3QgM5aDkJvW8Tf1Y3kgF7f2hu2mKvXqZcC30/iyR37UeM2w1ElxohHcc/v0Eky2EBA1P DhS+dxfUkkJLQcaxMWmIssaDziq498nxPanyrW8h/7Wzc2GwCqzjw4Ie/gV4cCmAgyDK Q/1j/O1hg/tVXWtbFtCmqEU1uG3oLXoyfuPaY37PmWb1c8zVC+7Y21FxT2VAKsnXqlWD cuLlz8Bin4PIrSljrMhXsZsTwsd+pxxNkz5yAf61L9ONvJdoV1ckJw+oTIjsIEz4RvA0 OZGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=c6n5QI0irHH6c5ra/Q3E/wLcrhle3muAJPs17KSoX0U=; b=Fct1sn0MfCipePilkfZGAl+DDsml94kX9wt62SSpNodum1d80tgng4NDlJUA9VCa/2 FmljA8RWpoDGbdD6pIHH7i0rhfXhGLrM+MIZkZ04TVMeTje0s1mR16lS5ZWTlugN8B0B FcumxYJUIXdLJL8Xn7o58xo3FjP4lSe4jhL+xUQisKh3/sZ8rI5kRIBtoxXX/DOwuA1I yDrn/dUf6rl/zxgaptHvmIWcg19NHLwGK/sXhrGWMqfVhkpF3WCMBW2F3dYHsWq4qMMr 5gjkPUsH5rrqh3tSoyesAwwdltRNLUs+AeRIz0OfzSJVoKhRZS8M9Yu+liStMy9ckOeX 2RYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=R6eU8iQw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gb12-20020a170907960c00b0078da99ecbdbsi18722953ejc.673.2022.11.09.13.53.12; Wed, 09 Nov 2022 13:53:35 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=R6eU8iQw; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231916AbiKIVw3 (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231959AbiKIVwH (ORCPT ); Wed, 9 Nov 2022 16:52:07 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4942FFD9 for ; Wed, 9 Nov 2022 13:52:04 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id c3-20020a1c3503000000b003bd21e3dd7aso2183765wma.1 for ; Wed, 09 Nov 2022 13:52:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=c6n5QI0irHH6c5ra/Q3E/wLcrhle3muAJPs17KSoX0U=; b=R6eU8iQwKU/LMhS2VW9nOl/u0GXzVuzcfis0xMxZc3gZbZRL08p+E0QHK+gGhhOGVe hPm5kaZCPZA3nIJu8QmY5AJmgoDnSs6CtBXzONyyQhqXWvQzviIuUF4cnlbQThgLirBs qqJu8jxEgsV7yAeDQFMmO4s0LArxXkJM1VOBWyZxYZszCcm1pgZHw61kqJOphxouNONa 0dgiKep+i8ea5RTdWGd3I6LLA2u1rgemxvoOUzyAkOjdBvKffDorHRPId7UWnJgeIFPC 0SztPoX0WuaUq4q9V94X93L4Cwr/m0NcK5wXP3bJUioFXOuv4bOP7sw2uHmKC0FT8zag Wn3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=c6n5QI0irHH6c5ra/Q3E/wLcrhle3muAJPs17KSoX0U=; b=pGUCUmX7h2lBGfQvgAeOV1daPkOy+q2lOX8fLI2YOvpHjUN48kDt4HJPy0jK8JDTcP KTi3J9d7y9ON93ZNJe8Hwta4kaSTrPGnhwfSnTAkEYIfvg/X72upxVUpVjHEad19RKSt JOiIQLdI+TcN1WQ1bFIYyyWG5qO6fouGIdW0NwFy8xBB3FD5c0OHJx8BzK6FwEgFJrvz 7Pxs1s0+wXFHClgXEJYBb5OpRZC45+iAbJFkDOMDWN6xLY1NxONtjQZxdmhZQePFrs1o H3dYmsRJyF7Tm5CxtXt03CXYHxdJLndQPxbv1R8KAYCfkGegFPi56VEhWMgS4hMRP2LP nQEg== X-Gm-Message-State: ACrzQf02dOLYKIEEYkp5aN15jrMf/yjIF7pv6zKXQRLYq89vw7k8p8KO uWAfnlrwtEPOVyWA6uxyEKo= X-Received: by 2002:a1c:f009:0:b0:3b4:9398:49c9 with SMTP id a9-20020a1cf009000000b003b4939849c9mr51489219wmb.174.1668030722922; Wed, 09 Nov 2022 13:52:02 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:02 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 08/15] Accessiblity: speakup_dtlk: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:01 +0500 Message-Id: <20221109215108.7933-9-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057080825900709?= X-GMAIL-MSGID: =?utf-8?q?1749057080825900709?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_dtlk 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 --- drivers/accessibility/speakup/speakup_dtlk.c | 50 +++++++++++++++----- 1 file changed, 39 insertions(+), 11 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_dtlk.c b/drivers/accessibility/speakup/speakup_dtlk.c index 6f01e010aaf4..fa826568937b 100644 --- a/drivers/accessibility/speakup/speakup_dtlk.c +++ b/drivers/accessibility/speakup/speakup_dtlk.c @@ -37,17 +37,27 @@ static unsigned int synth_portlist[] = { static u_char synth_status; -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x01+35p" } }, - { CAPS_STOP, .u.s = {"\x01-35p" } }, - { RATE, .u.n = {"\x01%ds", 8, 0, 9, 0, 0, NULL } }, - { PITCH, .u.n = {"\x01%dp", 50, 0, 99, 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", 7, 0, 15, 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 } }, - { 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, TONE_ID, PUNCT_ID, + VOICE_ID, FREQUENCY_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID, +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x01+35p" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x01-35p" } }, + [RATE_ID] = { RATE, .u.n = {"\x01%ds", 8, 0, 9, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x01%dp", 50, 0, 99, 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", 7, 0, 15, 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 } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -376,9 +386,27 @@ static void dtlk_release(struct spk_synth *synth) module_param_hw_named(port, port_forced, int, ioport, 0444); module_param_named(start, synth_dtlk.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(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_param_named(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); + MODULE_PARM_DESC(port, "Set the port for the synthesizer (override probing)."); 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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(voice, "Set the voice variable on load."); +MODULE_PARM_DESC(frequency, "Set the frequency variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_dtlk); From patchwork Wed Nov 9 21:51:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17845 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579003wru; Wed, 9 Nov 2022 13:53:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM7JmgXodzoP5QwSL9LZ+6yYIpqypzxO/bjmRA68GDz7tkK650d8NbMZjUjBjEPNZ3ocv39Q X-Received: by 2002:a17:906:99c2:b0:7a8:c167:1d93 with SMTP id s2-20020a17090699c200b007a8c1671d93mr56191911ejn.490.1668030821302; Wed, 09 Nov 2022 13:53:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030821; cv=none; d=google.com; s=arc-20160816; b=AHDTHq9H/dxVPDl+CShsXCWgX6UWjmdk1glcByliqw4zTybJ7rk9zIMxt8Nw+b8Aht R9GUA5X7w0PjOFfvfdIrYyfwqWr3nv1IwKXTzetBnVW4skF4o6kBXl5g7pLPNJoHMA4U taTCakWwmnM1urcNyr9ObzuyNmF3bv1MfJt8Ebldj10W6n+NdtgdWUg/LX69YvEVP/Sx 8cBLG6V24lMdDPNlFhlb2hVvSMdevY48qDfWzYcDoGKab33nG4lm/+6/cqIcUqZCQz9t y3UJRcyBfkVUPHRiiCog6t1FksR2On5Tdrj1BPh7bWtByCyFVd4ZjS4CQoR+12bxUV0V I+1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=sHsK+KbIO4yH/BIpFol8qX26pgAqv1083y12c/rgkm8=; b=yZxZ7DHyoDCDTq6KW2n5CXMokmgOWQ3KuPyWC/7vBKmjNWj4H3k0Wz52W4jF29fkzR /o5UbQMm+Z0CTWPVeYPD6jMW9manecA2/lhgQ6o4J109OVxqspnFWjQSQtO8YgD+YsCs 3O7adfENuIT6IxfH1j7M7+LfxeVPwYTCEdJgk9ZasntJl3vf/PBw8KOFOL+jItgSZrqT KpyiubwtOSSjYKfn2wEB9tR4/YY6ebxvH1llenxSx4/iSXoMTR6Vw/0+6EeyOeA4evAT KIq+/YS07ZaWJcjoOb/okA6+hit3+JNbUmiMw8/OF/gCdA1xbZNYH1RD5w04RE+GLfEd RCeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=dMIvvJle; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e6-20020a17090658c600b007ae4c686a4esi19419240ejs.159.2022.11.09.13.53.17; Wed, 09 Nov 2022 13:53:41 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=dMIvvJle; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232101AbiKIVwc (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232023AbiKIVw1 (ORCPT ); Wed, 9 Nov 2022 16:52:27 -0500 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF8EC31DD5 for ; Wed, 9 Nov 2022 13:52:06 -0800 (PST) Received: by mail-wm1-x32c.google.com with SMTP id fn7-20020a05600c688700b003b4fb113b86so13526wmb.0 for ; Wed, 09 Nov 2022 13:52:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=sHsK+KbIO4yH/BIpFol8qX26pgAqv1083y12c/rgkm8=; b=dMIvvJler7IaTwTnU9k1E2ZO8+iQHW81ODjdfoCojttLGtxIl9NtMPLJpVRGgd2zsO d5Qxma+xkGr+oW263PLt+jrc3tcwfc0FT9luiSDu4CVjYbw9amdFmTBZe9jvNarNFUB/ fv4HKx427cCb0TeLzBDTfVHJbCfnKLzHfvGBAFsvCJhPIhc7sA9Zul2sL7pWOM9qhoA/ 4IE5aJk9zeOogK11euq0Q5KNqC8q6hQj1PGXKYzdndy5cKP0ljgJVIuQGkopWENQO7uQ aSqpfX7z4C86wRZIy8EJqHWXpXzXOdpylNqYawl09juzJsKeZF8dGZcQHOkPd+M69trX t3sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=sHsK+KbIO4yH/BIpFol8qX26pgAqv1083y12c/rgkm8=; b=3rhhqX3/olesALKv9QopfW4WC7y+lHtyHkW9NyAA5ig9kfg6ot4zH+wZCJKh/+2SD+ jzyo6Id/HAuuKm14DLYDb00TFldcGOq4BYm4h+1Yuz81DUdsbQTdhRfOFY3VIA6ZAtwK 4zy2KJ7RtQ1RNu5iZuVHrAJbun1RQ75+nuqvI3iH1LcNLjkQDRzO1BPSok3IEOOzimaN n2KasR//rdlV+O15wkz0ycp2Z1DgnxNt6Rlii4THXa1++Mrutr0LLPc8Z9TEgG9K7q9S XYv6kYqgbuAbLckozZHtz3AAEGBeOtn62Io/g1g28SZ/9ypAvbNIz73NPUiw6F35Apjj KlKg== X-Gm-Message-State: ACrzQf0D2z1bmKCvMOA5QMGgLyAulPNUOriJ8MpOVozS0EKvX6j5TbZY fp0YjVE/vK+UcpINxA0e+0s= X-Received: by 2002:a05:600c:3011:b0:3cf:9c3f:3b60 with SMTP id j17-20020a05600c301100b003cf9c3f3b60mr18903333wmh.183.1668030725266; Wed, 09 Nov 2022 13:52:05 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:04 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 09/15] Accessiblity: speakup_dummy: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:02 +0500 Message-Id: <20221109215108.7933-10-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057086046488555?= X-GMAIL-MSGID: =?utf-8?q?1749057086046488555?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_dummy 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 --- drivers/accessibility/speakup/speakup_dummy.c | 53 +++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_dummy.c b/drivers/accessibility/speakup/speakup_dummy.c index 56419dbb28d3..52b2c5d44576 100644 --- a/drivers/accessibility/speakup/speakup_dummy.c +++ b/drivers/accessibility/speakup/speakup_dummy.c @@ -18,17 +18,30 @@ #define DRV_VERSION "2.11" #define SYNTH_CLEAR '!' -static struct var_t vars[] = { - { CAPS_START, .u.s = {"CAPS_START\n" } }, - { CAPS_STOP, .u.s = {"CAPS_STOP\n" } }, - { PAUSE, .u.s = {"PAUSE\n"} }, - { RATE, .u.n = {"RATE %d\n", 8, 1, 16, 0, 0, NULL } }, - { PITCH, .u.n = {"PITCH %d\n", 8, 0, 16, 0, 0, NULL } }, - { INFLECTION, .u.n = {"INFLECTION %d\n", 8, 0, 16, 0, 0, NULL } }, - { VOL, .u.n = {"VOL %d\n", 8, 0, 16, 0, 0, NULL } }, - { TONE, .u.n = {"TONE %d\n", 8, 0, 16, 0, 0, NULL } }, - { PUNCT, .u.n = {"PUNCT %d\n", 0, 0, 3, 0, 0, NULL } }, - { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, + +enum default_vars_id { + CAPS_START_ID = 0, CAPS_STOP_ID, + PAUSE_ID, + RATE_ID, PITCH_ID, INFLECTION_ID, + VOL_ID, TONE_ID, PUNCT_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"CAPS_START\n" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"CAPS_STOP\n" } }, + [PAUSE_ID] = { PAUSE, .u.s = {"PAUSE\n"} }, + [RATE_ID] = { RATE, .u.n = {"RATE %d\n", 8, 1, 16, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"PITCH %d\n", 8, 0, 16, 0, 0, NULL } }, + [INFLECTION_ID] = { INFLECTION, .u.n = {"INFLECTION %d\n", 8, 0, 16, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"VOL %d\n", 8, 0, 16, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"TONE %d\n", 8, 0, 16, 0, 0, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"PUNCT %d\n", 0, 0, 3, 0, 0, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -129,10 +142,28 @@ static struct spk_synth synth_dummy = { module_param_named(ser, synth_dummy.ser, int, 0444); module_param_named(dev, synth_dummy.dev_name, charp, 0444); module_param_named(start, synth_dummy.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(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(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(inflection, "Set the inflection variable on load."); +MODULE_PARM_DESC(vol, "Set the vol variable on load."); +MODULE_PARM_DESC(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_dummy); From patchwork Wed Nov 9 21:51:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17846 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579283wru; Wed, 9 Nov 2022 13:54:18 -0800 (PST) X-Google-Smtp-Source: AMsMyM41URrD+qUKqIR85pi620ugzfIEkfli4eqxs8JtEGTxq10jtKcUiFHg3N9XGdyoew9dd6QC X-Received: by 2002:a17:906:a099:b0:7a7:1d4f:c7d9 with SMTP id q25-20020a170906a09900b007a71d4fc7d9mr1807687ejy.402.1668030858004; Wed, 09 Nov 2022 13:54:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030857; cv=none; d=google.com; s=arc-20160816; b=eLGON5fXL5ZfVcFYxPT7i+pnglmEmJ3v8LUL5FKqSj6IQ0qFBdlCEseVmfRPPhHU8l lI0mDhD5UjIajhnN5QzDAbazCwKBadZWzUs0oSGgWfzQOVfw/UUQT7ETWirc7FXGIKMo an0J04VGDQJzT7FxhJzqXh6QpV4gJO82bt94YAk+D5Pz3w+iRTuGmnA7mpF59GCzv8ha 8uIgeyogA+RKsQCNBtw8mGze8txSy4779cPz6nTwQc4TawZG/b1VQAWeDQbUhovTqETX OGJpVZacnJw9IfRGUkbJGtGpN93jWluozOx3JTG4LU9gD6Rp0zG36u5J2KMGrrVULhES O9NA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=wyPGedY3Et+99+MoSUVtsR7MJ8v6BaFKXsa07SnlUIM=; b=dj5E5a5TJjbauwrjJxi+JFH+r/SAVth6VuK4zQK11D1gumdD2f+L9cJROSEHzKMkAC udMOeYhuqkinfTNM/hu+xel48utvgZ4W2NWnaX82ehTPJR/9Q0OAN8huWn20oC60w8y+ yq9elH4faY0wdymYbWrTQ7kRm4m7t1qcJU2fnezs1K6II/aQiBvLSWh7IIobx04hqMRD TZA1RfO3KyAmgSkA1gWwmdyICdX7leg8CTCpXLYkChdL0wrPGsdGDijBWlRWjatzct6y DDEbViDXVgD7ztKz9rcrQ9fqDQtUYvig9deiTaOHFYjO8yY2/h6rQhErEzERUtGgfL4H aSww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZQZwLGL5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t20-20020a056402021400b0045bfaaab6d1si14761958edv.48.2022.11.09.13.53.53; Wed, 09 Nov 2022 13:54:17 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=ZQZwLGL5; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232124AbiKIVwi (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232053AbiKIVw2 (ORCPT ); Wed, 9 Nov 2022 16:52:28 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 38A6131EC9 for ; Wed, 9 Nov 2022 13:52:09 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id o30so25755wms.2 for ; Wed, 09 Nov 2022 13:52:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wyPGedY3Et+99+MoSUVtsR7MJ8v6BaFKXsa07SnlUIM=; b=ZQZwLGL5pXO/AnK3wN8zrR9n89d5jFQgI4erStFmIDKfugQ/snADwEZDhFuA861bnR K89YVf9HcSRVhNBJH9zUK1m613gjTWSmSbNzP2dXGTaedCHVX8itHbH8+WsXDYNVB30F DiAsaC3aZXBeqJ8iefZPiXlffy5mDqCJUSwJbkusdseKCxyAiqBo86tDR4OSE/8r41Nv Q3MtMh2xq8xQabociae6Wgl9BI39w0pE8LZC52W6s4K0oupDrZqCGx1Ixdc8/mJt+q8D WIE2z5J0T45/NWgJoomjAnhtdGdeQ6VLbxNexV/+MQAtbaOLtHS4nAVFuhqUtJcENPM8 4JgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wyPGedY3Et+99+MoSUVtsR7MJ8v6BaFKXsa07SnlUIM=; b=KizNQtDUMtsEbB3MygU4vW6ahbw6mrPEbgPk9YvNm9M/mVffhwUwasyxbxmWbArQjY OELMVJ+jR/A0xDH3RmS05C8fbmOJWSLh2VocZpiHGsQb9AVuhpbgy1LupQ4ZhN5YGslx /V82UFR1EAD3RyQIP4TfD6SfqsBHgWypwWUHdxYAFRx9LFSWSgWuWKLEcK84cmWlxe6l w7q709UvjJwHFoFcEe1O1AWV/kI6Z6a9lLpOXfrQfpgDoJDAolw5mY1MRtgrVyOG1lXy cUftd1IPAHLwwaHJZGuAQ0Brc4piqOd1NbcZI9smKNbtaABiPFU5/5X21ptsu4RDeGph R/yg== X-Gm-Message-State: ACrzQf3mxhpxEAwdj20SpTA0YlsZpmrhH7mz4wT5mgirpjjq6I69KQgQ Rul+Jwm94869TMH7Ezxpeq0trCEohjY= X-Received: by 2002:a05:600c:3587:b0:3cf:9aab:ab4a with SMTP id p7-20020a05600c358700b003cf9aabab4amr19724257wmq.155.1668030727767; Wed, 09 Nov 2022 13:52:07 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:07 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 10/15] Accessiblity: speakup_keypc: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:03 +0500 Message-Id: <20221109215108.7933-11-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057124716731975?= X-GMAIL-MSGID: =?utf-8?q?1749057124716731975?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_keypc 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 --- drivers/accessibility/speakup/speakup_keypc.c | 29 +++++++++++++++---- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_keypc.c b/drivers/accessibility/speakup/speakup_keypc.c index f61b62f1ea4d..9356f6379560 100644 --- a/drivers/accessibility/speakup/speakup_keypc.c +++ b/drivers/accessibility/speakup/speakup_keypc.c @@ -33,12 +33,21 @@ static int synth_port; static int port_forced; static unsigned int synth_portlist[] = { 0x2a8, 0 }; -static struct var_t vars[] = { - { CAPS_START, .u.s = {"[f130]" } }, - { CAPS_STOP, .u.s = {"[f90]" } }, - { RATE, .u.n = {"\04%c ", 8, 0, 10, 81, -8, NULL } }, - { PITCH, .u.n = {"[f%d]", 5, 0, 9, 40, 10, 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, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"[f130]" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"[f90]" } }, + [RATE_ID] = { RATE, .u.n = {"\04%c ", 8, 0, 10, 81, -8, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"[f%d]", 5, 0, 9, 40, 10, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -305,9 +314,17 @@ static void keynote_release(struct spk_synth *synth) module_param_hw_named(port, port_forced, int, ioport, 0444); module_param_named(start, synth_keypc.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(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); MODULE_PARM_DESC(port, "Set the port for the synthesizer (override probing)."); 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(direct, "Set the direct variable on load."); + + module_spk_synth(synth_keypc); From patchwork Wed Nov 9 21:51:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17847 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579292wru; Wed, 9 Nov 2022 13:54:19 -0800 (PST) X-Google-Smtp-Source: AMsMyM5XUvpGRfuL5BhiVb7HEEqxVsaZ6vjo9+yuLeDNGddmWtMJWTcFgMe2BCpPI0B32aKcJnB1 X-Received: by 2002:a05:6402:1749:b0:464:b8b:f594 with SMTP id v9-20020a056402174900b004640b8bf594mr1003886edx.407.1668030859057; Wed, 09 Nov 2022 13:54:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030859; cv=none; d=google.com; s=arc-20160816; b=xaG1u9MjdwrcMRG1r2FlVLj26MvVLsK/JLOXUUjvCW6MkJzjEDJANrOubGIdjfLsk0 06whmRXxW1V4NH0piZMZMh8xytTUYFkt0szQ+KmcWio6Hg/FA5UiQdv0hvQ4rEmfWqqi xuo0JYpKOXIPISYTmbvoomPbDkI3dREds+/XWMFuFdKkVtlUwQrRMYd0kcm7GUBLrrp6 tJ03w9vPGne3W0gvdILIMxoiz69/dN1MjEYHD04aoLDOLaKRCOr0KX5TLFktFqAKxXTt 4L7jXEm7vkW6oq5T2QlPVCYtGKt/rcuLj6gjS/sCZNzppLYr53+xy4frOiEg8Ut1G+5P sPkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=C8S0HlohWlYP5GxiObhBs51DVH6bOEt+kedYZZ5xHeU=; b=j8LVopqy1Hisqpyb4gEHSQJgp5YTNXkWEFWpY/a4pXEJZHYYoVnV+xb9zSGbyCc4CJ mk4hY0v1eQaMQYMzTD1/rlOxSn9jLTKPk6NHcbOO5wj1aBkkEK8gSranssb7fwAa+VN3 arNCTuejV/yTOwSdiD7f6rIHDvakPHeAbNHIr9txHK/jjYuZjGRfBXxRG01Qtas3ZBj4 4vPM8t4uusSCRKCMeFC0s24AlKr51YMhss+3zmnYz2vStiu/TEU7hdPp9A5QnQiPvPr9 U8PYmYNvuwkYfbOgrCJMkJNX+f0G1wYTpQf2mktlFN/WpAlbJ3pgDBrh1MsqnGXTj6gZ pDEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=bkj4LkMB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a21-20020a1709066d5500b0078d2a99972fsi11133132ejt.316.2022.11.09.13.53.55; Wed, 09 Nov 2022 13:54:19 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=bkj4LkMB; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231927AbiKIVwx (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232019AbiKIVw3 (ORCPT ); Wed, 9 Nov 2022 16:52:29 -0500 Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 935E731DE4 for ; Wed, 9 Nov 2022 13:52:11 -0800 (PST) Received: by mail-wr1-x42f.google.com with SMTP id z14so27887345wrn.7 for ; Wed, 09 Nov 2022 13:52:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=C8S0HlohWlYP5GxiObhBs51DVH6bOEt+kedYZZ5xHeU=; b=bkj4LkMBhryNiHcUK56hTqvLuVYo2EvyiPwrCQgowlq8CDjpINs8a/Vl2CB9mxBNZu U/Whh/VsrqZJfxfGngnfBCzQWcwe0jLVJHQLC7H0ND5YL1KCRkCQhSTFSHEpLl+BuGdA +wJtzQ++gEoG4ORuUnQ+tm4vHdpRatUjquQdhFTCElgOTbnkMBiqVedsr2GFOEw0IB7p DIJDUQnfW1bvAfKx8g/Kryawr6jfSSMbLGdd8go4C9LUAYtG6ewSCThhesyL8kx2kqlr z4CDHwO7UHbrPFVbMbUPotZ1UNlcAPbajDYKtWMQdHligxB2x210y0B+n6qgSp7M2Mfx wkGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=C8S0HlohWlYP5GxiObhBs51DVH6bOEt+kedYZZ5xHeU=; b=umLEM3dRks9h6/UOAsiAKoNul2ty/sLtUW8bM1FcYM/sxoof0h9BSp2Kc22G2MiRz3 UNL6jDjIV082/LINvyqMsnoeu3E2i8hSyXi/4sm1guwbCl+REIgmH0JgvBg+nauUlRCo QRMbe1/GWI2pgiVXO22NKrX+8KMWivERbyoqbQq5G4JW4idyEtxFo0DOFg7PB7pAmbDv M99pGmjJU/ceoqOImrh6n95kNPvXPjsLvU4vaSJCQevT2ID2dtRwOl0kQm7aOwi21Z1v pedTyBvY1sH1WuHIda0evwsDShQx+6y5fFtw9w8M9sTzsjN8y4TgKBLKr1PyqbW2XF4U iFQQ== X-Gm-Message-State: ACrzQf1uY+/Br4LL3tiSGT5QBeg9pqbm5dGxGB/dlaAPqbO8/uoSSm5A XnbNnd1YcYiMbXeb/NVtLfs= X-Received: by 2002:a5d:654d:0:b0:235:197d:72d1 with SMTP id z13-20020a5d654d000000b00235197d72d1mr39286734wrv.680.1668030729884; Wed, 09 Nov 2022 13:52:09 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:09 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 11/15] Accessiblity: speakup_ltlk: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:04 +0500 Message-Id: <20221109215108.7933-12-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057125864060165?= X-GMAIL-MSGID: =?utf-8?q?1749057125864060165?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_ltlk 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 --- drivers/accessibility/speakup/speakup_ltlk.c | 53 ++++++++++++++++---- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_ltlk.c b/drivers/accessibility/speakup/speakup_ltlk.c index f885cfaa27c8..1e279ae143bf 100644 --- a/drivers/accessibility/speakup/speakup_ltlk.c +++ b/drivers/accessibility/speakup/speakup_ltlk.c @@ -18,17 +18,28 @@ static int synth_probe(struct spk_synth *synth); -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x01+35p" } }, - { CAPS_STOP, .u.s = {"\x01-35p" } }, - { RATE, .u.n = {"\x01%ds", 8, 0, 9, 0, 0, NULL } }, - { PITCH, .u.n = {"\x01%dp", 50, 0, 99, 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", 7, 0, 15, 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 } }, - { 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, TONE_ID, PUNCT_ID, + VOICE_ID, FREQUENCY_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x01+35p" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x01-35p" } }, + [RATE_ID] = { RATE, .u.n = {"\x01%ds", 8, 0, 9, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x01%dp", 50, 0, 99, 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", 7, 0, 15, 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 } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -160,10 +171,30 @@ static int synth_probe(struct spk_synth *synth) module_param_named(ser, synth_ltlk.ser, int, 0444); module_param_named(dev, synth_ltlk.dev_name, charp, 0444); module_param_named(start, synth_ltlk.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(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_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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(voice, "Set the voice variable on load."); +MODULE_PARM_DESC(frequency, "Set the frequency variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_ltlk); From patchwork Wed Nov 9 21:51:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17848 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579406wru; Wed, 9 Nov 2022 13:54:39 -0800 (PST) X-Google-Smtp-Source: AMsMyM5QByHHwy+fg1aR/DuaVzZ1lao8bOnaXbOxP2yEOMHRXCHryVKu+F2L5UBXKZUNav3OlJuy X-Received: by 2002:a17:907:a068:b0:7ad:956f:f13d with SMTP id ia8-20020a170907a06800b007ad956ff13dmr58326115ejc.643.1668030879341; Wed, 09 Nov 2022 13:54:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030879; cv=none; d=google.com; s=arc-20160816; b=fs98ZwQF7t49KDXONMXuVIJHI/un5DtaUYL70fdOmyNKENbCRb/g7xZ+xqo5Djhsrt JyYB5MIyD4spL4xz+WtPWiWsoolSWsN3jICewX6G381+FXNrzHJxxkapCsBHcEGkT8Gj cMRzdWFlgP2saZcAq9PN7VdzmShRCtbQ5nh6pZjRIuPP+A6Y73f4GGohpgL8RgceQQ5C jQoymET73q3RXo09hR9XDKZYt0uEqNrw//3CLmxv3kVYuiLstrqGbLI0ywHo40afBpkk s4vK66PYtw5gjR9mnO2NxWYh9kaTr7+JHgBzTZa8RkZxZwxVCaHE1OP/n3uR56aPcoUo OMvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=cWzTyDXe6WKEiZlJR/l3thqarFb+PbNri74dj26a3wQ=; b=uWrt86aDq8hrOdrV+Tx0Tfb13N2IAp0SK4tA1/ToVYCeXzYaz2pc0SpR3P2Q+zJ8Y3 asXcR1OnWArmD211XQD/0LyvwqdHFBlJM7XvWK8Pp8XGnCtkR0/SN5txi8V5pYCCDieW Amxk72FvCaBRVzYeVyTPRozFsHGNiQYVc0rcsjbtjZqwA2mvtpispG1u9tzLANQY8e/q Mof92uBq8xKwcZmLYNzSPdwO9977VVvf4Xox8K/cYEMUBDGovLIs8xbwbnPxTlPv+P1j okWIvHX3/D6AP0EMyDqiR0rFSQMdk3GxM1fa1tPK9IfON9hT6OBflTf16gh7Wio1YidA ABeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=VDJ1rNdF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qk15-20020a1709077f8f00b00741a0720a2bsi18805226ejc.814.2022.11.09.13.54.16; Wed, 09 Nov 2022 13:54:39 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=VDJ1rNdF; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232030AbiKIVw5 (ORCPT + 99 others); Wed, 9 Nov 2022 16:52:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231944AbiKIVwb (ORCPT ); Wed, 9 Nov 2022 16:52:31 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FC2831EFB for ; Wed, 9 Nov 2022 13:52:13 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id k8so27919570wrh.1 for ; Wed, 09 Nov 2022 13:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=cWzTyDXe6WKEiZlJR/l3thqarFb+PbNri74dj26a3wQ=; b=VDJ1rNdFE9BJ/heAGm41xdjbaBiIKUdTJMHilrB3mCuuQaeU2eCj5UVCH6cvottRoU s9Ja1VvRSS7eGcHr6MQp0A800cb7Jm6/6K8z0fmNlhQzzjB34VfCOu8DvA7pUKsQIXmm DSXA3pRe8b7ZstTlvnXcwXq0XEdHKQfGJhtPXEl+EHYOkFMe7UfDE6wM8NVK5ZasOrpt LImJztUVAXgHLgSZqU6/JIz9cv1jeG6PTbM/qjAXK7NyA4TSnJw4NZadVTAnTXrkB+Rz t/fVhPz4YGu8vn2hVrMg1U2AG69yG+/4WvvSB0cGQJE4krHxxRll0te/wSZZyBPsMDKZ Vs7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cWzTyDXe6WKEiZlJR/l3thqarFb+PbNri74dj26a3wQ=; b=HXBdc4pgrsrBHWP/NMuYbCULbuCNxYuWMeR8YBd1HM0wIDx0Z8FbSUBrB/DzJbAylH BF9Wf6meY9ErdCE9VfE4MmxWE2oAhVRvb49f6vjR8MURj+wPTAMIEH5MWUCdHwF6AtYW leON27LmHMYISa5tGevhj8Ku4LBbM8OFi6XEogGG2xklE+C6jcxhoheJUoYZze2qcjiS gA/DBTdRizE/oEq337WwkKRqfH2P1B5YGvvRY5g+eU6YPHvc7hU1Qv/73G6VP/i6mTyC hPf/agOHMrmnqNv+1wtrAXutDMFjG1RhRhU/8zN2wh6fu6bSGP5uECyEyfkzeklrcrwP lrNQ== X-Gm-Message-State: ACrzQf1BmrEoAFpk9X5zU0aA10gNvUt1qgEEy6dmqaTcu6ppkfdV2fb5 F1QM+kWZICMYLQlHvCQlikc= X-Received: by 2002:adf:b612:0:b0:236:5d1f:143a with SMTP id f18-20020adfb612000000b002365d1f143amr38595679wre.364.1668030732042; Wed, 09 Nov 2022 13:52:12 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:11 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 12/15] Accessiblity: speakup_spkout: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:05 +0500 Message-Id: <20221109215108.7933-13-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057147557037477?= X-GMAIL-MSGID: =?utf-8?q?1749057147557037477?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_spkout 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 --- .../accessibility/speakup/speakup_spkout.c | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_spkout.c b/drivers/accessibility/speakup/speakup_spkout.c index 5e3bb3aa98b6..d3f26095b0ee 100644 --- a/drivers/accessibility/speakup/speakup_spkout.c +++ b/drivers/accessibility/speakup/speakup_spkout.c @@ -18,15 +18,26 @@ static void synth_flush(struct spk_synth *synth); -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x05P+" } }, - { CAPS_STOP, .u.s = {"\x05P-" } }, - { RATE, .u.n = {"\x05R%d", 7, 0, 9, 0, 0, NULL } }, - { PITCH, .u.n = {"\x05P%d", 3, 0, 9, 0, 0, NULL } }, - { VOL, .u.n = {"\x05V%d", 9, 0, 9, 0, 0, NULL } }, - { TONE, .u.n = {"\x05T%c", 8, 0, 25, 65, 0, NULL } }, - { PUNCT, .u.n = {"\x05M%c", 0, 0, 3, 0, 0, "nsma" } }, - { 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, TONE_ID, PUNCT_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x05P+" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x05P-" } }, + [RATE_ID] = { RATE, .u.n = {"\x05R%d", 7, 0, 9, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x05P%d", 3, 0, 9, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\x05V%d", 9, 0, 9, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\x05T%c", 8, 0, 25, 65, 0, NULL } }, + [PUNCT_ID] = { PUNCT, .u.n = {"\x05M%c", 0, 0, 3, 0, 0, "nsma" } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -124,10 +135,24 @@ static void synth_flush(struct spk_synth *synth) module_param_named(ser, synth_spkout.ser, int, 0444); module_param_named(dev, synth_spkout.dev_name, charp, 0444); module_param_named(start, synth_spkout.startup, short, 0444); +module_param_named(rate, vars[RATE_ID].u.n.default_val, int, 0444); +module_param_named(vol, vars[PITCH_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(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(vol, "Set the vol variable on load."); +MODULE_PARM_DESC(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(punct, "Set the punct variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + + module_spk_synth(synth_spkout); From patchwork Wed Nov 9 21:51:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17849 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579423wru; Wed, 9 Nov 2022 13:54:41 -0800 (PST) X-Google-Smtp-Source: AMsMyM7B6+n6M7WBdyRs31NNNAJbp7CtxiPT95ciccHdHxdGLCMf/92xK5khqS4BpNIIA5KHJd6K X-Received: by 2002:a17:907:88ca:b0:7ad:b635:2f1c with SMTP id rq10-20020a17090788ca00b007adb6352f1cmr56337511ejc.6.1668030881323; Wed, 09 Nov 2022 13:54:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030881; cv=none; d=google.com; s=arc-20160816; b=Zz8kN7aSeb43rgwXw36Rv223s8jfGZ7Jdwbz9uoJZ90bLVxDQZvltAeqslkhrj0qN0 R2f6XT+hETAw5r8B4dezpSMXqT6BzlWtRHQA/SRq7q41zP8peU8F1DWUSxkscG3QD4oJ 2ThgO/dlTSP1fxybx5B+BlrK8crvOy5Jf4rKVr8kt6Kx7cNmuJ5eFPU/RWF2W8DnXnvH aLAHMHtd1Zjeafw+xcJ0OPipHKNwB94j8+1YTVbgA6Ys9MN/SJztuLXtG4ZBEXoa4e7u mv1Adl8h627x8Jm11TpdfVINIT01sMoOCV3AFHByZBq5VeM8EnF+uGre6bvjBBz2/Tt1 qfUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WsVCjMUiSVthlr+vgQCdnAlc6L3uC1kVAH/ssI7/ACQ=; b=uZzsCbEDrepnv7i4lvCucVpbweqsmD8+RfEUXMBdG/K/w4y+jIIvWV+zAnSV+jpBsQ +LHP742JX2GC3Ge/IWIBepTjdy6pA/D6nsgb8oqKaIckWNQxv7Up0rKMeCEmgplUu6IK Vbip9BVZ5mcRjZEMo00DJKc5SKlWLXGq8HdnjUesFFIqhnQhH3r6+Gl48srZLFGtBmAb U2fhaph5d+qbiGA30mhfQxU8Ol1S418SieIKr/ALt4dXIyULPC/7Z6XLyLEkIbTKIr/L t92AOLff77oLm29f2kOtjykI9+URh8K+jjA8WH5t/wxbPElPxpml26rFgjacRsFMYQlD 8P4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AmHNjmKE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l11-20020a056402254b00b00443e3fe60a0si18408617edb.622.2022.11.09.13.54.18; Wed, 09 Nov 2022 13:54:41 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=AmHNjmKE; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232178AbiKIVxB (ORCPT + 99 others); Wed, 9 Nov 2022 16:53:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbiKIVwc (ORCPT ); Wed, 9 Nov 2022 16:52:32 -0500 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BDFED31F86 for ; Wed, 9 Nov 2022 13:52:15 -0800 (PST) Received: by mail-wr1-x435.google.com with SMTP id v1so27842052wrt.11 for ; Wed, 09 Nov 2022 13:52:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=WsVCjMUiSVthlr+vgQCdnAlc6L3uC1kVAH/ssI7/ACQ=; b=AmHNjmKEDQ7GtSBT6QCvL4l2GRuwkGZNe57eloXOq7GX+c9qSw5izDhGlsPKuYQvpg 7vxP0SsgHJnRA3GxOqgZWZ3qr6XtEzPJKsQgjvfC5QCDySid0UpTAsWenxBeXALoNwRX //iN4KBuxG3Vvr1XTKJLU/eePr/tEKuV5GiVz4xXSAiwwbVocH1Hnn68b2spYNdJDerD mgm5bLcLjc0tEUxEB88c8c5BC6Bvto5VCg2K2O8ZOpeUEWaK1loRfgxYTo0Y8yHLwgf4 0rG6mH5sqaSf2kOr0mxE6zAsXF+fYD+ovNxI16+m8Um9tlFB65A9ZrJl+kJFmQJsYI93 OQcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WsVCjMUiSVthlr+vgQCdnAlc6L3uC1kVAH/ssI7/ACQ=; b=WJKGlBrJF0o3pz1z+21xgUfbd1k+cffASvDub+JHAfYxfkhYoCBmtLRNuvYJulUUrk e+V9YoG9lf/D2Jw3qUr1ZcX46Dg4NXDYGq5ai+GQycpSo1YA2lgfEy4aW0bW4rXnZNRR FVY4B4zHpcZ4aLnO83vXUlz5lRFJ2H6xRswToVcM+nDa7GmS8lZjkIFnfzrLx2/wzZeB NQYq+8ec/rjQhBBP2rV3/jFfvygSrPHW30aJZtxOphGF5WVMh4X9GhSFoKeR6NpY1c13 hb7tXaUcqNdfgVsTf3SxHs0KTM/7z8K8y1iqIg+VW0vMfs3gTKQY5Qj2I4cPsEFIpwAV lWQA== X-Gm-Message-State: ACrzQf3F0bEEuCAeIpHKZcLnroEJRc4aftTlH7vqm0L93SrmtX/WlLD4 /84xbCfujWDIa/ulsb7UdMQ= X-Received: by 2002:adf:fc8d:0:b0:236:7433:2b2c with SMTP id g13-20020adffc8d000000b0023674332b2cmr38336860wrr.527.1668030734288; Wed, 09 Nov 2022 13:52:14 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:13 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad Subject: [PATCH 13/15] Accessiblity: speakup_txprt: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:06 +0500 Message-Id: <20221109215108.7933-14-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057149581267794?= X-GMAIL-MSGID: =?utf-8?q?1749057149581267794?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding a default variables to the speakup_txprt 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 --- drivers/accessibility/speakup/speakup_txprt.c | 45 +++++++++++++++---- 1 file changed, 37 insertions(+), 8 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_txprt.c b/drivers/accessibility/speakup/speakup_txprt.c index 9e781347f7eb..4d0a0d4c41f0 100644 --- a/drivers/accessibility/speakup/speakup_txprt.c +++ b/drivers/accessibility/speakup/speakup_txprt.c @@ -16,14 +16,29 @@ #define SYNTH_CLEAR 0x18 #define PROCSPEECH '\r' /* process speech char */ -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\x05P8" } }, - { CAPS_STOP, .u.s = {"\x05P5" } }, - { RATE, .u.n = {"\x05R%d", 5, 0, 9, 0, 0, NULL } }, - { PITCH, .u.n = {"\x05P%d", 5, 0, 9, 0, 0, NULL } }, - { VOL, .u.n = {"\x05V%d", 5, 0, 9, 0, 0, NULL } }, - { TONE, .u.n = {"\x05T%c", 12, 0, 25, 61, 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, TONE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + + + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\x05P8" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\x05P5" } }, + [RATE_ID] = { RATE, .u.n = {"\x05R%d", 5, 0, 9, 0, 0, NULL } }, + [PITCH_ID] = { PITCH, .u.n = {"\x05P%d", 5, 0, 9, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\x05V%d", 5, 0, 9, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\x05T%c", 12, 0, 25, 61, 0, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -112,10 +127,24 @@ static struct spk_synth synth_txprt = { module_param_named(ser, synth_txprt.ser, int, 0444); module_param_named(dev, synth_txprt.dev_name, charp, 0444); module_param_named(start, synth_txprt.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(tone, vars[TONE_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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + + module_spk_synth(synth_txprt); From patchwork Wed Nov 9 21:51:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17850 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579560wru; Wed, 9 Nov 2022 13:54:59 -0800 (PST) X-Google-Smtp-Source: AMsMyM5x9awrx4HUz6OPi7rA+dXBX2aVEx8foRUwahqKjmKy+NMHWdYU4o+64r3vlHYIMWAoRprO X-Received: by 2002:a17:906:5a46:b0:7ad:b822:d2c2 with SMTP id my6-20020a1709065a4600b007adb822d2c2mr55488062ejc.41.1668030898810; Wed, 09 Nov 2022 13:54:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030898; cv=none; d=google.com; s=arc-20160816; b=Xe9CPlOkOeSDk8Qe5qvGnCTFDgMFiTHTrdL+bYYgEkPFCKQ67Xy7UgyWrJKzuC7z3M Z9LEAaX+De/PouQyQP5A7kXayy5J/VFdkX9mEG+pfbMHWPXBsXI5TPJiKMTo+ucMAilY S6+rs4C2BQmcVtURxH60nsV4RYbsGCsfUdFlfPT+sbbmTKnUnTjaOVkSDbzc6wHRfYPn 2iaO1hq/JZnd25godeb3/2R1Vp68N1f9KOtfKic9jdixylAHA+yCht5TVqs9X2yTAbE0 UdymR256gaVM5lorjqA+tmJnKeUJP0PO4fUKqSOMDeJ9hKM4ONTo6C2s1yON0i8DsPNl aLOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=xVa9D+c6P7uTx0fhUi+7ocLfNmZ9LwakhMxKgE7GifE=; b=VwHtbti7HyAx6QI8HmnC5nij/esisSgK93F2lhWo0uJcgYJbu8dtEGXnyz3aX9eEbW cBrYlOqTaXNzDlky0ZQNNAkXUBdjpbd0tHOr0QxrCiS+NgWT6+RAdrWHR1VKbAsjXVVe M+dWsGAGpSaqVYfNCdSm+ALLVm/iUXXUSlJ52AkiBr7QVNbU96yzzkHt/NiYyLpSTuNz mitYX5qzap2zNT5ZhM5VH05rwLm3H0ZrEHXxf4o5eUSe/vr5R/3sTGKsUDz832WwFV2r P77bhCRYgpJMmT/Y+pFTIqkuLZL0QjS9x3X+s7l2CqqpKs7SbUk/211VYIZN1f22uifZ psqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=LP3LYSpz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk17-20020a170907767100b007413ed9efb1si14039705ejc.543.2022.11.09.13.54.35; Wed, 09 Nov 2022 13:54:58 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=LP3LYSpz; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232186AbiKIVxL (ORCPT + 99 others); Wed, 9 Nov 2022 16:53:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232055AbiKIVwi (ORCPT ); Wed, 9 Nov 2022 16:52:38 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F1831FBE for ; Wed, 9 Nov 2022 13:52:17 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id a14so27883783wru.5 for ; Wed, 09 Nov 2022 13:52:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xVa9D+c6P7uTx0fhUi+7ocLfNmZ9LwakhMxKgE7GifE=; b=LP3LYSpzGRzPcye/zt3E50sgEvGfSLYUzG+wYp5b7VaC6EypVoFbtn/GCMJ1ZDKBlC i9R1QEFtNY6q4koNMQTk8gtDjFzsfEmMOtZyy7s0bxa08kiiU67gG1ytxLrh+qBHDXwy EkIqOJuxuARGQKiqqVC0GzcFSdWkuFK2YggIlAyFBmfWB5dVPddvsoozJNm4tAhfq6Bm BUgyWy3cMMpt5mUwpCBxeR3Oq/Y47JvzUT/gCvWEQoD5sinTMcpd0oDi7g+GEH6nVKci /riTJfgsQ40yUKZJLMw+UrZiXigTJyD8dJm9x6SyDf4YD7H9DDD0euip75dgURHmLu88 auTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xVa9D+c6P7uTx0fhUi+7ocLfNmZ9LwakhMxKgE7GifE=; b=rD4EoCiciLE+Hqi+fRMNDrv1RqMeHrAZ4pUEjJ/4OmlwcHqRz/zJcHP7hMIATF8LKX MhjVgTtPi6etUu5b6BlJCwKptq+nctLAbnc7Kml6dE+i2o+iB2i3t1wRfcFW+daD/Z1d sJGrfIFXILgrp5gFALS9qfkPewk+sIzOIz40ySCqxY3U2Sp+sBxsDE9Q7qkU/tr9cZtP rmOG/rE/VzneOPF9ay26+1VQc1YKlH89eTPOfECOjMCpAGBL3bN0R/nltnpMPmgpvtx4 vJ4cE14He3obtOim7wcFDSaPgCpWm2spPwE6k7aSzISdXQsWFFf+y5Q7Lf9ON8Ik9J6i S3Iw== X-Gm-Message-State: ACrzQf2RdrSHuZoJHE0DpmIBLQSAHxvdkncgVD/6MkRTWvb01wRVgIeJ Npkcyt/u7GlKRXO2IigIEis= X-Received: by 2002:a5d:4143:0:b0:236:4b40:bbd1 with SMTP id c3-20020a5d4143000000b002364b40bbd1mr39221317wrq.26.1668030736528; Wed, 09 Nov 2022 13:52:16 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:16 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 14/15] Accessiblity: speakup_acntpc: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:07 +0500 Message-Id: <20221109215108.7933-15-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057167896550301?= X-GMAIL-MSGID: =?utf-8?q?1749057167896550301?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_acntpc 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 --- .../accessibility/speakup/speakup_acntpc.c | 38 +++++++++++++++---- 1 file changed, 30 insertions(+), 8 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_acntpc.c b/drivers/accessibility/speakup/speakup_acntpc.c index a55b60754eb1..a27e6bbf05da 100644 --- a/drivers/accessibility/speakup/speakup_acntpc.c +++ b/drivers/accessibility/speakup/speakup_acntpc.c @@ -34,14 +34,23 @@ static int synth_port_control; static int port_forced; static unsigned int synth_portlist[] = { 0x2a8, 0 }; -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\033P8" } }, - { CAPS_STOP, .u.s = {"\033P5" } }, - { RATE, .u.n = {"\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" } }, - { PITCH, .u.n = {"\033P%d", 5, 0, 9, 0, 0, NULL } }, - { VOL, .u.n = {"\033A%d", 5, 0, 9, 0, 0, NULL } }, - { TONE, .u.n = {"\033V%d", 5, 0, 9, 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, TONE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\033P8" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\033P5" } }, + [RATE_ID] = { RATE, .u.n = {"\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" } }, + [PITCH_ID] = { PITCH, .u.n = {"\033P%d", 5, 0, 9, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\033A%d", 5, 0, 9, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\033V%d", 5, 0, 9, 0, 0, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -305,9 +314,22 @@ static void accent_release(struct spk_synth *synth) module_param_hw_named(port, port_forced, int, ioport, 0444); module_param_named(start, synth_acntpc.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(tone, vars[TONE_ID].u.n.default_val, int, 0444); +module_param_named(direct, vars[DIRECT_ID].u.n.default_val, int, 0444); + + MODULE_PARM_DESC(port, "Set the port for the synthesizer (override probing)."); 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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_acntpc); From patchwork Wed Nov 9 21:51:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Osama Muhammad X-Patchwork-Id: 17851 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp579899wru; Wed, 9 Nov 2022 13:55:58 -0800 (PST) X-Google-Smtp-Source: AMsMyM4ewWFhjCRzKCMeimdDEPxdzMYJvGXRM0E4lZ+G2MMDjPbiJtJC2QsTmeCjARbav18x/DR5 X-Received: by 2002:a17:907:2c42:b0:7ad:d798:f2d5 with SMTP id hf2-20020a1709072c4200b007add798f2d5mr49073160ejc.386.1668030958305; Wed, 09 Nov 2022 13:55:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668030958; cv=none; d=google.com; s=arc-20160816; b=d14Ui8cIZ9wjpLA6yQAqZIHAsWMDj7X5WRjkQQmBgoKypTX50FvGbgecHhPHwLfI9C EmPWTB35IfdDwA8aw5zKu9cGvRlSnWR7ajLaEZtpDr770fFvE4ivDuvqvBHdPTtrqxQp CLmYDfoGyeWHlcM7Uc8veZO/TPuazzKK7wvmCInFED+zTDudxVw+gjpfsU/oHQz4kvT7 LuF+E/jQ+RN0HAF3xoRzSKzYhwPgD0cFGXSizj/AOGKcQjdfoNMTbu0QV930HkfYS8iA da2TdIVL5reDdwFmNyG3xAYt90P8OXWONtqq3R0VjWmYnEuVXYN2IjsPGzJ//FVTofux bJaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=phMCunUzMzBIeOwh1nBHGGoR98Q0GIyBGyO5sBxaNIA=; b=vrwLtXrNDV1rn0S8XIDZk3GwFuWVUyQAOytsnT1FfPOoUpuvXLG7VmwvqTXy3d/S4r J8COVKo0Z2+wI5LwfnLr+pj5JQ9lTIrLAnDGsgXgnWzSmFXF7YGwKlZGW7oQA449z3ux 6VpqatRnsSIpbRk06MmZk9ar7488us8Zd4hXZPofMt1itDQ+kxDgrc2ljppRU5fXpgJw Bmnq6NMbCozAnmqgpLx75vA1c0cO/vayOHZZjkcCYOUClsSRpUi1pLyfVQDX/fQHK0Bw 8lY7MnV4JaHtUYQmxBjkPtBkXWCVdfzRsedpzfKO6RdVzXLFhIkYow6pKFnyKiSUeuzT 1HFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=AKxVP8KA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b20-20020a056402351400b0045743696acbsi20112282edd.139.2022.11.09.13.55.35; Wed, 09 Nov 2022 13:55:58 -0800 (PST) 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=@gmail.com header.s=20210112 header.b=AKxVP8KA; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232136AbiKIVxP (ORCPT + 99 others); Wed, 9 Nov 2022 16:53:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231992AbiKIVwq (ORCPT ); Wed, 9 Nov 2022 16:52:46 -0500 Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6269832048 for ; Wed, 9 Nov 2022 13:52:20 -0800 (PST) Received: by mail-wm1-x334.google.com with SMTP id v7so41786wmn.0 for ; Wed, 09 Nov 2022 13:52:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=phMCunUzMzBIeOwh1nBHGGoR98Q0GIyBGyO5sBxaNIA=; b=AKxVP8KAs6BwhhVH3G+S7ARHO9+hYYs4x3O7zMhZvEFip1+/ncNQF4EzTrhRLyChbd luEqp9POqScQytEfHUTyQvmoYBn9oXFGMFDbaMvMsBmIBrQuBhdH0sFOfO9zHu26hR5n rM2NXoZj1t9il+XCm1945M/xm63RVftKXlj136GqqTnQ33qwADkuVogz+GGtAyXE6L4+ CDuOjev7YxZEN213jsG96qqUQEIztWjP50y4Uy2rPHyEcTj9oEZasEvtOrPdT+39RRNg zjYWwRz8L7AfD+/y9zDldX0YIflE+cp5I+iAfSWztCekvJZcOLMBoe0sjnCQF1uIUGxb Ho7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=phMCunUzMzBIeOwh1nBHGGoR98Q0GIyBGyO5sBxaNIA=; b=0ECuwVdG+EwEmyUYNwrWi58inrymuZoGJVo8Ot5IR4HZgQj5uVNJGpEDlvARPQkYHv Ehf6lOTloVjGwf7LXkSFC9hFzusbASe23IyrpUahtGd2yMIrMJAQ9KwBrWbvW0k6+F3w YK67NwA1S3LTVrVTkoxSWdy++DX29Q/ZgZPx553gwTZG1fYwg1JubaisbmCAsrcOwjfx R4osxkHG2i0WV9UAmnnLqAuU5RtYLUUT4pvOkINZ9iL7CJ9/2Y601oCJlIRxgzVwpr68 seYnlBq5dWdE62Sy0515aPVHEgz/9I591I088XeWtuZBgthcfZPT1FtyZZGKODe6HIbl DOyQ== X-Gm-Message-State: ACrzQf17OI0hGD5XB9GUfN0KxxiE0q0OwHiqczBAoKR1cZwwSEdbD6Pq NJuSUsLn2rSnh0+Q0MB6UlQ= X-Received: by 2002:a05:600c:3ac5:b0:3cf:8897:3205 with SMTP id d5-20020a05600c3ac500b003cf88973205mr26881813wms.76.1668030738871; Wed, 09 Nov 2022 13:52:18 -0800 (PST) Received: from localhost.localdomain ([111.88.203.172]) by smtp.gmail.com with ESMTPSA id o20-20020a05600c4fd400b003cf7292c553sm3022305wmq.13.2022.11.09.13.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 13:52:18 -0800 (PST) From: Osama Muhammad To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Osama Muhammad , Samuel Thibault Subject: [PATCH 15/15] Accessiblity: speakup_acntsa: specifying the default driver parameters among the module params Date: Thu, 10 Nov 2022 02:51:08 +0500 Message-Id: <20221109215108.7933-16-osmtendev@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221109215108.7933-1-osmtendev@gmail.com> References: <20221109215108.7933-1-osmtendev@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749057230408018373?= X-GMAIL-MSGID: =?utf-8?q?1749057230408018373?= This is an enhancement which allows to specify the default driver parameters among the module parameters. Adding default variables to the speakup_acntsa 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 --- .../accessibility/speakup/speakup_acntsa.c | 37 +++++++++++++++---- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/drivers/accessibility/speakup/speakup_acntsa.c b/drivers/accessibility/speakup/speakup_acntsa.c index 2697c51ed6b5..26bb9f9399d3 100644 --- a/drivers/accessibility/speakup/speakup_acntsa.c +++ b/drivers/accessibility/speakup/speakup_acntsa.c @@ -19,14 +19,24 @@ static int synth_probe(struct spk_synth *synth); -static struct var_t vars[] = { - { CAPS_START, .u.s = {"\033P8" } }, - { CAPS_STOP, .u.s = {"\033P5" } }, - { RATE, .u.n = {"\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" } }, - { PITCH, .u.n = {"\033P%d", 5, 0, 9, 0, 0, NULL } }, - { VOL, .u.n = {"\033A%d", 9, 0, 9, 0, 0, NULL } }, - { TONE, .u.n = {"\033V%d", 5, 0, 9, 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, TONE_ID, + DIRECT_ID, V_LAST_VAR_ID, + NB_ID +}; + + +static struct var_t vars[NB_ID] = { + [CAPS_START_ID] = { CAPS_START, .u.s = {"\033P8" } }, + [CAPS_STOP_ID] = { CAPS_STOP, .u.s = {"\033P5" } }, + [RATE_ID] = { RATE, .u.n = {"\033R%c", 9, 0, 17, 0, 0, "0123456789abcdefgh" } }, + [PITCH_ID] = { PITCH, .u.n = {"\033P%d", 5, 0, 9, 0, 0, NULL } }, + [VOL_ID] = { VOL, .u.n = {"\033A%d", 9, 0, 9, 0, 0, NULL } }, + [TONE_ID] = { TONE, .u.n = {"\033V%d", 5, 0, 9, 0, 0, NULL } }, + [DIRECT_ID] = { DIRECT, .u.n = {NULL, 0, 0, 1, 0, 0, NULL } }, V_LAST_VAR }; @@ -129,10 +139,21 @@ static int synth_probe(struct spk_synth *synth) module_param_named(ser, synth_acntsa.ser, int, 0444); module_param_named(dev, synth_acntsa.dev_name, charp, 0444); module_param_named(start, synth_acntsa.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(tone, vars[TONE_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(tone, "Set the tone variable on load."); +MODULE_PARM_DESC(direct, "Set the direct variable on load."); + module_spk_synth(synth_acntsa);