* [PATCH v3 0/3] Introduce support for Vortex GPIO pins
@ 2025-08-21 10:18 Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 10:18 UTC (permalink / raw)
To: linux-kernel
Cc: Marcos Del Sol Vives, Linus Walleij, Bartosz Golaszewski,
Michael Walle, Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
This series of patches add support for the GPIO pins exposed on the
southbridge of DM&P's Vortex86 line of SoCs, using a new GPIO driver
plus a MFD driver to automatically load the driver in supported platforms.
Marcos Del Sol Vives (3):
gpio: gpio-regmap: add flags to control some behaviour
gpio: vortex: add new GPIO device driver
mfd: vortex: implement new driver for Vortex southbridges
MAINTAINERS | 6 ++
drivers/gpio/Kconfig | 11 ++++
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-regmap.c | 17 +++++-
drivers/gpio/gpio-vortex.c | 110 ++++++++++++++++++++++++++++++++++++
drivers/mfd/Kconfig | 9 +++
drivers/mfd/Makefile | 1 +
drivers/mfd/vortex-sb.c | 81 ++++++++++++++++++++++++++
include/linux/gpio/regmap.h | 17 ++++++
include/linux/pci_ids.h | 1 +
10 files changed, 253 insertions(+), 1 deletion(-)
create mode 100644 drivers/gpio/gpio-vortex.c
create mode 100644 drivers/mfd/vortex-sb.c
--
2.34.1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 10:18 [PATCH v3 0/3] Introduce support for Vortex GPIO pins Marcos Del Sol Vives
@ 2025-08-21 10:18 ` Marcos Del Sol Vives
2025-08-21 14:32 ` Bjorn Helgaas
` (2 more replies)
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 3/3] mfd: vortex: implement new driver for Vortex southbridges Marcos Del Sol Vives
2 siblings, 3 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 10:18 UTC (permalink / raw)
To: linux-kernel
Cc: Marcos Del Sol Vives, Linus Walleij, Bartosz Golaszewski,
Michael Walle, Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
The Vortex86 family of SoCs need the direction set before the value, else
writes to the DATA ports are ignored.
This commit adds a new "flags" field plus a flag to change the default
behaviour, which is to set first the direction and then the value.
Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
---
drivers/gpio/gpio-regmap.c | 17 ++++++++++++++++-
include/linux/gpio/regmap.h | 17 +++++++++++++++++
2 files changed, 33 insertions(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
index e8a32dfebdcb..24cefbd57637 100644
--- a/drivers/gpio/gpio-regmap.c
+++ b/drivers/gpio/gpio-regmap.c
@@ -31,6 +31,7 @@ struct gpio_regmap {
unsigned int reg_clr_base;
unsigned int reg_dir_in_base;
unsigned int reg_dir_out_base;
+ unsigned int flags;
int (*reg_mask_xlate)(struct gpio_regmap *gpio, unsigned int base,
unsigned int offset, unsigned int *reg,
@@ -196,7 +197,20 @@ static int gpio_regmap_direction_input(struct gpio_chip *chip,
static int gpio_regmap_direction_output(struct gpio_chip *chip,
unsigned int offset, int value)
{
- gpio_regmap_set(chip, offset, value);
+ struct gpio_regmap *gpio = gpiochip_get_data(chip);
+ int ret;
+
+ if (gpio->flags & GPIO_REGMAP_DIR_BEFORE_SET) {
+ ret = gpio_regmap_set_direction(chip, offset, true);
+ if (ret)
+ return ret;
+
+ return gpio_regmap_set(chip, offset, value);
+ }
+
+ ret = gpio_regmap_set(chip, offset, value);
+ if (ret)
+ return ret;
return gpio_regmap_set_direction(chip, offset, true);
}
@@ -247,6 +261,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
gpio->reg_clr_base = config->reg_clr_base;
gpio->reg_dir_in_base = config->reg_dir_in_base;
gpio->reg_dir_out_base = config->reg_dir_out_base;
+ gpio->flags = config->flags;
chip = &gpio->gpio_chip;
chip->parent = config->parent;
diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
index c722c67668c6..aea107e71fec 100644
--- a/include/linux/gpio/regmap.h
+++ b/include/linux/gpio/regmap.h
@@ -12,6 +12,20 @@ struct regmap;
#define GPIO_REGMAP_ADDR_ZERO ((unsigned int)(-1))
#define GPIO_REGMAP_ADDR(addr) ((addr) ? : GPIO_REGMAP_ADDR_ZERO)
+
+/**
+ * enum gpio_regmap_flags - flags to control GPIO operation
+ */
+enum gpio_regmap_flags {
+ /**
+ * @GPIO_REGMAP_DIR_BEFORE_SET: when setting a pin as an output, set
+ * its direction before the value. The output value will be undefined
+ * for a short time which may have unwanted side effects, but some
+ * hardware requires this.
+ */
+ GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
+};
+
/**
* struct gpio_regmap_config - Description of a generic regmap gpio_chip.
* @parent: The parent device
@@ -23,6 +37,8 @@ struct regmap;
* If not given, the name of the device is used.
* @ngpio: (Optional) Number of GPIOs
* @names: (Optional) Array of names for gpios
+ * @flags: (Optional) A bitmask of flags from
+ * &enum gpio_regmap_flags
* @reg_dat_base: (Optional) (in) register base address
* @reg_set_base: (Optional) set register base address
* @reg_clr_base: (Optional) clear register base address
@@ -68,6 +84,7 @@ struct gpio_regmap_config {
const char *label;
int ngpio;
const char *const *names;
+ unsigned int flags;
unsigned int reg_dat_base;
unsigned int reg_set_base;
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-21 10:18 [PATCH v3 0/3] Introduce support for Vortex GPIO pins Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
@ 2025-08-21 10:18 ` Marcos Del Sol Vives
2025-08-21 16:48 ` Linus Walleij
2025-08-21 17:05 ` Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 3/3] mfd: vortex: implement new driver for Vortex southbridges Marcos Del Sol Vives
2 siblings, 2 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 10:18 UTC (permalink / raw)
To: linux-kernel
Cc: Marcos Del Sol Vives, Linus Walleij, Bartosz Golaszewski,
Michael Walle, Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
Add a new simple GPIO device driver for Vortex86 lines of SoCs,
implemented according to their programming reference manual [1].
This is required for detecting the status of the poweroff button and
performing the poweroff sequence on ICOP eBox computers.
IRQs are not implemented, as they are only available for ports 0 and 1,
none which are accessible on my test machine (an EBOX-3352-GLW).
[1]:
http://www.dmp.com.tw/tech/DMP_Vortex86_Series_Software_Programming_Reference_091216.pdf
Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
---
MAINTAINERS | 5 ++
drivers/gpio/Kconfig | 11 ++++
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-vortex.c | 110 +++++++++++++++++++++++++++++++++++++
4 files changed, 127 insertions(+)
create mode 100644 drivers/gpio/gpio-vortex.c
diff --git a/MAINTAINERS b/MAINTAINERS
index daf520a13bdf..8c3098a39411 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26953,6 +26953,11 @@ VOLTAGE AND CURRENT REGULATOR IRQ HELPERS
R: Matti Vaittinen <mazziesaccount@gmail.com>
F: drivers/regulator/irq_helpers.c
+VORTEX HARDWARE SUPPORT
+R: Marcos Del Sol Vives <marcos@orca.pet>
+S: Maintained
+F: drivers/gpio/gpio-vortex.c
+
VRF
M: David Ahern <dsahern@kernel.org>
L: netdev@vger.kernel.org
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index e43abb322fa6..cd2b1e105908 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -1077,6 +1077,17 @@ config GPIO_TS5500
blocks of the TS-5500: DIO1, DIO2 and the LCD port, and the TS-5600
LCD port.
+config GPIO_VORTEX
+ tristate "Vortex SoC GPIO support"
+ select REGMAP_MMIO
+ select GPIO_REGMAP
+ help
+ Driver to access the five 8-bit bidirectional GPIO ports present on
+ all DM&P Vortex SoCs.
+
+ To compile this driver as a module, choose M here: the module will
+ be called gpio-vortex.
+
config GPIO_WINBOND
tristate "Winbond Super I/O GPIO support"
select ISA_BUS_API
diff --git a/drivers/gpio/Makefile b/drivers/gpio/Makefile
index 379f55e9ed1e..7b8626c9bd75 100644
--- a/drivers/gpio/Makefile
+++ b/drivers/gpio/Makefile
@@ -197,6 +197,7 @@ obj-$(CONFIG_GPIO_VIPERBOARD) += gpio-viperboard.o
obj-$(CONFIG_GPIO_VIRTUSER) += gpio-virtuser.o
obj-$(CONFIG_GPIO_VIRTIO) += gpio-virtio.o
obj-$(CONFIG_GPIO_VISCONTI) += gpio-visconti.o
+obj-$(CONFIG_GPIO_VORTEX) += gpio-vortex.o
obj-$(CONFIG_GPIO_VX855) += gpio-vx855.o
obj-$(CONFIG_GPIO_WCD934X) += gpio-wcd934x.o
obj-$(CONFIG_GPIO_WHISKEY_COVE) += gpio-wcove.o
diff --git a/drivers/gpio/gpio-vortex.c b/drivers/gpio/gpio-vortex.c
new file mode 100644
index 000000000000..6fc184942e7f
--- /dev/null
+++ b/drivers/gpio/gpio-vortex.c
@@ -0,0 +1,110 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * GPIO driver for Vortex86 SoCs
+ *
+ * Author: Marcos Del Sol Vives <marcos@orca.pet>
+ */
+
+#include <linux/types.h>
+#include <linux/errno.h>
+#include <linux/module.h>
+#include <linux/ioport.h>
+#include <linux/spinlock.h>
+#include <linux/gpio/driver.h>
+#include <linux/gpio/regmap.h>
+#include <linux/regmap.h>
+#include <linux/ioport.h>
+#include <linux/types.h>
+#include <linux/platform_device.h>
+
+#define DAT_RANGE 0
+#define DIR_RANGE 1
+
+struct vortex_gpio {
+ struct regmap_range ranges[2];
+ struct regmap_access_table access_table;
+};
+
+static int vortex_gpio_probe(struct platform_device *pdev)
+{
+ struct gpio_regmap_config gpiocfg = {};
+ struct resource *dat_res, *dir_res;
+ struct device *dev = &pdev->dev;
+ struct regmap_config rmcfg = {};
+ unsigned long io_start, io_end;
+ struct vortex_gpio *priv;
+ struct regmap *map;
+ void __iomem *regs;
+
+ dat_res = platform_get_resource_byname(pdev, IORESOURCE_IO, "dat");
+ if (unlikely(!dat_res)) {
+ dev_err(dev, "failed to get data register\n");
+ return -ENODEV;
+ }
+
+ dir_res = platform_get_resource_byname(pdev, IORESOURCE_IO, "dir");
+ if (unlikely(!dir_res)) {
+ dev_err(dev, "failed to get direction register\n");
+ return -ENODEV;
+ }
+
+ if (unlikely(resource_size(dat_res) != resource_size(dir_res))) {
+ dev_err(dev, "data and direction size mismatch\n");
+ return -EINVAL;
+ }
+
+ priv = devm_kzalloc(&pdev->dev, sizeof(struct vortex_gpio),
+ GFP_KERNEL);
+ if (unlikely(!priv))
+ return -ENOMEM;
+ pdev->dev.driver_data = priv;
+
+ /* Map an I/O window that covers both data and direction */
+ io_start = min(dat_res->start, dir_res->start);
+ io_end = max(dat_res->end, dir_res->end);
+ regs = devm_ioport_map(dev, io_start, io_end - io_start + 1);
+ if (unlikely(!regs))
+ return -ENOMEM;
+
+ /* Dynamically build access table from gpiocfg */
+ priv->ranges[DAT_RANGE].range_min = dat_res->start - io_start;
+ priv->ranges[DAT_RANGE].range_max = dat_res->end - io_start;
+ priv->ranges[DIR_RANGE].range_min = dir_res->start - io_start;
+ priv->ranges[DIR_RANGE].range_max = dir_res->end - io_start;
+ priv->access_table.n_yes_ranges = ARRAY_SIZE(priv->ranges);
+ priv->access_table.yes_ranges = priv->ranges;
+
+ rmcfg.reg_bits = 8;
+ rmcfg.val_bits = 8;
+ rmcfg.io_port = true;
+ rmcfg.wr_table = &priv->access_table;
+ rmcfg.rd_table = &priv->access_table;
+
+ map = devm_regmap_init_mmio(dev, regs, &rmcfg);
+ if (unlikely(IS_ERR(map)))
+ return dev_err_probe(dev, PTR_ERR(map),
+ "Unable to initialize register map\n");
+
+ gpiocfg.parent = dev;
+ gpiocfg.regmap = map;
+ gpiocfg.ngpio = 8 * resource_size(dat_res);
+ gpiocfg.ngpio_per_reg = 8;
+ gpiocfg.reg_dat_base = GPIO_REGMAP_ADDR(priv->ranges[DAT_RANGE].range_min);
+ gpiocfg.reg_set_base = GPIO_REGMAP_ADDR(priv->ranges[DAT_RANGE].range_min);
+ gpiocfg.reg_dir_out_base = GPIO_REGMAP_ADDR(priv->ranges[DIR_RANGE].range_min);
+ gpiocfg.flags = GPIO_REGMAP_DIR_BEFORE_SET;
+
+ return PTR_ERR_OR_ZERO(devm_gpio_regmap_register(dev, &gpiocfg));
+}
+
+static struct platform_driver vortex_gpio_driver = {
+ .driver.name = "vortex-gpio",
+ .probe = vortex_gpio_probe,
+};
+
+module_platform_driver(vortex_gpio_driver);
+
+MODULE_AUTHOR("Marcos Del Sol Vives <marcos@orca.pet>");
+MODULE_DESCRIPTION("GPIO driver for Vortex86 SoCs");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:vortex-gpio");
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH v3 3/3] mfd: vortex: implement new driver for Vortex southbridges
2025-08-21 10:18 [PATCH v3 0/3] Introduce support for Vortex GPIO pins Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
@ 2025-08-21 10:18 ` Marcos Del Sol Vives
2 siblings, 0 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 10:18 UTC (permalink / raw)
To: linux-kernel
Cc: Marcos Del Sol Vives, Linus Walleij, Bartosz Golaszewski,
Michael Walle, Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
This new driver loads resources related to southbridges available in DM&P
Vortex devices, currently only the GPIO pins.
Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
---
MAINTAINERS | 1 +
drivers/mfd/Kconfig | 9 +++++
drivers/mfd/Makefile | 1 +
drivers/mfd/vortex-sb.c | 81 +++++++++++++++++++++++++++++++++++++++++
include/linux/pci_ids.h | 1 +
5 files changed, 93 insertions(+)
create mode 100644 drivers/mfd/vortex-sb.c
diff --git a/MAINTAINERS b/MAINTAINERS
index 8c3098a39411..bc0c541309dd 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -26957,6 +26957,7 @@ VORTEX HARDWARE SUPPORT
R: Marcos Del Sol Vives <marcos@orca.pet>
S: Maintained
F: drivers/gpio/gpio-vortex.c
+F: drivers/mfd/vortex-sb.c
VRF
M: David Ahern <dsahern@kernel.org>
diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
index 425c5fba6cb1..fe54bb22687d 100644
--- a/drivers/mfd/Kconfig
+++ b/drivers/mfd/Kconfig
@@ -2008,6 +2008,15 @@ config MFD_VX855
VIA VX855/VX875 south bridge. You will need to enable the vx855_spi
and/or vx855_gpio drivers for this to do anything useful.
+config MFD_VORTEX_SB
+ tristate "Vortex southbridge"
+ select MFD_CORE
+ depends on PCI
+ help
+ Say yes here if you want to have support for the southbridge
+ present on Vortex SoCs. You will need to enable the vortex-gpio
+ driver for this to do anything useful.
+
config MFD_ARIZONA
select REGMAP
select REGMAP_IRQ
diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
index f7bdedd5a66d..2504ba311f1a 100644
--- a/drivers/mfd/Makefile
+++ b/drivers/mfd/Makefile
@@ -202,6 +202,7 @@ obj-$(CONFIG_MFD_JANZ_CMODIO) += janz-cmodio.o
obj-$(CONFIG_MFD_TPS6586X) += tps6586x.o
obj-$(CONFIG_MFD_VX855) += vx855.o
obj-$(CONFIG_MFD_WL1273_CORE) += wl1273-core.o
+obj-$(CONFIG_MFD_VORTEX_SB) += vortex-sb.o
si476x-core-y := si476x-cmd.o si476x-prop.o si476x-i2c.o
obj-$(CONFIG_MFD_SI476X_CORE) += si476x-core.o
diff --git a/drivers/mfd/vortex-sb.c b/drivers/mfd/vortex-sb.c
new file mode 100644
index 000000000000..ef9bbe2d3870
--- /dev/null
+++ b/drivers/mfd/vortex-sb.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * MFD southbridge driver for Vortex SoCs
+ *
+ * Author: Marcos Del Sol Vives <marcos@orca.pet>
+ *
+ * Based on the RDC321x MFD driver by Florian Fainelli and Bernhard Loos
+ */
+
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/pci.h>
+#include <linux/mfd/core.h>
+
+static const struct resource vortex_gpio_resources[] = {
+ {
+ .name = "dat",
+ .start = 0x78,
+ .end = 0x7C,
+ .flags = IORESOURCE_IO,
+ }, {
+ .name = "dir",
+ .start = 0x98,
+ .end = 0x9C,
+ .flags = IORESOURCE_IO,
+ }
+};
+
+static const struct mfd_cell vortex_sb_cells[] = {
+ {
+ .name = "vortex-gpio",
+ .resources = vortex_gpio_resources,
+ .num_resources = ARRAY_SIZE(vortex_gpio_resources),
+ },
+};
+
+static int vortex_sb_probe(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
+{
+ int err;
+
+ /*
+ * In the Vortex86DX3, the southbridge appears twice (on both 00:07.0
+ * and 00:07.1). Register only once for .0.
+ *
+ * Other Vortex boards (eg Vortex86MX+) have the southbridge exposed
+ * only once, also at 00:07.0.
+ */
+ if (PCI_FUNC(pdev->devfn) != 0)
+ return -ENODEV;
+
+ err = pci_enable_device(pdev);
+ if (err) {
+ dev_err(&pdev->dev, "failed to enable device\n");
+ return err;
+ }
+
+ return devm_mfd_add_devices(&pdev->dev, -1,
+ vortex_sb_cells,
+ ARRAY_SIZE(vortex_sb_cells),
+ NULL, 0, NULL);
+}
+
+static const struct pci_device_id vortex_sb_table[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_RDC, PCI_DEVICE_ID_RDC_R6035) },
+ {}
+};
+MODULE_DEVICE_TABLE(pci, vortex_sb_table);
+
+static struct pci_driver vortex_sb_driver = {
+ .name = "vortex-sb",
+ .id_table = vortex_sb_table,
+ .probe = vortex_sb_probe,
+};
+
+module_pci_driver(vortex_sb_driver);
+
+MODULE_AUTHOR("Marcos Del Sol Vives <marcos@orca.pet>");
+MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Vortex MFD southbridge driver");
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 92ffc4373f6d..2ff8a593ef72 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2412,6 +2412,7 @@
#define PCI_VENDOR_ID_RDC 0x17f3
#define PCI_DEVICE_ID_RDC_R6020 0x6020
#define PCI_DEVICE_ID_RDC_R6030 0x6030
+#define PCI_DEVICE_ID_RDC_R6035 0x6035
#define PCI_DEVICE_ID_RDC_R6040 0x6040
#define PCI_DEVICE_ID_RDC_R6060 0x6060
#define PCI_DEVICE_ID_RDC_R6061 0x6061
--
2.34.1
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
@ 2025-08-21 14:32 ` Bjorn Helgaas
2025-08-21 17:14 ` Marcos Del Sol Vives
2025-08-21 16:40 ` Linus Walleij
2025-08-22 3:27 ` kernel test robot
2 siblings, 1 reply; 16+ messages in thread
From: Bjorn Helgaas @ 2025-08-21 14:32 UTC (permalink / raw)
To: Marcos Del Sol Vives
Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, Michael Walle,
Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
Not my area, but consider making the subject more specific, e.g.,
"add flag to set direction before value"
On Thu, Aug 21, 2025 at 12:18:57PM +0200, Marcos Del Sol Vives wrote:
> The Vortex86 family of SoCs need the direction set before the value, else
> writes to the DATA ports are ignored.
>
> This commit adds a new "flags" field plus a flag to change the default
> behaviour, which is to set first the direction and then the value.
This sounds like the default behavior is to set direction, then value.
But from the patch, it looks like:
- default: set value, then direction
- with GPIO_REGMAP_DIR_BEFORE_SET: set direction, then value
> Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
> ---
> drivers/gpio/gpio-regmap.c | 17 ++++++++++++++++-
> include/linux/gpio/regmap.h | 17 +++++++++++++++++
> 2 files changed, 33 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpio/gpio-regmap.c b/drivers/gpio/gpio-regmap.c
> index e8a32dfebdcb..24cefbd57637 100644
> --- a/drivers/gpio/gpio-regmap.c
> +++ b/drivers/gpio/gpio-regmap.c
> @@ -31,6 +31,7 @@ struct gpio_regmap {
> unsigned int reg_clr_base;
> unsigned int reg_dir_in_base;
> unsigned int reg_dir_out_base;
> + unsigned int flags;
>
> int (*reg_mask_xlate)(struct gpio_regmap *gpio, unsigned int base,
> unsigned int offset, unsigned int *reg,
> @@ -196,7 +197,20 @@ static int gpio_regmap_direction_input(struct gpio_chip *chip,
> static int gpio_regmap_direction_output(struct gpio_chip *chip,
> unsigned int offset, int value)
> {
> - gpio_regmap_set(chip, offset, value);
> + struct gpio_regmap *gpio = gpiochip_get_data(chip);
> + int ret;
> +
> + if (gpio->flags & GPIO_REGMAP_DIR_BEFORE_SET) {
> + ret = gpio_regmap_set_direction(chip, offset, true);
> + if (ret)
> + return ret;
> +
> + return gpio_regmap_set(chip, offset, value);
> + }
> +
> + ret = gpio_regmap_set(chip, offset, value);
> + if (ret)
> + return ret;
>
> return gpio_regmap_set_direction(chip, offset, true);
> }
> @@ -247,6 +261,7 @@ struct gpio_regmap *gpio_regmap_register(const struct gpio_regmap_config *config
> gpio->reg_clr_base = config->reg_clr_base;
> gpio->reg_dir_in_base = config->reg_dir_in_base;
> gpio->reg_dir_out_base = config->reg_dir_out_base;
> + gpio->flags = config->flags;
>
> chip = &gpio->gpio_chip;
> chip->parent = config->parent;
> diff --git a/include/linux/gpio/regmap.h b/include/linux/gpio/regmap.h
> index c722c67668c6..aea107e71fec 100644
> --- a/include/linux/gpio/regmap.h
> +++ b/include/linux/gpio/regmap.h
> @@ -12,6 +12,20 @@ struct regmap;
> #define GPIO_REGMAP_ADDR_ZERO ((unsigned int)(-1))
> #define GPIO_REGMAP_ADDR(addr) ((addr) ? : GPIO_REGMAP_ADDR_ZERO)
>
> +
> +/**
> + * enum gpio_regmap_flags - flags to control GPIO operation
> + */
> +enum gpio_regmap_flags {
> + /**
> + * @GPIO_REGMAP_DIR_BEFORE_SET: when setting a pin as an output, set
> + * its direction before the value. The output value will be undefined
> + * for a short time which may have unwanted side effects, but some
> + * hardware requires this.
> + */
> + GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
> +};
> +
> /**
> * struct gpio_regmap_config - Description of a generic regmap gpio_chip.
> * @parent: The parent device
> @@ -23,6 +37,8 @@ struct regmap;
> * If not given, the name of the device is used.
> * @ngpio: (Optional) Number of GPIOs
> * @names: (Optional) Array of names for gpios
> + * @flags: (Optional) A bitmask of flags from
> + * &enum gpio_regmap_flags
> * @reg_dat_base: (Optional) (in) register base address
> * @reg_set_base: (Optional) set register base address
> * @reg_clr_base: (Optional) clear register base address
> @@ -68,6 +84,7 @@ struct gpio_regmap_config {
> const char *label;
> int ngpio;
> const char *const *names;
> + unsigned int flags;
>
> unsigned int reg_dat_base;
> unsigned int reg_set_base;
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
2025-08-21 14:32 ` Bjorn Helgaas
@ 2025-08-21 16:40 ` Linus Walleij
2025-08-22 7:07 ` Michael Walle
2025-08-22 3:27 ` kernel test robot
2 siblings, 1 reply; 16+ messages in thread
From: Linus Walleij @ 2025-08-21 16:40 UTC (permalink / raw)
To: Marcos Del Sol Vives
Cc: linux-kernel, Bartosz Golaszewski, Michael Walle, Lee Jones,
Bjorn Helgaas, linux-gpio, linux-pci
On Thu, Aug 21, 2025 at 12:19 PM Marcos Del Sol Vives <marcos@orca.pet> wrote:
> static int gpio_regmap_direction_output(struct gpio_chip *chip,
> unsigned int offset, int value)
> {
> - gpio_regmap_set(chip, offset, value);
> + struct gpio_regmap *gpio = gpiochip_get_data(chip);
> + int ret;
> +
> + if (gpio->flags & GPIO_REGMAP_DIR_BEFORE_SET) {
> + ret = gpio_regmap_set_direction(chip, offset, true);
> + if (ret)
> + return ret;
> +
> + return gpio_regmap_set(chip, offset, value);
> + }
> +
> + ret = gpio_regmap_set(chip, offset, value);
> + if (ret)
> + return ret;
>
> return gpio_regmap_set_direction(chip, offset, true);
I guess this looks like this because it is just copied from
gpio-mmio.c:
static int bgpio_simple_dir_out(struct gpio_chip *gc, unsigned int gpio,
int val)
{
gc->set(gc, gpio, val);
return bgpio_dir_return(gc, gpio, true);
}
It's hard to know which semantic to employ here, it's one
way or the other.
I like the new flag.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
You can merge this with the rest of the series.
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
@ 2025-08-21 16:48 ` Linus Walleij
2025-08-21 17:05 ` Marcos Del Sol Vives
1 sibling, 0 replies; 16+ messages in thread
From: Linus Walleij @ 2025-08-21 16:48 UTC (permalink / raw)
To: Marcos Del Sol Vives
Cc: linux-kernel, Bartosz Golaszewski, Michael Walle, Lee Jones,
Bjorn Helgaas, linux-gpio, linux-pci
On Thu, Aug 21, 2025 at 12:19 PM Marcos Del Sol Vives <marcos@orca.pet> wrote:
> Add a new simple GPIO device driver for Vortex86 lines of SoCs,
> implemented according to their programming reference manual [1].
>
> This is required for detecting the status of the poweroff button and
> performing the poweroff sequence on ICOP eBox computers.
>
> IRQs are not implemented, as they are only available for ports 0 and 1,
> none which are accessible on my test machine (an EBOX-3352-GLW).
>
> [1]:
> http://www.dmp.com.tw/tech/DMP_Vortex86_Series_Software_Programming_Reference_091216.pdf
>
> Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
Wow this driver got really compact with gpio regmap!
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
2025-08-21 16:48 ` Linus Walleij
@ 2025-08-21 17:05 ` Marcos Del Sol Vives
2025-08-22 15:47 ` Bjorn Helgaas
1 sibling, 1 reply; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 17:05 UTC (permalink / raw)
To: linux-kernel
Cc: Linus Walleij, Bartosz Golaszewski, Michael Walle, Lee Jones,
Bjorn Helgaas, linux-gpio, linux-pci
El 21/08/2025 a las 12:18, Marcos Del Sol Vives escribió:
> +#include <linux/types.h>
> +#include <linux/errno.h>
> +#include <linux/module.h>
> +#include <linux/ioport.h>
> +#include <linux/spinlock.h>
> +#include <linux/gpio/driver.h>
> +#include <linux/gpio/regmap.h>
> +#include <linux/regmap.h>
> +#include <linux/ioport.h>
> +#include <linux/types.h>
> +#include <linux/platform_device.h>
I realized now that, despite checking over and over the patches before
sending to the mailing list, I forgot to clean up leftover includes from
previous versions of the driver.
I am fairly new to this procedure of merging patches. Should I later, after
a send a sensible amount of time has passed to let everyone voice their
opinion, send a new v4 version of the patch to fix these (and also clarify
the commit message on the regmap-gpio, as requested in another email),
or if accepted would maybe the person merging it sort this out?
Sorry for the mess,
Marcos
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 14:32 ` Bjorn Helgaas
@ 2025-08-21 17:14 ` Marcos Del Sol Vives
0 siblings, 0 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-21 17:14 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, Michael Walle,
Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
El 21/08/2025 a las 16:32, Bjorn Helgaas escribió:
> Not my area, but consider making the subject more specific, e.g.,
> "add flag to set direction before value"
>
> On Thu, Aug 21, 2025 at 12:18:57PM +0200, Marcos Del Sol Vives wrote:
>> The Vortex86 family of SoCs need the direction set before the value, else
>> writes to the DATA ports are ignored.
>>
>> This commit adds a new "flags" field plus a flag to change the default
>> behaviour, which is to set first the direction and then the value.
>
> This sounds like the default behavior is to set direction, then value.
> But from the patch, it looks like:
>
> - default: set value, then direction
>
> - with GPIO_REGMAP_DIR_BEFORE_SET: set direction, then value
>
Noted, thanks for the feedback! I've amended the commit and now it reads:
> gpio: gpio-regmap: add flag to set direction before value
>
> When configuring a pin as an output, the gpio-regmap driver by default
> writes first to the the value register, and then configures the direction.
>
> The Vortex86 family of SoCs, however, need the direction set before the
> value, else writes to the data ports are ignored.
>
> This commit adds a new "flags" field plus a flag to reverse that order,
> allowing the direction to be set before the value.
Hope that looks more clear!
Thanks,
Marcos
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
2025-08-21 14:32 ` Bjorn Helgaas
2025-08-21 16:40 ` Linus Walleij
@ 2025-08-22 3:27 ` kernel test robot
2025-08-22 11:11 ` Marcos Del Sol Vives
2 siblings, 1 reply; 16+ messages in thread
From: kernel test robot @ 2025-08-22 3:27 UTC (permalink / raw)
To: Marcos Del Sol Vives, linux-kernel
Cc: llvm, oe-kbuild-all, Marcos Del Sol Vives, Linus Walleij,
Bartosz Golaszewski, Michael Walle, Lee Jones, Bjorn Helgaas,
linux-gpio, linux-pci
Hi Marcos,
kernel test robot noticed the following build errors:
[auto build test ERROR on brgl/gpio/for-next]
[also build test ERROR on lee-mfd/for-mfd-next lee-mfd/for-mfd-fixes pci/next pci/for-linus linus/master v6.17-rc2 next-20250821]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/Marcos-Del-Sol-Vives/gpio-gpio-regmap-add-flags-to-control-some-behaviour/20250821-182416
base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
patch link: https://lore.kernel.org/r/20250821101902.626329-2-marcos%40orca.pet
patch subject: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
config: x86_64-buildonly-randconfig-001-20250822 (https://download.01.org/0day-ci/archive/20250822/202508221142.ETxcEpjA-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250822/202508221142.ETxcEpjA-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508221142.ETxcEpjA-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from drivers/gpio/gpio-fxl6408.c:11:
>> include/linux/gpio/regmap.h:26:31: error: call to undeclared function 'BIT'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
26 | GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
| ^
>> include/linux/gpio/regmap.h:26:31: error: expression is not an integer constant expression
26 | GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
| ^~~~~~
In file included from drivers/gpio/gpio-fxl6408.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:20:
In file included from include/linux/elf.h:6:
In file included from arch/x86/include/asm/elf.h:10:
In file included from arch/x86/include/asm/ia32.h:7:
In file included from include/linux/compat.h:17:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:98:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
98 | return (set->sig[3] | set->sig[2] |
| ^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
24 | unsigned long sig[_NSIG_WORDS];
| ^
In file included from drivers/gpio/gpio-fxl6408.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:20:
In file included from include/linux/elf.h:6:
In file included from arch/x86/include/asm/elf.h:10:
In file included from arch/x86/include/asm/ia32.h:7:
In file included from include/linux/compat.h:17:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:98:25: warning: array index 2 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
98 | return (set->sig[3] | set->sig[2] |
| ^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
24 | unsigned long sig[_NSIG_WORDS];
| ^
In file included from drivers/gpio/gpio-fxl6408.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:20:
In file included from include/linux/elf.h:6:
In file included from arch/x86/include/asm/elf.h:10:
In file included from arch/x86/include/asm/ia32.h:7:
In file included from include/linux/compat.h:17:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:99:4: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
99 | set->sig[1] | set->sig[0]) == 0;
| ^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
24 | unsigned long sig[_NSIG_WORDS];
| ^
In file included from drivers/gpio/gpio-fxl6408.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:20:
In file included from include/linux/elf.h:6:
In file included from arch/x86/include/asm/elf.h:10:
In file included from arch/x86/include/asm/ia32.h:7:
In file included from include/linux/compat.h:17:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:101:11: warning: array index 1 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
101 | return (set->sig[1] | set->sig[0]) == 0;
| ^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
24 | unsigned long sig[_NSIG_WORDS];
| ^
In file included from drivers/gpio/gpio-fxl6408.c:12:
In file included from include/linux/i2c.h:13:
In file included from include/linux/acpi.h:14:
In file included from include/linux/device.h:32:
In file included from include/linux/device/driver.h:21:
In file included from include/linux/module.h:20:
In file included from include/linux/elf.h:6:
In file included from arch/x86/include/asm/elf.h:10:
In file included from arch/x86/include/asm/ia32.h:7:
In file included from include/linux/compat.h:17:
In file included from include/linux/fs.h:34:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:6:
include/linux/signal.h:114:11: warning: array index 3 is past the end of the array (that has type 'const unsigned long[1]') [-Warray-bounds]
114 | return (set1->sig[3] == set2->sig[3]) &&
| ^ ~
arch/x86/include/asm/signal.h:24:2: note: array 'sig' declared here
vim +/BIT +26 include/linux/gpio/regmap.h
14
15
16 /**
17 * enum gpio_regmap_flags - flags to control GPIO operation
18 */
19 enum gpio_regmap_flags {
20 /**
21 * @GPIO_REGMAP_DIR_BEFORE_SET: when setting a pin as an output, set
22 * its direction before the value. The output value will be undefined
23 * for a short time which may have unwanted side effects, but some
24 * hardware requires this.
25 */
> 26 GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
27 };
28
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-21 16:40 ` Linus Walleij
@ 2025-08-22 7:07 ` Michael Walle
2025-08-22 11:04 ` Marcos Del Sol Vives
0 siblings, 1 reply; 16+ messages in thread
From: Michael Walle @ 2025-08-22 7:07 UTC (permalink / raw)
To: Linus Walleij, Marcos Del Sol Vives
Cc: linux-kernel, Bartosz Golaszewski, Lee Jones, Bjorn Helgaas,
linux-gpio, linux-pci
[-- Attachment #1: Type: text/plain, Size: 1310 bytes --]
Hi,
On Thu Aug 21, 2025 at 6:40 PM CEST, Linus Walleij wrote:
> On Thu, Aug 21, 2025 at 12:19 PM Marcos Del Sol Vives <marcos@orca.pet> wrote:
>
> > static int gpio_regmap_direction_output(struct gpio_chip *chip,
> > unsigned int offset, int value)
> > {
> > - gpio_regmap_set(chip, offset, value);
> > + struct gpio_regmap *gpio = gpiochip_get_data(chip);
> > + int ret;
> > +
> > + if (gpio->flags & GPIO_REGMAP_DIR_BEFORE_SET) {
> > + ret = gpio_regmap_set_direction(chip, offset, true);
> > + if (ret)
> > + return ret;
> > +
> > + return gpio_regmap_set(chip, offset, value);
> > + }
> > +
> > + ret = gpio_regmap_set(chip, offset, value);
> > + if (ret)
> > + return ret;
Could you add a short paragraph to the commit message that you've
added error checking? Something like:
While at it, add the missing error check in
gpio_regmap_direction_output().
> >
> > return gpio_regmap_set_direction(chip, offset, true);
>
> I guess this looks like this because it is just copied from
> gpio-mmio.c:
Yeah probably :)
With that above fixed:
Reviewed-by: Michael Walle <mwalle@kernel.org>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 297 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-22 7:07 ` Michael Walle
@ 2025-08-22 11:04 ` Marcos Del Sol Vives
0 siblings, 0 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-22 11:04 UTC (permalink / raw)
To: Michael Walle, Linus Walleij
Cc: linux-kernel, Bartosz Golaszewski, Lee Jones, Bjorn Helgaas,
linux-gpio, linux-pci
El 22/08/2025 a las 9:07, Michael Walle escribió:
>>> + ret = gpio_regmap_set(chip, offset, value);
>>> + if (ret)
>>> + return ret;
>
> Could you add a short paragraph to the commit message that you've
> added error checking? Something like:
>
> While at it, add the missing error check in
> gpio_regmap_direction_output().
>
Added! Thanks for the feedback!
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
2025-08-22 3:27 ` kernel test robot
@ 2025-08-22 11:11 ` Marcos Del Sol Vives
0 siblings, 0 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-22 11:11 UTC (permalink / raw)
To: kernel test robot, linux-kernel
Cc: llvm, oe-kbuild-all, Linus Walleij, Bartosz Golaszewski,
Michael Walle, Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
El 22/08/2025 a las 5:27, kernel test robot escribió:
> Hi Marcos,
>
> kernel test robot noticed the following build errors:
>
> [auto build test ERROR on brgl/gpio/for-next]
> [also build test ERROR on lee-mfd/for-mfd-next lee-mfd/for-mfd-fixes pci/next pci/for-linus linus/master v6.17-rc2 next-20250821]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
>
> url: https://github.com/intel-lab-lkp/linux/commits/Marcos-Del-Sol-Vives/gpio-gpio-regmap-add-flags-to-control-some-behaviour/20250821-182416
> base: https://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git gpio/for-next
> patch link: https://lore.kernel.org/r/20250821101902.626329-2-marcos%40orca.pet
> patch subject: [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour
> config: x86_64-buildonly-randconfig-001-20250822 (https://download.01.org/0day-ci/archive/20250822/202508221142.ETxcEpjA-lkp@intel.com/config)
> compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250822/202508221142.ETxcEpjA-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202508221142.ETxcEpjA-lkp@intel.com/
>
> All errors (new ones prefixed by >>):
>
> In file included from drivers/gpio/gpio-fxl6408.c:11:
>>> include/linux/gpio/regmap.h:26:31: error: call to undeclared function 'BIT'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
> 26 | GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
> | ^
>>> include/linux/gpio/regmap.h:26:31: error: expression is not an integer constant expression
> 26 | GPIO_REGMAP_DIR_BEFORE_SET = BIT(0),
> | ^~~~~~
> In file included from drivers/gpio/gpio-fxl6408.c:12:
> In file included from include/linux/i2c.h:13:
> In file included from include/linux/acpi.h:14:
> In file included from include/linux/device.h:32:
> In file included from include/linux/device/driver.h:21:
> In file included from include/linux/module.h:20:
> In file included from include/linux/elf.h:6:
> In file included from arch/x86/include/asm/elf.h:10:
> In file included from arch/x86/include/asm/ia32.h:7:
> In file included from include/linux/compat.h:17:
> In file included from include/linux/fs.h:34:
> In file included from include/linux/percpu-rwsem.h:7:
> In file included from include/linux/rcuwait.h:6:
> In file included from include/linux/sched/signal.h:6:
> include/linux/signal.h:98:11: warning: array index 3 is past the end of the array (that has type 'unsigned long[1]') [-Warray-bounds]
This is correct, thanks. I added a missing "#include <linux/bits.h>" to
fix it. Will be in a v4 of the patch set.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-21 17:05 ` Marcos Del Sol Vives
@ 2025-08-22 15:47 ` Bjorn Helgaas
2025-08-22 15:49 ` Bjorn Helgaas
0 siblings, 1 reply; 16+ messages in thread
From: Bjorn Helgaas @ 2025-08-22 15:47 UTC (permalink / raw)
To: Marcos Del Sol Vives
Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, Michael Walle,
Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
On Thu, Aug 21, 2025 at 07:05:16PM +0200, Marcos Del Sol Vives wrote:
> El 21/08/2025 a las 12:18, Marcos Del Sol Vives escribió:
> > +#include <linux/types.h>
> > +#include <linux/errno.h>
> > +#include <linux/module.h>
> > +#include <linux/ioport.h>
> > +#include <linux/spinlock.h>
> > +#include <linux/gpio/driver.h>
> > +#include <linux/gpio/regmap.h>
> > +#include <linux/regmap.h>
> > +#include <linux/ioport.h>
> > +#include <linux/types.h>
> > +#include <linux/platform_device.h>
>
> I realized now that, despite checking over and over the patches before
> sending to the mailing list, I forgot to clean up leftover includes from
> previous versions of the driver.
>
> I am fairly new to this procedure of merging patches. Should I later, after
> a send a sensible amount of time has passed to let everyone voice their
> opinion, send a new v4 version of the patch to fix these (and also clarify
> the commit message on the regmap-gpio, as requested in another email),
> or if accepted would maybe the person merging it sort this out?
I'm not the person to merge this, but my advice is to wait a few days
and post a v4 that cleans up the includes and updates the commit
messages. It makes the process cleaner if the patch you post is the
same as the one that gets merged.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-22 15:47 ` Bjorn Helgaas
@ 2025-08-22 15:49 ` Bjorn Helgaas
2025-08-22 16:08 ` Marcos Del Sol Vives
0 siblings, 1 reply; 16+ messages in thread
From: Bjorn Helgaas @ 2025-08-22 15:49 UTC (permalink / raw)
To: Marcos Del Sol Vives
Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, Michael Walle,
Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
On Fri, Aug 22, 2025 at 10:47:20AM -0500, Bjorn Helgaas wrote:
> On Thu, Aug 21, 2025 at 07:05:16PM +0200, Marcos Del Sol Vives wrote:
> > El 21/08/2025 a las 12:18, Marcos Del Sol Vives escribió:
> > > +#include <linux/types.h>
> > > +#include <linux/errno.h>
> > > +#include <linux/module.h>
> > > +#include <linux/ioport.h>
> > > +#include <linux/spinlock.h>
> > > +#include <linux/gpio/driver.h>
> > > +#include <linux/gpio/regmap.h>
> > > +#include <linux/regmap.h>
> > > +#include <linux/ioport.h>
> > > +#include <linux/types.h>
> > > +#include <linux/platform_device.h>
> >
> > I realized now that, despite checking over and over the patches before
> > sending to the mailing list, I forgot to clean up leftover includes from
> > previous versions of the driver.
> >
> > I am fairly new to this procedure of merging patches. Should I later, after
> > a send a sensible amount of time has passed to let everyone voice their
> > opinion, send a new v4 version of the patch to fix these (and also clarify
> > the commit message on the regmap-gpio, as requested in another email),
> > or if accepted would maybe the person merging it sort this out?
>
> I'm not the person to merge this, but my advice is to wait a few days
> and post a v4 that cleans up the includes and updates the commit
> messages. It makes the process cleaner if the patch you post is the
> same as the one that gets merged.
Sorry for the noise, should have read farther through my email :)
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH v3 2/3] gpio: vortex: add new GPIO device driver
2025-08-22 15:49 ` Bjorn Helgaas
@ 2025-08-22 16:08 ` Marcos Del Sol Vives
0 siblings, 0 replies; 16+ messages in thread
From: Marcos Del Sol Vives @ 2025-08-22 16:08 UTC (permalink / raw)
To: Bjorn Helgaas
Cc: linux-kernel, Linus Walleij, Bartosz Golaszewski, Michael Walle,
Lee Jones, Bjorn Helgaas, linux-gpio, linux-pci
El 22/08/2025 a las 17:49, Bjorn Helgaas escribió:
> On Fri, Aug 22, 2025 at 10:47:20AM -0500, Bjorn Helgaas wrote:
>> I'm not the person to merge this, but my advice is to wait a few days
>> and post a v4 that cleans up the includes and updates the commit
>> messages. It makes the process cleaner if the patch you post is the
>> same as the one that gets merged.
>
> Sorry for the noise, should have read farther through my email :)
No problem, thanks for clarifying!
I would've waited for a couple days more to give more time for review
before the v4 if it was just minor styling details, but I found a nasty
surprise yesterday in the DX3 programming manual (I was using the SX/MX/DX
manual before): it has two discontinuous ranges for data and two
discontinuous ranges for direction, and the icing on top is that
*all four ranges have different sizes*.
So as it was a pretty big change I wanted to have a new one with support
for that for review asap :)
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-08-22 16:16 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-21 10:18 [PATCH v3 0/3] Introduce support for Vortex GPIO pins Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 1/3] gpio: gpio-regmap: add flags to control some behaviour Marcos Del Sol Vives
2025-08-21 14:32 ` Bjorn Helgaas
2025-08-21 17:14 ` Marcos Del Sol Vives
2025-08-21 16:40 ` Linus Walleij
2025-08-22 7:07 ` Michael Walle
2025-08-22 11:04 ` Marcos Del Sol Vives
2025-08-22 3:27 ` kernel test robot
2025-08-22 11:11 ` Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 2/3] gpio: vortex: add new GPIO device driver Marcos Del Sol Vives
2025-08-21 16:48 ` Linus Walleij
2025-08-21 17:05 ` Marcos Del Sol Vives
2025-08-22 15:47 ` Bjorn Helgaas
2025-08-22 15:49 ` Bjorn Helgaas
2025-08-22 16:08 ` Marcos Del Sol Vives
2025-08-21 10:18 ` [PATCH v3 3/3] mfd: vortex: implement new driver for Vortex southbridges Marcos Del Sol Vives
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).