From patchwork Tue Oct 18 22:34:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 616269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCB6DC433FE for ; Tue, 18 Oct 2022 22:34:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229917AbiJRWeL (ORCPT ); Tue, 18 Oct 2022 18:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbiJRWeJ (ORCPT ); Tue, 18 Oct 2022 18:34:09 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FE132BB35; Tue, 18 Oct 2022 15:34:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666132449; x=1697668449; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=F9JP4Rut70+5vMxDTp1Mi/+AlzNzYRFFWAXbDZNeCb8=; b=ndtSk4JPgG2dy4m44i8jkEP5Nv3Prpv7oONtT+dHjkTW5WGA+uLnvswp PgeqAbPeWtrSoHhEDCZWgB9nTNd2CG54kWtKk3Vca74DYM0V0ostvnwIm f+6DdhIDAEns9oe04j/oIIZtHXLYBWHluWLUMkN8SYaP3edmfiRJo3QfM 7tz+1oDcLqi3nUCgHEa695Ya+aFIfPO2i/wMGCOOcBpqzN3xFOmjDTIo/ zlXWCrFE5s8eNl4pKBRbYTNowxX8ViEcQE20+Hazx/KQnkaoIbmSihNqk yPFjnEOeFDy2buKh89KAbj2xIDliNSS2Fbb03dU/2nUqXmcfIqbzTIswD Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="306236223" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="306236223" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 15:34:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="697745778" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="697745778" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2022 15:34:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 9E203B9; Wed, 19 Oct 2022 01:34:28 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij Subject: [PATCH v1 1/5] pinctrl: alderlake: Deduplicate COMMUNITY macro code Date: Wed, 19 Oct 2022 01:34:23 +0300 Message-Id: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Define a common COMUNITY macro and supply a variant to it. This removes some verbosity in macros. Signed-off-by: Andy Shevchenko Reviewed-by: Mika Westerberg --- drivers/pinctrl/intel/pinctrl-alderlake.c | 40 +++++++++-------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-alderlake.c b/drivers/pinctrl/intel/pinctrl-alderlake.c index 1bf24ab7b380..19ecc0596bf5 100644 --- a/drivers/pinctrl/intel/pinctrl-alderlake.c +++ b/drivers/pinctrl/intel/pinctrl-alderlake.c @@ -34,33 +34,25 @@ .gpio_base = (g), \ } -#define ADL_N_COMMUNITY(b, s, e, g) \ - { \ - .barno = (b), \ - .padown_offset = ADL_N_PAD_OWN, \ - .padcfglock_offset = ADL_N_PADCFGLOCK, \ - .hostown_offset = ADL_N_HOSTSW_OWN, \ - .is_offset = ADL_N_GPI_IS, \ - .ie_offset = ADL_N_GPI_IE, \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ - .gpps = (g), \ - .ngpps = ARRAY_SIZE(g), \ +#define ADL_COMMUNITY(b, s, e, g, v) \ + { \ + .barno = (b), \ + .padown_offset = ADL_##v##_PAD_OWN, \ + .padcfglock_offset = ADL_##v##_PADCFGLOCK, \ + .hostown_offset = ADL_##v##_HOSTSW_OWN, \ + .is_offset = ADL_##v##_GPI_IS, \ + .ie_offset = ADL_##v##_GPI_IE, \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ + .gpps = (g), \ + .ngpps = ARRAY_SIZE(g), \ } +#define ADL_N_COMMUNITY(b, s, e, g) \ + ADL_COMMUNITY(b, s, e, g, N) + #define ADL_S_COMMUNITY(b, s, e, g) \ - { \ - .barno = (b), \ - .padown_offset = ADL_S_PAD_OWN, \ - .padcfglock_offset = ADL_S_PADCFGLOCK, \ - .hostown_offset = ADL_S_HOSTSW_OWN, \ - .is_offset = ADL_S_GPI_IS, \ - .ie_offset = ADL_S_GPI_IE, \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ - .gpps = (g), \ - .ngpps = ARRAY_SIZE(g), \ - } + ADL_COMMUNITY(b, s, e, g, S) /* Alder Lake-N */ static const struct pinctrl_pin_desc adln_pins[] = { From patchwork Tue Oct 18 22:34:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 616268 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F513C43219 for ; Tue, 18 Oct 2022 22:34:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229975AbiJRWeM (ORCPT ); Tue, 18 Oct 2022 18:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229962AbiJRWeL (ORCPT ); Tue, 18 Oct 2022 18:34:11 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6559EB3B23; Tue, 18 Oct 2022 15:34:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666132450; x=1697668450; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9fcaWKO9aXLkv+dqa94dbpKX48/m+j1H+Zp+GyGjibU=; b=n45HdTeAaTbqPfR6L1v4dQUICHhAAtmTtyLOOxfNV/xUyl/KYzmwFdrH BKMn6HnF2ERaHmUhQf/fcRJjtCkEIYn6lXC7dn9237D9IQKUMphoDmM2N U3paM2TyYWrukzZ7EnvJkpkHOZJZazqmxLp0dufyHpS39RiyZU8sh5DKg /DWUgop8XLHN7MgX1//UOfWXfPelXbPcZhRYKtySx/KYI6rdTM6h8jbjG SxBbq8DzahG9K2wO9RfQHfF0/vA9Pnp5L5Co66K23svABTti1WWa3V54h LSrLwm0Yjmy23ZAm2lneY3OtxPIBSlhYDaWsXdQlTW0qN0PEHG0QYb6gO A==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="306236224" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="306236224" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 15:34:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="697745779" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="697745779" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2022 15:34:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id C9C0520B; Wed, 19 Oct 2022 01:34:28 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij Subject: [PATCH v1 4/5] pinctrl: sunrisepoint: Deduplicate COMMUNITY macro code Date: Wed, 19 Oct 2022 01:34:26 +0300 Message-Id: <20221018223427.43579-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com> References: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Define a common COMUNITY macro and supply a variant to it. This removes some verbosity in macros. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-sunrisepoint.c | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c index 026067e18349..be5bb0f4b1dc 100644 --- a/drivers/pinctrl/intel/pinctrl-sunrisepoint.c +++ b/drivers/pinctrl/intel/pinctrl-sunrisepoint.c @@ -22,24 +22,24 @@ #define SPT_GPI_IS 0x100 #define SPT_GPI_IE 0x120 -#define SPT_COMMUNITY(b, s, e, pl, gs, gn, g, n) \ - { \ - .barno = (b), \ - .padown_offset = SPT_PAD_OWN, \ - .padcfglock_offset = (pl), \ - .hostown_offset = SPT_HOSTSW_OWN, \ - .is_offset = SPT_GPI_IS, \ - .ie_offset = SPT_GPI_IE, \ - .gpp_size = (gs), \ - .gpp_num_padown_regs = (gn), \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ - .gpps = (g), \ - .ngpps = (n), \ +#define SPT_COMMUNITY(b, s, e, g, n, v, gs, gn) \ + { \ + .barno = (b), \ + .padown_offset = SPT_PAD_OWN, \ + .padcfglock_offset = SPT_##v##_PADCFGLOCK, \ + .hostown_offset = SPT_HOSTSW_OWN, \ + .is_offset = SPT_GPI_IS, \ + .ie_offset = SPT_GPI_IE, \ + .gpp_size = (gs), \ + .gpp_num_padown_regs = (gn), \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ + .gpps = (g), \ + .ngpps = (n), \ } #define SPT_LP_COMMUNITY(b, s, e) \ - SPT_COMMUNITY(b, s, e, SPT_LP_PADCFGLOCK, 24, 4, NULL, 0) + SPT_COMMUNITY(b, s, e, NULL, 0, LP, 24, 4) #define SPT_H_GPP(r, s, e, g) \ { \ @@ -50,7 +50,7 @@ } #define SPT_H_COMMUNITY(b, s, e, g) \ - SPT_COMMUNITY(b, s, e, SPT_H_PADCFGLOCK, 0, 0, g, ARRAY_SIZE(g)) + SPT_COMMUNITY(b, s, e, g, ARRAY_SIZE(g), H, 0, 0) /* Sunrisepoint-LP */ static const struct pinctrl_pin_desc sptlp_pins[] = { From patchwork Tue Oct 18 22:34:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 616267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F2F9C43217 for ; Tue, 18 Oct 2022 22:34:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229509AbiJRWeN (ORCPT ); Tue, 18 Oct 2022 18:34:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbiJRWeL (ORCPT ); Tue, 18 Oct 2022 18:34:11 -0400 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 391622BB35; Tue, 18 Oct 2022 15:34:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666132451; x=1697668451; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+vCoymx5NkqT+DCUBjvcufzqfyqPvwuEyg7xUD1Func=; b=MGWvVYPGJs7mcpKod8GqLcvj/TvRGAOrCMv5PGCfVI2AOSzsVeSOwKaW QjURn6DvKC9EQW2BM59Neac8LrpddC3TD8bXM6XiuYewQuQ0KzIVE9bIo Jy7vJci7eXpQp2mezT9IMkmIH6iBwivI1FkAU3UkvvSGxejtK5gdG4Rhq gx/gf3BPUgFoOFkQrQLtBd4g6CH59+/jT7qolGxKnT/hLwW6n/BJNE9rY Nk2zDIEiuX41Tf8ZbxgUQOiF7NzU1BJC+HZM0ScLpL8w+acqMH1TkvQrJ 5y3l/Tmc4mw72TFiwCvJhqZeGv/fKkALrDrdW0oXOi8JbDT1gJ14CqZy8 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="306236227" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="306236227" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2022 15:34:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10504"; a="697745782" X-IronPort-AV: E=Sophos;i="5.95,194,1661842800"; d="scan'208";a="697745782" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2022 15:34:07 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id D16643FD; Wed, 19 Oct 2022 01:34:28 +0300 (EEST) From: Andy Shevchenko To: Andy Shevchenko , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Mika Westerberg , Andy Shevchenko , Linus Walleij Subject: [PATCH v1 5/5] pinctrl: tigerlake: Deduplicate COMMUNITY macro code Date: Wed, 19 Oct 2022 01:34:27 +0300 Message-Id: <20221018223427.43579-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com> References: <20221018223427.43579-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Define a common COMUNITY macro and supply a variant to it. This removes some verbosity in macros. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-tigerlake.c | 28 +++++++++++------------ 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-tigerlake.c b/drivers/pinctrl/intel/pinctrl-tigerlake.c index 5a4cd0d9a89f..4f5a3b80b72d 100644 --- a/drivers/pinctrl/intel/pinctrl-tigerlake.c +++ b/drivers/pinctrl/intel/pinctrl-tigerlake.c @@ -31,25 +31,25 @@ .gpio_base = (g), \ } -#define TGL_COMMUNITY(b, s, e, pl, ho, g) \ - { \ - .barno = (b), \ - .padown_offset = TGL_PAD_OWN, \ - .padcfglock_offset = (pl), \ - .hostown_offset = (ho), \ - .is_offset = TGL_GPI_IS, \ - .ie_offset = TGL_GPI_IE, \ - .pin_base = (s), \ - .npins = ((e) - (s) + 1), \ - .gpps = (g), \ - .ngpps = ARRAY_SIZE(g), \ +#define TGL_COMMUNITY(b, s, e, g, v) \ + { \ + .barno = (b), \ + .padown_offset = TGL_PAD_OWN, \ + .padcfglock_offset = TGL_##v##_PADCFGLOCK, \ + .hostown_offset = TGL_##v##_HOSTSW_OWN, \ + .is_offset = TGL_GPI_IS, \ + .ie_offset = TGL_GPI_IE, \ + .pin_base = (s), \ + .npins = ((e) - (s) + 1), \ + .gpps = (g), \ + .ngpps = ARRAY_SIZE(g), \ } #define TGL_LP_COMMUNITY(b, s, e, g) \ - TGL_COMMUNITY(b, s, e, TGL_LP_PADCFGLOCK, TGL_LP_HOSTSW_OWN, g) + TGL_COMMUNITY(b, s, e, g, LP) #define TGL_H_COMMUNITY(b, s, e, g) \ - TGL_COMMUNITY(b, s, e, TGL_H_PADCFGLOCK, TGL_H_HOSTSW_OWN, g) + TGL_COMMUNITY(b, s, e, g, H) /* Tiger Lake-LP */ static const struct pinctrl_pin_desc tgllp_pins[] = {