regmap-irq: Provide IRQ resource request and release callbacks

The users which rely on regmap IRQ to create the IRQ chip may also
 want to have an additional tracking of the IRQ requests and releases.
 Provide a callback for them.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpH1IMACgkQJNaLcl1U
 h9BbqQf+Kbxx8fZTq9/B2We7wNK70hyrMB1hsnyKRGSgJXBEr+V/k5C5iG+vzFjB
 syZLwk+Ghkk+FvtQbZsBrtkbY0kPyUz0xff+X6VyJO5ylFQs27RijTPwI1MheU+o
 baSOhwRaAs8FFJdBEdC611STaxYVuJKc2Z+fKPQGp54VpD0anXjgTFTe0SP6IrnT
 H7HtbQUIP3ZTtCLH2/Fq9ZZfeCmpOkeuvr5iMv/KrSI5uv6AkB8eCoTt1gnTSnNh
 3XDkTlhT2EnoEEc2TCFi392rUcu+sv5sbld6PwaXlhJryLYz+95IXEWFYYwDL64c
 3t0ElJvBRZIoOc9Ry589ElXxPbEQFQ==
 =d+FT
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmpH1RQACgkQJNaLcl1U
 h9AUJgf/SMsHAhkFaMozi5V6fSGjc5SjLfQPSEyX6gQOrLhQ8VKCHlstsZjEamp9
 H0c/EF+4EMvQMO8FIDVSw/Na3fMuzrTDGJif6v2JQnNejT87tDG/GDH+3CRdLgYE
 zCPbpjr6rIV85zjnC3yJ4ebybWNPZJ/IV+wpKhaNxU9/x1fVLE+z0TluYrpRNZrq
 /uclUTV42OS7a0+oHq8n0Ysd1wALb5/aP6EQGZ/GTeLOPmIy2Qi93JcVkae7yzIL
 cRrT3MD6iLiDSSp+nS4bVTiH6OHNfKSU79axxECxaKciYuAtuqgJi+/094qffdCe
 7lcM6gtkLkIBvA2ZEcL1dFASBMFSVw==
 =YuSX
 -----END PGP SIGNATURE-----

regmap-irq: Provide IRQ resource request and release callbacks

The users which rely on regmap IRQ to create the IRQ chip may also
want to have an additional tracking of the IRQ requests and releases.
Provide a callback for them.
This commit is contained in:
Mark Brown 2026-07-03 16:28:16 +01:00
commit 35845da94b
2 changed files with 24 additions and 0 deletions

View File

@ -296,6 +296,26 @@ static int regmap_irq_set_wake(struct irq_data *data, unsigned int on)
return 0;
}
static int regmap_irq_reqres(struct irq_data *data)
{
struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
irq_hw_number_t hwirq = irqd_to_hwirq(data);
if (d->chip->irq_reqres)
return d->chip->irq_reqres(d->chip->irq_drv_data, hwirq);
return 0;
}
static void regmap_irq_relres(struct irq_data *data)
{
struct regmap_irq_chip_data *d = irq_data_get_irq_chip_data(data);
irq_hw_number_t hwirq = irqd_to_hwirq(data);
if (d->chip->irq_relres)
d->chip->irq_relres(d->chip->irq_drv_data, hwirq);
}
static const struct irq_chip regmap_irq_chip = {
.irq_bus_lock = regmap_irq_lock,
.irq_bus_sync_unlock = regmap_irq_sync_unlock,
@ -303,6 +323,8 @@ static const struct irq_chip regmap_irq_chip = {
.irq_enable = regmap_irq_enable,
.irq_set_type = regmap_irq_set_type,
.irq_set_wake = regmap_irq_set_wake,
.irq_request_resources = regmap_irq_reqres,
.irq_release_resources = regmap_irq_relres,
};
static inline int read_sub_irq_data(struct regmap_irq_chip_data *data,

View File

@ -1770,6 +1770,8 @@ struct regmap_irq_chip {
void *irq_drv_data);
unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
unsigned int base, int index);
int (*irq_reqres)(void *irq_drv_data, irq_hw_number_t hwirq);
void (*irq_relres)(void *irq_drv_data, irq_hw_number_t hwirq);
void *irq_drv_data;
};