mbox series

[v3,00/22] mfd: adp5585: support keymap events and drop legacy Input driver

Message ID 20250512-dev-adp5589-fw-v3-0-092b14b79a88@analog.com
Headers show
Series mfd: adp5585: support keymap events and drop legacy Input driver | expand

Message

Nuno Sá via B4 Relay May 12, 2025, 12:38 p.m. UTC
Hi all,

Here it goes v3. There was some major refactoring in this version due to
Lee's and Laurent's feedback. There are some splits (and some explicit
requests) resulting in new patches being added. The biggest change is the
effort in trying to minimize the usage of specific child device bits in
the top level device (mainly stuff related to the keymap). I think now
it's fairly self contained and the only thing that we really need to
handle in the top device are the unlock and reset events as those can be
supported through both the input and gpio devices (via gpio_keys). This
results in a bit of more runtime complexity but well, that's life...

Another change is Lee's suggestion of making use of templates (for
regmap and chip specific data) and fill things up at probe.

I also refactored a bit the event handling so it's more generic now.
There were lot's of changes so odds are that I might have forgotten some
feedback and so, my apologies in advance :).

I also dropped the tags in:

patch 16/22 ("gpio: adp5585: support gpi events") as it has some
significant changes (replacing .init_valid_masks() with .request() and
.free())

Thanks!
- Nuno Sá

---
Changes in v3:
- Patch 2:
 * New patch (only add devices given in DT).
- Patch 5:
 * Don't include adp5585-keys (still not present at this point).
- Patch 6:
 * Alphabetical order for compatibles.
- Patch 7:
 * New patch. Refactor regmap_config and fill variant differences at probe.
- Patch 8:
 * Rework according to changes introduced in patch 7;
 * Drop the regs struct in this patch. 
- Patch 9:
 * New patch. Add a per chip register structure. 
- Patch 10:
 * Moved the per variant gpio register into the gpio driver;
 * Moved ADP558[59]_GPIO_{BANK_BIT} into the gpio driver;
 * Moved ADP5589_GPIO_MAX and dropped the max_{col|row}.
- Patch 11:
 * Moved the per variant pwm register into the pwm driver (hence adding a chip_info struct.
- Patch 12:
 * Renamed the -keys suffix in the unlock/reset to events as that's the code we give in dt.
- Patch 13:
 * New patch (add event handling in a more generic way).
- Patch 14:
 * Support reset and unlock events in a separate patch;
 * Reworked how these events are validated.
- Patch 15:
 * Add support for input devices in it's own patch;
 * Add a bitmap for marking pins busy so there's no overlaps between
   the input and gpio devices. 
- Patch 16:
 * Drop .init_valid_mask() and use .free() and .request() for checking
   pin availability;
 * Drop max_gpios variables as that info is now available from the top
   device;
 * Adapt events handling to the new code.
- Patch 17:
 * Moved DT pin parsing into the input driver;
 * Validate reset/unlock events that are generated by the keymap;
 * Use error instead of ret;
 * Drop call to input_set_drvdata();
 * Adapt events handling to the new code.
- Patch 20:
 * Add a comment on the reset sleep time.

- Link to v2: https://lore.kernel.org/r/20250415-dev-adp5589-fw-v2-0-3a799c3ed812@analog.com
- Link to v1: https://lore.kernel.org/r/20250313-dev-adp5589-fw-v1-0-20e80d4bd4ea@analog.com

---
Nuno Sá (22):
      dt-bindings: mfd: adp5585: ease on the required properties
      mfd: adp5585: only add devices given in FW
      mfd: adp5585: enable oscilator during probe
      pwm: adp5585: don't control OSC_EN in the pwm driver
      mfd: adp5585: make use of MFD_CELL_NAME()
      dt-bindings: mfd: adp5585: document adp5589 I/O expander
      mfd: adp5585: refactor how regmap defaults are handled
      mfd: adp5585: add support for adp5589
      mfd: adp5585: add a per chip reg struture
      gpio: adp5585: add support for the adp5589 expander
      pwm: adp5585: add support for adp5589
      dt-bindings: mfd: adp5585: add properties for input events
      mfd: adp5585: add support for event handling
      mfd: adp5585: support reset and unlock events
      mfd: adp5585: add support for input devices
      gpio: adp5585: support gpi events
      Input: adp5585: Add Analog Devices ADP5585/89 support
      Input: adp5589: remove the driver
      mfd: adp5585: support getting vdd regulator
      dt-bindings: mfd: adp5585: document reset gpio
      mfd: adp5585: add support for a reset pin
      pwm: adp5585: make sure to include mod_devicetable.h

 .../devicetree/bindings/mfd/adi,adp5585.yaml       |  240 ++++-
 .../devicetree/bindings/trivial-devices.yaml       |    2 -
 MAINTAINERS                                        |    1 +
 drivers/gpio/Kconfig                               |    1 +
 drivers/gpio/gpio-adp5585.c                        |  348 ++++++-
 drivers/input/keyboard/Kconfig                     |   21 +-
 drivers/input/keyboard/Makefile                    |    2 +-
 drivers/input/keyboard/adp5585-keys.c              |  356 +++++++
 drivers/input/keyboard/adp5589-keys.c              | 1066 --------------------
 drivers/mfd/adp5585.c                              |  794 ++++++++++++++-
 drivers/pwm/pwm-adp5585.c                          |   79 +-
 include/linux/mfd/adp5585.h                        |  148 ++-
 12 files changed, 1852 insertions(+), 1206 deletions(-)
---
base-commit: 407f60a151df3c44397e5afc0111eb9b026c38d3
change-id: 20250311-dev-adp5589-fw-e04cfd945286
--

Thanks!
- Nuno Sá