Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3851731pxb; Tue, 17 Nov 2020 05:24:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzltvRZ6EnsgOSF3x0TChQcjvsPRgbaaD0SXUQjkTlJHzEDfH2kOkB8MMQ/IbVy8xIAqKcN X-Received: by 2002:a05:6402:947:: with SMTP id h7mr20867323edz.85.1605619446599; Tue, 17 Nov 2020 05:24:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605619446; cv=none; d=google.com; s=arc-20160816; b=pmz38RZFDf6s0j8cvveGUg9Mnw9A0PlVr7pXO5RrgI/4PYdafjRIZpQgECgf+EKEiC thnUkxhGbKJCUEhrtYL/43SolnWjSENfF4AURJFXmdx9eHF0WjgUsHLJYQ5kpnj9uQ7x gurRAO/5eMNBinog/jXgE8oCm2T3JmPakbaEnJ4CdhTUge6uxL0rX/XDI/XTVNMU6P8b gD1Mc8NXhQu8ZpKxlu3Of61omwn5hjVs1tqJkkGrfZZVKFVMKxMlV5hhkmUTfxpj6gPS zmsYmnGC8aCjgqFcizexMue4qAyk0M/KSzrj0jPi1Z/aqQlC93Z4XfDrL5UYs8/qua2j aIlA== 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=3hCizX2aOjEcHvvLXBhCNt6242UG1eCMC870KLqKP0U=; b=WZRRbwOg/6Lvd2OExs6JEKTtOQoMAzGNkjUTx62p3znDkf5Qf65KjfaurLdrLt1NZp kHL/Xzt3F25stCBVD7rp/WZAJ9o2QS7Wpbw877FaOipNxjKby9v/4J4WqZQkjnApygBx XRL3vSkx31tc6im3mOg371hEMr7QoWVEWIzSNPF5phBefgvA3RJ8RehUOawouah4OxoN adJSTluYV+rZxoDMQfBuLelS2i0fEA3UvzVDQNLQee4XMiMo7lWwVgzdL+SMCKU1pmrE mlhPPwfy6gaLcyzl2AtFER4Xpx6sICkTD+5XcMd4a7cEUTG1Su8PRxOSFh9uylBdPyYM UNDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ViJderJ7; 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 cx24si13644614edb.419.2020.11.17.05.23.43; Tue, 17 Nov 2020 05:24:06 -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=ViJderJ7; 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 S1730451AbgKQNTj (ORCPT + 99 others); Tue, 17 Nov 2020 08:19:39 -0500 Received: from mail.kernel.org ([198.145.29.99]:52414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730402AbgKQNTY (ORCPT ); Tue, 17 Nov 2020 08:19:24 -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 2FBE0241A5; Tue, 17 Nov 2020 13:19:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605619163; bh=v8MsClufYvTK/t6qcxQVvhqC2wC2CEu2WCZ5DyiZeyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ViJderJ7YevJBzW5N3dsniDAgJgSHQP1aBwLTslDX9ewAA/Xt1QWqgzsbjuLzbhND CM+tJ/NXtuvErOioBNrtyAABsB9JaiqqrkwLOLgV+ste+oGv6VHqZR1He3xbStH8g6 yvJCr3kPrVGiTZp1ZkwbMrvVRVws4e++eddP/3/k= 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.19 050/101] pinctrl: intel: Set default bias in case no particular value given Date: Tue, 17 Nov 2020 14:05:17 +0100 Message-Id: <20201117122115.531617980@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201117122113.128215851@linuxfoundation.org> References: <20201117122113.128215851@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 89ff2795a8b55..5e0adb00b4307 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -621,6 +621,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; @@ -643,6 +647,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