Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3849404pxb; Tue, 17 Nov 2020 05:20:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTelc30pgN0u0MvxZjGfrxH/KFAMmePMTNIR8CKq2OP3TVzXrpMDSU7G12FfmlnGOOYV/E X-Received: by 2002:aa7:c2c4:: with SMTP id m4mr21761983edp.66.1605619235913; Tue, 17 Nov 2020 05:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619235; cv=none; d=google.com; s=arc-20160816; b=WeM7UL8/B8DD6EDk/eS+LTkRWCOSGXcVonbNqAEmai4odhi5YjBFgqRyjzCEXbsn0u HxrGpCTLEhHT1ouHOpxnIxIjy2KX1RJunM7ZeM9lWb/Rr0EpuTW1oZDInvgu6pRdRsSq XqM8u8jqwoLwQulm2i7ULkGrSIV2QE9P2qrBccx0L1mGc3TwGpb220estc/602qRH/CG +g5uZyPI8/pAhPUjShNqJPlqbfhFAM6A/sYIJ9cm6b1kUixV2CNNG+ODD1B5lYOuuY4d SdNAgzDm563lRVUQxTwwekFBbVP8+lhqy8WhQCQ8+ACC/wz98iD47D9TERE+ZpPSfRPY KoNA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Uoc5Otogm1coNWG6GtHgO4a5H0g/TL0CgcWAaiI+BuU=; b=vXOab/sLilqj4mOWFJrX67ksNsbFyr8MgkStyBklmB5Hydxk7vVKrEijoWCRV2CBjq ITLrIQGoCdP43p8+ePUvETsS44dF+Re2BrMBfVZJW1CbYsDBtk7wnfvTjitU1ThMNdIh YlYMLEl9oAoAG1fKM6uAqGuWLMHwwemyHHz4OJvWtbMkEudxLT06RxbWK8L+qao4XjGi 9mgY7SQ4suQ2HNkaW3EIv9ArxNu1yVhHIY6TU3+NqC/a5HB/bLGbJe0BdHshgCWyrEZ7 lfORn29B8UOn60fAos7c+lRPuHVWQyygPVv8tFJMovEFuqQZ97P7iL8y8uhG0/u9KZ10 sBjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=duwb3jp4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oa23si1278878ejb.707.2020.11.17.05.20.12; Tue, 17 Nov 2020 05:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=duwb3jp4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728934AbgKQNPU (ORCPT + 99 others); Tue, 17 Nov 2020 08:15:20 -0500 Received: from mail.kernel.org ([198.145.29.99]:46604 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730162AbgKQNPR (ORCPT ); Tue, 17 Nov 2020 08:15:17 -0500 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id EAD86246BF; Tue, 17 Nov 2020 13:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605618916; bh=EXnd/v92FTeYhAqhSbs36rm6Qfj6+smhBqqNFaS+fqE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=duwb3jp470+u9N55hah5lphWw6r3yWJyXlBUFiX/g/BrZpPmpltGRgaBsZizIRgQF Erq4LB7gtiEcDM2FfEoe60Vy4tT0BHGHegPreyD8EkOkOJM+L4/Eni0wfTe/Kaxs41 o106iv8+P97e0XnnWYy8qELBK61iUBjvrJGwax1w= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jamie McClymont , Andy Shevchenko , Mika Westerberg , Sasha Levin Subject: [PATCH 4.14 34/85] pinctrl: intel: Set default bias in case no particular value given Date: Tue, 17 Nov 2020 14:05:03 +0100 Message-Id: <20201117122112.699344401@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122111.018425544@linuxfoundation.org> References: <20201117122111.018425544@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andy Shevchenko [ Upstream commit f3c75e7a9349d1d33eb53ddc1b31640994969f73 ] When GPIO library asks pin control to set the bias, it doesn't pass any value of it and argument is considered boolean (and this is true for ACPI GpioIo() / GpioInt() resources, by the way). Thus, individual drivers must behave well, when they got the resistance value of 1 Ohm, i.e. transforming it to sane default. In case of Intel pin control hardware the 5 kOhm sounds plausible because on one hand it's a minimum of resistors present in all hardware generations and at the same time it's high enough to minimize leakage current (will be only 200 uA with the above choice). Fixes: e57725eabf87 ("pinctrl: intel: Add support for hardware debouncer") Reported-by: Jamie McClymont Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-intel.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 71df0f70b61f0..45b062b0d4188 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -602,6 +602,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin, value |= PADCFG1_TERM_UP; + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 5000; + switch (arg) { case 20000: value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; @@ -624,6 +628,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned pin, case PIN_CONFIG_BIAS_PULL_DOWN: value &= ~(PADCFG1_TERM_UP | PADCFG1_TERM_MASK); + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 5000; + switch (arg) { case 20000: value |= PADCFG1_TERM_20K << PADCFG1_TERM_SHIFT; -- 2.27.0