Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp2119047ioo; Mon, 23 May 2022 10:28:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8SeCXPFU82Nd9DymTAaN7Wsqiey8vLpVcnkmf+kSnQmIV4hSJ48u/CuvR36g5f+VFziZ3 X-Received: by 2002:a05:6a00:2450:b0:4f7:bf07:c063 with SMTP id d16-20020a056a00245000b004f7bf07c063mr24296875pfj.51.1653326881420; Mon, 23 May 2022 10:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653326881; cv=none; d=google.com; s=arc-20160816; b=VCah+Vc+0IaxJFUowaNRsUKfkSkgplsSBdXhxN2pg5kPgVE+zWYi+q0oyhYqsqwcwf je8wSEAxAy979fa/pIDsSbFqqBzxeB86zw2JZdowq8C/ocBtwPHVwhoR5vLAWP05kafo rvK37iFwDLaCZbILMwSN+2Bemjq5Hpv0fBtFWT7T8nBxsOVWfsJYvNQoUHt8llNMYI/X TrdcO3zCflvwzrih6O9PFudUPGLYRP8KrCQ1XIFyrYnNgGJslORPkVUvAlWaI5yC7mQ4 7gGpbJ2/y381tF0ikx2w+BAF4h1dYXs+dfnN6ilcstM008IVrQTXkdUQUxgNRlIOkGiW JSpg== 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=i8/FyMBmk/WoY/DLYO2ExDVrrPcJAO/nVL/EWIXhCT4=; b=o5UfJ9sS1D29hUfIuOse2S9CIymMl8PVeiHEIDyiD9XzwONWdge9HQZmx2PQFY1/e9 GyEUIGn4VAEY6H6eoqMN5LR5OHfkGcKs2LKuN4MTIiuW6F9dVg84bZtvag0h/oV+oPah TWwizrVEKQq54mqkCoqY2PDg3VB4gdN3plFn377MMyktWHBngecqNbxI7Tde2qbsqF4M LgrnefUGp2LpIf3IFDFv/0kvB2T50+8GabyBdZr7QsLV2rVqwroYDvkwaij2I0NNVW48 clAAT67WTAYOzHr5KtT5bINqTvhaKJVbTTmiB5EQZdAAZ1BRqUQV85Fkp3f4JXczM1ZW XKHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=k3GxIH37; 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 j71-20020a638b4a000000b003f9f00dd576si10316029pge.604.2022.05.23.10.28.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 10:28:01 -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=k3GxIH37; 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 319F090CE9; Mon, 23 May 2022 10:25:53 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240268AbiEWRQL (ORCPT + 99 others); Mon, 23 May 2022 13:16:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240317AbiEWRL4 (ORCPT ); Mon, 23 May 2022 13:11:56 -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 D68D0326F4; Mon, 23 May 2022 10:11:28 -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 AC9C4B81211; Mon, 23 May 2022 17:11:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BCAE1C385AA; Mon, 23 May 2022 17:11:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1653325886; bh=MGqKrvHFvARdJt/JIi7NLnlI4gIIz7ipAPd2/3U30qk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k3GxIH37WIN21GNlKqr0Dzqe8RGkCZJC259VuT6+jY4zhWqa3zdks3KWBc0ryV2g5 kt2p0AQ+dch3MMCn0Lvz5knaXTOzUAotesKhOQjuFrWyFh5iCFraqQuFcfpKZS8f1K vDBo3BURdoYceRo8qqQoxQxJp2mArD3M5BrPuulY= 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.19 34/44] gpio: gpio-vf610: do not touch other bits when set the target bit Date: Mon, 23 May 2022 19:05:18 +0200 Message-Id: <20220523165759.390957581@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220523165752.797318097@linuxfoundation.org> References: <20220523165752.797318097@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 a9cb5571de54..f7692999df47 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