Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp472602lqb; Wed, 29 May 2024 00:48:54 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV4tPr65mUORigS2eSMn203VoVGxiKFhNHEhm51BHJmmVjBDsn6FFgpVr45ovdRhfjCNZgWrtccYq+5ZjwcSK+lvbI/LlZbCwV/07JGXQ== X-Google-Smtp-Source: AGHT+IEJg0+lfWuSrbHKNhCE5WAMsss2kSX/XdNTC12FVwfblecDG70VykGHQOanAK9vsRlwk7gL X-Received: by 2002:a05:6a20:dca0:b0:1af:8c2f:5f5e with SMTP id adf61e73a8af0-1b212d360c5mr13528827637.28.1716968933931; Wed, 29 May 2024 00:48:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716968933; cv=pass; d=google.com; s=arc-20160816; b=S8LSqxWBmwBBXDTN9G8x1Qw/UJ0I+bprjYnlHa9N+uapftiT+VhRwHXxLWsHH4fdIy Q+QZSWUgE97fXcYDBgATtfUNG4kt8yBZIpEAAlV7au0yrKl8kDsHgOD3Rsm8J1Hf7LOu b6qo80g2qt4y/lBnYFDu3fZ7k9XYfyVPk/VdegsxNteG0a01Wy+ja02Qck+zhtg2SJwp 6BdLJesPz6YBTPulRPRMKP+PbEiqkUsfkZubMQlnshAkJkBH23598/H/ruB4loheXijk iqK49isGkYLJdSl/knDgnnuDEzDhCdXXy6GG00FkEuL1fiyh/GQ2OccwmuM0oEoe6JTc tcNQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature; bh=5mC5a04FWitjLLcuwOIE5BRImolQeptkvJ2oDOnHWlM=; fh=FDrBqZC62wUIXBG6A5oepzLRCzd70HcTCEYDxU+dZMg=; b=cGQouGJaWfPxDHpP3khHCX5erKinMSJtid79ak2JAkovYXiS6syBrFMsJ5Gh/w5SyM YlecMK926DgMF/uZq04IRhukGVjMtaigxNFavs14eLvJo17lO6JADowbq6Q1oTDDk0G4 2vflCh7D71UMsNjOrxaxJnlIyy0OZSfZWMvfrc8+LvFfZbRzjLNTYPN3NUeYUBhgaRBG uYMUh+mUbN9315716P5/tQkYJ5+IO5ANlx1vryynVLqWxgDzovnVnzGtKXFAApeBdzM7 XTxeDnugFj+yKYX3tS91sox1LyIUR/GodIeQUQrSNnKDDW/KKI/Cn1XpYUqPJMpt33WQ aXIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=FzrIIszX; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=Vq82qAAm; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-193629-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f8fc36d267si9301503b3a.113.2024.05.29.00.48.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 00:48:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-193629-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@tq-group.com header.s=key1 header.b=FzrIIszX; dkim=temperror (no key for signature) header.i=@ew.tq-group.com header.s=dkim header.b=Vq82qAAm; arc=pass (i=1 spf=pass spfdomain=ew.tq-group.com dkim=pass dkdomain=tq-group.com dmarc=pass fromdomain=ew.tq-group.com); spf=pass (google.com: domain of linux-kernel+bounces-193629-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-193629-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=tq-group.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 2905F2846C5 for ; Wed, 29 May 2024 07:47:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B67EA169AFD; Wed, 29 May 2024 07:47:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="FzrIIszX"; dkim=fail reason="key not found in DNS" (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b="Vq82qAAm" Received: from mx1.tq-group.com (mx1.tq-group.com [93.104.207.81]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 45B44169AD4; Wed, 29 May 2024 07:46:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=93.104.207.81 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716968819; cv=none; b=UPCwSN2M+mWGtEo+A3JcjEN+aHs9uV4KTFGF9+Ay6G19KmmimEJUuyz5l2rzreTHFKNgLP89A0MmQx2UUDFhCb2/4X718/FL9HJmX23So2c6hgiWASnc+h4d43Ia7kTUQAiwuBv4+8wPs7sWNQy67sN6Bz9xttyQmxSGgfcq9U4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716968819; c=relaxed/simple; bh=e9bGX647w93B52kYjOmsjqM01YRxU/eV/LT0LaGAkcA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MDyrvTj8Ew0fKOqBce3hTYr3TfH2hIDwz5l/seg9n+7wtF/7ADNTJz349I7YZDcm4AthRQSnFLlTjlr+9b6yMAf/tOsS5tS0eA0KNp5WiQ/g9o8x0+bs+fVC57nBGPGWoHUsFoberUaOA/SlRcfqvqP9vlqlvoqbqtpA9FnYxGg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com; spf=pass smtp.mailfrom=ew.tq-group.com; dkim=pass (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b=FzrIIszX; dkim=fail (0-bit key) header.d=ew.tq-group.com header.i=@ew.tq-group.com header.b=Vq82qAAm reason="key not found in DNS"; arc=none smtp.client-ip=93.104.207.81 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ew.tq-group.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1716968817; x=1748504817; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5mC5a04FWitjLLcuwOIE5BRImolQeptkvJ2oDOnHWlM=; b=FzrIIszXv77n9Nx2ZxUhGKVcNOHpI2w/GdOkiRqhK7opy95jhIz5q72x 4CqQv95d7B+Px53D84NE58szsIctTLKj62wRtcjuqpMOY4QDDlDybEGph F/uD6EMoLgsSvrPj48V6ByuBTe+HeQ7QGBYtGjCH6a7ECrgWwSKcU16CT 9TOmiHYFPrQ/ILBqm4BhZusRNh8E7gdWfo+RwXRQUDx+rQvbej3j1GC38 InmE9pwdqp7vZe89t3b0yCueMi+YCR9+NgG3TtYCOP6wbq3l3HMXFZTZq zRTpYL5PGx9OAIgiWEFYUgKY+oZpNQp+m5VMqYzuC/8ZnxfrfcR0Loh49 Q==; X-CSE-ConnectionGUID: FuVZP7pBQBibKHXtc/oEOA== X-CSE-MsgGUID: 8VPqbF+tRqmmqhSsDH2qJg== X-IronPort-AV: E=Sophos;i="6.08,197,1712613600"; d="scan'208";a="37119687" Received: from vmailcow01.tq-net.de ([10.150.86.48]) by mx1.tq-group.com with ESMTP; 29 May 2024 09:46:56 +0200 Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id EB9CF1653B0; Wed, 29 May 2024 09:46:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ew.tq-group.com; s=dkim; t=1716968812; h=from:subject:date:message-id:to:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=5mC5a04FWitjLLcuwOIE5BRImolQeptkvJ2oDOnHWlM=; b=Vq82qAAmpxXLhcHuuQtM4yvxWQ54zcTutca/XiOKmFTm75q1D+oLQjX7Sl5Q5uLjJAuyDz jO1JJr40afhDfyuYi8xrIYjSTrI4UqLTrkqWuVbdEeNc7MykT0CxwVKtr80DG9M5Bw0L/d qbM0e9/WJAHaZFrBKiSsgd2QXxU5khzSy+wG+n4EIOqskqwdv5F8dl9SmEwhSOquJ0MW1b pDwlcH/+goOpxP5keFAHEWZtANdHKV4ilEltYErNaH8k+VVrnlyX8VHZtJb6ovvE7pedUJ bW1jIa2psCM3Kf8Y8fBmURGoh/H5LKC0rzrv7D4TT8BRPK7ZQkr5uBC71FO3Ig== From: Matthias Schiffer To: Linus Walleij , Bartosz Golaszewski Cc: Andrew Lunn , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Gregor Herburger , linux@ew.tq-group.com, Matthias Schiffer Subject: [PATCH 6/8] gpio: tqmx86: store IRQ triggers without offsetting index Date: Wed, 29 May 2024 09:45:18 +0200 Message-ID: <9525c437801bbb9be1c67745a0ffb7797bb58e05.1716967982.git.matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.45.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Last-TLS-Session-Version: TLSv1.3 This will allow us to move all offset handling into a single place in the following commits. The additional irq_type indices remain unused, but the tqmx86_gpio_data size increase is insignificant. No functional change intended. Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller") Signed-off-by: Matthias Schiffer --- drivers/gpio/gpio-tqmx86.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c index d6e77f604f4df..4b37cc3bdd455 100644 --- a/drivers/gpio/gpio-tqmx86.c +++ b/drivers/gpio/gpio-tqmx86.c @@ -44,7 +44,7 @@ struct tqmx86_gpio_data { int irq; raw_spinlock_t spinlock; DECLARE_BITMAP(output, TQMX86_NGPIO); - u8 irq_type[TQMX86_NGPI]; + u8 irq_type[TQMX86_NGPIO]; }; static u8 tqmx86_gpio_read(struct tqmx86_gpio_data *gd, unsigned int reg) @@ -146,7 +146,7 @@ static void tqmx86_gpio_irq_unmask(struct irq_data *data) gpiochip_enable_irq(&gpio->chip, irqd_to_hwirq(data)); mask = TQMX86_GPII_MASK(offset); - val = TQMX86_GPII_CONFIG(offset, gpio->irq_type[offset]); + val = TQMX86_GPII_CONFIG(offset, gpio->irq_type[data->hwirq]); raw_spin_lock_irqsave(&gpio->spinlock, flags); _tqmx86_gpio_update_bits(gpio, TQMX86_GPIIC, mask, val); raw_spin_unlock_irqrestore(&gpio->spinlock, flags); @@ -175,7 +175,7 @@ static int tqmx86_gpio_irq_set_type(struct irq_data *data, unsigned int type) return -EINVAL; /* not supported */ } - gpio->irq_type[offset] = new_type; + gpio->irq_type[data->hwirq] = new_type; mask = TQMX86_GPII_MASK(offset); val = TQMX86_GPII_CONFIG(offset, new_type); -- TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany Amtsgericht München, HRB 105018 Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider https://www.tq-group.com/