Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2108485ioo; Mon, 23 May 2022 10:13:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz3+KqW636mWO/blLOe1CpniZKtVFjt8lx4grtFST9kzczXEaub8sinTajpftwoURTlZlYQ X-Received: by 2002:a17:90b:4f82:b0:1e0:4852:bc5d with SMTP id qe2-20020a17090b4f8200b001e04852bc5dmr56879pjb.64.1653326030999; Mon, 23 May 2022 10:13:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326030; cv=none; d=google.com; s=arc-20160816; b=rt54yz2OV/xggnC8sNPrtnNpPVzi3YA/aPt+NITVgbu5SUtUr9kPfShWQDQhsiu5EZ q9du6bzzfpZn9wCRhbC4Io0shiMPIa4Z2DHaimT6Ezhx3S0QySvG0EH/VdeRZduCJPPn plV8WBp6zHoug3n4CSl/+RA8jBo+vJIZadJxNpftJrAj6dWnwQhQWzNMigZma/j87eB2 DRDawD2XrcOWEfPYWJ88CvPzl2YhKKAc1ypUSRC+wds2qiErCcDGtDIU50SkyVKWZDw9 D3uLHQkdIgwnFFnAvWTUHJElDyBrStC9GBHJ2vhfto1go4lIaaFrYz+JbkbdwtJ1AwhX ogcw== 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=G9QxPtEx1KaADkoFeA5aNXT/JWvO3DGnW+vfEE3GqgU=; b=Iy+994WoPDmBtV+myexuGIbyiuceQ9L9EcUgEA6meedwqaFK1rLxVhHFA8djhFnCQe DQzv0g1x2+UsDhWlu9dT8jK3VsMk9/Q2FtvYLa0PwwxtTWec5QG4ANhAfd3EfAvmymac KTxcsUmTXjw6cflkm01ip9zQsMyJiQPb/b27rLw5/6VXNvlpd5IAdUasfr4233U58tfq +M0avyoF9CIRxTGRV7oKzVx/Xvrz34BGHkA1tTCiXzg9DwC/l5EzRAUPYK/PyvrB5N+k oQdX9GJOyx+8XCFQypFAA8A5gBcuuvP+/e2yEDJVBIbc0Ka3HbrxMZZpV3JtMjHKC2T3 uVEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eIW1PKvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id ls3-20020a17090b350300b001caa43d9645si16662592pjb.95.2022.05.23.10.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:13:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eIW1PKvY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D183C6EB1A; Mon, 23 May 2022 10:13:35 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239457AbiEWRKQ (ORCPT + 99 others); Mon, 23 May 2022 13:10:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239148AbiEWRJU (ORCPT ); Mon, 23 May 2022 13:09:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFC836C57E; Mon, 23 May 2022 10:08:50 -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 ams.source.kernel.org (Postfix) with ESMTPS id 0517EB81200; Mon, 23 May 2022 17:08:49 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32020C385A9; Mon, 23 May 2022 17:08:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325727; bh=4QCZPleviOfuZ1ZwMThHIKWJ0OshKRzdD/4GOWZGbTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eIW1PKvYBeEkScdkrpDAZ53/SvxXE6XloqzuhqPV+Zg1wX9kXcPwl/TDwh4XwseI1 j+KVZ2pcFN6hdEceQs1VUYQzwShQVLqEYETkzw0yg9Sq7nIVS+OWcwHr5fJOG2TW3P HXoFM7eBX1odDq0iY9FtROOZP1wgGv3iLMFLOl+M= 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 4.14 24/33] gpio: gpio-vf610: do not touch other bits when set the target bit Date: Mon, 23 May 2022 19:05:13 +0200 Message-Id: <20220523165752.186790332@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165746.957506211@linuxfoundation.org> References: <20220523165746.957506211@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 '|=' 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 3210fba16a9b..91d6966c3d29 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c @@ -135,9 +135,13 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, { struct vf610_gpio_port *port = gpiochip_get_data(chip); unsigned long mask = BIT(gpio); + u32 val; - if (port->sdata && port->sdata->have_paddr) - vf610_gpio_writel(mask, port->gpio_base + GPIO_PDDR); + if (port->sdata && port->sdata->have_paddr) { + val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR); + val |= mask; + vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR); + } vf610_gpio_set(chip, gpio, value); -- 2.35.1