LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Zhou Yanjie <zhouyanjie@wanyeetech.com>
To: Paul Cercueil <paul@crapouillou.net>,
Linus Walleij <linus.walleij@linaro.org>
Cc: linux-mips@vger.kernel.org, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/3] pinctrl: ingenic: Add .max_register in regmap_config
Date: Sat, 24 Jul 2021 14:43:56 +0800 [thread overview]
Message-ID: <ebae8ead-d7c4-071b-7415-d83f2db9f9cc@wanyeetech.com> (raw)
In-Reply-To: <20210717174836.14776-3-paul@crapouillou.net>
Hi Paul,
On 2021/7/18 上午1:48, Paul Cercueil wrote:
> Compute the max register from the GPIO chip offset and number of GPIO
> chips.
>
> This permits to read all registers from debugfs.
>
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> ---
> drivers/pinctrl/pinctrl-ingenic.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
Tested-by: 周琰杰 (Zhou Yanjie)<zhouyanjie@wanyeetech.com>
> diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c
> index 263498be8e31..2bbcb8063a16 100644
> --- a/drivers/pinctrl/pinctrl-ingenic.c
> +++ b/drivers/pinctrl/pinctrl-ingenic.c
> @@ -3759,6 +3759,7 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
> void __iomem *base;
> const struct ingenic_chip_info *chip_info;
> struct device_node *node;
> + struct regmap_config regmap_config;
> unsigned int i;
> int err;
>
> @@ -3776,8 +3777,10 @@ static int __init ingenic_pinctrl_probe(struct platform_device *pdev)
> if (IS_ERR(base))
> return PTR_ERR(base);
>
> - jzpc->map = devm_regmap_init_mmio(dev, base,
> - &ingenic_pinctrl_regmap_config);
> + regmap_config = ingenic_pinctrl_regmap_config;
> + regmap_config.max_register = chip_info->num_chips * chip_info->reg_offset;
> +
> + jzpc->map = devm_regmap_init_mmio(dev, base, ®map_config);
> if (IS_ERR(jzpc->map)) {
> dev_err(dev, "Failed to create regmap\n");
> return PTR_ERR(jzpc->map);
next prev parent reply other threads:[~2021-07-24 6:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-17 17:48 [PATCH 1/3] pinctrl: ingenic: Fix incorrect pull up/down info Paul Cercueil
2021-07-17 17:48 ` [PATCH 2/3] pinctrl: ingenic: Fix bias config for X2000(E) Paul Cercueil
2021-07-24 6:42 ` Zhou Yanjie
2021-08-11 8:25 ` Linus Walleij
2021-07-17 17:48 ` [PATCH 3/3] pinctrl: ingenic: Add .max_register in regmap_config Paul Cercueil
2021-07-24 6:43 ` Zhou Yanjie [this message]
2021-08-11 8:25 ` Linus Walleij
2021-07-24 6:41 ` [PATCH 1/3] pinctrl: ingenic: Fix incorrect pull up/down info Zhou Yanjie
2021-08-11 8:24 ` Linus Walleij
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=ebae8ead-d7c4-071b-7415-d83f2db9f9cc@wanyeetech.com \
--to=zhouyanjie@wanyeetech.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul@crapouillou.net \
--subject='Re: [PATCH 3/3] pinctrl: ingenic: Add .max_register in regmap_config' \
/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
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).