From: William Breathitt Gray <william.gray@linaro.org>
To: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>
Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Mark Brown <broonie@kernel.org>,
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 v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
Date: Wed, 5 Apr 2023 11:45:42 -0400 [thread overview]
Message-ID: <20e15cd3afae80922b7e0577c7741df86b3390c5.1680708357.git.william.gray@linaro.org> (raw)
In-Reply-To: <cover.1680708357.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 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
next prev parent reply other threads:[~2023-04-05 15:46 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 15:45 [PATCH v6 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers to the regmap API William Breathitt Gray
2023-04-05 15:45 ` William Breathitt Gray [this message]
2023-04-06 17:23 ` [PATCH v6 1/3] regmap: Pass irq_drv_data as a parameter for set_type_config() Mark Brown
2023-04-07 10:17 ` Bartosz Golaszewski
2023-04-07 11:39 ` William Breathitt Gray
2023-04-07 11:42 ` Mark Brown
2023-04-07 11:46 ` Bartosz Golaszewski
2023-04-05 15:45 ` [PATCH v6 2/3] gpio: pcie-idio-24: Migrate to the regmap API William Breathitt Gray
2023-04-05 15:45 ` [PATCH v6 3/3] gpio: ws16c48: " William Breathitt Gray
2023-04-05 16:11 ` [PATCH v6 0/3] Migrate the PCIe-IDIO-24 and WS16C48 GPIO drivers " Andy Shevchenko
2023-04-05 20:57 ` (subset) " Mark Brown
2023-04-10 22:13 ` Linus Walleij
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=20e15cd3afae80922b7e0577c7741df86b3390c5.1680708357.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
all inboxes | Powered by JetHome®