Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1354512pxm; Sat, 26 Feb 2022 12:45:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJyT/g/MB7aY3Iz+rib7gr8xIJVejBUx6ONmEV/lzKrNH+iBrX3uoeSPeSJrpcyYn4n9CtUS X-Received: by 2002:a05:6a00:b90:b0:4f1:4b2:738e with SMTP id g16-20020a056a000b9000b004f104b2738emr14290971pfj.33.1645908351485; Sat, 26 Feb 2022 12:45:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645908351; cv=none; d=google.com; s=arc-20160816; b=Zp4PJwLReqtKhpRiH7uh0wByu8rMA3OoSwWe+8/po9Ne4qRRCVeanXFYMkmvMTSorr cPIJif/UGv+YF2+3RSCrPhTS+6hkqTH87VHBTyfzeM+UPrSesbRLN6gRcmf1CYcNzeSY 4JWgqtSoIm0QYNX5GH/cBXqNy+JbRZSw89NGBXDwxJb1mxj5rYVZAMKpgOV/Zl4obExe m/JNXHOxlYooWa83FbxKx5emwuisEc7cFrTpaD3kZrYPUYCBPSaBa7jNSxOAdoZXncm0 uBVK7qpnFdz17NAx1fvJc6kB14risA/MW9BdcJ1kCiuStnf74Jo0uBlMIgrhkro8PYd6 TLwg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=8xvvhK271QRdegqFwLAfRIGQqEXyXtaSS8xqkOohR88=; b=N9QX35Y/yhtbibofOOZmXHxREoX8wDgQ1sigyJjMF+nwH1Fa0CKRHrJFx57OKj2ddF V7FafhFQ93jw/0R6qQBl3tS1PzsRF2cmbgH+g541yOiolxC+LlryfsV3V270BHyV8RuE 4PUDuL/fV3WverMjadl3+rFlMwc8B3KIuxzLnsFkxdnn3F0xZH0AigW8CgYh6OEDhgdX GD/6A80ASZusVzQLrRYsu53Ti8WciNjUqyvTeiu1Bktb98v+Om8NHbV1Zf5qgfqNycLc iOzBmcY+jc/+duI+MiZGRdpXMsgwmXfdx40L4XR6z44GyKGspos8ifAhcWbsdITi6csx 9IfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2016061301 header.b=Z0aX5cig; 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 Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d29-20020a631d5d000000b00372f420ee23si5232300pgm.850.2022.02.26.12.45.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Feb 2022 12:45:51 -0800 (PST) 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=@walle.cc header.s=mail2016061301 header.b=Z0aX5cig; 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1E6C51BAF18; Sat, 26 Feb 2022 12:45:28 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229628AbiBZUp7 (ORCPT + 99 others); Sat, 26 Feb 2022 15:45:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229603AbiBZUp4 (ORCPT ); Sat, 26 Feb 2022 15:45:56 -0500 Received: from ssl.serverraum.org (ssl.serverraum.org [176.9.125.105]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 32B131B45E0 for ; Sat, 26 Feb 2022 12:45:21 -0800 (PST) Received: from mwalle01.kontron.local. (unknown [213.135.10.150]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ssl.serverraum.org (Postfix) with ESMTPSA id 57772223ED; Sat, 26 Feb 2022 21:45:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2016061301; t=1645908319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8xvvhK271QRdegqFwLAfRIGQqEXyXtaSS8xqkOohR88=; b=Z0aX5cig+qMwLpktysIL8/WycgNZsrMy9FNNavBzROAhPNyXBLSbHxkxJXCSUbrNDNbROe 1Q34g+7dVRUfrUj9zQ9/bmmxh43gnqnjmBtwvqBzlha9U05LvSs39HtUTY0SQtDa7k8JOu PP1sUnR7EqYzt5lJAgmIhgerhTACppI= From: Michael Walle To: Lars Povlsen , Steen Hegelund , Linus Walleij Cc: UNGLinuxDriver@microchip.com, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Colin Foster , Michael Walle Subject: [PATCH v2 2/5] pinctrl: microchip-sgpio: don't do RMW for interrupt ack register Date: Sat, 26 Feb 2022 21:45:04 +0100 Message-Id: <20220226204507.2511633-3-michael@walle.cc> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220226204507.2511633-1-michael@walle.cc> References: <20220226204507.2511633-1-michael@walle.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,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=no 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 The interrupt ack register has the usual "write one to clear" semantics. No read-modify-write is required here. This is also a preparation patch to change the sgpio_clrsetbits() to use regmap_update_bits() which don't write the value if it is not changed. Signed-off-by: Michael Walle --- drivers/pinctrl/pinctrl-microchip-sgpio.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 666f1e3889e0..29cce0609fd9 100644 --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c @@ -640,7 +640,14 @@ static void microchip_sgpio_irq_unmask(struct irq_data *data) static void microchip_sgpio_irq_ack(struct irq_data *data) { - microchip_sgpio_irq_setreg(data, REG_INT_ACK, false); + struct gpio_chip *chip = irq_data_get_irq_chip_data(data); + struct sgpio_bank *bank = gpiochip_get_data(chip); + unsigned int gpio = irqd_to_hwirq(data); + struct sgpio_port_addr addr; + + sgpio_pin_to_addr(bank->priv, gpio, &addr); + + sgpio_writel(bank->priv, BIT(addr.port), REG_INT_ACK, addr.bit); } static int microchip_sgpio_irq_set_type(struct irq_data *data, unsigned int type) -- 2.30.2