[PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()

William Breathitt Gray posted 3 patches 2 years, 10 months ago
[PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by William Breathitt Gray 2 years, 10 months ago
Allow the struct regmap_irq_chip set_type_config() callback to access
irq_drv_data by passing it as a parameter.

Signed-off-by: William Breathitt Gray <william.gray@linaro.org>
---
Changes in v6:
 - Wrap lines to 80 characters rather than 100
Changes in v5:
 - Wrap lines to 100 characters rather than 80
Changes in v4: none
Changes in v3:
 - Drop map from set_type_config() parameter list; regmap can be passed
   by irq_drv_data instead
Changes in v2: none

 drivers/base/regmap/regmap-irq.c | 8 +++++---
 include/linux/regmap.h           | 6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/drivers/base/regmap/regmap-irq.c b/drivers/base/regmap/regmap-irq.c
index ff6b585b9049..362926d155a4 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -328,8 +328,8 @@ static int regmap_irq_set_type(struct irq_data *data, unsigned int type)
 	}
 
 	if (d->chip->set_type_config) {
-		ret = d->chip->set_type_config(d->config_buf, type,
-					       irq_data, reg);
+		ret = d->chip->set_type_config(d->config_buf, type, irq_data,
+					       reg, d->chip->irq_drv_data);
 		if (ret)
 			return ret;
 	}
@@ -653,13 +653,15 @@ EXPORT_SYMBOL_GPL(regmap_irq_get_irq_reg_linear);
  * @type: The requested IRQ type.
  * @irq_data: The IRQ being configured.
  * @idx: Index of the irq's config registers within each array `buf[i]`
+ * @irq_drv_data: Driver specific IRQ data
  *
  * This is a &struct regmap_irq_chip->set_type_config callback suitable for
  * chips with one config register. Register values are updated according to
  * the &struct regmap_irq_type data associated with an IRQ.
  */
 int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
-				      const struct regmap_irq *irq_data, int idx)
+				      const struct regmap_irq *irq_data,
+				      int idx, void *irq_drv_data)
 {
 	const struct regmap_irq_type *t = &irq_data->type;
 
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 8d9d601da782..18311c12c44a 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1651,7 +1651,8 @@ struct regmap_irq_chip {
 	int (*set_type_virt)(unsigned int **buf, unsigned int type,
 			     unsigned long hwirq, int reg);
 	int (*set_type_config)(unsigned int **buf, unsigned int type,
-			       const struct regmap_irq *irq_data, int idx);
+			       const struct regmap_irq *irq_data, int idx,
+			       void *irq_drv_data);
 	unsigned int (*get_irq_reg)(struct regmap_irq_chip_data *data,
 				    unsigned int base, int index);
 	void *irq_drv_data;
@@ -1660,7 +1661,8 @@ struct regmap_irq_chip {
 unsigned int regmap_irq_get_irq_reg_linear(struct regmap_irq_chip_data *data,
 					   unsigned int base, int index);
 int regmap_irq_set_type_config_simple(unsigned int **buf, unsigned int type,
-				      const struct regmap_irq *irq_data, int idx);
+				      const struct regmap_irq *irq_data,
+				      int idx, void *irq_drv_data);
 
 int regmap_add_irq_chip(struct regmap *map, int irq, int irq_flags,
 			int irq_base, const struct regmap_irq_chip *chip,
-- 
2.39.2
Re: [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by Mark Brown 2 years, 10 months ago
On Wed, Apr 05, 2023 at 11:45:42AM -0400, William Breathitt Gray wrote:
> Allow the struct regmap_irq_chip set_type_config() callback to access
> irq_drv_data by passing it as a parameter.

The following changes since commit e8d018dd0257f744ca50a729e3d042cf2ec9da65:

  Linux 6.3-rc3 (2023-03-19 13:27:55 -0700)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-set-type-irq-drv-data

for you to fetch changes up to 7697c64b9e4908196f0ae68aa6d423dd40607973:

  regmap: Pass irq_drv_data as a parameter for set_type_config() (2023-04-05 17:19:24 +0100)

----------------------------------------------------------------
regmap: Pass irq_drv_data as a parameter for set_type_config()

Allow callbacks to access irq_drv_data.

----------------------------------------------------------------
William Breathitt Gray (1):
      regmap: Pass irq_drv_data as a parameter for set_type_config()

 drivers/base/regmap/regmap-irq.c | 8 +++++---
 include/linux/regmap.h           | 6 ++++--
 2 files changed, 9 insertions(+), 5 deletions(-)
Re: [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by Bartosz Golaszewski 2 years, 10 months ago
On Thu, Apr 6, 2023 at 7:23 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Wed, Apr 05, 2023 at 11:45:42AM -0400, William Breathitt Gray wrote:
> > Allow the struct regmap_irq_chip set_type_config() callback to access
> > irq_drv_data by passing it as a parameter.
>
> The following changes since commit e8d018dd0257f744ca50a729e3d042cf2ec9da65:
>
>   Linux 6.3-rc3 (2023-03-19 13:27:55 -0700)
>
> are available in the Git repository at:
>
>   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-set-type-irq-drv-data
>
> for you to fetch changes up to 7697c64b9e4908196f0ae68aa6d423dd40607973:
>
>   regmap: Pass irq_drv_data as a parameter for set_type_config() (2023-04-05 17:19:24 +0100)
>
> ----------------------------------------------------------------
> regmap: Pass irq_drv_data as a parameter for set_type_config()
>
> Allow callbacks to access irq_drv_data.
>
> ----------------------------------------------------------------
> William Breathitt Gray (1):
>       regmap: Pass irq_drv_data as a parameter for set_type_config()
>
>  drivers/base/regmap/regmap-irq.c | 8 +++++---
>  include/linux/regmap.h           | 6 ++++--
>  2 files changed, 9 insertions(+), 5 deletions(-)

Pulled Mark's tag and applied the two remaining patches, thanks!

Bart
Re: [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by William Breathitt Gray 2 years, 10 months ago
On Fri, Apr 07, 2023 at 12:17:31PM +0200, Bartosz Golaszewski wrote:
> On Thu, Apr 6, 2023 at 7:23 PM Mark Brown <broonie@kernel.org> wrote:
> >
> > On Wed, Apr 05, 2023 at 11:45:42AM -0400, William Breathitt Gray wrote:
> > > Allow the struct regmap_irq_chip set_type_config() callback to access
> > > irq_drv_data by passing it as a parameter.
> >
> > The following changes since commit e8d018dd0257f744ca50a729e3d042cf2ec9da65:
> >
> >   Linux 6.3-rc3 (2023-03-19 13:27:55 -0700)
> >
> > are available in the Git repository at:
> >
> >   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-set-type-irq-drv-data
> >
> > for you to fetch changes up to 7697c64b9e4908196f0ae68aa6d423dd40607973:
> >
> >   regmap: Pass irq_drv_data as a parameter for set_type_config() (2023-04-05 17:19:24 +0100)
> >
> > ----------------------------------------------------------------
> > regmap: Pass irq_drv_data as a parameter for set_type_config()
> >
> > Allow callbacks to access irq_drv_data.
> >
> > ----------------------------------------------------------------
> > William Breathitt Gray (1):
> >       regmap: Pass irq_drv_data as a parameter for set_type_config()
> >
> >  drivers/base/regmap/regmap-irq.c | 8 +++++---
> >  include/linux/regmap.h           | 6 ++++--
> >  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> Pulled Mark's tag and applied the two remaining patches, thanks!
> 
> Bart

Bart, the two remaining patches still depend on the handle_mask_sync
change descripted in the cover patch [0].

Mark, are you able to Ack those patches or alternatively provide an
immutable branch with them? We need the handle_mask_sync change as well
for the idio-16 migration patchset [1].

William Breathitt Gray

[0] https://lore.kernel.org/all/cover.1679323449.git.william.gray@linaro.org/
[1] https://lore.kernel.org/all/cover.1680618405.git.william.gray@linaro.org/
Re: [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by Bartosz Golaszewski 2 years, 10 months ago
On Fri, Apr 7, 2023 at 1:40 PM William Breathitt Gray
<william.gray@linaro.org> wrote:
>
> On Fri, Apr 07, 2023 at 12:17:31PM +0200, Bartosz Golaszewski wrote:
> > On Thu, Apr 6, 2023 at 7:23 PM Mark Brown <broonie@kernel.org> wrote:
> > >
> > > On Wed, Apr 05, 2023 at 11:45:42AM -0400, William Breathitt Gray wrote:
> > > > Allow the struct regmap_irq_chip set_type_config() callback to access
> > > > irq_drv_data by passing it as a parameter.
> > >
> > > The following changes since commit e8d018dd0257f744ca50a729e3d042cf2ec9da65:
> > >
> > >   Linux 6.3-rc3 (2023-03-19 13:27:55 -0700)
> > >
> > > are available in the Git repository at:
> > >
> > >   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git tags/regmap-set-type-irq-drv-data
> > >
> > > for you to fetch changes up to 7697c64b9e4908196f0ae68aa6d423dd40607973:
> > >
> > >   regmap: Pass irq_drv_data as a parameter for set_type_config() (2023-04-05 17:19:24 +0100)
> > >
> > > ----------------------------------------------------------------
> > > regmap: Pass irq_drv_data as a parameter for set_type_config()
> > >
> > > Allow callbacks to access irq_drv_data.
> > >
> > > ----------------------------------------------------------------
> > > William Breathitt Gray (1):
> > >       regmap: Pass irq_drv_data as a parameter for set_type_config()
> > >
> > >  drivers/base/regmap/regmap-irq.c | 8 +++++---
> > >  include/linux/regmap.h           | 6 ++++--
> > >  2 files changed, 9 insertions(+), 5 deletions(-)
> >
> > Pulled Mark's tag and applied the two remaining patches, thanks!
> >
> > Bart
>
> Bart, the two remaining patches still depend on the handle_mask_sync
> change descripted in the cover patch [0].
>
> Mark, are you able to Ack those patches or alternatively provide an
> immutable branch with them? We need the handle_mask_sync change as well
> for the idio-16 migration patchset [1].
>
> William Breathitt Gray
>
> [0] https://lore.kernel.org/all/cover.1679323449.git.william.gray@linaro.org/
> [1] https://lore.kernel.org/all/cover.1680618405.git.william.gray@linaro.org/

Ok, I'll back them out.

Bart
Re: [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Posted by Mark Brown 2 years, 10 months ago
On Fri, Apr 07, 2023 at 07:39:58AM -0400, William Breathitt Gray wrote:
> On Fri, Apr 07, 2023 at 12:17:31PM +0200, Bartosz Golaszewski wrote:

> Bart, the two remaining patches still depend on the handle_mask_sync
> change descripted in the cover patch [0].

> Mark, are you able to Ack those patches or alternatively provide an
> immutable branch with them? We need the handle_mask_sync change as well
> for the idio-16 migration patchset [1].

I don't have those patches, I presume I was expecting some
change.  Please resend.