From patchwork Mon Dec 19 12:42:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635863 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 33DBAC10F1B for ; Mon, 19 Dec 2022 12:42:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231859AbiLSMmY (ORCPT ); Mon, 19 Dec 2022 07:42:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231857AbiLSMmX (ORCPT ); Mon, 19 Dec 2022 07:42:23 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9727E00F; Mon, 19 Dec 2022 04:42:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453742; x=1702989742; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=dlPPnlNjLJmioznly2ozXS6UiYy5/U2w53JSKTh6byQ=; b=MTke11rjUmg1NYxPOodI0QenntzWaH1bWsWXYNxYxytFKAVaAfatxk+5 LEw/ZipU0fqn6VdROPZCsPN4zJzzV2uwEJ40hqyh4R91NDXUiuAMkUmO/ oF2/YguZVaC1HjtuZMDWR8h/RF3/kRFdUrw4fC0CcWNaWff9AqJXGiN/F ULCPC18hJs75q439iamYugtM7yZg9P1MzvXFnkq7JYEuCe2UyWGVD11rq aIpWG9iBLv2zpzW7WTSg/kDOWawGtej2w+5HCzNTVcAYzKPlbIU+/Ov8+ rd9Wfx3chOg4cN3CaMI/cZpenssVgd3sq2Pa3L7M3zW1SGa1GzhmEvR18 w==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="320510332" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="320510332" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="681210329" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="681210329" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 19 Dec 2022 04:42:20 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id BBD87F7; Mon, 19 Dec 2022 14:42:49 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 1/8] pinctrl: Introduce struct pinfunction and PINCTRL_PINFUNCTION() macro Date: Mon, 19 Dec 2022 14:42:33 +0200 Message-Id: <20221219124240.62781-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 There are many pin control drivers define their own data type for pin function representation which is the same or embed the same data as newly introduced one. Provide the data type and convenient macro for all pin control drivers. Signed-off-by: Andy Shevchenko Reviewed-by: Linus Walleij --- include/linux/pinctrl/pinctrl.h | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h index a0d39b303431..4d252ea00ed1 100644 --- a/include/linux/pinctrl/pinctrl.h +++ b/include/linux/pinctrl/pinctrl.h @@ -206,6 +206,26 @@ extern int pinctrl_get_group_pins(struct pinctrl_dev *pctldev, const char *pin_group, const unsigned **pins, unsigned *num_pins); +/** + * struct pinfunction - Description about a function + * @name: Name of the function + * @groups: An array of groups for this function + * @ngroups: Number of groups in @groups + */ +struct pinfunction { + const char *name; + const char * const *groups; + size_t ngroups; +}; + +/* Convenience macro to define a single named pinfunction */ +#define PINCTRL_PINFUNCTION(_name, _groups, _ngroups) \ +(struct pinfunction) { \ + .name = (_name), \ + .groups = (_groups), \ + .ngroups = (_ngroups), \ + } + #if IS_ENABLED(CONFIG_OF) && IS_ENABLED(CONFIG_PINCTRL) extern struct pinctrl_dev *of_pinctrl_get(struct device_node *np); #else From patchwork Mon Dec 19 12:42:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635860 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 13526C4332F for ; Mon, 19 Dec 2022 12:44:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230283AbiLSMoJ (ORCPT ); Mon, 19 Dec 2022 07:44:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231857AbiLSMnq (ORCPT ); Mon, 19 Dec 2022 07:43:46 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C91D3FD18; Mon, 19 Dec 2022 04:43:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453807; x=1702989807; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RiEyeQwFNbzEcZUDvCsiL9JfnkclSpnnO35jl8CiXtY=; b=I65WtZCOSg7lkuO+S06e3BtIKrINSNpIykdLuMldArBXjqx8EaGM8O6P 3WJUTx5cO7/CGwhbL6L2SbI8pFH9W/Ujo+QTRRWS4HzMn8SqQDFV4uCjL Vr4CxpTvKccDqde+tew3L4pzxmtKd17b5ZFUzTwQTNdddH3SsMAwpkqjA f5R2c9B+Q/AleyyAKfNQJqoO5HtRD7RnzkA3vsO240WrUKwHJ2dYkwwOE PxqgeXU1cQ5mgRj3yd8SHSD9DUOAbtYVu0DqK+JN//E+sCwKMEvCOrnZe ZAdXUZHSRxwF346KAipKh9/jzd0nRJ9jr2hV5tPxKZiTSvQ4X72oUBlb7 Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="381564846" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="381564846" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="979361542" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="979361542" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Dec 2022 04:42:45 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 92D18F7; Mon, 19 Dec 2022 14:42:55 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 2/8] pinctrl: intel: Make use of struct pinfunction and PINCTRL_PINFUNCTION() Date: Mon, 19 Dec 2022 14:42:34 +0200 Message-Id: <20221219124240.62781-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Since pin control provides a generic data type and a macro for the pin function definition, use them in the Intel driver. Signed-off-by: Andy Shevchenko --- I went with the embedding a generic structure into intel_function instead of replacing the latter in order to keep symmetry with intel_pingroup. In the case we will need the additional memeber in the future there will be less churn, otherwise from the code generation perspective it's the same. drivers/pinctrl/intel/pinctrl-intel.c | 6 +++--- drivers/pinctrl/intel/pinctrl-intel.h | 13 ++++++++----- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index 2f7931d9602c..682fd902009f 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c @@ -372,7 +372,7 @@ static const char *intel_get_function_name(struct pinctrl_dev *pctldev, { struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); - return pctrl->soc->functions[function].name; + return pctrl->soc->functions[function].func.name; } static int intel_get_function_groups(struct pinctrl_dev *pctldev, @@ -382,8 +382,8 @@ static int intel_get_function_groups(struct pinctrl_dev *pctldev, { struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); - *groups = pctrl->soc->functions[function].groups; - *ngroups = pctrl->soc->functions[function].ngroups; + *groups = pctrl->soc->functions[function].func.groups; + *ngroups = pctrl->soc->functions[function].func.ngroups; return 0; } diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h index 3b0e2d3f15d5..91e5bedba00b 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.h +++ b/drivers/pinctrl/intel/pinctrl-intel.h @@ -36,11 +36,13 @@ struct intel_pingroup { /** * struct intel_function - Description about a function + * @func: Generic data of the pin function (name and groups of pins) * @name: Name of the function * @groups: An array of groups for this function * @ngroups: Number of groups in @groups */ struct intel_function { + struct pinfunction func; const char *name; const char * const *groups; size_t ngroups; @@ -183,11 +185,12 @@ struct intel_community { .modes = __builtin_choose_expr(__builtin_constant_p((m)), NULL, (m)), \ } -#define FUNCTION(n, g) \ - { \ - .name = (n), \ - .groups = (g), \ - .ngroups = ARRAY_SIZE((g)), \ +#define FUNCTION(n, g) \ + { \ + .func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \ + .name = (n), \ + .groups = (g), \ + .ngroups = ARRAY_SIZE((g)), \ } /** From patchwork Mon Dec 19 12:42:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635308 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 384DAC10F1B for ; Mon, 19 Dec 2022 12:42:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231377AbiLSMmb (ORCPT ); Mon, 19 Dec 2022 07:42:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbiLSMm3 (ORCPT ); Mon, 19 Dec 2022 07:42:29 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B31DFC6; Mon, 19 Dec 2022 04:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453748; x=1702989748; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6mI0ViUNS836fKzrEqVfJ8ESwDkp7g6U7Pv35w8R+Dg=; b=XpQg3riiYT1Pq6Hft3nxZWZza5I+cbDMMzeVhBzKZBLHR5fsDjN0pwk0 auNrveIAo5+PMcrTPYXPfPag+VH22ipgPEz3pA1X8kIlXf1A4WZTJh12W 8oCxEwD8JENbx/zIgE4Xo3Ahb20Y+P7vEvdn9RBYHPm1JS1Nffcq4xtsN xW8uFZi3cjjVJkGRxsSEd0pjYpE9oz3fVt5n7N/gPdjO904iXmMclWIKr IaJEb6OEdan5iE6NsaYgDK4nthoeYIbI16T3GQd6xIN0xIV48W6n5nrZl bqBa4GQOWJ9MkSSvjDiEaleRyIkbd19Pj0XAWOpXrgxce+1jEvOmzXxEl A==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="320510348" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="320510348" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="681210358" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="681210358" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 19 Dec 2022 04:42:26 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 400C011D; Mon, 19 Dec 2022 14:42:56 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 3/8] pinctrl: baytrail: Convert to use new memeber in struct intel_function Date: Mon, 19 Dec 2022 14:42:35 +0200 Message-Id: <20221219124240.62781-3-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Convert driver to use generic data type and hence a new member in the struct intel_function. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-baytrail.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index 67db79f38051..770a2723ef81 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c @@ -637,18 +637,18 @@ static const char *byt_get_function_name(struct pinctrl_dev *pctldev, { struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); - return vg->soc->functions[selector].name; + return vg->soc->functions[selector].func.name; } static int byt_get_function_groups(struct pinctrl_dev *pctldev, unsigned int selector, const char * const **groups, - unsigned int *num_groups) + unsigned int *ngroups) { struct intel_pinctrl *vg = pinctrl_dev_get_drvdata(pctldev); - *groups = vg->soc->functions[selector].groups; - *num_groups = vg->soc->functions[selector].ngroups; + *groups = vg->soc->functions[selector].func.groups; + *ngroups = vg->soc->functions[selector].func.ngroups; return 0; } @@ -722,7 +722,7 @@ static int byt_set_mux(struct pinctrl_dev *pctldev, unsigned int func_selector, if (group.modes) byt_set_group_mixed_mux(vg, group, group.modes); - else if (!strcmp(func.name, "gpio")) + else if (!strcmp(func.func.name, "gpio")) byt_set_group_simple_mux(vg, group, BYT_DEFAULT_GPIO_MUX); else byt_set_group_simple_mux(vg, group, group.mode); From patchwork Mon Dec 19 12:42:36 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635305 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 9F5B9C4332F for ; Mon, 19 Dec 2022 12:44:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232033AbiLSMod (ORCPT ); Mon, 19 Dec 2022 07:44:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52082 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232117AbiLSMnx (ORCPT ); Mon, 19 Dec 2022 07:43:53 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7831510B6A; Mon, 19 Dec 2022 04:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453814; x=1702989814; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EnL6MrmnzkZ9KQarfI8X6RWJyObe5UEYwf4Sqd3GiDU=; b=kR5H9Ucv6tFIJTC8ZxC56T8V4lOJOgALziDm9O4f3SIvlqR6yAfILYXy /+rhqRuuvz6GDRIqd6yjouPc65oluZaoioLjJ9JILRLLy4xSaa+ZpKT0h ZbZ3QXuQncMG1k+O/pnanvfZd+1COaBNEG7KssR6/rlvxDZGvL49E2Unu OOVOLBd6Hxk2adK+RnvynZz5jM7geui2+07bASEskrmZsi5Mrs4u5nm6x XMqC8B3mX0BUFLEh/nYgtPaenuQ3mLjLaomanK/fGSBMxe8w7NrFeWSsh /YoZAstGHGmFwiFeaAj2RPCtqgKGqlWxF6BKJKIKp4l45vGf1JN2hrm2z A==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="381564859" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="381564859" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="979361554" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="979361554" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Dec 2022 04:42:46 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id B67F0132; Mon, 19 Dec 2022 14:42:56 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 4/8] pinctrl: cherryview: Convert to use new memeber in struct intel_function Date: Mon, 19 Dec 2022 14:42:36 +0200 Message-Id: <20221219124240.62781-4-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Convert driver to use generic data type and hence a new member in the struct intel_function. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-cherryview.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 11b81213922d..722990e27836 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c @@ -694,7 +694,7 @@ static const char *chv_get_function_name(struct pinctrl_dev *pctldev, { struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); - return pctrl->soc->functions[function].name; + return pctrl->soc->functions[function].func.name; } static int chv_get_function_groups(struct pinctrl_dev *pctldev, @@ -704,8 +704,8 @@ static int chv_get_function_groups(struct pinctrl_dev *pctldev, { struct intel_pinctrl *pctrl = pinctrl_dev_get_drvdata(pctldev); - *groups = pctrl->soc->functions[function].groups; - *ngroups = pctrl->soc->functions[function].ngroups; + *groups = pctrl->soc->functions[function].func.groups; + *ngroups = pctrl->soc->functions[function].func.ngroups; return 0; } From patchwork Mon Dec 19 12:42:37 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635862 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 6A365C4332F for ; Mon, 19 Dec 2022 12:42:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231874AbiLSMmc (ORCPT ); Mon, 19 Dec 2022 07:42:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231320AbiLSMma (ORCPT ); Mon, 19 Dec 2022 07:42:30 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C96BE00F; Mon, 19 Dec 2022 04:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453749; x=1702989749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Wjyg7b3+Cz5+uNHjs62Sul3FvaH5gYXBtxaOwtuoGJc=; b=XWgUyfYnApA/VoJgeL2+T9Ctib6QjjFLjUAVuJepbaarNr3L+5kJr+DM dFlzouB6dFTmSOuxiLrsmLQ7991JeUXSl02a1MqeUCZHLxBz1IbH0QTK3 NrmznuEDoNxelro8/xWmC/MpJyls6xpaDnvLs1epiUc423r78nVfn7FXR 19GyBeFcVaPzke1TLSZbNlBAMnrD1Jz4KIlRgCZlwigcQgSRypwK9BX32 ZdNiy7o3aJig3CbrmUUtKUjhswcd7aoS5mlBP5LjMVPiTaINUw+BSor6/ 8QX9OUjCX72sLX0qfXlQ3mNaXkq6r0YJurwKgAMCHzkvSaqRFTVOk0oN1 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="381564787" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="381564787" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="979361373" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="979361373" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Dec 2022 04:42:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4FFD71C3; Mon, 19 Dec 2022 14:42:57 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 5/8] pinctrl: lynxpoint: Convert to use new memeber in struct intel_function Date: Mon, 19 Dec 2022 14:42:37 +0200 Message-Id: <20221219124240.62781-5-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Convert driver to use generic data type and hence a new member in the struct intel_function. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-lynxpoint.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-lynxpoint.c b/drivers/pinctrl/intel/pinctrl-lynxpoint.c index 8d05dad38556..cdace55aaeac 100644 --- a/drivers/pinctrl/intel/pinctrl-lynxpoint.c +++ b/drivers/pinctrl/intel/pinctrl-lynxpoint.c @@ -341,18 +341,18 @@ static const char *lp_get_function_name(struct pinctrl_dev *pctldev, { struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); - return lg->soc->functions[selector].name; + return lg->soc->functions[selector].func.name; } static int lp_get_function_groups(struct pinctrl_dev *pctldev, unsigned int selector, const char * const **groups, - unsigned int *num_groups) + unsigned int *ngroups) { struct intel_pinctrl *lg = pinctrl_dev_get_drvdata(pctldev); - *groups = lg->soc->functions[selector].groups; - *num_groups = lg->soc->functions[selector].ngroups; + *groups = lg->soc->functions[selector].func.groups; + *ngroups = lg->soc->functions[selector].func.ngroups; return 0; } From patchwork Mon Dec 19 12:42:38 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635307 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 856A8C10F1B for ; Mon, 19 Dec 2022 12:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231931AbiLSMmd (ORCPT ); Mon, 19 Dec 2022 07:42:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231136AbiLSMma (ORCPT ); Mon, 19 Dec 2022 07:42:30 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61EE1E018; Mon, 19 Dec 2022 04:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453749; x=1702989749; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=uUJAw123d6rgti8BHrMLRShZWWNRv/+Tg9Cbe+KiQAk=; b=bdIYZBoW35rOdHpL6GPLlTZjj4LdeLQc2VYE1fxMUJv2ldgNcWZLJsbY lfcYXylEJ4zIq1Ax6NAi17Xgp6MdNpDvY3KkZS1W7oJxdwhxha+zdNi1Y pDHMMMP6Nt7mZx4udpnf3xN3cxKg+yTMX+3YxveYnixdUnJDYptDqeGqv WXxNFaRef7Fy33MGbi7pQ0kufQlDO/aM8DCpoF3SABQBrfgIua+gSioy9 cX8IUlNG4r1B4e24vjHx2RnMKZFlQHZpp54ogi0UzSbpmrVEc3e/mQ2jd n95ZjSstRobhcfonxcWTGeVKSLEiZH6Xp0zMS5qRo0IoMo8rYod8bFmZD w==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="320510351" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="320510351" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:29 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="681210363" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="681210363" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 19 Dec 2022 04:42:27 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 59B1CB7; Mon, 19 Dec 2022 14:42:57 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 6/8] pinctrl: merrifield: Convert to use new memeber in struct intel_function Date: Mon, 19 Dec 2022 14:42:38 +0200 Message-Id: <20221219124240.62781-6-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Convert driver to use generic data type and hence a new member in the struct intel_function. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-merrifield.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-merrifield.c b/drivers/pinctrl/intel/pinctrl-merrifield.c index c0845bb1e9e3..365c391c97a3 100644 --- a/drivers/pinctrl/intel/pinctrl-merrifield.c +++ b/drivers/pinctrl/intel/pinctrl-merrifield.c @@ -576,7 +576,7 @@ static const char *mrfld_get_function_name(struct pinctrl_dev *pctldev, { struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); - return mp->functions[function].name; + return mp->functions[function].func.name; } static int mrfld_get_function_groups(struct pinctrl_dev *pctldev, @@ -586,8 +586,8 @@ static int mrfld_get_function_groups(struct pinctrl_dev *pctldev, { struct mrfld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); - *groups = mp->functions[function].groups; - *ngroups = mp->functions[function].ngroups; + *groups = mp->functions[function].func.groups; + *ngroups = mp->functions[function].func.ngroups; return 0; } From patchwork Mon Dec 19 12:42:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635306 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 708C1C4332F for ; Mon, 19 Dec 2022 12:42:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231997AbiLSMmj (ORCPT ); Mon, 19 Dec 2022 07:42:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231857AbiLSMmc (ORCPT ); Mon, 19 Dec 2022 07:42:32 -0500 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F017E00F; Mon, 19 Dec 2022 04:42:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453751; x=1702989751; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=RTfdE9Kw7+wzicmDdsrrzv8JpM6HgptCGGcTTtg6Geg=; b=Gz0KhRvJfXyOeHS5OgSSV8r6ZAu/WBUEPTaGjpRVv68X4rTm0k9rOkKd Q5aC0JkLNYCHY5/STD49EQ3IEj+DCD6aTH6/ITiSrCWRGipDC6xsTH81h 8kcniJqcyW71QazZ1oclH+jgKk38K7X9Ep+I8QL1RMkSEb+l+D2+mfyzd Ifl/YKuMBslVMP3N8F0Kk+p2saLgyqgS2J/InyOjNYMONRATl3Vl2LugC ywNkgkDb6xxdXmGjZ7AORApXFi3MiGssdg3HqqO8q1QtaSWV1knG9BJ+O 5jGG1zbwgO6cgJtviU3YQ8snxTULorvpi2JsQxiuZqEpjV/wdHOVoKHaD g==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="320510354" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="320510354" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="681210369" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="681210369" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga008.jf.intel.com with ESMTP; 19 Dec 2022 04:42:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6378C223; Mon, 19 Dec 2022 14:42:57 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 7/8] pinctrl: moorefield: Convert to use new memeber in struct intel_function Date: Mon, 19 Dec 2022 14:42:39 +0200 Message-Id: <20221219124240.62781-7-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Convert driver to use generic data type and hence a new member in the struct intel_function. No functional change intended. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-moorefield.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-moorefield.c b/drivers/pinctrl/intel/pinctrl-moorefield.c index e3eec671e15d..3c9a8484b442 100644 --- a/drivers/pinctrl/intel/pinctrl-moorefield.c +++ b/drivers/pinctrl/intel/pinctrl-moorefield.c @@ -530,7 +530,7 @@ static const char *mofld_get_function_name(struct pinctrl_dev *pctldev, unsigned { struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); - return mp->functions[function].name; + return mp->functions[function].func.name; } static int mofld_get_function_groups(struct pinctrl_dev *pctldev, unsigned int function, @@ -538,8 +538,8 @@ static int mofld_get_function_groups(struct pinctrl_dev *pctldev, unsigned int f { struct mofld_pinctrl *mp = pinctrl_dev_get_drvdata(pctldev); - *groups = mp->functions[function].groups; - *ngroups = mp->functions[function].ngroups; + *groups = mp->functions[function].func.groups; + *ngroups = mp->functions[function].func.ngroups; return 0; } From patchwork Mon Dec 19 12:42:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 635861 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 18611C4167B for ; Mon, 19 Dec 2022 12:42:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231952AbiLSMmf (ORCPT ); Mon, 19 Dec 2022 07:42:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231458AbiLSMmb (ORCPT ); Mon, 19 Dec 2022 07:42:31 -0500 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF352E02C; Mon, 19 Dec 2022 04:42:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1671453750; x=1702989750; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rFXRuNuxKSqw6oDareMv/+ap40tT1Fx8IbD+8iaDdIA=; b=IZXetE5XNAHD7uM/btlUAH6uU8hmpShZrZjomkb+CyNzsWvuFKxGg1aQ ArPLVfcN4PsEtShgjLLne7amUxMlGKxKmUmU90FadwGVxNLuXNcjLlf+1 JUjCcYl8sRVd2khi7gEnbkVykPv7Zjnj+GFpf6g24fJtkxz9yMOZ8gybC GuqcZTMk1G36aYdwIjWudIkedB/0h4DjrXFar8xqBuNEIQ1rWZw3+1LK/ KVppPNoENae3fpjluJCk0OW6Yu02dC7Z05UjgN+4uLvdK1EGjl73vIIG2 bszhZ3ulISZwweOtgUA06YvSK3LqCoLcMtmgXWIg4a6YSpi86DYMGYZaH g==; X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="381564791" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="381564791" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2022 04:42:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10565"; a="979361387" X-IronPort-AV: E=Sophos;i="5.96,255,1665471600"; d="scan'208";a="979361387" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga005.fm.intel.com with ESMTP; 19 Dec 2022 04:42:29 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 6A45343A; Mon, 19 Dec 2022 14:42:57 +0200 (EET) From: Andy Shevchenko To: Andy Shevchenko , Mika Westerberg , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko , Linus Walleij Subject: [PATCH v1 8/8] pinctrl: intel: Get rid of unused members in struct intel_function Date: Mon, 19 Dec 2022 14:42:40 +0200 Message-Id: <20221219124240.62781-8-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> References: <20221219124240.62781-1-andriy.shevchenko@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org The driver has been converted to a generic data type and macro for the pin function definition, hence get rid of not used members in the struct intel_function. Signed-off-by: Andy Shevchenko --- drivers/pinctrl/intel/pinctrl-intel.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/drivers/pinctrl/intel/pinctrl-intel.h b/drivers/pinctrl/intel/pinctrl-intel.h index 91e5bedba00b..1faf2ada480a 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.h +++ b/drivers/pinctrl/intel/pinctrl-intel.h @@ -37,15 +37,9 @@ struct intel_pingroup { /** * struct intel_function - Description about a function * @func: Generic data of the pin function (name and groups of pins) - * @name: Name of the function - * @groups: An array of groups for this function - * @ngroups: Number of groups in @groups */ struct intel_function { struct pinfunction func; - const char *name; - const char * const *groups; - size_t ngroups; }; #define INTEL_PINCTRL_MAX_GPP_SIZE 32 @@ -188,9 +182,6 @@ struct intel_community { #define FUNCTION(n, g) \ { \ .func = PINCTRL_PINFUNCTION((n), (g), ARRAY_SIZE(g)), \ - .name = (n), \ - .groups = (g), \ - .ngroups = ARRAY_SIZE((g)), \ } /**