Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3670024lfo; Mon, 23 May 2022 10:55:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9vCPHSyetSQ5sf+hFNaXX7UzMwXFSsEpB2Wa9JoM21a3pWiBK6HIPsjG7JLMH55KF4iad X-Received: by 2002:a17:90b:1e47:b0:1df:caa8:1b3c with SMTP id pi7-20020a17090b1e4700b001dfcaa81b3cmr174835pjb.69.1653328536616; Mon, 23 May 2022 10:55:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653328536; cv=none; d=google.com; s=arc-20160816; b=AsKX/agY6649t/RmDWL5U47jFMuqc0+MLl+FWJ5Zc4JRr4hxco+N/Fhq2GyMFwijgv m98/4BJBfaRkVU4n5vb7h9h45bTv4kKF7jGSF3ZnG2OrgAKL4bS+SmaMFZhtgY3mXRQt LLSOw8dPzx3r1DrCS04Jxye0h7gxCt3CfIgvLwDKNxS3EMG8AuUE9eBWFPD5j87Zns2d 3/L7qUZcAQj16IbtFLGw0HFKSZlz/ywz0CiiGKxrUSDSs5Xwi9htQ0DhiKvN4GwR43oq QMNzB2IhgxoXMByzcQC1IPr2Goih5fmL5bxqS4EWqrvbc7vmHBDV2WjvbY/k961KM5qU TaoA== 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=lg4+ctBNh4ns23w8wncL7fNq1WWMUDDBfW0xffCeuB8=; b=s7c2VdL+Jzz1PpKWcj9B8EYDY+zLlzN8NV0h0C61qGKbB7/xSqTVzAOEJ1C1HqpA2E XS23l7I6QTiwKQXFV94LQHROqDVzF5VOjy3wp5SPQdrYWfCF+RKoOUV49w/SRl+ca5UO /J1MIt6bzVmp+fz76HUFmhJp2wO7zflzQHB14OFIuAzcT48a4qOZxbxCxNSNhORHcA1h WtsLCPq6pRnCkyz9HZ/ja0ktBhwPrsrOLSeuaQlfFLoicZEVdlR81ASH/hlF6pzFcdvJ 9ENL38cH3qjbb+zaSmrrK/U3WWsVEHU3uKOfyz6FUvuUtJIZbuZ12RodAGptxM4xcimY zPDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YGkFSxYN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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. [23.128.96.19]) by mx.google.com with ESMTPS id k13-20020a170902d58d00b0015cf9502127si10670377plh.267.2022.05.23.10.55.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:55:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YGkFSxYN; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1553C27CCB; Mon, 23 May 2022 10:54:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243515AbiEWRl7 (ORCPT + 99 others); Mon, 23 May 2022 13:41:59 -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-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 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_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