linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
@ 2021-07-16 10:00 Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
                   ` (7 more replies)
  0 siblings, 8 replies; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

v3:
- Removed Fixes tag from patch 3 again

v2: 
- A number of new patches (more hardware support and a few fixes)
- Patches 1-3 have gained Fixes tags
- Patch 2 depends on 1, so maybe we can push the GPIO patch through the
  MFD tree to keep them together?
- The change in patch 7 was somewhat controversial. I've added a
  warning, but it is the last patch of the series, so it doesn't affect
  the rest of the series if it is rejected.

Matthias Schiffer (7):
  gpio: tqmx86: really make IRQ optional
  mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  mfd: tqmx86: remove incorrect TQMx90UC board ID
  mfd: tqmx86: fix typo in "platform"
  mfd: tqmx86: add support for TQMx110EB and TQMxE40x
  mfd: tqmx86: add support for TQ-Systems DMI IDs
  mfd: tqmx86: assume 24MHz LPC clock for unknown boards

 drivers/gpio/gpio-tqmx86.c |  6 ++---
 drivers/mfd/tqmx86.c       | 48 ++++++++++++++++++++++++++++++--------
 2 files changed, 41 insertions(+), 13 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-07-23 16:15   ` Linus Walleij
  2021-07-16 10:00 ` [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
causes warnings with newer kernels.

Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
missing IRQ properly.

Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2: add Fixes line
v3: no changes

 drivers/gpio/gpio-tqmx86.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-tqmx86.c b/drivers/gpio/gpio-tqmx86.c
index 5022e0ad0fae..0f5d17f343f1 100644
--- a/drivers/gpio/gpio-tqmx86.c
+++ b/drivers/gpio/gpio-tqmx86.c
@@ -238,8 +238,8 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
 	struct resource *res;
 	int ret, irq;
 
-	irq = platform_get_irq(pdev, 0);
-	if (irq < 0)
+	irq = platform_get_irq_optional(pdev, 0);
+	if (irq < 0 && irq != -ENXIO)
 		return irq;
 
 	res = platform_get_resource(pdev, IORESOURCE_IO, 0);
@@ -278,7 +278,7 @@ static int tqmx86_gpio_probe(struct platform_device *pdev)
 
 	pm_runtime_enable(&pdev->dev);
 
-	if (irq) {
+	if (irq > 0) {
 		struct irq_chip *irq_chip = &gpio->irq_chip;
 		u8 irq_status;
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-08-05 13:30   ` Lee Jones
  2021-07-16 10:00 ` [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

The driver was registering IRQ 0 when no IRQ was set. This leads to
warnings with newer kernels.

Clear the resource flags, so no resource is registered at all in this
case.

Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2: add Fixes line
v3: no changes

 drivers/mfd/tqmx86.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index ddddf08b6a4c..732013f40e4e 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -209,6 +209,8 @@ static int tqmx86_probe(struct platform_device *pdev)
 
 		/* Assumes the IRQ resource is first. */
 		tqmx_gpio_resources[0].start = gpio_irq;
+	} else {
+		tqmx_gpio_resources[0].flags = 0;
 	}
 
 	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-08-05 13:31   ` Lee Jones
  2021-07-16 10:00 ` [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
be used eventually (and if it is, how that SoM will be named).

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2: new patch
v3: remove Fixes line

 drivers/mfd/tqmx86.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 732013f40e4e..9b65dbedc1bb 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,7 +35,6 @@
 #define TQMX86_REG_BOARD_ID_E39x	7
 #define TQMX86_REG_BOARD_ID_70EB	8
 #define TQMX86_REG_BOARD_ID_80UC	9
-#define TQMX86_REG_BOARD_ID_90UC	10
 #define TQMX86_REG_BOARD_REV	0x21
 #define TQMX86_REG_IO_EXT_INT	0x26
 #define TQMX86_REG_IO_EXT_INT_NONE		0
@@ -128,8 +127,6 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 		return "TQMx70EB";
 	case TQMX86_REG_BOARD_ID_80UC:
 		return "TQMx80UC";
-	case TQMX86_REG_BOARD_ID_90UC:
-		return "TQMx90UC";
 	default:
 		return "Unknown";
 	}
@@ -142,7 +139,6 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_60EB:
 	case TQMX86_REG_BOARD_ID_70EB:
 	case TQMX86_REG_BOARD_ID_80UC:
-	case TQMX86_REG_BOARD_ID_90UC:
 		return 24000;
 	case TQMX86_REG_BOARD_ID_E39M:
 	case TQMX86_REG_BOARD_ID_E39C:
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform"
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (2 preceding siblings ...)
  2021-07-16 10:00 ` [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-08-05 13:38   ` Lee Jones
  2021-07-16 10:00 ` [PATCH v3 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
                   ` (3 subsequent siblings)
  7 siblings, 1 reply; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Rename variable from "ocores_platfom_data" to "ocores_platform_data".

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2: new patch
v3: new patch

 drivers/mfd/tqmx86.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9b65dbedc1bb..ff1bdb742e3f 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -76,7 +76,7 @@ static struct i2c_board_info tqmx86_i2c_devices[] = {
 	},
 };
 
-static struct ocores_i2c_platform_data ocores_platfom_data = {
+static struct ocores_i2c_platform_data ocores_platform_data = {
 	.num_devices = ARRAY_SIZE(tqmx86_i2c_devices),
 	.devices = tqmx86_i2c_devices,
 };
@@ -84,8 +84,8 @@ static struct ocores_i2c_platform_data ocores_platfom_data = {
 static const struct mfd_cell tqmx86_i2c_soft_dev[] = {
 	{
 		.name = "ocores-i2c",
-		.platform_data = &ocores_platfom_data,
-		.pdata_size = sizeof(ocores_platfom_data),
+		.platform_data = &ocores_platform_data,
+		.pdata_size = sizeof(ocores_platform_data),
 		.resources = tqmx_i2c_soft_resources,
 		.num_resources = ARRAY_SIZE(tqmx_i2c_soft_resources),
 	},
@@ -209,7 +209,7 @@ static int tqmx86_probe(struct platform_device *pdev)
 		tqmx_gpio_resources[0].flags = 0;
 	}
 
-	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
 
 	if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
 		err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (3 preceding siblings ...)
  2021-07-16 10:00 ` [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Add the board IDs for the TQMx110EB and the TQMxE40x family. All use a
24MHz LPC clock.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2:
- add more new modules
- explicitly list each module for LPC clock

v3: no changes

 drivers/mfd/tqmx86.c | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index ff1bdb742e3f..9eb05b3ef573 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -35,6 +35,11 @@
 #define TQMX86_REG_BOARD_ID_E39x	7
 #define TQMX86_REG_BOARD_ID_70EB	8
 #define TQMX86_REG_BOARD_ID_80UC	9
+#define TQMX86_REG_BOARD_ID_110EB	11
+#define TQMX86_REG_BOARD_ID_E40M	12
+#define TQMX86_REG_BOARD_ID_E40S	13
+#define TQMX86_REG_BOARD_ID_E40C1	14
+#define TQMX86_REG_BOARD_ID_E40C2	15
 #define TQMX86_REG_BOARD_REV	0x21
 #define TQMX86_REG_IO_EXT_INT	0x26
 #define TQMX86_REG_IO_EXT_INT_NONE		0
@@ -127,6 +132,16 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 		return "TQMx70EB";
 	case TQMX86_REG_BOARD_ID_80UC:
 		return "TQMx80UC";
+	case TQMX86_REG_BOARD_ID_110EB:
+		return "TQMx110EB";
+	case TQMX86_REG_BOARD_ID_E40M:
+		return "TQMxE40M";
+	case TQMX86_REG_BOARD_ID_E40S:
+		return "TQMxE40S";
+	case TQMX86_REG_BOARD_ID_E40C1:
+		return "TQMxE40C1";
+	case TQMX86_REG_BOARD_ID_E40C2:
+		return "TQMxE40C2";
 	default:
 		return "Unknown";
 	}
@@ -139,6 +154,11 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_60EB:
 	case TQMX86_REG_BOARD_ID_70EB:
 	case TQMX86_REG_BOARD_ID_80UC:
+	case TQMX86_REG_BOARD_ID_110EB:
+	case TQMX86_REG_BOARD_ID_E40M:
+	case TQMX86_REG_BOARD_ID_E40S:
+	case TQMX86_REG_BOARD_ID_E40C1:
+	case TQMX86_REG_BOARD_ID_E40C2:
 		return 24000;
 	case TQMX86_REG_BOARD_ID_E39M:
 	case TQMX86_REG_BOARD_ID_E39C:
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (4 preceding siblings ...)
  2021-07-16 10:00 ` [PATCH v3 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-07-16 10:00 ` [PATCH v3 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
  2021-08-16 13:02 ` [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Lee Jones
  7 siblings, 0 replies; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

Newer TQMx86 modules use TQ-Systems instead of TQ-Group as their vendor
ID.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2: new patch
v3: no changes

 drivers/mfd/tqmx86.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 9eb05b3ef573..58f35c8b5a45 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -271,6 +271,14 @@ static const struct dmi_system_id tqmx86_dmi_table[] __initconst = {
 		},
 		.callback = tqmx86_create_platform_device,
 	},
+	{
+		.ident = "TQMX86",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "TQ-Systems"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "TQMx"),
+		},
+		.callback = tqmx86_create_platform_device,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(dmi, tqmx86_dmi_table);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* [PATCH v3 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (5 preceding siblings ...)
  2021-07-16 10:00 ` [PATCH v3 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
@ 2021-07-16 10:00 ` Matthias Schiffer
  2021-08-16 13:02 ` [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Lee Jones
  7 siblings, 0 replies; 17+ messages in thread
From: Matthias Schiffer @ 2021-07-16 10:00 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Lee Jones
  Cc: Andrew Lunn, Andy Shevchenko, linux-gpio, linux-kernel,
	Matthias Schiffer

All future TQMx86 modules should use a 24MHz LPC clock. Warn about
unknown boards, but assume this is the case.

Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
---

v2:
- Separated from TQMxE40M support patch
- Add warning for unknown boards

v3: no changes

 drivers/mfd/tqmx86.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
index 58f35c8b5a45..7ae906ff8e35 100644
--- a/drivers/mfd/tqmx86.c
+++ b/drivers/mfd/tqmx86.c
@@ -147,7 +147,7 @@ static const char *tqmx86_board_id_to_name(u8 board_id)
 	}
 }
 
-static int tqmx86_board_id_to_clk_rate(u8 board_id)
+static int tqmx86_board_id_to_clk_rate(struct device *dev, u8 board_id)
 {
 	switch (board_id) {
 	case TQMX86_REG_BOARD_ID_50UC:
@@ -168,7 +168,9 @@ static int tqmx86_board_id_to_clk_rate(u8 board_id)
 	case TQMX86_REG_BOARD_ID_E38C:
 		return 33000;
 	default:
-		return 0;
+		dev_warn(dev, "unknown board %d, assuming 24MHz LPC clock\n",
+			 board_id);
+		return 24000;
 	}
 }
 
@@ -229,7 +231,7 @@ static int tqmx86_probe(struct platform_device *pdev)
 		tqmx_gpio_resources[0].flags = 0;
 	}
 
-	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
+	ocores_platform_data.clock_khz = tqmx86_board_id_to_clk_rate(dev, board_id);
 
 	if (i2c_det == TQMX86_REG_I2C_DETECT_SOFT) {
 		err = devm_mfd_add_devices(dev, PLATFORM_DEVID_NONE,
-- 
2.17.1


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-16 10:00 ` [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
@ 2021-07-23 16:15   ` Linus Walleij
  2021-08-02 15:18     ` Bartosz Golaszewski
  0 siblings, 1 reply; 17+ messages in thread
From: Linus Walleij @ 2021-07-23 16:15 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Bartosz Golaszewski, Lee Jones, Andrew Lunn, Andy Shevchenko,
	open list:GPIO SUBSYSTEM, linux-kernel

On Fri, Jul 16, 2021 at 12:01 PM Matthias Schiffer
<matthias.schiffer@ew.tq-group.com> wrote:

> The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
> causes warnings with newer kernels.
>
> Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
> missing IRQ properly.
>
> Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
>
> v2: add Fixes line
> v3: no changes

Acked-by: Linus Walleij <linus.walleij@linaro.org>

I suppose Lee will merge this into MFD with the rest of the patches?
I don't see anything stopping Bart from just merging this one patch
into the GPIO tree though. Only runtime dependencies.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional
  2021-07-23 16:15   ` Linus Walleij
@ 2021-08-02 15:18     ` Bartosz Golaszewski
  0 siblings, 0 replies; 17+ messages in thread
From: Bartosz Golaszewski @ 2021-08-02 15:18 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Matthias Schiffer, Lee Jones, Andrew Lunn, Andy Shevchenko,
	open list:GPIO SUBSYSTEM, linux-kernel

On Fri, Jul 23, 2021 at 6:16 PM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> On Fri, Jul 16, 2021 at 12:01 PM Matthias Schiffer
> <matthias.schiffer@ew.tq-group.com> wrote:
>
> > The tqmx86 MFD driver was passing IRQ 0 for "no IRQ" in the past. This
> > causes warnings with newer kernels.
> >
> > Prepare the gpio-tqmx86 driver for the fixed MFD driver by handling a
> > missing IRQ properly.
> >
> > Fixes: b868db94a6a7 ("gpio: tqmx86: Add GPIO from for this IO controller")
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> >
> > v2: add Fixes line
> > v3: no changes
>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
>
> I suppose Lee will merge this into MFD with the rest of the patches?
> I don't see anything stopping Bart from just merging this one patch
> into the GPIO tree though. Only runtime dependencies.
>
> Yours,
> Linus Walleij

I applied this patch for fixes and will shortly send a PR with some
other fixes to Linus.

Bart

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-07-16 10:00 ` [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
@ 2021-08-05 13:30   ` Lee Jones
  2021-08-05 13:40     ` Matthias Schiffer
  0 siblings, 1 reply; 17+ messages in thread
From: Lee Jones @ 2021-08-05 13:30 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> The driver was registering IRQ 0 when no IRQ was set. This leads to
> warnings with newer kernels.
> 
> Clear the resource flags, so no resource is registered at all in this
> case.
> 
> Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> 
> v2: add Fixes line
> v3: no changes
> 
>  drivers/mfd/tqmx86.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
> index ddddf08b6a4c..732013f40e4e 100644
> --- a/drivers/mfd/tqmx86.c
> +++ b/drivers/mfd/tqmx86.c
> @@ -209,6 +209,8 @@ static int tqmx86_probe(struct platform_device *pdev)
>  
>  		/* Assumes the IRQ resource is first. */
>  		tqmx_gpio_resources[0].start = gpio_irq;
> +	} else {
> +		tqmx_gpio_resources[0].flags = 0;

Strange - why is this !0 in the first place?

>  	}
>  
>  	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID
  2021-07-16 10:00 ` [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
@ 2021-08-05 13:31   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2021-08-05 13:31 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> No TQMx90UC exists at the moment, and it is undecided whether ID 10 will
> be used eventually (and if it is, how that SoM will be named).
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> 
> v2: new patch
> v3: remove Fixes line
> 
>  drivers/mfd/tqmx86.c | 4 ----
>  1 file changed, 4 deletions(-)

For my own reference (apply this as-is to your sign-off block):

  Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform"
  2021-07-16 10:00 ` [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
@ 2021-08-05 13:38   ` Lee Jones
  0 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2021-08-05 13:38 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> Rename variable from "ocores_platfom_data" to "ocores_platform_data".
> 
> Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> ---
> 
> v2: new patch
> v3: new patch

Heh?

>  drivers/mfd/tqmx86.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

For my own reference (apply this as-is to your sign-off block):

  Acked-for-MFD-by: Lee Jones <lee.jones@linaro.org>

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-08-05 13:30   ` Lee Jones
@ 2021-08-05 13:40     ` Matthias Schiffer
  2021-08-05 13:42       ` Andy Shevchenko
  0 siblings, 1 reply; 17+ messages in thread
From: Matthias Schiffer @ 2021-08-05 13:40 UTC (permalink / raw)
  To: Lee Jones
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Thu, 2021-08-05 at 14:30 +0100, Lee Jones wrote:
> On Fri, 16 Jul 2021, Matthias Schiffer wrote:
> 
> > The driver was registering IRQ 0 when no IRQ was set. This leads to
> > warnings with newer kernels.
> > 
> > Clear the resource flags, so no resource is registered at all in this
> > case.
> > 
> > Fixes: 2f17dd34ffed ("mfd: tqmx86: IO controller with I2C, Wachdog and GPIO")
> > Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
> > Reviewed-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> > 
> > v2: add Fixes line
> > v3: no changes
> > 
> >  drivers/mfd/tqmx86.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/mfd/tqmx86.c b/drivers/mfd/tqmx86.c
> > index ddddf08b6a4c..732013f40e4e 100644
> > --- a/drivers/mfd/tqmx86.c
> > +++ b/drivers/mfd/tqmx86.c
> > @@ -209,6 +209,8 @@ static int tqmx86_probe(struct platform_device *pdev)
> >  
> >  		/* Assumes the IRQ resource is first. */
> >  		tqmx_gpio_resources[0].start = gpio_irq;
> > +	} else {
> > +		tqmx_gpio_resources[0].flags = 0;
> 
> Strange - why is this !0 in the first place?

I don't see anything strange here. DEFINE_RES_IRQ() sets flags to
IORESOURCE_IRQ. We reset it to 0 when there is no IRQ to clear that
resource entry.

An alternative would be to start with an empty entry and only fill in
the fields when an IRQ is used, but that seems more cumbersome than the
current code to me.

> 
> >  	}
> >  
> >  	ocores_platfom_data.clock_khz = tqmx86_board_id_to_clk_rate(board_id);
> 
> 


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-08-05 13:40     ` Matthias Schiffer
@ 2021-08-05 13:42       ` Andy Shevchenko
  2021-08-09  7:11         ` Matthias Schiffer
  0 siblings, 1 reply; 17+ messages in thread
From: Andy Shevchenko @ 2021-08-05 13:42 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Lee Jones, Linus Walleij, Bartosz Golaszewski, Andrew Lunn,
	open list:GPIO SUBSYSTEM, Linux Kernel Mailing List

On Thu, Aug 5, 2021 at 4:40 PM Matthias Schiffer
<matthias.schiffer@ew.tq-group.com> wrote:
> On Thu, 2021-08-05 at 14:30 +0100, Lee Jones wrote:
> > On Fri, 16 Jul 2021, Matthias Schiffer wrote:

...

> > Strange - why is this !0 in the first place?
>
> I don't see anything strange here. DEFINE_RES_IRQ() sets flags to
> IORESOURCE_IRQ. We reset it to 0 when there is no IRQ to clear that
> resource entry.
>
> An alternative would be to start with an empty entry and only fill in
> the fields when an IRQ is used, but that seems more cumbersome than the
> current code to me.

Another alternative is to start using the IRQ DISABLED resource flag,
but I'm afraid that OF code is not ready for that.
https://elixir.bootlin.com/linux/latest/source/include/linux/ioport.h#L331

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
  2021-08-05 13:42       ` Andy Shevchenko
@ 2021-08-09  7:11         ` Matthias Schiffer
  0 siblings, 0 replies; 17+ messages in thread
From: Matthias Schiffer @ 2021-08-09  7:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Lee Jones, Linus Walleij, Bartosz Golaszewski, Andrew Lunn,
	open list:GPIO SUBSYSTEM, Linux Kernel Mailing List

On Thu, 2021-08-05 at 16:42 +0300, Andy Shevchenko wrote:
> On Thu, Aug 5, 2021 at 4:40 PM Matthias Schiffer
> <matthias.schiffer@ew.tq-group.com> wrote:
> > On Thu, 2021-08-05 at 14:30 +0100, Lee Jones wrote:
> > > On Fri, 16 Jul 2021, Matthias Schiffer wrote:
> 
> ...
> 
> > > Strange - why is this !0 in the first place?
> > 
> > I don't see anything strange here. DEFINE_RES_IRQ() sets flags to
> > IORESOURCE_IRQ. We reset it to 0 when there is no IRQ to clear that
> > resource entry.
> > 
> > An alternative would be to start with an empty entry and only fill in
> > the fields when an IRQ is used, but that seems more cumbersome than the
> > current code to me.
> 
> Another alternative is to start using the IRQ DISABLED resource flag,
> but I'm afraid that OF code is not ready for that.
> https://elixir.bootlin.com/linux/latest/source/include/linux/ioport.h#L331
> 

As this patch is a fairly simple bugfix, I'd prefer to get it (or a
similar fix) applied without having to wait for improvements of the
core code - also for the sake of stable backports.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support
  2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
                   ` (6 preceding siblings ...)
  2021-07-16 10:00 ` [PATCH v3 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
@ 2021-08-16 13:02 ` Lee Jones
  7 siblings, 0 replies; 17+ messages in thread
From: Lee Jones @ 2021-08-16 13:02 UTC (permalink / raw)
  To: Matthias Schiffer
  Cc: Linus Walleij, Bartosz Golaszewski, Andrew Lunn, Andy Shevchenko,
	linux-gpio, linux-kernel

On Fri, 16 Jul 2021, Matthias Schiffer wrote:

> v3:
> - Removed Fixes tag from patch 3 again
> 
> v2: 
> - A number of new patches (more hardware support and a few fixes)
> - Patches 1-3 have gained Fixes tags
> - Patch 2 depends on 1, so maybe we can push the GPIO patch through the
>   MFD tree to keep them together?
> - The change in patch 7 was somewhat controversial. I've added a
>   warning, but it is the last patch of the series, so it doesn't affect
>   the rest of the series if it is rejected.
> 
> Matthias Schiffer (7):
>   gpio: tqmx86: really make IRQ optional

>   mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set
>   mfd: tqmx86: remove incorrect TQMx90UC board ID
>   mfd: tqmx86: fix typo in "platform"
>   mfd: tqmx86: add support for TQMx110EB and TQMxE40x
>   mfd: tqmx86: add support for TQ-Systems DMI IDs
>   mfd: tqmx86: assume 24MHz LPC clock for unknown boards

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2021-08-16 13:02 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 10:00 [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Matthias Schiffer
2021-07-16 10:00 ` [PATCH v3 1/7] gpio: tqmx86: really make IRQ optional Matthias Schiffer
2021-07-23 16:15   ` Linus Walleij
2021-08-02 15:18     ` Bartosz Golaszewski
2021-07-16 10:00 ` [PATCH v3 2/7] mfd: tqmx86: clear GPIO IRQ resource when no IRQ is set Matthias Schiffer
2021-08-05 13:30   ` Lee Jones
2021-08-05 13:40     ` Matthias Schiffer
2021-08-05 13:42       ` Andy Shevchenko
2021-08-09  7:11         ` Matthias Schiffer
2021-07-16 10:00 ` [PATCH v3 3/7] mfd: tqmx86: remove incorrect TQMx90UC board ID Matthias Schiffer
2021-08-05 13:31   ` Lee Jones
2021-07-16 10:00 ` [PATCH v3 4/7] mfd: tqmx86: fix typo in "platform" Matthias Schiffer
2021-08-05 13:38   ` Lee Jones
2021-07-16 10:00 ` [PATCH v3 5/7] mfd: tqmx86: add support for TQMx110EB and TQMxE40x Matthias Schiffer
2021-07-16 10:00 ` [PATCH v3 6/7] mfd: tqmx86: add support for TQ-Systems DMI IDs Matthias Schiffer
2021-07-16 10:00 ` [PATCH v3 7/7] mfd: tqmx86: assume 24MHz LPC clock for unknown boards Matthias Schiffer
2021-08-16 13:02 ` [PATCH v3 0/7] TQMx86: TQMx110EB and TQMxE40x MFD/GPIO support Lee Jones

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).