Migrate i8255 GPIO drivers to regmap API
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest8 patches 1 replyIn review
- v49 patches 4 repliesSuperseded
- v39 patches 18 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 22 replies | Superseded | |
| v1 | 3 patches | 4 replies | Superseded |
Changes in v5 from the cover letter
- Add REGMAP_MMIO Kconfig selection for GPIO_104_DIO_48E, GPIO_104_IDI_48, and GPIO_GPIO_MM
- Replace magic number 0x3 with GENMASK(1, 0) to make intent clear in the dio48e_handle_mask_sync() function
- Write (instead of read) to clear interrupts on unmask; although the datasheet lists the respective register as read/write, all other references state that this should be a write operation to clear
Patches in v5 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | gpio: regmap: Always set gpio_chip get_directiondrivers/ | +6 | 0 replies | |
| 2/8 | gpio: 104-dio-48e: Migrate to the regmap-irq APIdrivers/ drivers/ | +135 | 0 replies | |
| 3/8 | gpio: 104-idi-48: Migrate to the regmap-irq APIdrivers/ drivers/ | +93 | 0 replies | |
| 4/8 | gpio: 104-idi-48: Migrate to gpio-regmap APIdrivers/ drivers/ | +21 | 0 replies | |
| 5/8 | gpio: i8255: Migrate to gpio-regmap APIdrivers/ drivers/ drivers/ | +136 | 0 replies | |
| 6/8 | gpio: 104-dio-48e: Migrate to regmap APIdrivers/ | +7 | 0 replies | |
| 7/8 | gpio: gpio-mm: Migrate to regmap APIdrivers/ drivers/ | +31 | 0 replies | |
| 8/8 | gpio: i8255: Remove unused legacy interfacedrivers/ drivers/ | +1 | 0 replies |
Reviews trailers per patch
All 8 patches have a Reviewed-by or Acked-by.
| Patch | Andy Shevchenko | Michael Walle |
|---|---|---|
| 1/8 | R-b | A-b |
| 2/8 | R-b | |
| 3/8 | R-b | |
| 4/8 | R-b | |
| 5/8 | R-b | |
| 6/8 | R-b | |
| 7/8 | R-b | |
| 8/8 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v5 0/8] Migrate i8255 GPIO drivers to regmap API
Changes in v5:
- Add REGMAP_MMIO Kconfig selection for GPIO_104_DIO_48E, GPIO_104_IDI_48, and GPIO_GPIO_MM
- Replace magic number 0x3 with GENMASK(1, 0) to make intent clear in the dio48e_handle_mask_sync() function
- Write (instead of read) to clear interrupts on unmask; although the datasheet lists the respective register as read/write, all other references state that this should be a write operation to 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 mostly 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.
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 (8):
gpio: regmap: Always set gpio_chip get_direction
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/gpio/Kconfig | 8 +- drivers/gpio/gpio-104-dio-48e.c | 398 +++++++++++--------------------- drivers/gpio/gpio-104-idi-48.c | 336 +++++++++------------------ drivers/gpio/gpio-gpio-mm.c | 154 +++--------- drivers/gpio/gpio-i8255.c | 320 +++++++------------------ drivers/gpio/gpio-i8255.h | 54 ++--- drivers/gpio/gpio-regmap.c | 7 +- 7 files changed, 390 insertions(+), 887 deletions(-)
base-commit: 1b929c02afd37871d5afb9d498426f83432e71c2
Signature · 1 line
2.38.1