Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9214394pxu; Mon, 28 Dec 2020 09:28:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJx+gwieQ7ZS/ZtFSa70oZD36NlbPw3R2OzCdDuGFBxURG1T044y4EfcTaOv6KUdXtzp9E3F X-Received: by 2002:a05:6402:d0a:: with SMTP id eb10mr7937633edb.305.1609176513073; Mon, 28 Dec 2020 09:28:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609176513; cv=none; d=google.com; s=arc-20160816; b=Oqg7ouobSAl+0bAaEwN8agIC8XcNiUvrwoWKQ2JNRu2zx8ZI/Y7PecdzXJMusdB/+o ni0sNU4cowuL3GpyKpv+J/huEZ4USYwVpMuRDWodSyhMdqK9OKrflgIyJ1ktla750aw1 qAeQ/LFxQWS/AbFcKMt87EVecxSzryU5TgaiK4It4rgTm/eOqTr4RO9y2sARvazjWJkl VBEPewiOMEUXon6wodr8Bg+fa+O3liCYdqpJ7ErVAewbajX40yuRizFfVPs+Rjs4iUqG 6BCi3LW3WtVvP6ZTvk+kt32N5wb36kxz1QBrmoYgYxLamEyWErFLTT6358jDmAFO0dsk aFUA== 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=FXRAKiNKk3mDh3u6egKKfzDooymk7MkRBUeJAwbcUq4=; b=D4DjwTilvHF1SVjELNDxq3/w7rF2CMJXeQShtSG3PcZ6QrAt/t27V8Damvwd7PgJY+ y/g4Uj/S76FUlCsesYe70yzM1Jj219AmaUQJ+7Yn0qB8X7l0bGrKNVcKqRLhq3c2k2Ld fYypixwid4YbIK2sCPNGx3ceZ94zykN/Mjg3YFVQWAq5oqub5vbjtbgAnOTJE84onag2 BADjNuebRgGNIzU/5yEZdunCCRPvrXYDSJZsdnheLBpN2iiYOA4s3LIRra2dno+Rq2gO i9Osj8/2FIZv6/PcmBkkzBeDj1hDw3gOOCrZVZdPqeKLqpdLNHWzti33d8Y0RNmJBCJt BK2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GgW5ySjC; 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=pass (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 z27si11415629eja.582.2020.12.28.09.28.10; Mon, 28 Dec 2020 09:28:33 -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=@linuxfoundation.org header.s=korg header.b=GgW5ySjC; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729939AbgL1NCB (ORCPT + 99 others); Mon, 28 Dec 2020 08:02:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:57930 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729816AbgL1NBe (ORCPT ); Mon, 28 Dec 2020 08:01:34 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D8AA4208D5; Mon, 28 Dec 2020 13:00:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160453; bh=3LplwEOCINzARgHDwmDjE88PLhUxKzlSGUbUgBtVux8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GgW5ySjCSCNOSRm6HN1ewE6pOBWD+KeENCjm3QfPGZ9dn1EBPCXK6DhHpIfEcSuXP Nuq6Uc+sPLOex2z/sgcnjslCCLoTESIrgAsDuWKIsJU1f0uonHvaMAnILcz3Qa5JcR Shp4vLtkIB57Apklf4vt7Kb3HdHFDK5HBmKAC77I= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andy Shevchenko , Mika Westerberg , Sasha Levin Subject: [PATCH 4.9 026/175] pinctrl: merrifield: Set default bias in case no particular value given Date: Mon, 28 Dec 2020 13:47:59 +0100 Message-Id: <20201228124854.525019102@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228124853.216621466@linuxfoundation.org> References: <20201228124853.216621466@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 0fa86fc2e28227f1e64f13867e73cf864c6d25ad ] 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 Merrifield pin control hardware the 20 kOhm sounds plausible because it gives a good trade off between weakness and minimization of leakage current (will be only 50 uA with the above choice). Fixes: 4e80c8f50574 ("pinctrl: intel: Add Intel Merrifield pin controller support") Depends-on: 2956b5d94a76 ("pinctrl / gpio: Introduce .set_config() callback for GPIO chips") Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-merrifield.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c index 04d6fd2be08cc..8d0cff3146b87 100644 --- a/drivers/pinctrl/intel/pinctrl-merrifield.c +++ b/drivers/pinctrl/intel/pinctrl-merrifield.c @@ -731,6 +731,10 @@ static int mrfld_config_set_pin(struct mrfld_pinctrl *mp, unsigned int pin, mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; bits |= BUFCFG_PU_EN; + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 20000; + switch (arg) { case 50000: bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; @@ -751,6 +755,10 @@ static int mrfld_config_set_pin(struct mrfld_pinctrl *mp, unsigned int pin, mask |= BUFCFG_Px_EN_MASK | BUFCFG_PUPD_VAL_MASK; bits |= BUFCFG_PD_EN; + /* Set default strength value in case none is given */ + if (arg == 1) + arg = 20000; + switch (arg) { case 50000: bits |= BUFCFG_PUPD_VAL_50K << BUFCFG_PUPD_VAL_SHIFT; -- 2.27.0