From: "Yu-Chun Lin [林祐君]" <eleanor.lin@realtek.com>
To: Michael Walle <mwalle@kernel.org>, Linus Walleij <linusw@kernel.org>
Cc: "Bartosz Golaszewski" <brgl@kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-realtek-soc@lists.infradead.org"
<linux-realtek-soc@lists.infradead.org>,
"CY_Huang[黃鉦晏]" <cy.huang@realtek.com>,
"Stanley Chang[昌育德]" <stanley_chang@realtek.com>,
"James Tai [戴志峰]" <james.tai@realtek.com>,
"robh@kernel.org" <robh@kernel.org>,
"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
"conor+dt@kernel.org" <conor+dt@kernel.org>,
"afaerber@suse.com" <afaerber@suse.com>,
"TY_Chang[張子逸]" <tychang@realtek.com>
Subject: RE: [PATCH v2 3/4] gpio: realtek: Add driver for Realtek DHC RTD1625 SoC
Date: Tue, 5 May 2026 10:26:36 +0000 [thread overview]
Message-ID: <3f9aa7a00a384511bf12d5b420c98e85@realtek.com> (raw)
In-Reply-To: <DI6G6LSE68E9.1PHS6K9083JJ9@kernel.org>
> Hi,
>
> On Thu Apr 30, 2026 at 11:58 AM CEST, Yu-Chun Lin [林祐君] wrote:
> >> >> 3. Hardware Debounce: We also need to support hardware debounce
> >> >> settings per pin, which requires custom configuration via
> >> >> set_config mapped to these specific per-pin registers.
> >> >
> >> > Just add a version of an optional .set_config() call to
> >> > gpio-regmap.c to handle this using .reg_mask_xlate() per above and
> >> > add a new GPIO_REGMAP_CONFIG_OP to the above enum, problem solved.
> >> >
> >> > If it seems too hard I can write patch 1 & 2 adding this
> >> > infrastructure but I bet you can easily see what can be done with
> >> > gpio-regmap.c here provided Michael W approves the idea.
> >> >
> >
> > Our .set_config requires mapping specific debounce time values to
> > hardware-specific enums and applying a Write-Enable bit.
> >
> > Would it be better to allow drivers to assign a custom '.set_config'
> > callback directly within 'struct gpio_regmap_config'?
>
> Yeah, I don't think there will be much code sharing of code/functionality
> for the .set_config callback. A custom .set_config was proposed many times in the past.
>
Will add a new patch to support custom .set_config.
> > Additionally, I didn't mention this in my previous email. we also need
> > to implement GPIO interrupts. Our hardware design does not fit well
> > with 'regmap_irq_chip'. Therefore, I am planning to create our own
> > 'irqdomain' and 'irqchip' ops to handle our cascaded interrupts.
> >
> > Because of this custom IRQ implementation, I would need to use 'readl()/writel()'
> > for the IRQ callbacks in the rtd1625 GPIO driver instead of the regmap APIs.
> > Do you have any suggestions on how to handle this gracefully while
> > keeping it aligned with the regmap infrastructure?
>
> Why can't the MMIO regmap be used for that?
>
> -michael
I was worried about regmap overhead in atomic context, but MMIO regmap should
be fine. I'll convert the irqchip callbacks to use regmap in v3.
Best Regards,
Yu-Chun
next prev parent reply other threads:[~2026-05-05 10:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-08 2:52 [PATCH v2 0/4] gpio: realtek: Add support for Realtek DHC RTD1625 Yu-Chun Lin
2026-04-08 2:52 ` [PATCH v2 1/4] gpio: Remove "default y" in Kconfig Yu-Chun Lin
2026-04-30 11:23 ` Krzysztof Kozlowski
2026-04-30 11:24 ` Krzysztof Kozlowski
2026-05-05 10:27 ` Yu-Chun Lin [林祐君]
2026-04-08 2:52 ` [PATCH v2 2/4] dt-bindings: gpio: realtek: Add realtek,rtd1625-gpio Yu-Chun Lin
2026-04-09 7:43 ` Krzysztof Kozlowski
2026-04-08 2:52 ` [PATCH v2 3/4] gpio: realtek: Add driver for Realtek DHC RTD1625 SoC Yu-Chun Lin
2026-04-08 7:31 ` Bartosz Golaszewski
2026-04-10 9:39 ` Yu-Chun Lin [林祐君]
2026-04-19 21:19 ` Linus Walleij
2026-04-20 7:22 ` Michael Walle
2026-04-30 9:58 ` Yu-Chun Lin [林祐君]
2026-04-30 11:20 ` Michael Walle
2026-05-05 10:26 ` Yu-Chun Lin [林祐君] [this message]
2026-04-08 2:52 ` [PATCH v2 4/4] arm64: dts: realtek: Add GPIO support for RTD1625 Yu-Chun Lin
2026-04-08 7:28 ` Bartosz Golaszewski
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=3f9aa7a00a384511bf12d5b420c98e85@realtek.com \
--to=eleanor.lin@realtek.com \
--cc=afaerber@suse.com \
--cc=brgl@kernel.org \
--cc=conor+dt@kernel.org \
--cc=cy.huang@realtek.com \
--cc=devicetree@vger.kernel.org \
--cc=james.tai@realtek.com \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-realtek-soc@lists.infradead.org \
--cc=mwalle@kernel.org \
--cc=robh@kernel.org \
--cc=stanley_chang@realtek.com \
--cc=tychang@realtek.com \
/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