drivers/base/regmap/regmap-irq.c | 8 +- drivers/gpio/Kconfig | 6 + drivers/gpio/gpio-pcie-idio-24.c | 677 +++++++++++-------------------- drivers/gpio/gpio-ws16c48.c | 552 +++++++++---------------- include/linux/regmap.h | 6 +- 5 files changed, 447 insertions(+), 802 deletions(-)
Changes in v6: - Wrap lines to 80 characters rather than 100 for set_type_config() - Remove regmap_config max_register lines as superfluous - Enable use_raw_spinlock to prevent deadlocks when running -rt kernels - Check regmap_update_bit() ret value before goto exit_unlock - Rename exit_early label to the more descriptive exit_unlock - Add sparse annotations for lock acquire/release in ws16c48_handle_pre_irq() and ws16c48_handle_post_irq() - Explicitly add 0 to WS16C48_ENAB in ws16c48_irq_init_hw() for sake of symmetry to match the other WS16C48_ENAB operations Changes in v5: - Refactor for map parameter removal from handle_mask_sync() - Cleanups and line wrappings to 100 characters rather than 80 - Adjust to change mutex/spinlock_t type locks to raw_spin_lock_t type - Remove pex8311_intcsr table configurations as superfluous - Adjust to set pex8311_intcsr_regmap_config reg_base to PLX_PEX8311_PCI_LCS_INTCSR - Rename PAGE_FIELD_PAGE_* defines to POL_PAGE, ENAB_PAGE, and INT_ID_PAGE Changes in v4: - Allocate idio24gpio before using it in idio_24_probe() Changes in v3: - Drop map from set_type_config() parameter list; regmap can be passed by irq_drv_data instead - Adjust idio_24_set_type_config() for parameter list - Add mutex to prevent clobbering the COS_ENABLE register when masking IRQ and setting their type configuration Changes in v2: - Simplify PCIe-IDIO-24 register offset defines to remove superfluous arithmetic - Check for NULL pointer after chip->irq_drv_data allocation - Set gpio_regmap drvdata and use gpio_regmap_get_drvdata() to get the regmap in idio_24_reg_map_xlate() The regmap API supports IO port accessors so we can take advantage of regmap abstractions rather than handling access to the device registers directly in the driver. A patch to pass irq_drv_data as a parameter for struct regmap_irq_chip set_type_config() is included. This is needed by the idio_24_set_type_config() and ws16c48_set_type_config() callbacks in order to update the type configuration on their respective devices. This patchset depends on the "Drop map from handle_mask_sync() parameters" patchset [0]. [0] https://lore.kernel.org/all/cover.1679323449.git.william.gray@linaro.org/ William Breathitt Gray (3): regmap: Pass irq_drv_data as a parameter for set_type_config() gpio: pcie-idio-24: Migrate to the regmap API gpio: ws16c48: Migrate to the regmap API drivers/base/regmap/regmap-irq.c | 8 +- drivers/gpio/Kconfig | 6 + drivers/gpio/gpio-pcie-idio-24.c | 677 +++++++++++-------------------- drivers/gpio/gpio-ws16c48.c | 552 +++++++++---------------- include/linux/regmap.h | 6 +- 5 files changed, 447 insertions(+), 802 deletions(-) base-commit: 7b59bdbc3965ca8add53e084af394c13a2be22a8 prerequisite-patch-id: cd19046150b7cff1be4ac7152198777aa960a3df prerequisite-patch-id: bd3e3830d9ce4f3876a77483364d7190b7fdffa7 -- 2.39.2
On Wed, Apr 5, 2023 at 5:45 PM William Breathitt Gray <william.gray@linaro.org> wrote: > Changes in v6: Excellent and persevere work, Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Yours, Linus Walleij
On Wed, Apr 05, 2023 at 11:45:41AM -0400, William Breathitt Gray wrote: > Changes in v6: > - Wrap lines to 80 characters rather than 100 for set_type_config() > - Remove regmap_config max_register lines as superfluous > - Enable use_raw_spinlock to prevent deadlocks when running -rt kernels > - Check regmap_update_bit() ret value before goto exit_unlock > - Rename exit_early label to the more descriptive exit_unlock > - Add sparse annotations for lock acquire/release in > ws16c48_handle_pre_irq() and ws16c48_handle_post_irq() > - Explicitly add 0 to WS16C48_ENAB in ws16c48_irq_init_hw() for sake of > symmetry to match the other WS16C48_ENAB operations > Changes in v5: > - Refactor for map parameter removal from handle_mask_sync() > - Cleanups and line wrappings to 100 characters rather than 80 > - Adjust to change mutex/spinlock_t type locks to raw_spin_lock_t type > - Remove pex8311_intcsr table configurations as superfluous > - Adjust to set pex8311_intcsr_regmap_config reg_base to > PLX_PEX8311_PCI_LCS_INTCSR > - Rename PAGE_FIELD_PAGE_* defines to POL_PAGE, ENAB_PAGE, and > INT_ID_PAGE > Changes in v4: > - Allocate idio24gpio before using it in idio_24_probe() > Changes in v3: > - Drop map from set_type_config() parameter list; regmap can be passed > by irq_drv_data instead > - Adjust idio_24_set_type_config() for parameter list > - Add mutex to prevent clobbering the COS_ENABLE register when masking > IRQ and setting their type configuration > Changes in v2: > - Simplify PCIe-IDIO-24 register offset defines to remove superfluous > arithmetic > - Check for NULL pointer after chip->irq_drv_data allocation > - Set gpio_regmap drvdata and use gpio_regmap_get_drvdata() to get the > regmap in idio_24_reg_map_xlate() > > The regmap API supports IO port accessors so we can take advantage of > regmap abstractions rather than handling access to the device registers > directly in the driver. > > A patch to pass irq_drv_data as a parameter for struct regmap_irq_chip > set_type_config() is included. This is needed by the > idio_24_set_type_config() and ws16c48_set_type_config() callbacks in > order to update the type configuration on their respective devices. > > This patchset depends on the "Drop map from handle_mask_sync() > parameters" patchset [0]. > > [0] https://lore.kernel.org/all/cover.1679323449.git.william.gray@linaro.org/ Looks good to me now. Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> It might be that regmap locks are unnecessary, but as far as I understood dropping them would require more intrusion into the regmap APIs along with GPIO regmap implementation. > William Breathitt Gray (3): > regmap: Pass irq_drv_data as a parameter for set_type_config() > gpio: pcie-idio-24: Migrate to the regmap API > gpio: ws16c48: Migrate to the regmap API > > drivers/base/regmap/regmap-irq.c | 8 +- > drivers/gpio/Kconfig | 6 + > drivers/gpio/gpio-pcie-idio-24.c | 677 +++++++++++-------------------- > drivers/gpio/gpio-ws16c48.c | 552 +++++++++---------------- > include/linux/regmap.h | 6 +- > 5 files changed, 447 insertions(+), 802 deletions(-) > > > base-commit: 7b59bdbc3965ca8add53e084af394c13a2be22a8 > prerequisite-patch-id: cd19046150b7cff1be4ac7152198777aa960a3df > prerequisite-patch-id: bd3e3830d9ce4f3876a77483364d7190b7fdffa7 > -- > 2.39.2 > -- With Best Regards, Andy Shevchenko
On Wed, 05 Apr 2023 11:45:41 -0400, William Breathitt Gray wrote:
> Changes in v6:
> - Wrap lines to 80 characters rather than 100 for set_type_config()
> - Remove regmap_config max_register lines as superfluous
> - Enable use_raw_spinlock to prevent deadlocks when running -rt kernels
> - Check regmap_update_bit() ret value before goto exit_unlock
> - Rename exit_early label to the more descriptive exit_unlock
> - Add sparse annotations for lock acquire/release in
> ws16c48_handle_pre_irq() and ws16c48_handle_post_irq()
> - Explicitly add 0 to WS16C48_ENAB in ws16c48_irq_init_hw() for sake of
> symmetry to match the other WS16C48_ENAB operations
> Changes in v5:
> - Refactor for map parameter removal from handle_mask_sync()
> - Cleanups and line wrappings to 100 characters rather than 80
> - Adjust to change mutex/spinlock_t type locks to raw_spin_lock_t type
> - Remove pex8311_intcsr table configurations as superfluous
> - Adjust to set pex8311_intcsr_regmap_config reg_base to
> PLX_PEX8311_PCI_LCS_INTCSR
> - Rename PAGE_FIELD_PAGE_* defines to POL_PAGE, ENAB_PAGE, and
> INT_ID_PAGE
> Changes in v4:
> - Allocate idio24gpio before using it in idio_24_probe()
> Changes in v3:
> - Drop map from set_type_config() parameter list; regmap can be passed
> by irq_drv_data instead
> - Adjust idio_24_set_type_config() for parameter list
> - Add mutex to prevent clobbering the COS_ENABLE register when masking
> IRQ and setting their type configuration
> Changes in v2:
> - Simplify PCIe-IDIO-24 register offset defines to remove superfluous
> arithmetic
> - Check for NULL pointer after chip->irq_drv_data allocation
> - Set gpio_regmap drvdata and use gpio_regmap_get_drvdata() to get the
> regmap in idio_24_reg_map_xlate()
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/3] regmap: Pass irq_drv_data as a parameter for set_type_config()
commit: 7697c64b9e4908196f0ae68aa6d423dd40607973
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
© 2016 - 2026 Red Hat, Inc.