From nobody Sat Feb 7 21:14:48 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A333EC352AA for ; Mon, 23 May 2022 17:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243521AbiEWRmB (ORCPT ); Mon, 23 May 2022 13:42:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242537AbiEWR1r (ORCPT ); Mon, 23 May 2022 13:27:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6A587CDF5; Mon, 23 May 2022 10:23:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4881D61537; Mon, 23 May 2022 17:14:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21BCFC34115; Mon, 23 May 2022 17:14:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653326069; bh=hkWZec3xGuxcobIe4ln5URJVnQJ+IW02w5+IMYVFol4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YGkFSxYNDgBOOsv4q1UyKOf4LkFrtvWy66OlJu1wixO57li2wbo10bgx5mV7TX8iV N1S3nma0Yo3t1VL1YG4ikZc30Fyx0rTViNub5ArjBT5snJQXRzNlrWpSbJpFWdb1Ht SaN8G03F2WQzJKAICu6zK5gLacLDz2GY7lYMnT7U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peng Fan , Haibo Chen , Bartosz Golaszewski , Sasha Levin Subject: [PATCH 5.4 50/68] gpio: gpio-vf610: do not touch other bits when set the target bit Date: Mon, 23 May 2022 19:05:17 +0200 Message-Id: <20220523165810.820691111@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165802.500642349@linuxfoundation.org> References: <20220523165802.500642349@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Haibo Chen [ Upstream commit 9bf3ac466faa83d51a8fe9212131701e58fdef74 ] For gpio controller contain register PDDR, when set one target bit, current logic will clear all other bits, this is wrong. Use operator '|=3D' to fix it. Fixes: 659d8a62311f ("gpio: vf610: add imx7ulp support") Reviewed-by: Peng Fan Signed-off-by: Haibo Chen Signed-off-by: Bartosz Golaszewski Signed-off-by: Sasha Levin --- drivers/gpio/gpio-vf610.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 58776f2d69ff..1ae612c796ee 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -125,9 +125,13 @@ static int vf610_gpio_direction_output(struct gpio_chi= p *chip, unsigned gpio, { struct vf610_gpio_port *port =3D gpiochip_get_data(chip); unsigned long mask =3D BIT(gpio); + u32 val; =20 - if (port->sdata && port->sdata->have_paddr) - vf610_gpio_writel(mask, port->gpio_base + GPIO_PDDR); + if (port->sdata && port->sdata->have_paddr) { + val =3D vf610_gpio_readl(port->gpio_base + GPIO_PDDR); + val |=3D mask; + vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR); + } =20 vf610_gpio_set(chip, gpio, value); =20 --=20 2.35.1