From: William Breathitt Gray <william.gray@linaro.org>
To: linus.walleij@linaro.org, brgl@bgdev.pl
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
broonie@kernel.org, andriy.shevchenko@linux.intel.com,
William Breathitt Gray <william.gray@linaro.org>,
techsupport@winsystems.com, pdemetrotion@winsystems.com,
quarium@gmail.com, jhentges@accesio.com, jay.dolan@accesio.com
Subject: [PATCH v4 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Date: Mon, 6 Mar 2023 07:59:51 -0500 [thread overview]
Message-ID: <ea1533c747c462755c6dbb8d5dc80fa29bbc96d0.1678106722.git.william.gray@linaro.org> (raw)
In-Reply-To: <cover.1678106722.git.william.gray@linaro.org>
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 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 8c903b8c9714..e489b235b36b 100644
--- a/drivers/base/regmap/regmap-irq.c
+++ b/drivers/base/regmap/regmap-irq.c
@@ -329,8 +329,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;
}
@@ -651,13 +651,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 4d10790adeb0..fb92d0ac13af 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1650,7 +1650,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;
@@ -1659,7 +1660,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
next prev parent reply other threads:[~2023-03-06 13:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-06 12:59 [PATCH v4 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers to the regmap API William Breathitt Gray
2023-03-06 12:59 ` William Breathitt Gray [this message]
2023-03-06 12:59 ` [PATCH v4 2/3] gpio: pcie-idio-24: Migrate " William Breathitt Gray
2023-03-06 14:24 ` Andy Shevchenko
2023-03-08 2:29 ` William Breathitt Gray
2023-03-06 14:33 ` Michael Walle
2023-03-06 12:59 ` [PATCH v4 3/3] gpio: ws16c48: " William Breathitt Gray
2023-03-06 14:20 ` Andy Shevchenko
2023-03-08 2:51 ` William Breathitt Gray
2023-03-08 13:06 ` Andy Shevchenko
2023-03-09 19:33 ` William Breathitt Gray
2023-03-06 14:35 ` Michael Walle
2023-03-06 14:25 ` [PATCH v4 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers " Andy Shevchenko
2023-03-08 2:11 ` William Breathitt Gray
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=ea1533c747c462755c6dbb8d5dc80fa29bbc96d0.1678106722.git.william.gray@linaro.org \
--to=william.gray@linaro.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=brgl@bgdev.pl \
--cc=broonie@kernel.org \
--cc=jay.dolan@accesio.com \
--cc=jhentges@accesio.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pdemetrotion@winsystems.com \
--cc=quarium@gmail.com \
--cc=techsupport@winsystems.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;
as well as URLs for NNTP newsgroup(s).