From patchwork Mon Jul 24 06:01:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huqiang Qin X-Patchwork-Id: 124630 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp1601855vqg; Sun, 23 Jul 2023 23:18:51 -0700 (PDT) X-Google-Smtp-Source: APBJJlFJNdWVmzXi73v7HAC/nb1H1VP7OH1l/A/wncdZCjXVnmO4/2W0hslB4gHPGViYs0aUqe+i X-Received: by 2002:a50:fb8c:0:b0:51d:914a:9f43 with SMTP id e12-20020a50fb8c000000b0051d914a9f43mr8649722edq.36.1690179531589; Sun, 23 Jul 2023 23:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690179531; cv=none; d=google.com; s=arc-20160816; b=oMOW/dcDQXAJ9bhnSI+77XOryDOznOMpOoxX7NqRYI3RD3h1Y68avc7YBg2wyv9DAF wDVkz131CXBXu40QHjh6f8ybCZWqWAUvB8jwDWMyKBggIc+cLxKDLL0WAPCzzBvW98Tc 6OX0IzpyqFamqVv3vsL7ybS9erx5gWM2wSg7GSxlCSVOyYojqL08YAJbIAWrz4WwxVwH Jvu1kgiUO0ijoxlVw+28+SMCRL88pwQZRbPCoW4fTdG4gtA8XGIcr0dSjhrbqU9Nkx0L JJVEUlsDVKHftKPPfw7MkT1+4M4zZewN5e9sB76YQ5Og4FgCYpMiUFGQYXadcpForj/y Pu+w== 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; bh=p92MJ0mrZBlQsLaTP82SQ/b962ixXil4l4e2/QrnuPk=; fh=kvSoLBUJ9nCIAgiItg0rwlS6tGETktlfPJWv6NBz0tI=; b=yfeZ6+KEhd3Pyuiq1GXgsiYyxAEYtJTgb/GwzG0ecAPu1PAXvwj7Y7tVTWW6ReaakJ LmPChX7QEZyNGj/EcAG3zDq7rBTAyOnS3FGHcRObA7NlsU2ILIgOofHESmCcJQKmepYv WZdW9rGpPl4MtO2FJ2Q50wd537n7yvXyoSSQd/GPqzzrBqZLswjWqAcNWsqxMFMfCO2R zGm7t7alk2mN8NMhElM4LqFeTBRlkQ0mDLR+3eB352REdDGMhyiptLgx0Z5hthvDdkWp 4xW1rgVC2LZE4vdxluVwKarPQ37FnFAmHqPuM4sHPoVRbwhat+VFTQqp7zkJ3k1xNvOY NUPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j17-20020aa7c411000000b0051e0fbedc14si5911841edq.411.2023.07.23.23.18.28; Sun, 23 Jul 2023 23:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=amlogic.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230166AbjGXGDH (ORCPT + 99 others); Mon, 24 Jul 2023 02:03:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230177AbjGXGDD (ORCPT ); Mon, 24 Jul 2023 02:03:03 -0400 Received: from mail-sh.amlogic.com (mail-sh.amlogic.com [58.32.228.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54D7B1AD; Sun, 23 Jul 2023 23:02:13 -0700 (PDT) Received: from rd02-sz.amlogic.software (10.28.11.83) by mail-sh.amlogic.com (10.18.11.5) with Microsoft SMTP Server id 15.1.2507.13; Mon, 24 Jul 2023 14:01:54 +0800 From: Huqiang Qin To: , , , , , , , CC: , , , , , Huqiang Qin Subject: [PATCH V2 2/3] pinctrl: Replace the IRQ number in the driver with the IRQID macro definition Date: Mon, 24 Jul 2023 14:01:07 +0800 Message-ID: <20230724060108.1403662-3-huqiang.qin@amlogic.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230724060108.1403662-1-huqiang.qin@amlogic.com> References: <20230724060108.1403662-1-huqiang.qin@amlogic.com> MIME-Version: 1.0 X-Originating-IP: [10.28.11.83] X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772281692301360546 X-GMAIL-MSGID: 1772281692301360546 Replacing IRQ numbers with IRQID macro definitions makes driver code easier to understand. Associated platforms: - Amlogic Meson-G12A - Amlogic Meson-G12B - Amlogic Meson-SM1 Signed-off-by: Huqiang Qin Acked-by: Linus Walleij --- V1 -> V2: Include header file changed to amlogic,meson-g12a-gpio-intc.h drivers/pinctrl/meson/pinctrl-meson-g12a.c | 35 +++++++++++----------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c index d182a575981e..3cd86d6a0a60 100644 --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c @@ -8,6 +8,7 @@ */ #include +#include #include "pinctrl-meson.h" #include "pinctrl-meson-axg-pmx.h" @@ -1318,31 +1319,31 @@ static struct meson_pmx_func meson_g12a_aobus_functions[] = { static struct meson_bank meson_g12a_periphs_banks[] = { /* name first last irq pullen pull dir out in ds */ - BANK_DS("Z", GPIOZ_0, GPIOZ_15, 12, 27, - 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0), - BANK_DS("H", GPIOH_0, GPIOH_8, 28, 36, - 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0), - BANK_DS("BOOT", BOOT_0, BOOT_15, 37, 52, - 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0), - BANK_DS("C", GPIOC_0, GPIOC_7, 53, 60, - 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0), - BANK_DS("A", GPIOA_0, GPIOA_15, 61, 76, - 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0), - BANK_DS("X", GPIOX_0, GPIOX_19, 77, 96, - 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0), + BANK_DS("Z", GPIOZ_0, GPIOZ_15, IRQID_GPIOZ_0, IRQID_GPIOZ_15, + 4, 0, 4, 0, 12, 0, 13, 0, 14, 0, 5, 0), + BANK_DS("H", GPIOH_0, GPIOH_8, IRQID_GPIOH_0, IRQID_GPIOH_8, + 3, 0, 3, 0, 9, 0, 10, 0, 11, 0, 4, 0), + BANK_DS("BOOT", BOOT_0, BOOT_15, IRQID_BOOT_0, IRQID_BOOT_15, + 0, 0, 0, 0, 0, 0, 1, 0, 2, 0, 0, 0), + BANK_DS("C", GPIOC_0, GPIOC_7, IRQID_GPIOC_0, IRQID_GPIOC_7, + 1, 0, 1, 0, 3, 0, 4, 0, 5, 0, 1, 0), + BANK_DS("A", GPIOA_0, GPIOA_15, IRQID_GPIOA_0, IRQID_GPIOA_15, + 5, 0, 5, 0, 16, 0, 17, 0, 18, 0, 6, 0), + BANK_DS("X", GPIOX_0, GPIOX_19, IRQID_GPIOX_0, IRQID_GPIOX_19, + 2, 0, 2, 0, 6, 0, 7, 0, 8, 0, 2, 0), }; static struct meson_bank meson_g12a_aobus_banks[] = { /* name first last irq pullen pull dir out in ds */ - BANK_DS("AO", GPIOAO_0, GPIOAO_11, 0, 11, 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, - 0, 0), + BANK_DS("AO", GPIOAO_0, GPIOAO_11, IRQID_GPIOAO_0, IRQID_GPIOAO_11, + 3, 0, 2, 0, 0, 0, 4, 0, 1, 0, 0, 0), /* GPIOE actually located in the AO bank */ - BANK_DS("E", GPIOE_0, GPIOE_2, 97, 99, 3, 16, 2, 16, 0, 16, 4, 16, 1, - 16, 1, 0), + BANK_DS("E", GPIOE_0, GPIOE_2, IRQID_GPIOE_0, IRQID_GPIOE_2, + 3, 16, 2, 16, 0, 16, 4, 16, 1, 16, 1, 0), }; static struct meson_pmx_bank meson_g12a_periphs_pmx_banks[] = { - /* name first lask reg offset */ + /* name first last reg offset */ BANK_PMX("Z", GPIOZ_0, GPIOZ_15, 0x6, 0), BANK_PMX("H", GPIOH_0, GPIOH_8, 0xb, 0), BANK_PMX("BOOT", BOOT_0, BOOT_15, 0x0, 0),