[PATCH v5 00/12] drivers: gpio: and the QIXIS FPGA GPIO controller

Ioana Ciornei posted 12 patches 1 week, 2 days ago
.../bindings/board/fsl,fpga-qixis-i2c.yaml    |  58 ++++++++++
.../bindings/board/fsl,fpga-qixis.yaml        |  10 ++
.../bindings/gpio/trivial-gpio.yaml           |   2 +
.../boot/dts/freescale/fsl-ls1046a-qds.dts    |  52 +++++++++
.../boot/dts/freescale/fsl-lx2160a-rdb.dts    |  78 +++++++++++++
drivers/gpio/Kconfig                          |   9 ++
drivers/gpio/Makefile                         |   1 +
drivers/gpio/gpio-qixis-fpga.c                | 107 ++++++++++++++++++
drivers/gpio/gpio-regmap.c                    |  28 ++++-
drivers/mfd/simple-mfd-i2c.c                  |   7 +-
include/linux/gpio/regmap.h                   |   5 +
11 files changed, 351 insertions(+), 6 deletions(-)
create mode 100644 drivers/gpio/gpio-qixis-fpga.c
[PATCH v5 00/12] drivers: gpio: and the QIXIS FPGA GPIO controller
Posted by Ioana Ciornei 1 week, 2 days ago
This patch set adds support for the GPIO controllers on the QIXIS FPGAs
found on some Layerscape boards such as LX2160ARDB and LS1046AQDS. At
the same time it describes the SFP+ cages found on these boards, which
are the users of those GPIO lines.

Before actually adding the GPIO driver, patches #2 and #3 add and
describe a new compatible string - fsl,lx2160ardb-fpga - which would be
used for the QIXIS FPGA found on the LX2160ARDB board. As opposed to the
other compatible strings found in fsl,fpga-qixis-i2c.yaml, the
fsl,lx2160ardb-fpga imposes a unit address for its child devices. This
will be used in the next patches when the gpio controller node will
define its unit address as the address of its underlying register offset
inside the FPGA. This requirement is described in the yaml file and it
only affects the newly added compatible.

Moving on to the GPIO subsystem, patch #4 is extending the gpio-regmap
with the fixed_direction_output bitmap which could be used by user
drivers to transmit directly the fixed direction of all the GPIO lines.

Even though this patch set touches multiple subsytems, each with their
own tree, I submit everything at once so that we can have a clear
picture on the overall intention. The hope is that each subsystem can
pick up the related patches since there is no compile time dependency
between them.

Please note that CHECK_DTBS will fail without the following fixup patch.
https://lore.kernel.org/all/20250912165916.3098215-1-ioana.ciornei@nxp.com/

Changes in v2:
- 1/9: Used the newly added trivial-gpio.yaml file
- 1/9: Removed redundant "bindings" from commit title
- 1/9: Added only one compatible string for the gpio controllers on
  LX2160ARDB since both registers have the same layout.
- 2/9: Enforce a unit address on the child gpios nodes (remove the ?)
- 2/9: Enforce the use of unit addresses by having #address-size and
  #size-cells only for the newly added fsl,lx2160ardb-fpga compatible
- 4/9: Add the fixed_direction_output bitmap to the gpio_regmap_config
- 5/9: Use the newly added .fixed_direction_output bitmap
  representing the fixed direction of the GPIO lines.
- 6/9: Use the same compatible string for both GPIO controller nodes.

Changes in v3:
- 2/10: Replace the trivial-gpio reference with an explicit mention of
  the accepted child gpio compatible.
- 2/10: Reword the commit message.
- 2/10: Add the 'else' case to the if statement.
- 3/10: New patch
- 5/10: Make a deep copy of the new bitmap.
- 5/10: Remove the offset check against the ngpio.
- 5/10: Added documentation for the new config field.
- 6/10: Remove 'drivers' from the commit title.
- 6/10: Remove the qixis_cpld_gpio_type enum since its not needed.
- 6/10: Remove the NULL check for device_get_match_data().
- 6/10: Use a bitmap declared on the stack as the config field passed to
  gpio-regmap.
- 9,10/10: Moved the reg property before address/cells-size.

Changes in v4:
- 2/11: Add an extra paragraph in the commit message to better explain
  the context.
- 4/11: New patch.
- 5/11: Insert the compatible so that the alphabetical order is kept.
- 6/11: Replace devres bitmap allocation with bitmap_alloc() and
  bitmap_free().

Changes in v5:
- 6/12: New patch. Fix a memory leak.
- 7/12: Rebased on top of latest linux-next, change the extra goto
  statement.

Ioana Ciornei (12):
  dt-bindings: gpio: add QIXIS FPGA based GPIO controller
  dt-bindings: fsl,fpga-qixis-i2c: add support for LX2160ARDB FPGA
  dt-bindings: fsl,fpga-qixis: describe the gpio child node found on
    LS1046AQDS
  mfd: simple-mfd-i2c: keep compatible strings in alphabetical order
  mfd: simple-mfd-i2c: add compatible string for LX2160ARDB
  gpio: regmap: fix memory leak of gpio_regmap structure
  gpio: regmap: add the .fixed_direction_output configuration parameter
  gpio: add QIXIS FPGA GPIO controller
  arm64: dts: lx2160a-rdb: describe the QIXIS FPGA and two child GPIO
    controllers
  arm64: dts: ls1046a-qds: describe the FPGA based GPIO controller
  arm64: dts: lx2160a-rdb: fully describe the two SFP+ cages
  arm64: dts: ls1046a-qds: describe the two on-board SFP+ cages

 .../bindings/board/fsl,fpga-qixis-i2c.yaml    |  58 ++++++++++
 .../bindings/board/fsl,fpga-qixis.yaml        |  10 ++
 .../bindings/gpio/trivial-gpio.yaml           |   2 +
 .../boot/dts/freescale/fsl-ls1046a-qds.dts    |  52 +++++++++
 .../boot/dts/freescale/fsl-lx2160a-rdb.dts    |  78 +++++++++++++
 drivers/gpio/Kconfig                          |   9 ++
 drivers/gpio/Makefile                         |   1 +
 drivers/gpio/gpio-qixis-fpga.c                | 107 ++++++++++++++++++
 drivers/gpio/gpio-regmap.c                    |  28 ++++-
 drivers/mfd/simple-mfd-i2c.c                  |   7 +-
 include/linux/gpio/regmap.h                   |   5 +
 11 files changed, 351 insertions(+), 6 deletions(-)
 create mode 100644 drivers/gpio/gpio-qixis-fpga.c

-- 
2.25.1
Re: (subset) [PATCH v5 00/12] drivers: gpio: and the QIXIS FPGA GPIO controller
Posted by Bartosz Golaszewski 1 week, 2 days ago
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>


On Mon, 22 Sep 2025 17:24:15 +0300, Ioana Ciornei wrote:
> This patch set adds support for the GPIO controllers on the QIXIS FPGAs
> found on some Layerscape boards such as LX2160ARDB and LS1046AQDS. At
> the same time it describes the SFP+ cages found on these boards, which
> are the users of those GPIO lines.
> 
> Before actually adding the GPIO driver, patches #2 and #3 add and
> describe a new compatible string - fsl,lx2160ardb-fpga - which would be
> used for the QIXIS FPGA found on the LX2160ARDB board. As opposed to the
> other compatible strings found in fsl,fpga-qixis-i2c.yaml, the
> fsl,lx2160ardb-fpga imposes a unit address for its child devices. This
> will be used in the next patches when the gpio controller node will
> define its unit address as the address of its underlying register offset
> inside the FPGA. This requirement is described in the yaml file and it
> only affects the newly added compatible.
> 
> [...]

It's too late into the cycle for the entire series to make the v6.18 merge
window but I queued this for fixes and will send it for v6.17.

[06/12] gpio: regmap: fix memory leak of gpio_regmap structure
        https://git.kernel.org/brgl/linux/c/3bd44edd6c55828fd4e11cb0efce5b7160bfa2de

Best regards,
-- 
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Re: (subset) [PATCH v5 00/12] drivers: gpio: and the QIXIS FPGA GPIO controller
Posted by Ioana Ciornei 1 week, 2 days ago
On Mon, Sep 22, 2025 at 04:36:11PM +0200, Bartosz Golaszewski wrote:
> From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
> 
> 
> On Mon, 22 Sep 2025 17:24:15 +0300, Ioana Ciornei wrote:
> > This patch set adds support for the GPIO controllers on the QIXIS FPGAs
> > found on some Layerscape boards such as LX2160ARDB and LS1046AQDS. At
> > the same time it describes the SFP+ cages found on these boards, which
> > are the users of those GPIO lines.
> > 
> > Before actually adding the GPIO driver, patches #2 and #3 add and
> > describe a new compatible string - fsl,lx2160ardb-fpga - which would be
> > used for the QIXIS FPGA found on the LX2160ARDB board. As opposed to the
> > other compatible strings found in fsl,fpga-qixis-i2c.yaml, the
> > fsl,lx2160ardb-fpga imposes a unit address for its child devices. This
> > will be used in the next patches when the gpio controller node will
> > define its unit address as the address of its underlying register offset
> > inside the FPGA. This requirement is described in the yaml file and it
> > only affects the newly added compatible.
> > 
> > [...]
> 
> It's too late into the cycle for the entire series to make the v6.18 merge
> window but I queued this for fixes and will send it for v6.17.
> 
> [06/12] gpio: regmap: fix memory leak of gpio_regmap structure
>         https://git.kernel.org/brgl/linux/c/3bd44edd6c55828fd4e11cb0efce5b7160bfa2de

Ok, sure.

I will re-submit after the merge window with what patches remain.

Ioana