From: aisheng.dong@nxp.com (Dong Aisheng)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/6] pinctrl: pinctrl-imx: improve the code comments of PIN_FUNC_ID
Date: Sat, 28 Apr 2018 03:01:49 +0800 [thread overview]
Message-ID: <1524855713-15527-3-git-send-email-aisheng.dong@nxp.com> (raw)
In-Reply-To: <1524855713-15527-1-git-send-email-aisheng.dong@nxp.com>
The current code comments of PIN_FUNC_ID actually is not true for
SHARE_MUX_CONF_REG case which should be a 4 u32 PIN_FUNC_ID.
Fix the comments and re-org it a bit for better extendibility
as we may add a different size for SCU based PIN_FUNC_ID later.
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
---
drivers/pinctrl/freescale/pinctrl-imx.c | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c
index 77cd364..ff6ca6a4 100644
--- a/drivers/pinctrl/freescale/pinctrl-imx.c
+++ b/drivers/pinctrl/freescale/pinctrl-imx.c
@@ -414,11 +414,18 @@ static const struct pinconf_ops imx_pinconf_ops = {
};
/*
- * Each pin represented in fsl,pins consists of 5 u32 PIN_FUNC_ID and
- * 1 u32 CONFIG, so 24 types in total for each pin.
+ * Each pin represented in fsl,pins consists of a number of u32 PIN_FUNC_ID
+ * and 1 u32 CONFIG, the total size is PIN_FUNC_ID + CONFIG for each pin.
+ * For generic_pinconf case, there's no extra u32 CONFIG.
+ *
+ * PIN_FUNC_ID format:
+ * Default:
+ * <mux_reg conf_reg input_reg mux_mode input_val>
+ * SHARE_MUX_CONF_REG:
+ * <mux_conf_reg input_reg mux_mode input_val>
*/
#define FSL_PIN_SIZE 24
-#define SHARE_FSL_PIN_SIZE 20
+#define FSL_PIN_SHARE_SIZE 20
static int imx_pinctrl_parse_groups(struct device_node *np,
struct group_desc *grp,
@@ -434,7 +441,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np,
dev_dbg(ipctl->dev, "group(%d): %s\n", index, np->name);
if (info->flags & SHARE_MUX_CONF_REG)
- pin_size = SHARE_FSL_PIN_SIZE;
+ pin_size = FSL_PIN_SHARE_SIZE;
else
pin_size = FSL_PIN_SIZE;
--
2.7.4
next prev parent reply other threads:[~2018-04-27 19:01 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-27 19:01 [PATCH 0/6] pinctrl: imx: add imx8qxp pinctrl support Dong Aisheng
2018-04-27 19:01 ` [PATCH 1/6] pinctrl: imx: fix unsigned check if nfuncs with less than or equal zero Dong Aisheng
2018-05-02 12:22 ` Linus Walleij
2018-04-27 19:01 ` Dong Aisheng [this message]
2018-05-02 12:23 ` [PATCH 2/6] pinctrl: pinctrl-imx: improve the code comments of PIN_FUNC_ID Linus Walleij
2018-04-27 19:01 ` [PATCH 3/6] pinctrl: imx: use seq_puts() instead of seq_printf() Dong Aisheng
2018-05-02 12:24 ` Linus Walleij
2018-04-27 19:01 ` [PATCH 4/6] pinctrl: fsl: add scu based pinctrl support Dong Aisheng
2018-05-02 12:27 ` Linus Walleij
2018-05-02 12:29 ` Linus Walleij
2018-05-02 12:36 ` Sascha Hauer
2018-05-02 13:03 ` Linus Walleij
2018-05-02 15:05 ` Sascha Hauer
2018-05-02 18:42 ` A.s. Dong
2018-04-27 19:01 ` [PATCH 5/6] dt-bindings: pinctrl: add imx8qxp pinctrl binding doc Dong Aisheng
2018-05-01 15:58 ` Rob Herring
2018-05-02 18:07 ` A.s. Dong
2018-04-27 19:01 ` [PATCH 6/6] pinctrl: imx: add imx8qxp driver Dong Aisheng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1524855713-15527-3-git-send-email-aisheng.dong@nxp.com \
--to=aisheng.dong@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).