From patchwork Mon Oct 30 15:54:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 159793 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2316338vqb; Mon, 30 Oct 2023 08:55:21 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHDfqq+npkFznO3CRbpMeMei1RIZd4L0/gmNnd5T66DVT1L0kAV7guawlwTsJrL8X+3r29j X-Received: by 2002:a05:6a21:780a:b0:161:3120:e865 with SMTP id be10-20020a056a21780a00b001613120e865mr7368757pzc.52.1698681321019; Mon, 30 Oct 2023 08:55:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698681321; cv=none; d=google.com; s=arc-20160816; b=mOTeix+Ghfh2P4MBVzNlF5ZmfPXxUUT/nBBW+t1MI0yPYq/MggWl81AhY8ufH6EkVq MeLKCPFPVD2R1sefQAl4btfl8SlC+p7ysjZ0sAgsE2tM5dZ6JpyFUEFR5/7YVk3IlvMb iefsvJgtoHMJxnvMZwTQM/hnV4knvCjttjTsRgRLMB3s3Y3G43EJziQAT80dU/WbuLEV 9Xuq9iU4P5JJtogO0YTqSkOei2GTN6EolAwf7N+hPI/pnxte/juT3+68LwOZUPdBxpBJ DPjReRjr6PZwljjPkO54/ZVTA9U3/6wcaQqp/QBpU+++8T3HFIe7MnZdaKy48GiU+lud 4zTw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=qCTWbknBEnQRNouMaLRAio8RiEsBmfWMhkKPYYGyX9Y=; fh=NnhJav8m0ogAvG6hAId+5RYj12VDvLtLFoqEjL7A7Jg=; b=hf5uILinIOJOaRp+vJ13NhsQby8mAzackVYYu+22asW4WeO/zwzwpWsfNJmnjTFCPl zSlRaK7fdpZoTV6MRgH1ry1yEE9WokH7f1hIiMF0K7S5E4JlqZJls3+/Nz3Rcn0dfilx r7Yssw/y8UZe2F8dQLeaoJ7o0vPk3iim/0g/jK/9O4CaMlqENtbL8CxBGsr/dP+Yv0Pb c7WZNRCX3o+ARnM2dDkLIkzu4Lo1uZOHYS9/IRp6IqpIAYa1eXoBu/JV6YG7e2IcZZK7 8QWQF/FKUF7VZyxG5bKJvQmPvFK709D/nd6aQM2LyZtHgLzLaxaGRC3u0rMj3WK5ST93 Dbmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QNwulWTa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id c11-20020a6566cb000000b005b9293dea1bsi5079597pgw.645.2023.10.30.08.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:55:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=QNwulWTa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A5ED68030285; Mon, 30 Oct 2023 08:55:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233738AbjJ3PzN (ORCPT + 32 others); Mon, 30 Oct 2023 11:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53882 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233642AbjJ3PzI (ORCPT ); Mon, 30 Oct 2023 11:55:08 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E492CDB; Mon, 30 Oct 2023 08:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698681306; x=1730217306; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=cui525UNipVa8oEMgTPsnR567PdLaN5sF8CXFM/W4Zk=; b=QNwulWTauECbxSl0bMpmcrTtnlsW6BqNKdBWi4EyRT2Tjd6yP2c3kcs0 7lSN4DkD59iI/PvcstmM4bitav/DPWEqIsXxOrHJLRxymSPlwcLSdmX5I 8liN4y44AwQd7AAgYY1QvkBY4esFgRrE+9zQBidGpcZTRMBoTP1nEw/8X nx11/Q0RDeuw0/OgaZg3TX1laH+TH+R6KiuAS+ieMpiRMt6dKN8428YfJ xoVVjjtPdYUDw5bZi0PFuCrKvAtLi7EMTDWvNKZCLADXE9pzAze5kND2c SuulFjGGYUJ8h1LGXZSaUYHDIRZonOIDTLLaFmgQRYMvFDo5ZIHgLVtUa Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="367444898" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="367444898" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Oct 2023 08:54:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="760322099" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="760322099" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 30 Oct 2023 08:54:34 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4A4FC2AB; Mon, 30 Oct 2023 17:54:33 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 1/1] pinctrl: intel: Move default strength assignment to a switch-case Date: Mon, 30 Oct 2023 17:54:32 +0200 Message-Id: <20231030155432.3468704-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.40.0.1.gaa8946217a0b MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_NONE 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-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 08:55:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781196464999482265 X-GMAIL-MSGID: 1781196464999482265 iWhen ->pin_config_set() is called from the GPIO library (assumed GpioIo() ACPI resource), the argument can be 1, when, for example, PullDefault is provided. In such case we supply sane default in the driver. Move that default assingment to a switch-case, so it will be consolidated in one place. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-intel.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index fb3e0e1e0a0e..3e8010607d32 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -677,10 +677,6 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, u32 term = 0, up = 0, value; void __iomem *padcfg1; - /* Set default strength value in case none is given */ - if (arg == 1) - arg = 5000; - switch (param) { case PIN_CONFIG_BIAS_DISABLE: break; @@ -690,6 +686,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, case 20000: term = PADCFG1_TERM_20K; break; + case 1: /* Set default strength value in case none is given */ case 5000: term = PADCFG1_TERM_5K; break; @@ -716,6 +713,7 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int pin, case 20000: term = PADCFG1_TERM_20K; break; + case 1: /* Set default strength value in case none is given */ case 5000: term = PADCFG1_TERM_5K; break;