From patchwork Mon Oct 30 15:54:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 159792 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:d641:0:b0:403:3b70:6f57 with SMTP id cy1csp2316289vqb; Mon, 30 Oct 2023 08:55:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGJW0ULK/WJSCPexk8x+l0uvsGb6wb2UOxVitr2SWddHDd29rx41iRx22sN67cwGSCiFijo X-Received: by 2002:a05:6a20:918f:b0:153:b16e:8db1 with SMTP id v15-20020a056a20918f00b00153b16e8db1mr9262000pzd.10.1698681314269; Mon, 30 Oct 2023 08:55:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698681314; cv=none; d=google.com; s=arc-20160816; b=vUDHNYCDruHJr3fcKAeNAMOf7N1yUFL+stl7hoExrc1yPAmpsyiTNH/EK7TJZzhr4M tktueBTThA9mP2BZEN7weGiyxsE66WG9lEVepRYqCnKlqHjK1gMdQ4bhDuhQsvU0wYNS tBN0IYSIRbn8dcRkNbagm1YcM7ISku/2UTto/bOL3aLonog4FUsimzm98oGMsSdaPivj 9LoanXivWA8+rx4rj/nm2qG5w7I1mYg8zdwxfHzk7dmVwjPDftY9JRQfzcHYIflkb4tR rEL+feAsJVhkTNfA8MTJAXVnXD/j5i0Ky52gV65LUOnX/Sd5DtGBCFuatXeVtwCljSMT XkzQ== 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=0ETomMetDHMk1odAN3KntK9J2yIMkJbgHwgs31J4F+s=; fh=5FU642BpIFAr4AKyJrXFMz4Yus9QjD/h8EEeKBF2tLg=; b=F6W9D9iW/CE1mzM+FJFJBxz6tZhbBq1gRoetPnP/VNB66GH30tCvFRRpkXkj3Dlk6+ 4lG+/KVWnxHCoofaTeST1/FApboDSCJ7F7e4xWSRbQbWSegrMJdhVcL4YYqGLmi8tsyI e4dDGSqr3XDYwYKPCZYky7I5PUvXO/HcDJW7LkEwrUWYMlPNm/O20YM93jVnBSUOXImD IovswkLg59mOcCznrBUdlDupyD5UJYJUYZJass26Y3b0X/GSquHOc1kjGwymsBc21T7c D2HhhhhDC5j/kGxiFcSgGeLcZLKv+PAU1kyDyL6jxiP7pW4e/j7VDO7OquUjyesOwNgZ bdYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mEot2FOj; 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 f9-20020a056a001ac900b006b9aef36fe8si5118965pfv.292.2023.10.30.08.55.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 08:55:14 -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=mEot2FOj; 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 033DD8030286; Mon, 30 Oct 2023 08:55:13 -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 S233630AbjJ3PzG (ORCPT + 32 others); Mon, 30 Oct 2023 11:55:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231919AbjJ3PzE (ORCPT ); Mon, 30 Oct 2023 11:55:04 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81280DA; Mon, 30 Oct 2023 08:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1698681302; x=1730217302; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=Vr9wC//U7mjFaon4HjCKM0j3IK8dVlIOCYgYttbl/8c=; b=mEot2FOj5zUXk66m79D1tEDYUJwWidkKa3+87oTlKyU5xg6ZdTJWkedn t9NMakp2bizRFyzA15B//4NMOFnFGlLUGHhUia9wRVGwWfozWaKTjtSzu W3CBGlkKjEV5jvTN0RkMDMkR+ATGAJZTkW9jH8il57aJxOeXKpXXpOjSe 8k4o7GlGrPi1/zo/cEMZm4wh46hDunAs3dLAo/5ir2EqpZquGNGR1yOzr ITztN1bOxGwLMyI/M5turp+cvkxrtQ7FPiWkvWlWGRp+poF1woIkJluUn vMeO9MTss6K+8H/8RlwZcRN1gHsmUCE1Lvn6wyUX5iyeOmW5cHAWOQ5wt w==; X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="367444829" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="367444829" 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:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10879"; a="760321886" X-IronPort-AV: E=Sophos;i="6.03,263,1694761200"; d="scan'208";a="760321886" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 30 Oct 2023 08:54:29 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E37E32AB; Mon, 30 Oct 2023 17:54:27 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij Subject: [PATCH v1 1/1] pinctrl: baytrail: Move default strength assignment to a switch-case Date: Mon, 30 Oct 2023 17:54:27 +0200 Message-Id: <20231030155427.3468671-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:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781196457434423996 X-GMAIL-MSGID: 1781196457434423996 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-baytrail.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 94c2438c4493..437315d32f18 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -799,6 +799,7 @@ static int byt_set_pull_strength(u32 *reg, u16 strength) *reg &= ~BYT_PULL_STR_MASK; switch (strength) { + case 1: /* Set default strength value in case none is given */ case 2000: *reg |= BYT_PULL_STR_2K; break; @@ -945,10 +946,6 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, conf &= ~BYT_PULL_ASSIGN_MASK; break; case PIN_CONFIG_BIAS_PULL_DOWN: - /* Set default strength value in case none is given */ - if (arg == 1) - arg = 2000; - byt_gpio_force_input_mode(vg, offset); conf &= ~BYT_PULL_ASSIGN_MASK; @@ -957,10 +954,6 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, break; case PIN_CONFIG_BIAS_PULL_UP: - /* Set default strength value in case none is given */ - if (arg == 1) - arg = 2000; - byt_gpio_force_input_mode(vg, offset); conf &= ~BYT_PULL_ASSIGN_MASK;