Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3862350pxb; Tue, 17 Nov 2020 05:39:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzK5Ohs+8jeiEy7sO2JpTviy48Avc5qpuYgTJ8DfcfKdUCu+ntDrLPQ4A+hEmNIzpSgBoOP X-Received: by 2002:a17:906:6949:: with SMTP id c9mr19032567ejs.482.1605620362499; Tue, 17 Nov 2020 05:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605620362; cv=none; d=google.com; s=arc-20160816; b=Dw+399+S8+AwuRVAbqDXgMVHzFRXLu+/DeBSrG3fGeVJ7cIEtAD9IV8lpuEXDm/k0H Ncwlme0siuH4PVKvbnrvXghPra39Fs8aGa0ThOqdoYwSiAEVJVK6DbG+j9bDYtU4OpKw w0GBHE66Mhs5ynVXGW9CF8j30M8gmjqpsDwuJ2JRI5hMdtl181JIFIV/0W5eRySLprME sZo+HcO+MNM/OrNToB7JCkuv5ndhzJmI+IRHgziqZeLlDFJqITGv9OPyLep/Z9AXlVfc LQxLc+94F41qMw3JL2Kb5Uci1/WY5izuF2tI+YPKOaAUodaJKgi2zKPAtr8z5hYpiRhw ejdw== 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=qOdevNU7YeiXXA8OUhM/wlh94zXUE4OsSStbZ2PZW+0=; b=g8HdbUWyniGFaCKEUrOnMOTr9T1ryDqNKMdNId0OWEiIdnCnVToLhhSKsYq3QEuPoI 8+5ZDA6eBOzkc99cPwW4nDmR+rWjOhlMbWMvzqW6o9Y+JK6YarK6iOAC8IWiDKBeeUaC YFZqyF89S+AzB+4tBdHkhBlXDC8/919Z58kL+WFqk42nzt3FvS9wpEhodZx3wnnIQh/2 FuN1ORv5zI6kHWxj0NOctqzdS4ibk2fALQvq3xm9i+wUh3vYuZPnWowgtb8Wd9tVnMAF SV4r16PfQSIffDvb8r15rkB/T9fZSr0aWoX4JST4XxxN2vOc+XyaEjEZNcGhguwSz6iE UeZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="boiD/3lu"; 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 r10si12873721edt.313.2020.11.17.05.39.00; Tue, 17 Nov 2020 05:39:22 -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="boiD/3lu"; 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 S1732977AbgKQNhn (ORCPT + 99 others); Tue, 17 Nov 2020 08:37:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:48890 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732466AbgKQNhk (ORCPT ); Tue, 17 Nov 2020 08:37:40 -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 6478E207BC; Tue, 17 Nov 2020 13:37:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605620258; bh=aTPvIWSdGl3VNu+IMvu8NQNJp1W9U1nYpkDGppYYOTM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=boiD/3luQLfTlONo+giPDgdJ2wl43oP2/pySPOpQc7FvHMtOcs3E5wWP/Fkye+kc2 +7vaI9BpnEGbUIQTHTXd3VUy897BfJHwB0OlTVtqdZNopkju2c0Miv3LIjR8bEqQ1L hseQ8AtyME/XZZ5cjpUOyM95PM5CmVZmELIWHuYA= 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 5.9 129/255] pinctrl: intel: Set default bias in case no particular value given Date: Tue, 17 Nov 2020 14:04:29 +0100 Message-Id: <20201117122145.213313363@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122138.925150709@linuxfoundation.org> References: <20201117122138.925150709@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 b738b28239bd4..31e7840bc5e25 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -683,6 +683,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int 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; @@ -705,6 +709,10 @@ static int intel_config_set_pull(struct intel_pinctrl *pctrl, unsigned int 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