From: Stefan Agner <stefan@agner.ch>
To: Dong Aisheng <aisheng.dong@nxp.com>
Cc: linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linus.walleij@linaro.org, shawnguo@kernel.org, ping.bai@nxp.com,
fugang.duan@nxp.com, kernel@pengutronix.de,
Alexandre Courbot <gnurou@gmail.com>
Subject: Re: [PATCH 1/2] pinctrl: pinctrl-imx: add IBE and OBE SoC property
Date: Mon, 15 May 2017 10:10:31 -0700 [thread overview]
Message-ID: <6560bc05ac21060efb5d39d81a662a7a@agner.ch> (raw)
In-Reply-To: <1494830906-6442-2-git-send-email-aisheng.dong@nxp.com>
On 2017-05-14 23:48, Dong Aisheng wrote:
> iMX ULP has different IOB/OBE shift from Vibrid, so let's make
s/Vibrid/Vybrid
> it a SoC property.
>
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Cc: Alexandre Courbot <gnurou@gmail.com>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Stefan Agner <stefan@agner.ch>
> Cc: Fugang Duan <fugang.duan@nxp.com>
> Cc: Bai Ping <ping.bai@nxp.com>
> Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
> ---
> drivers/pinctrl/freescale/pinctrl-imx.c | 8 ++++----
> drivers/pinctrl/freescale/pinctrl-imx.h | 2 ++
> drivers/pinctrl/freescale/pinctrl-imx7ulp.c | 2 ++
> drivers/pinctrl/freescale/pinctrl-vf610.c | 2 ++
> 4 files changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c
> b/drivers/pinctrl/freescale/pinctrl-imx.c
> index 57e1f7a..0d6aaca 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.c
> @@ -331,8 +331,8 @@ static int imx_pmx_gpio_set_direction(struct
> pinctrl_dev *pctldev,
> u32 reg;
>
> /*
> - * Only Vybrid has the input/output buffer enable flags (IBE/OBE)
> - * They are part of the shared mux/conf register.
> + * Only Vybrid and iMX ULP has the input/output buffer enable flags
> + * (IBE/OBE) They are part of the shared mux/conf register.
> */
> if (!(info->flags & SHARE_MUX_CONF_REG))
> return 0;
> @@ -344,9 +344,9 @@ static int imx_pmx_gpio_set_direction(struct
> pinctrl_dev *pctldev,
> /* IBE always enabled allows us to read the value "on the wire" */
> reg = readl(ipctl->base + pin_reg->mux_reg);
> if (input)
> - reg &= ~0x2;
> + reg = (reg & ~info->obe_bit) | info->ibe_bit;
> else
> - reg |= 0x2;
> + reg = (reg & ~info->ibe_bit) | info->obe_bit;
Why disabling IBE bit now? As the comment above states, it is really
handy to leave the input buffer enabled so we can read back the true
value on the wire...
--
Stefan
> writel(reg, ipctl->base + pin_reg->mux_reg);
>
> return 0;
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h
> b/drivers/pinctrl/freescale/pinctrl-imx.h
> index eb0ce95..9ded65d 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx.h
> +++ b/drivers/pinctrl/freescale/pinctrl-imx.h
> @@ -67,6 +67,8 @@ struct imx_pinctrl_soc_info {
> /* MUX_MODE shift and mask in case SHARE_MUX_CONF_REG */
> unsigned int mux_mask;
> u8 mux_shift;
> + u32 ibe_bit;
> + u32 obe_bit;
>
> /* generic pinconf */
> bool generic_pinconf;
> diff --git a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
> b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
> index dead416..f724a01 100644
> --- a/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
> +++ b/drivers/pinctrl/freescale/pinctrl-imx7ulp.c
> @@ -324,6 +324,8 @@ static struct imx_pinctrl_soc_info imx7ulp_pinctrl_info = {
> .flags = ZERO_OFFSET_VALID | SHARE_MUX_CONF_REG,
> .mux_mask = 0xf00,
> .mux_shift = 8,
> + .ibe_bit = BIT(16),
> + .obe_bit = BIT(17),
> .generic_pinconf = true,
> .custom_params = imx7ulp_cfg_params,
> .num_custom_params = ARRAY_SIZE(imx7ulp_cfg_params),
> diff --git a/drivers/pinctrl/freescale/pinctrl-vf610.c
> b/drivers/pinctrl/freescale/pinctrl-vf610.c
> index 3bd8556..c0823f9 100644
> --- a/drivers/pinctrl/freescale/pinctrl-vf610.c
> +++ b/drivers/pinctrl/freescale/pinctrl-vf610.c
> @@ -301,6 +301,8 @@ static struct imx_pinctrl_soc_info vf610_pinctrl_info = {
> .flags = SHARE_MUX_CONF_REG | ZERO_OFFSET_VALID,
> .mux_mask = 0x700000,
> .mux_shift = 20,
> + .ibe_bit = BIT(0),
> + .obe_bit = BIT(1),
> };
>
> static const struct of_device_id vf610_pinctrl_of_match[] = {
next prev parent reply other threads:[~2017-05-15 17:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-15 6:48 [PATCH 0/2] pinctrl: pinctrl-imx: add gpio support for mx7ulp Dong Aisheng
2017-05-15 6:48 ` [PATCH 1/2] pinctrl: pinctrl-imx: add IBE and OBE SoC property Dong Aisheng
2017-05-15 17:10 ` Stefan Agner [this message]
2017-05-17 6:13 ` A.S. Dong
2017-05-23 12:06 ` A.S. Dong
2017-05-23 19:16 ` Stefan Agner
2017-05-24 5:48 ` A.S. Dong
2017-05-24 8:59 ` Lothar Waßmann
2017-05-15 6:48 ` [PATCH 2/2] pinctrl: pinctrl-imx: do not assume mux 0 is gpio Dong Aisheng
2017-05-15 17:27 ` Stefan Agner
2017-05-17 7:18 ` A.S. Dong
2017-05-17 18:16 ` Stefan Agner
2017-05-18 7:00 ` A.S. Dong
2017-05-23 10:23 ` A.S. Dong
2017-05-23 19:55 ` Stefan Agner
2017-05-24 5:40 ` A.S. Dong
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=6560bc05ac21060efb5d39d81a662a7a@agner.ch \
--to=stefan@agner.ch \
--cc=aisheng.dong@nxp.com \
--cc=fugang.duan@nxp.com \
--cc=gnurou@gmail.com \
--cc=kernel@pengutronix.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=ping.bai@nxp.com \
--cc=shawnguo@kernel.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).