From: William Breathitt Gray <william.gray@linaro.org>
To: linus.walleij@linaro.org, brgl@bgdev.pl
Cc: andriy.shevchenko@linux.intel.com, linux-gpio@vger.kernel.org,
linux-kernel@vger.kernel.org, michael@walle.cc,
broonie@kernel.org,
William Breathitt Gray <william.gray@linaro.org>
Subject: [PATCH v3 0/9] Migrate i8255 GPIO drivers to regmap API
Date: Tue, 22 Nov 2022 02:10:57 -0500 [thread overview]
Message-ID: <cover.1669100542.git.william.gray@linaro.org> (raw)
Changes in v3:
- Changed handle_mask_sync description to show range using a more
typical mathematical notation ('[' changed to ')')
- Split addition of new i8255 library regmap interface and removal of
old i8255 library interface to separate patches
- Split migration of 104-dio-48e, 104-idi-48, and gpio-mm modules to
regmap-irq, gpio-regmap, and new i8255 library interface to separate
patches
- Simplified logic in dio48e_handle_mask_sync(); the previous version
separated the conditional evaluations from the if statements which
made it more complicated than it needed to be
- Removed initial interrupt clearing in dio48e_probe(); superfluous
because clear_on_unmask is set to true so the interrupts will be
cleared anyway later.
- Replace IDI48_IRQ_REG with IDI48_IRQ_STATUS and IDI48_IRQ_ENABLE to
make the intent of this register clear
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. The 104-dio-48e and gpio-mm modules depend on
the i8255 library and are thus updated accordingly.
The 104-IDI-48 is hardwired as an input-only device. Because the i8255
control registers are not exposed on the 104-IDI-48, the i8255 library
doesn't provide much benefit here. In this case it's simpler to utilize
the gpio_regmap API directly, so this patch series does such and removes
the i8255 library dependency from the 104-idi-48 module.
The first patch in this series adjusts gpio_regmap to always set
gpio_chip get_direction. This patch is larger independent of the rest of
the patches in the series and can be picked up separately if desired.
I'm including it here because it allows the input-only 104-idi-48 driver
to continue reporting offset directions after migrating to gpio_regmap.
A handle_mask_sync() callback is introduced for the regmap_irq API. This
is used by the 104-dio-48e driver to handle its enable/disable interrupt
functionality. The 104-DIO-48E has a single register to handle
enabling/disabling interrupts: a write of any value to this register
enables interrupts, while any read disables interrupts.
By leveraging the gpio_regmap API, the i8255 library is reduced to
simply a devm_i8255_regmap_register() function, a configuration
structure struct i8255_regmap_config, and a helper macro
i8255_volatile_regmap_range() provided to simplify volatile PPI register
hinting for the regmap.
The regmap_irq API is leveraged by the 104-idi-48 and 104-dio-48e
modules to support their IRQ functionality. Do their respective regmap
configurations need use_hwlock set to true in this case, or is adequate
locking already handled by the regmap_irq API?
William Breathitt Gray (9):
gpio: regmap: Always set gpio_chip get_direction
regmap-irq: Add handle_mask_sync() callback
gpio: 104-dio-48e: Migrate to the regmap-irq API
gpio: 104-idi-48: Migrate to the regmap-irq API
gpio: 104-idi-48: Migrate to gpio-regmap API
gpio: i8255: Migrate to gpio-regmap API
gpio: 104-dio-48e: Migrate to regmap API
gpio: gpio-mm: Migrate to regmap API
gpio: i8255: Remove unused legacy interface
drivers/base/regmap/regmap-irq.c | 44 +++-
drivers/gpio/Kconfig | 5 +-
drivers/gpio/gpio-104-dio-48e.c | 395 ++++++++++---------------------
drivers/gpio/gpio-104-idi-48.c | 325 ++++++++-----------------
drivers/gpio/gpio-gpio-mm.c | 153 +++---------
drivers/gpio/gpio-i8255.c | 320 +++++++------------------
drivers/gpio/gpio-i8255.h | 54 ++---
drivers/gpio/gpio-regmap.c | 7 +-
include/linux/regmap.h | 5 +
9 files changed, 412 insertions(+), 896 deletions(-)
base-commit: 3687a82b1db1c827cc4b367e3efde3235f68d9f6
--
2.38.1
next reply other threads:[~2022-11-23 14:26 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 7:10 William Breathitt Gray [this message]
2022-11-22 7:10 ` [PATCH v3 1/9] gpio: regmap: Always set gpio_chip get_direction William Breathitt Gray
2022-11-22 7:10 ` [PATCH v3 2/9] regmap-irq: Add handle_mask_sync() callback William Breathitt Gray
2022-11-22 7:11 ` [PATCH v3 3/9] gpio: 104-dio-48e: Migrate to the regmap-irq API William Breathitt Gray
2022-11-23 15:01 ` Andy Shevchenko
2022-11-22 10:29 ` William Breathitt Gray
2022-11-27 18:31 ` Michael Walle
2022-11-27 22:00 ` William Breathitt Gray
2022-11-28 9:51 ` Andy Shevchenko
2022-11-28 9:56 ` Andy Shevchenko
2022-11-28 10:04 ` Andy Shevchenko
2022-11-28 9:41 ` Andy Shevchenko
2022-11-28 9:56 ` Michael Walle
2022-11-28 10:02 ` Andy Shevchenko
2022-11-22 7:11 ` [PATCH v3 4/9] gpio: 104-idi-48: " William Breathitt Gray
2022-11-23 17:28 ` Andy Shevchenko
2022-11-22 7:11 ` [PATCH v3 5/9] gpio: 104-idi-48: Migrate to gpio-regmap API William Breathitt Gray
2022-11-23 17:31 ` Andy Shevchenko
2022-11-22 7:11 ` [PATCH v3 6/9] gpio: i8255: " William Breathitt Gray
2022-11-23 17:42 ` Andy Shevchenko
2022-11-22 11:34 ` William Breathitt Gray
2022-11-22 7:11 ` [PATCH v3 7/9] gpio: 104-dio-48e: Migrate to regmap API William Breathitt Gray
2022-11-23 17:43 ` Andy Shevchenko
2022-11-22 7:11 ` [PATCH v3 8/9] gpio: gpio-mm: " William Breathitt Gray
2022-11-23 17:46 ` Andy Shevchenko
2022-11-22 7:11 ` [PATCH v3 9/9] gpio: i8255: Remove unused legacy interface William Breathitt Gray
2022-11-23 17:31 ` Andy Shevchenko
2022-12-09 18:59 ` (subset) [PATCH v3 0/9] Migrate i8255 GPIO drivers to regmap API Mark Brown
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=cover.1669100542.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=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
/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).