Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9184309pxu; Mon, 28 Dec 2020 08:41:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJx60rzKh2K6bG5MdYVdSNKXTwOQLqyDuXV5SGZs+JRyY7UTUzOB1liFoGAydM3q0iEqsI0B X-Received: by 2002:a17:907:414c:: with SMTP id od20mr41960454ejb.75.1609173671538; Mon, 28 Dec 2020 08:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609173671; cv=none; d=google.com; s=arc-20160816; b=DgrOM4+XeZ9Xic7+02H5ojQWQqxeelQkaT5C76nRgkWsRoPAP4qkbjrUOl2dQcmeAq wmShkZwG/0vPXuQ+EXn1/bHMgojufYhsqf0gQZdnExpU0Ee6smkI2m2TrnobrFcYzV8k cVQWbF1q5pRqKIX8fvYWGlVRIYjdw22uvyzlpX+m3B3sfWNGWnX2csbogKa8t9bSf985 usuBcaYFBbqyKzsPjkZ9Aa108ZGekVgyQshUDgHLXr9o438KCOPLJslFlZCtYD2x4KdT Y59JgCQe1tzrGS5ho/Oq+xmpIjnqTPDYi74ZWZwzfnferGvoJ8ffG4v8pzWo0sVIsi4Z HTEQ== 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=TWN3jUEA5yWq2/1M59UTR7iY2/+B+pqk+7ipqw9li/g=; b=BrLS9Jz0cvcWkpxfwdaTaIVb4aqp5sl1r70lxglOZ9twXWp2wgEfdmB6Yhy5sczMyB bmdVpp2ePaSwp9/z8raakghpsgKUfX27UiFAOpBKGkf18si5EAfL/9wwX/xndPxxS5C7 RMxL1e7wnHBJZUgYl7QzSQC9E/Bto+eP506I2kD/ZlmZjwwA2Vd8CUclaRIkygb6xI// B0uQ9sSC724cmD2sPPVcG40phwSEAE7Tr7rCjALIbeBWLOITczRPsWLFa4phHb50uro3 zPg3tRj0+kTpoJDPY6nt7Dr0YWmHrQUKBsJ/pvZ7fw9/ftt3TdaMRp2BmXTcyJim83kZ jwoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k+R0l4iu; 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 u7si21035569edb.213.2020.12.28.08.40.48; Mon, 28 Dec 2020 08:41:11 -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=k+R0l4iu; 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 S2633750AbgL1Qiy (ORCPT + 99 others); Mon, 28 Dec 2020 11:38:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:57190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729523AbgL1NBM (ORCPT ); Mon, 28 Dec 2020 08:01:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D3A6B224D2; Mon, 28 Dec 2020 13:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609160456; bh=SZp8g9xzLYkM0YAiClQYmv0ngKU0I3jblK0BI2acyv0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k+R0l4iuyTRGnii5/dVjnVD80Mz/AE5J4Yq0lm9NBXb2pOCXdlpwXrTsIRRJ4BjmM KIwx5Y466JsS5cvYUeQwsSJDwWik1EmUx93mNAQI5MlYFQoBT8xcc47gthK3zKzKbY NCznd5MZkggODiNBox09YXWQ3FTLQmRw6ja7kaJc= 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 027/175] pinctrl: baytrail: Avoid clearing debounce value when turning it off Date: Mon, 28 Dec 2020 13:48:00 +0100 Message-Id: <20201228124854.573493041@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 0b74e40a4e41f3cbad76dff4c50850d47b525b26 ] Baytrail pin control has a common register to set up debounce timeout. When a pin configuration requested debounce to be disabled, the rest of the pins may still want to have debounce enabled and thus rely on the common timeout value. Avoid clearing debounce value when turning it off for one pin while others may still use it. Fixes: 658b476c742f ("pinctrl: baytrail: Add debounce configuration") Depends-on: 04ff5a095d66 ("pinctrl: baytrail: Rectify debounce support") Depends-on: 827e1579e1d5 ("pinctrl: baytrail: Rectify debounce support (part 2)") Signed-off-by: Andy Shevchenko Acked-by: Mika Westerberg Signed-off-by: Sasha Levin --- drivers/pinctrl/intel/pinctrl-baytrail.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index fc51922839f82..73d3c4122eb89 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -1266,7 +1266,6 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, break; case PIN_CONFIG_INPUT_DEBOUNCE: debounce = readl(db_reg); - debounce &= ~BYT_DEBOUNCE_PULSE_MASK; if (arg) conf |= BYT_DEBOUNCE_EN; @@ -1275,24 +1274,31 @@ static int byt_pin_config_set(struct pinctrl_dev *pctl_dev, switch (arg) { case 375: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_375US; break; case 750: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_750US; break; case 1500: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_1500US; break; case 3000: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_3MS; break; case 6000: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_6MS; break; case 12000: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_12MS; break; case 24000: + debounce &= ~BYT_DEBOUNCE_PULSE_MASK; debounce |= BYT_DEBOUNCE_PULSE_24MS; break; default: -- 2.27.0