[PATCH v3 0/3] Samsung mfd/rtc driver alarm IRQ simplification

André Draszik posted 3 patches 3 weeks, 5 days ago
drivers/mfd/sec-common.c         | 45 ++++++++++++++++++++--------
drivers/mfd/sec-core.h           |  2 +-
drivers/mfd/sec-irq.c            | 64 ++++++++++++++++++----------------------
drivers/rtc/rtc-s5m.c            | 21 +++++--------
include/linux/mfd/samsung/core.h |  1 -
5 files changed, 71 insertions(+), 62 deletions(-)
[PATCH v3 0/3] Samsung mfd/rtc driver alarm IRQ simplification
Posted by André Draszik 3 weeks, 5 days ago
Hi,

With the attached patches the Samsung s5m RTC driver is simplified a
little bit with regards to alarm IRQ acquisition.

The end result is that instead of having a list of IRQ numbers for each
variant (and a BUILD_BUG_ON() to ensure consistency), the RTC driver
queries the 'alarm' platform resource from the parent (mfd cell).

Additionally, we can drop a now-useless field from runtime data,
reducing memory consumption slightly.

The attached patches must be applied in-order as patch 2 without 1 will
fail at runtime, and patch 3 without 2 will fail at build time. I would
expect them all to go via the MFD tree. Alternatively, they could be
applied individually to the respective kernel trees during multiple
kernel release cycles, but that seems a needless complication and
delay.

Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
Changes in v3:
- make s2mpg1x_add_chained_irq_chip() specific to PMIC irq chip (Lee),
  and rename to s2mpg1x_add_chained_pmic() (Andre)
- Link to v2: https://lore.kernel.org/r/20251120-s5m-alarm-v2-0-cc15f0e32161@linaro.org

Changes in v2:
- rebase on top of https://lore.kernel.org/r/20251114-s2mpg10-chained-irq-v1-1-34ddfa49c4cd@linaro.org
- return struct regmap_irq_chip_data * in sec_irq_init() (Lee)
- collect tags
- Link to v1: https://lore.kernel.org/r/20251114-s5m-alarm-v1-0-c9b3bebae65f@linaro.org

---
André Draszik (3):
      mfd: sec: add rtc alarm IRQ as platform device resource
      rtc: s5m: query platform device IRQ resource for alarm IRQ
      mfd: sec: drop now unused struct sec_pmic_dev::irq_data

 drivers/mfd/sec-common.c         | 45 ++++++++++++++++++++--------
 drivers/mfd/sec-core.h           |  2 +-
 drivers/mfd/sec-irq.c            | 64 ++++++++++++++++++----------------------
 drivers/rtc/rtc-s5m.c            | 21 +++++--------
 include/linux/mfd/samsung/core.h |  1 -
 5 files changed, 71 insertions(+), 62 deletions(-)
---
base-commit: 0f853ca2a798ead9d24d39cad99b0966815c582a
change-id: 20251114-s5m-alarm-3de705ea53ce

Best regards,
-- 
André Draszik <andre.draszik@linaro.org>

Re: [PATCH v3 0/3] Samsung mfd/rtc driver alarm IRQ simplification
Posted by Lee Jones 2 weeks, 4 days ago
On Tue, 13 Jan 2026 14:03:10 +0000, André Draszik wrote:
> With the attached patches the Samsung s5m RTC driver is simplified a
> little bit with regards to alarm IRQ acquisition.
> 
> The end result is that instead of having a list of IRQ numbers for each
> variant (and a BUILD_BUG_ON() to ensure consistency), the RTC driver
> queries the 'alarm' platform resource from the parent (mfd cell).
> 
> [...]

Applied, thanks!

[1/3] mfd: sec: add rtc alarm IRQ as platform device resource
      commit: 153ae5c52b7063ac0926926d0cc9b53ee9d7fed2
[2/3] rtc: s5m: query platform device IRQ resource for alarm IRQ
      commit: c70aee3dd85482c67720eb642d59ebbb9433faa5
[3/3] mfd: sec: drop now unused struct sec_pmic_dev::irq_data
      commit: b31583a1a9ab32923734ceb5fc95e536dfacccf7

--
Lee Jones [李琼斯]

Re: [PATCH v3 0/3] Samsung mfd/rtc driver alarm IRQ simplification
Posted by Lee Jones 2 weeks, 4 days ago
On Tue, 20 Jan 2026, Lee Jones wrote:

> On Tue, 13 Jan 2026 14:03:10 +0000, André Draszik wrote:
> > With the attached patches the Samsung s5m RTC driver is simplified a
> > little bit with regards to alarm IRQ acquisition.
> > 
> > The end result is that instead of having a list of IRQ numbers for each
> > variant (and a BUILD_BUG_ON() to ensure consistency), the RTC driver
> > queries the 'alarm' platform resource from the parent (mfd cell).
> > 
> > [...]
> 
> Applied, thanks!
> 
> [1/3] mfd: sec: add rtc alarm IRQ as platform device resource
>       commit: 153ae5c52b7063ac0926926d0cc9b53ee9d7fed2
> [2/3] rtc: s5m: query platform device IRQ resource for alarm IRQ
>       commit: c70aee3dd85482c67720eb642d59ebbb9433faa5
> [3/3] mfd: sec: drop now unused struct sec_pmic_dev::irq_data
>       commit: b31583a1a9ab32923734ceb5fc95e536dfacccf7

Submitted for testing.  Pull-request to follow.

For my own reference: ib-mfd-rtc-6.20

-- 
Lee Jones [李琼斯]