Skip to contentSkip to conversation

leds: simatic-ipc-leds-gpio: split up

PATCH Superseded Henning Schild 4 participants 29 messages Mar 1, 2023 – May 15, 2023

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v2 cover leds: simatic-ipc-leds-gpio: split up

changes since v1:
- move from header- to -core.c-based implementation
- style changes from review

This series mainly splits the one GPIO driver into two. The split allows to clearly model runtime and compile time dependencies on the GPIO chip drivers.

p1 is kind of not too related to that split but also prepares for more GPIO based drivers to come.

p2 takes the driver we had and puts some of its content into a -core, to be used by the two drivers.

p3 deals with more fine-grained configuration posibilities and compile time dependencies.

It is based on
[PATCH v4] leds: simatic-ipc-leds-gpio: make sure we have the GPIO providing driver

Henning Schild (3):
leds: simatic-ipc-leds-gpio: move two extra gpio pins into another
table
leds: simatic-ipc-leds-gpio: split up into multiple drivers
leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

 drivers/leds/simple/Kconfig                   |  31 +++-
 drivers/leds/simple/Makefile                  |   5 +-
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 ++++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 +++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 ++++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 139 ------------------
 drivers/leds/simple/simatic-ipc-leds-gpio.h   |  22 +++
 drivers/platform/x86/simatic-ipc.c            |   7 +-
 8 files changed, 288 insertions(+), 147 deletions(-)
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-core.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c
 delete mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.h
Signature · 1 line
2.39.2
#1 lore raw

PATCH v2 1/3 leds: simatic-ipc-leds-gpio: move two extra gpio pins into another table

There are two special pins needed to init the LEDs. We used to have them at the end of the gpiod_lookup table to give to "leds-gpio". A cleaner way is to have a dedicated table for the special pins.

---
 drivers/leds/simple/simatic-ipc-leds-gpio.c | 26 ++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
drivers/leds/simple/simatic-ipc-leds-gpio.c +23 -3
index e8d329b5a68c..ba0f24638af5 100644
@@ -16,6 +16,7 @@
 #include <linux/platform_data/x86/simatic-ipc-base.h>
 
 static struct gpiod_lookup_table *simatic_ipc_led_gpio_table;
+static struct gpiod_lookup_table *simatic_ipc_led_gpio_table_extra;
 
 static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = {
 	.dev_id = "leds-gpio",
@@ -26,6 +27,12 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e = {
 		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 3, GPIO_ACTIVE_LOW),
 		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 4, GPIO_ACTIVE_LOW),
 		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, GPIO_ACTIVE_LOW),
+	},
+};
+
+static struct gpiod_lookup_table simatic_ipc_led_gpio_table_127e_extra = {
+	.dev_id = NULL,
+	.table = {
 		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW),
 		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH),
 	},
@@ -40,9 +47,15 @@ static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g = {
 		GPIO_LOOKUP_IDX("gpio-f7188x-2", 3, NULL, 3, GPIO_ACTIVE_LOW),
 		GPIO_LOOKUP_IDX("gpio-f7188x-2", 4, NULL, 4, GPIO_ACTIVE_LOW),
 		GPIO_LOOKUP_IDX("gpio-f7188x-2", 5, NULL, 5, GPIO_ACTIVE_LOW),
+	},
+};
+
+static struct gpiod_lookup_table simatic_ipc_led_gpio_table_227g_extra = {
+	.dev_id = NULL,
+	.table = {
 		GPIO_LOOKUP_IDX("gpio-f7188x-3", 6, NULL, 6, GPIO_ACTIVE_HIGH),
 		GPIO_LOOKUP_IDX("gpio-f7188x-3", 7, NULL, 7, GPIO_ACTIVE_HIGH),
-	}
+	},
 };
 
 static const struct gpio_led simatic_ipc_gpio_leds[] = {
@@ -64,6 +77,7 @@ static struct platform_device *simatic_leds_pdev;
 static int simatic_ipc_leds_gpio_remove(struct platform_device *pdev)
 {
 	gpiod_remove_lookup_table(simatic_ipc_led_gpio_table);
+	gpiod_remove_lookup_table(simatic_ipc_led_gpio_table_extra);
 	platform_device_unregister(simatic_leds_pdev);
 
 	return 0;
@@ -72,6 +86,7 @@ static int simatic_ipc_leds_gpio_remove(struct platform_device *pdev)
 static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev)
 {
 	const struct simatic_ipc_platform *plat = pdev->dev.platform_data;
+	struct device *dev = &pdev->dev;
 	struct gpio_desc *gpiod;
 	int err;
 
@@ -80,12 +95,14 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev)
 		if (!IS_ENABLED(CONFIG_PINCTRL_BROXTON))
 			return -ENODEV;
 		simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_127e;
+		simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_127e_extra;
 		break;
 	case SIMATIC_IPC_DEVICE_227G:
 		if (!IS_ENABLED(CONFIG_GPIO_F7188X))
 			return -ENODEV;
 		request_module("gpio-f7188x");
 		simatic_ipc_led_gpio_table = &simatic_ipc_led_gpio_table_227g;
+		simatic_ipc_led_gpio_table_extra = &simatic_ipc_led_gpio_table_227g_extra;
 		break;
 	default:
 		return -ENODEV;
@@ -101,8 +118,11 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev)
 		goto out;
 	}
 
+	simatic_ipc_led_gpio_table_extra->dev_id = dev_name(dev);
+	gpiod_add_lookup_table(simatic_ipc_led_gpio_table_extra);
+
 	/* PM_BIOS_BOOT_N */
-	gpiod = gpiod_get_index(&simatic_leds_pdev->dev, NULL, 6, GPIOD_OUT_LOW);
+	gpiod = gpiod_get_index(dev, NULL, 6, GPIOD_OUT_LOW);
 	if (IS_ERR(gpiod)) {
 		err = PTR_ERR(gpiod);
 		goto out;
@@ -110,7 +130,7 @@ static int simatic_ipc_leds_gpio_probe(struct platform_device *pdev)
 	gpiod_put(gpiod);
 
 	/* PM_WDT_OUT */
-	gpiod = gpiod_get_index(&simatic_leds_pdev->dev, NULL, 7, GPIOD_OUT_LOW);
+	gpiod = gpiod_get_index(dev, NULL, 7, GPIOD_OUT_LOW);
 	if (IS_ERR(gpiod)) {
 		err = PTR_ERR(gpiod);
 		goto out;
Signature · 1 line
2.39.2
#2 lore raw

Re: [PATCH v2 1/3] leds: simatic-ipc-leds-gpio: move two extra gpio pins into another table

Quoted 3 lines · Henning Schild

There are two special pins needed to init the LEDs. We used to have them at the end of the gpiod_lookup table to give to "leds-gpio". A cleaner way is to have a dedicated table for the special pins.

...

Review

Quoted 1 line
(quoted diff) +1 -0
+	.dev_id = NULL,

Technically speaking this is redundant. Maybe you wanted to be more explicit with a comment like

.dev_id = NULL, /* Filled during initialization */

...

Review

Quoted 1 line
(quoted diff) +1 -0
+	.dev_id = NULL,

Ditto.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Re: [PATCH v2 1/3] leds: simatic-ipc-leds-gpio: move two extra gpio pins into another table

Am Wed, 1 Mar 2023 19:21:53 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 12 lines · Henning Schild
Quoted 3 lines

There are two special pins needed to init the LEDs. We used to have them at the end of the gpiod_lookup table to give to "leds-gpio". A cleaner way is to have a dedicated table for the special pins.

...

Review

Quoted 1 line
(quoted diff) +1 -0
+	.dev_id = NULL,  

Technically speaking this is redundant. Maybe you wanted to be more explicit with a comment like

Quoted 8 lines

.dev_id = NULL, /* Filled during
initialization */

...

Review

Quoted 1 line
(quoted diff) +1 -0
+	.dev_id = NULL,  

Ditto.

Sorry you already pointed that out earlier, it slipped back in with the rewrite.

Henning

#4 lore raw

PATCH v2 2/3 leds: simatic-ipc-leds-gpio: split up into multiple drivers

In reply to Henning Schild

In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header.

---
 drivers/leds/simple/Makefile                  |   4 +-
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 +++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 ++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 +++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 159 ------------------
 drivers/leds/simple/simatic-ipc-leds-gpio.h   |  22 +++
 drivers/platform/x86/simatic-ipc.c            |   7 +-
 7 files changed, 260 insertions(+), 163 deletions(-)
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-core.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c
 delete mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.c
 create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.h
drivers/leds/simple/Makefile +3 -1
index 1c7ef5e1324b..ed9057f7b6da 100644
@@ -1,3 +1,5 @@
 # SPDX-License-Identifier: GPL-2.0
 obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)  += simatic-ipc-leds-gpio-core.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-f7188x.o
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +64 -0

64 lines not on this page · raw message

drivers/leds/simple/simatic-ipc-leds-gpio-core.c new file +103 -0

103 lines not on this page · raw message

drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c new file +64 -0

64 lines not on this page · raw message

drivers/leds/simple/simatic-ipc-leds-gpio.c deleted +0 -159

159 lines not on this page · raw message

drivers/leds/simple/simatic-ipc-leds-gpio.h new file +22 -0
new file mode 100644
index 000000000000..bf258c32f83d
@@ -0,0 +1,22 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Siemens SIMATIC IPC driver for GPIO based LEDs
+ *
+ * Copyright (c) Siemens AG, 2023
+ *
+ * Author:
+ *  Henning Schild <[email protected]>
+ */
+
+#ifndef _SIMATIC_IPC_LEDS_GPIO_H
+#define _SIMATIC_IPC_LEDS_GPIO_H
+
+int simatic_ipc_leds_gpio_probe(struct platform_device *pdev,
+				struct gpiod_lookup_table *table,
+				struct gpiod_lookup_table *table_extra);
+
+int simatic_ipc_leds_gpio_remove(struct platform_device *pdev,
+				 struct gpiod_lookup_table *table,
+				 struct gpiod_lookup_table *table_extra);
+
+#endif /* _SIMATIC_IPC_LEDS_GPIO_H */
drivers/platform/x86/simatic-ipc.c +4 -3
index b3622419cd1a..c773995b230d 100644
@@ -68,9 +68,10 @@ static int register_platform_devices(u32 station_id)
 	}
 
 	if (ledmode != SIMATIC_IPC_DEVICE_NONE) {
-		if (ledmode == SIMATIC_IPC_DEVICE_127E ||
-		    ledmode == SIMATIC_IPC_DEVICE_227G)
-			pdevname = KBUILD_MODNAME "_leds_gpio";
+		if (ledmode == SIMATIC_IPC_DEVICE_127E)
+			pdevname = KBUILD_MODNAME "_leds_gpio_apollolake";
+		if (ledmode == SIMATIC_IPC_DEVICE_227G)
+			pdevname = KBUILD_MODNAME "_leds_gpio_f7188x";
 		platform_data.devmode = ledmode;
 		ipc_led_platform_device =
 			platform_device_register_data(NULL,
Signature · 1 line
2.39.2
#5 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Quoted 3 lines · Henning Schild

In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header.

...

Quoted 4 lines
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 +++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 ++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 +++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 159 ------------------

I'm wondering if you have used -M -C when creating this patch.

...

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c line 16

Quoted 6 lines
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +6 -0
+#include <linux/gpio/machine.h>
+#include <linux/gpio/consumer.h>
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/x86/simatic-ipc-base.h>

+ Blank line?

Quoted 1 line

+#include "simatic-ipc-leds-gpio.h"

...

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c line 28

Quoted 8 lines
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +8 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL, 0, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL, 1, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL, 2, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL, 3, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL, 4, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL, 5, GPIO_ACTIVE_LOW),
+	},

Shouldn't this have the terminator entry?

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+static struct gpiod_lookup_table simatic_ipc_led_gpio_table_extra = {
+	.dev_id = NULL,

As per previous patch.

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c line 36

Quoted 4 lines
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +4 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL, 6, GPIO_ACTIVE_LOW),
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL, 7, GPIO_ACTIVE_HIGH),
+	},

As per above.

Quoted 1 line

+};

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Personally I prefer explicit string literal here.

Quoted 1 line
(quoted diff) +1 -0
+	},

...

Quoted 1 line

+

Redundant blank line.

Quoted 1 line

+module_platform_driver(simatic_ipc_led_gpio_apollolake_driver);

...

Quoted 1 line

+MODULE_ALIAS("platform:" KBUILD_MODNAME);

Why? HAve you missed MODULE_DEVICE_TABLE()?

...

Quoted 1 line

+++ b/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c

Similar comments as per above.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 68 lines · Henning Schild
Quoted 3 lines

In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header.

...

Quoted 5 lines
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 +++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 ++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 +++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 159

------------------

I'm wondering if you have used -M -C when creating this patch.

...

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c line 16

Quoted 6 lines
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +6 -0
+#include <linux/gpio/machine.h>
+#include <linux/gpio/consumer.h>
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/x86/simatic-ipc-base.h>  

+ Blank line?

Quoted 1 line

+#include "simatic-ipc-leds-gpio.h"

...

Quoted 13 lines
(quoted diff) +2 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL,

0, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL,

1, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL,

2, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL,

3, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL,

4, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL,

5, GPIO_ACTIVE_LOW),

Review

Quoted 1 line
(quoted diff) +1 -0
+	},  

Shouldn't this have the terminator entry?

...

Review

Quoted 3 lines

+static struct gpiod_lookup_table simatic_ipc_led_gpio_table_extra = {

(quoted diff) +1 -0
+	.dev_id = NULL,  

As per previous patch.

Review

Quoted 6 lines
(quoted diff) +2 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL,

6, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL,

7, GPIO_ACTIVE_HIGH),

(quoted diff) +1 -0
+	},  

As per above.

Quoted 1 line

+};

...

Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,  

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Personally I prefer explicit string literal here.

Switching from one module to three the names have to change. People who explicitly loaded the old module which supported multiple machines, will now how to load either both oŕ know which one to load.

I personally think the ABI change is acceptable, the assumption would be that the drivers load automatically anyhow. And since there are no params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff around.

And with the split i guess an ABI change can not be fully avoided. Whether the names is explicit or implicit is another discussion and just a matter of style. I prefer to stay with the currently used pattern, it is not un-common in the kernel.

Quoted 8 lines
Quoted 1 line
(quoted diff) +1 -0
+	},  

...

Quoted 1 line

+

Redundant blank line.

Quoted 7 lines
Quoted 1 line

+module_platform_driver(simatic_ipc_led_gpio_apollolake_driver);

...

Quoted 1 line

+MODULE_ALIAS("platform:" KBUILD_MODNAME);

Why? HAve you missed MODULE_DEVICE_TABLE()?

I do not know what that is, but i will have a look.

Henning

Quoted 6 lines

...

Quoted 1 line

+++ b/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c

Similar comments as per above.

#7 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Quoted 3 lines · Henning Schild

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 1 line · Henning Schild

...

Quoted 7 lines
Quoted 7 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,  

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Quoted 5 lines
Quoted 1 line

Personally I prefer explicit string literal here.

Switching from one module to three the names have to change. People who explicitly loaded the old module which supported multiple machines, will now how to load either both oŕ know which one to load.

Wait, are you telling that now users load modules _manually_?!

Quoted 9 lines

I personally think the ABI change is acceptable, the assumption would be that the drivers load automatically anyhow. And since there are no params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff around.

And with the split i guess an ABI change can not be fully avoided. Whether the names is explicit or implicit is another discussion and just a matter of style. I prefer to stay with the currently used pattern, it is not un-common in the kernel.

The problem with that pattern is possible, while unlikely, renaming of the file which triggers this to be updated.

Under sysfs the folder will change its name. If user has a script relying on this, it will be broken. So, I prefer mine.

Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1 -0
+	},  
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#8 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Am Thu, 2 Mar 2023 17:46:54 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 14 lines · Henning Schild
Quoted 3 lines

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 1 line · Henning Schild

...

Quoted 7 lines
Quoted 7 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,    

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Personally I prefer explicit string literal here.

Switching from one module to three the names have to change. People who explicitly loaded the old module which supported multiple machines, will now how to load either both oŕ know which one to load.

Wait, are you telling that now users load modules _manually_?!

No i am not, the modules all load automatically. I was trying to construct a hypothetical case where the name change could affect users doing unexpected things.

Quoted 10 lines
Quoted 9 lines

I personally think the ABI change is acceptable, the assumption would be that the drivers load automatically anyhow. And since there are no params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff around.

And with the split i guess an ABI change can not be fully avoided. Whether the names is explicit or implicit is another discussion and just a matter of style. I prefer to stay with the currently used pattern, it is not un-common in the kernel.

Quoted 5 lines

The problem with that pattern is possible, while unlikely, renaming of the file which triggers this to be updated.

Under sysfs the folder will change its name. If user has a script relying on this, it will be broken. So, I prefer mine.

Yes, the name of the module will change ... and the location of module metadata and params in sysfs, both not a big deal here. Because there are no params, and there is not need to modprobe manually.

Henning

Quoted 2 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1 -0
+	},    
#9 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Quoted 6 lines · Henning Schild

Am Thu, 2 Mar 2023 17:46:54 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 4 lines · Henning Schild
Quoted 3 lines

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 1 line · Henning Schild

...

Quoted 33 lines
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,    

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Personally I prefer explicit string literal here.

Switching from one module to three the names have to change. People who explicitly loaded the old module which supported multiple machines, will now how to load either both oŕ know which one to load.

Wait, are you telling that now users load modules _manually_?!

No i am not, the modules all load automatically. I was trying to construct a hypothetical case where the name change could affect users doing unexpected things.

Quoted 13 lines
Quoted 9 lines

I personally think the ABI change is acceptable, the assumption would be that the drivers load automatically anyhow. And since there are no params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff around.

And with the split i guess an ABI change can not be fully avoided. Whether the names is explicit or implicit is another discussion and just a matter of style. I prefer to stay with the currently used pattern, it is not un-common in the kernel.

The problem with that pattern is possible, while unlikely, renaming of the file which triggers this to be updated.

Quoted 6 lines
Quoted 2 lines

Under sysfs the folder will change its name. If user has a script relying on this, it will be broken. So, I prefer mine.

Yes, the name of the module will change ... and the location of module metadata and params in sysfs, both not a big deal here. Because there are no params, and there is not need to modprobe manually.

It's not only one folder AFAIU. Also folder in the drivers will change its name. Parameters is one thing, the folder presence is another.

Yes, the case is quite unlikely to happen (to break anyone's setup) that's why I started this with 'Strictly speaking...'. So, seems you are staying on your side, I will leave this to maintainers. If they are fine, I will have no objections.

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
(quoted diff) +1 -0
+	},    
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#10 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

Am Thu, 2 Mar 2023 18:21:21 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 54 lines · Henning Schild
Quoted 7 lines

Am Thu, 2 Mar 2023 17:46:54 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 5 lines · Henning Schild
Quoted 4 lines

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 2 lines

On Wed, Mar 01, 2023 at 06:02:14PM +0100, Henning Schild wrote:

...

Quoted 35 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,      

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Personally I prefer explicit string literal here.

Switching from one module to three the names have to change. People who explicitly loaded the old module which supported multiple machines, will now how to load either both oŕ know which one to load.

Wait, are you telling that now users load modules _manually_?!

No i am not, the modules all load automatically. I was trying to construct a hypothetical case where the name change could affect users doing unexpected things.

Quoted 14 lines
Quoted 10 lines

I personally think the ABI change is acceptable, the assumption would be that the drivers load automatically anyhow. And since there are no params i doubt users will have /etc/modprobe.d/ or /sys/module/ stuff around.

And with the split i guess an ABI change can not be fully avoided. Whether the names is explicit or implicit is another discussion and just a matter of style. I prefer to stay with the currently used pattern, it is not un-common in the kernel.

The problem with that pattern is possible, while unlikely, renaming of the file which triggers this to be updated.

Quoted 7 lines
Quoted 2 lines

Under sysfs the folder will change its name. If user has a script relying on this, it will be broken. So, I prefer mine.

Yes, the name of the module will change ... and the location of module metadata and params in sysfs, both not a big deal here. Because there are no params, and there is not need to modprobe manually.

Quoted 7 lines

It's not only one folder AFAIU. Also folder in the drivers will change its name. Parameters is one thing, the folder presence is another.

Yes, the case is quite unlikely to happen (to break anyone's setup) that's why I started this with 'Strictly speaking...'. So, seems you are staying on your side, I will leave this to maintainers. If they are fine, I will have no objections.

We are splitting one module into three, so we will end up with three names. Or i miss something here.

The only thing one could talk about is whether that string should be hardcoded or derived from the name of the c-file.

Anyhow, thanks and we should probably just wait what others have to say.

Henning

Quoted 3 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
(quoted diff) +1 -0
+	},      
#11 lore raw

Re: [PATCH v2 2/3] leds: simatic-ipc-leds-gpio: split up into multiple drivers

In reply to Andy Shevchenko

Am Wed, 1 Mar 2023 19:28:12 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 17 lines · Henning Schild
Quoted 3 lines

In order to clearly describe the dependencies between the GPIO controller drivers and the users the driver is split up into a core, two drivers and a common header.

...

Quoted 5 lines
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 +++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 ++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 +++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 159

------------------

I'm wondering if you have used -M -C when creating this patch.

...

Quoted 8 lines

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c line 16

Quoted 6 lines
drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c new file +6 -0
+#include <linux/gpio/machine.h>
+#include <linux/gpio/consumer.h>
+#include <linux/leds.h>
+#include <linux/module.h>
+#include <linux/platform_device.h>
+#include <linux/platform_data/x86/simatic-ipc-base.h>  

+ Blank line?

Will be added in 3 files in v3.

Quoted 21 lines
Quoted 1 line

+#include "simatic-ipc-leds-gpio.h"

...

Quoted 13 lines
(quoted diff) +2 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 52, NULL,

0, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 53, NULL,

1, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 57, NULL,

2, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 58, NULL,

3, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 60, NULL,

4, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 51, NULL,

5, GPIO_ACTIVE_LOW),

Review

Quoted 1 line
(quoted diff) +1 -0
+	},  

Shouldn't this have the terminator entry?

Quoted 7 lines

...

Review

Quoted 3 lines

+static struct gpiod_lookup_table simatic_ipc_led_gpio_table_extra = {

(quoted diff) +1 -0
+	.dev_id = NULL,  

As per previous patch.

comment will be added in p1 and p2 and be in v3.

Quoted 22 lines

Review

Quoted 6 lines
(quoted diff) +2 -0
+	.table = {
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 56, NULL,

6, GPIO_ACTIVE_LOW),

(quoted diff) +1 -0
+		GPIO_LOOKUP_IDX("apollolake-pinctrl.0", 59, NULL,

7, GPIO_ACTIVE_HIGH),

(quoted diff) +1 -0
+	},  

As per above.

Quoted 1 line

+};

...

Review

Quoted 2 lines
(quoted diff) +2 -0
+	.driver = {
+		.name = KBUILD_MODNAME,  

Strictly speaking this is an ABI (as something may instantiate the driver from the user space or elsewhere by this name. At the same time this may change with the file name change.

Personally I prefer explicit string literal here.

Quoted 7 lines
Quoted 1 line
(quoted diff) +1 -0
+	},  

...

Quoted 1 line

+

Redundant blank line.

Will be removed in v3 in 3 files.

Henning

Quoted 14 lines
Quoted 1 line

+module_platform_driver(simatic_ipc_led_gpio_apollolake_driver);

...

Quoted 1 line

+MODULE_ALIAS("platform:" KBUILD_MODNAME);

Why? HAve you missed MODULE_DEVICE_TABLE()?

...

Quoted 1 line

+++ b/drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c

Similar comments as per above.

#12 lore raw

PATCH v2 3/3 leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

In reply to Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
drivers/leds/simple/Kconfig +28 -3
index fd2b8225d926..44fa0f93cb3b 100644
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several Industrial PCs
 	  from Siemens.
 
-	  To compile this driver as a module, choose M here: the modules
-	  will be called simatic-ipc-leds and simatic-ipc-leds-gpio.
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on Intel Apollo Lake GPIO"
+	depends on LEDS_GPIO
+	depends on PINCTRL_BROXTON
+	depends on SIEMENS_SIMATIC_IPC
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several Industrial PCs
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on Nuvoton GPIO"
+	depends on LEDS_GPIO
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several Industrial PCs
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds-gpio-f7188x.
drivers/leds/simple/Makefile +3 -4
index ed9057f7b6da..e3e840cea275 100644
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)  += simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-apollolake.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)			+= simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE)	+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X)		+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o
Signature · 1 line
2.39.2
#13 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Quoted 3 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

...

drivers/leds/simple/Makefile line 4

Quoted 3 lines
drivers/leds/simple/Makefile +3 -0
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)			+= simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE)	+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X)		+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Have you tried the configuration where all three are Y?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#14 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Am Wed, 1 Mar 2023 19:29:40 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 7 lines · Henning Schild
Quoted 3 lines

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

...

Quoted 9 lines
Quoted 6 lines

+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Have you tried the configuration where all three are Y?

I tried all m and will also try all Y. Why do you ask?

Henning

#15 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

In reply to Henning Schild

Hi,

Quoted 15 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
drivers/leds/simple/Kconfig +0 -0
index fd2b8225d926..44fa0f93cb3b 100644

drivers/leds/simple/Kconfig line 4

Quoted 4 lines
drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

drivers/leds/simple/Kconfig line 14

Quoted 13 lines
drivers/leds/simple/Kconfig +6 -2
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several Industrial PCs
 	  from Siemens.
 
-	  To compile this driver as a module, choose M here: the modules
-	  will be called simatic-ipc-leds and simatic-ipc-leds-gpio.
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on Intel Apollo Lake GPIO"
+	depends on LEDS_GPIO

And then it can be dropped here.

drivers/leds/simple/Kconfig line 16

Quoted 3 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on PINCTRL_BROXTON
 
+	depends on SIEMENS_SIMATIC_IPC

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

drivers/leds/simple/Kconfig line 27

Quoted 11 lines
drivers/leds/simple/Kconfig +11 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several Industrial PCs
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on Nuvoton GPIO"
+	depends on LEDS_GPIO

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC

Idem.

Quoted 12 lines
drivers/leds/simple/Kconfig +7 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several Industrial PCs
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the module
+	  will be called simatic-ipc-leds-gpio-f7188x.
drivers/leds/simple/Makefile +0 -0
index ed9057f7b6da..e3e840cea275 100644

drivers/leds/simple/Makefile line 4

Quoted 8 lines
drivers/leds/simple/Makefile +3 -4
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)  += simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-apollolake.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)			+= simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE)	+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X)		+= simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

#16 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Am Wed, 1 Mar 2023 19:04:01 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 13 lines

Hi,

Quoted 10 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
Quoted 12 lines

drivers/leds/simple/Kconfig line 4

Quoted 9 lines
(quoted diff) +0 -0

b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig
+++ b/drivers/leds/simple/Kconfig

drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO  

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

No this one is now only for the port-IO based driver. The GPIO core is built under the two new switches only.

Quoted 21 lines
Quoted 17 lines
drivers/leds/simple/Kconfig +0 -0
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several

Industrial PCs from Siemens.

(quoted diff) +0 -1
-	  To compile this driver as a module, choose M here: the

modules

(quoted diff) +0 -1
-	  will be called simatic-ipc-leds and

simatic-ipc-leds-gpio.

(quoted diff) +1 -0
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on

Intel Apollo Lake GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO  

And then it can be dropped here.

Quoted 6 lines

drivers/leds/simple/Kconfig line 16

Quoted 3 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on PINCTRL_BROXTON  
 
+	depends on SIEMENS_SIMATIC_IPC  

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

Same as above, the GPIO based drivers do not depend on the port-IO based driver.

Henning

Quoted 55 lines
Quoted 13 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on

Nuvoton GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO  

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC  

Idem.

Quoted 20 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +1 -0
+	  will be called simatic-ipc-leds-gpio-f7188x.
(quoted diff) +0 -0

b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile
+++ b/drivers/leds/simple/Makefile

drivers/leds/simple/Makefile +0 -2
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)  +=

simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-apollolake.o

Quoted 8 lines

-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

#17 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Hi,

Quoted 29 lines · Henning Schild

Am Wed, 1 Mar 2023 19:04:01 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 13 lines

Hi,

Quoted 10 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
Quoted 12 lines

drivers/leds/simple/Kconfig line 4

Quoted 9 lines
(quoted diff) +0 -0

b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig
+++ b/drivers/leds/simple/Kconfig

drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO  

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

Quoted 2 lines

No this one is now only for the port-IO based driver. The GPIO core is built under the two new switches only.

You are right, I thought this would enable building simatic-ipc-leds-gpio-core.o into its own .ko which would then be used by both other gpio LED drivers. But upon a closer look at the Makefile changes I see that is not the case.

Note that with your current solution you are linking that into the kernel twice.

As long this is build into modules that is fine. But if both are builtin I *think* you may get linker errors because of duplicate symbols?

I believe this is why Andy asked to try a build with all 3 options set to Y.

Quoted 22 lines
Quoted 22 lines
Quoted 16 lines
drivers/leds/simple/Kconfig +0 -0
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several

Industrial PCs from Siemens.

(quoted diff) +0 -1
-	  To compile this driver as a module, choose M here: the

modules

(quoted diff) +0 -1
-	  will be called simatic-ipc-leds and

simatic-ipc-leds-gpio.

(quoted diff) +1 -0
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on

Intel Apollo Lake GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO  

And then it can be dropped here.

Quoted 1 line
drivers/leds/simple/Kconfig +1 -0
+	depends on PINCTRL_BROXTON  
Quoted 7 lines
Quoted 4 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on SIEMENS_SIMATIC_IPC  

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

Same as above, the GPIO based drivers do not depend on the port-IO based driver.

Ack.

Regards,

Hans

Quoted 56 lines
Quoted 55 lines
Quoted 13 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on

Nuvoton GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO  

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC  

Idem.

Quoted 20 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +1 -0
+	  will be called simatic-ipc-leds-gpio-f7188x.
(quoted diff) +0 -0

b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile
+++ b/drivers/leds/simple/Makefile

drivers/leds/simple/Makefile +0 -2
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+= simatic-ipc-leds.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)  +=

simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-apollolake.o

Quoted 8 lines

-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

#18 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Am Thu, 2 Mar 2023 10:02:51 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 43 lines

Hi,

Quoted 29 lines · Henning Schild

Am Wed, 1 Mar 2023 19:04:01 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 13 lines

Hi,

Quoted 10 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
Quoted 12 lines

drivers/leds/simple/Kconfig line 4

Quoted 9 lines
(quoted diff) +0 -0

b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig
+++ b/drivers/leds/simple/Kconfig

drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO    

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

Quoted 2 lines

No this one is now only for the port-IO based driver. The GPIO core is built under the two new switches only.

You are right, I thought this would enable building simatic-ipc-leds-gpio-core.o into its own .ko which would then be used by both other gpio LED drivers. But upon a closer look at the Makefile changes I see that is not the case.

Note that with your current solution you are linking that into the kernel twice.

Quoted 6 lines

As long this is build into modules that is fine. But if both are builtin I *think* you may get linker errors because of duplicate symbols?

I believe this is why Andy asked to try a build with all 3 options set to Y.

Thanks. There are no linker errors so i think there is no need for yet another CONFIG especially for the core. I would try to keep it simple as the name of the directory suggests, so go with what we have.

Henning

Quoted 99 lines
Quoted 23 lines
Quoted 23 lines
Quoted 17 lines
drivers/leds/simple/Kconfig +0 -0
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several

Industrial PCs from Siemens.

(quoted diff) +0 -1
-	  To compile this driver as a module, choose M here: the

modules

(quoted diff) +0 -1
-	  will be called simatic-ipc-leds and

simatic-ipc-leds-gpio.

(quoted diff) +1 -0
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on

Intel Apollo Lake GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

And then it can be dropped here.

Quoted 1 line
drivers/leds/simple/Kconfig +1 -0
+	depends on PINCTRL_BROXTON    
Quoted 7 lines
Quoted 4 lines

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on SIEMENS_SIMATIC_IPC    

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

Same as above, the GPIO based drivers do not depend on the port-IO based driver.

Ack.

Regards,

Hans

Quoted 56 lines
Quoted 55 lines
Quoted 13 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on

Nuvoton GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC    

Idem.

Quoted 20 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +1 -0
+	  will be called simatic-ipc-leds-gpio-f7188x.
(quoted diff) +0 -0

b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile
+++ b/drivers/leds/simple/Makefile

(quoted diff) +0 -1
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+=

simatic-ipc-leds.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-apollolake.o

Quoted 8 lines

-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

#19 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

In reply to Hans de Goede

Am Thu, 2 Mar 2023 10:02:51 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 43 lines

Hi,

Quoted 29 lines · Henning Schild

Am Wed, 1 Mar 2023 19:04:01 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 13 lines

Hi,

Quoted 10 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
Quoted 12 lines

drivers/leds/simple/Kconfig line 4

Quoted 9 lines
(quoted diff) +0 -0

b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig
+++ b/drivers/leds/simple/Kconfig

drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO    

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

Quoted 2 lines

No this one is now only for the port-IO based driver. The GPIO core is built under the two new switches only.

You are right, I thought this would enable building simatic-ipc-leds-gpio-core.o into its own .ko which would then be used by both other gpio LED drivers. But upon a closer look at the Makefile changes I see that is not the case.

Note that with your current solution you are linking that into the kernel twice.

Quoted 36 lines

As long this is build into modules that is fine. But if both are builtin I *think* you may get linker errors because of duplicate symbols?

I believe this is why Andy asked to try a build with all 3 options set to Y.

Quoted 29 lines
Quoted 20 lines
Quoted 16 lines
drivers/leds/simple/Kconfig +0 -0
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several

Industrial PCs from Siemens.

(quoted diff) +0 -1
-	  To compile this driver as a module, choose M here: the

modules

(quoted diff) +0 -1
-	  will be called simatic-ipc-leds and

simatic-ipc-leds-gpio.

(quoted diff) +1 -0
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on

Intel Apollo Lake GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

And then it can be dropped here.

Quoted 6 lines

drivers/leds/simple/Kconfig line 16

Quoted 3 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on PINCTRL_BROXTON    
 
+	depends on SIEMENS_SIMATIC_IPC    

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

Same as above, the GPIO based drivers do not depend on the port-IO based driver.

Hi Hans,

Quoted 1 line

Ack.

was that for that last patch or all three of them? I am preparing a v3 which will include ACKs, i will have to assume p3 only because it came in reply to that patch.

regards,
Henning

Quoted 67 lines

Regards,

Hans

Quoted 56 lines
Quoted 55 lines
Quoted 13 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on

Nuvoton GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC    

Idem.

Quoted 20 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +1 -0
+	  will be called simatic-ipc-leds-gpio-f7188x.
(quoted diff) +0 -0

b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile
+++ b/drivers/leds/simple/Makefile

(quoted diff) +0 -1
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+=

simatic-ipc-leds.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-apollolake.o

Quoted 8 lines

-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

Acked-by
#20 lore raw

Re: [PATCH v2 3/3] leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

Hi,

Quoted 83 lines · Henning Schild

Am Thu, 2 Mar 2023 10:02:51 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 43 lines

Hi,

Quoted 29 lines · Henning Schild

Am Wed, 1 Mar 2023 19:04:01 +0100
schrieb Hans de Goede <[email protected]>:

Quoted 13 lines

Hi,

Quoted 10 lines · Henning Schild

To describe the dependency chain better and allow for potential fine-grained config tuning, introduce Kconfig switch for the individual GPIO based drivers.

---
 drivers/leds/simple/Kconfig  | 31 ++++++++++++++++++++++++++++---
 drivers/leds/simple/Makefile |  7 +++----
 2 files changed, 31 insertions(+), 7 deletions(-)
Quoted 12 lines

drivers/leds/simple/Kconfig line 4

Quoted 9 lines
(quoted diff) +0 -0

b/drivers/leds/simple/Kconfig index fd2b8225d926..44fa0f93cb3b 100644 --- a/drivers/leds/simple/Kconfig
+++ b/drivers/leds/simple/Kconfig

drivers/leds/simple/Kconfig +0 -1
@@ -1,11 +1,36 @@
 # SPDX-License-Identifier: GPL-2.0-only
 config LEDS_SIEMENS_SIMATIC_IPC
 	tristate "LED driver for Siemens Simatic IPCs"
-	depends on LEDS_GPIO    

Since it is simatic-ipc-leds-gpio-core.c which actually registers the LEDs GPIO platform device, this one should stay IMHO.

Quoted 2 lines

No this one is now only for the port-IO based driver. The GPIO core is built under the two new switches only.

You are right, I thought this would enable building simatic-ipc-leds-gpio-core.o into its own .ko which would then be used by both other gpio LED drivers. But upon a closer look at the Makefile changes I see that is not the case.

Note that with your current solution you are linking that into the kernel twice.

Quoted 36 lines

As long this is build into modules that is fine. But if both are builtin I *think* you may get linker errors because of duplicate symbols?

I believe this is why Andy asked to try a build with all 3 options set to Y.

Quoted 29 lines
Quoted 20 lines
Quoted 16 lines
drivers/leds/simple/Kconfig +0 -0
 	depends on SIEMENS_SIMATIC_IPC
 	help
 	  This option enables support for the LEDs of several

Industrial PCs from Siemens.

(quoted diff) +0 -1
-	  To compile this driver as a module, choose M here: the

modules

(quoted diff) +0 -1
-	  will be called simatic-ipc-leds and

simatic-ipc-leds-gpio.

(quoted diff) +1 -0
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds.
+
+config LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE
+	tristate "LED driver for Siemens Simatic IPCs based on

Intel Apollo Lake GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

And then it can be dropped here.

Quoted 6 lines

drivers/leds/simple/Kconfig line 16

Quoted 3 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on PINCTRL_BROXTON    
 
+	depends on SIEMENS_SIMATIC_IPC    

This should be "depends on LEDS_SIEMENS_SIMATIC_IPC" since it actually uses symbol from that module.

Same as above, the GPIO based drivers do not depend on the port-IO based driver.

Quoted 7 lines

Hi Hans,

Quoted 1 line

Ack.

was that for that last patch or all three of them? I am preparing a v3 which will include ACKs, i will have to assume p3 only because it came in reply to that patch.

You may add my:

To all 3 patches in the series.

Regards,

Hans

Quoted 58 lines
Quoted 57 lines
Quoted 56 lines
Quoted 55 lines
Quoted 13 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Apollo Lake GPIO i.e. IPC127E.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +4 -0
+	  will be called simatic-ipc-leds-gpio-apollolake.
+
+config LEDS_SIEMENS_SIMATIC_IPC_F7188X
+	tristate "LED driver for Siemens Simatic IPCs based on

Nuvoton GPIO"

Review

Quoted 1 line
(quoted diff) +1 -0
+	depends on LEDS_GPIO    

Idem.

drivers/leds/simple/Kconfig line 29

Quoted 2 lines
drivers/leds/simple/Kconfig +2 -0
+	depends on GPIO_F7188X
+	depends on SIEMENS_SIMATIC_IPC    

Idem.

Quoted 20 lines
drivers/leds/simple/Kconfig +3 -0
+	default LEDS_SIEMENS_SIMATIC_IPC
+	help
+	  This option enables support for the LEDs of several

Industrial PCs

drivers/leds/simple/Kconfig +3 -0
+	  from Siemens based on Nuvoton GPIO i.e. IPC227G.
+
+	  To compile this driver as a module, choose M here: the

module

drivers/leds/simple/Kconfig +1 -0
+	  will be called simatic-ipc-leds-gpio-f7188x.
(quoted diff) +0 -0

b/drivers/leds/simple/Makefile index ed9057f7b6da..e3e840cea275 100644 --- a/drivers/leds/simple/Makefile
+++ b/drivers/leds/simple/Makefile

(quoted diff) +0 -1
@@ -1,5 +1,4 @@
 # SPDX-License-Identifier: GPL-2.0
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC)	+=

simatic-ipc-leds.o -obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) += simatic-ipc-leds-gpio-core.o
-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-apollolake.o

Quoted 8 lines

-obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds-gpio-f7188x.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC) +=
simatic-ipc-leds.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_APOLLOLAKE) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-apollolake.o
+obj-$(CONFIG_LEDS_SIEMENS_SIMATIC_IPC_F7188X) +=
simatic-ipc-leds-gpio-core.o simatic-ipc-leds-gpio-f7188x.o

Regards,

Hans

#21 lore raw
In reply to Henning Schild
Quoted 7 lines · Henning Schild

This series mainly splits the one GPIO driver into two. The split allows to clearly model runtime and compile time dependencies on the GPIO chip drivers.

p1 is kind of not too related to that split but also prepares for more GPIO based drivers to come.

Quoted 8 lines

p2 takes the driver we had and puts some of its content into a -core, to be used by the two drivers.

p3 deals with more fine-grained configuration posibilities and compile time dependencies.

It is based on
[PATCH v4] leds: simatic-ipc-leds-gpio: make sure we have the GPIO providing driver

Thank you for an update.
Not big issues found (except maybe the Makefile).

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#22 lore raw

Am Wed, 1 Mar 2023 19:30:38 +0200
schrieb Andy Shevchenko <[email protected]>:

Quoted 15 lines · Henning Schild
Quoted 14 lines

This series mainly splits the one GPIO driver into two. The split allows to clearly model runtime and compile time dependencies on the GPIO chip drivers.

p1 is kind of not too related to that split but also prepares for more GPIO based drivers to come.

p2 takes the driver we had and puts some of its content into a -core, to be used by the two drivers.

p3 deals with more fine-grained configuration posibilities and compile time dependencies.

Quoted 7 lines
Quoted 3 lines

It is based on
[PATCH v4] leds: simatic-ipc-leds-gpio: make sure we have the GPIO providing driver

Thank you for an update.
Not big issues found (except maybe the Makefile).

The Makefile does work with all Y. So if that was all that was open, and the rest is just optional improvement. I would be happy if this can be merged as is, and deal with improvements later.

Thanks!

Henning

#23 lore raw
In reply to Henning Schild

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Henning

Am Wed, 1 Mar 2023 18:02:12 +0100
schrieb Henning Schild <[email protected]>:

Quoted 43 lines

changes since v1:
- move from header- to -core.c-based implementation
- style changes from review

This series mainly splits the one GPIO driver into two. The split allows to clearly model runtime and compile time dependencies on the GPIO chip drivers.

p1 is kind of not too related to that split but also prepares for more GPIO based drivers to come.

p2 takes the driver we had and puts some of its content into a -core, to be used by the two drivers.

p3 deals with more fine-grained configuration posibilities and compile time dependencies.

It is based on
[PATCH v4] leds: simatic-ipc-leds-gpio: make sure we have the GPIO providing driver

Henning Schild (3):
leds: simatic-ipc-leds-gpio: move two extra gpio pins into another
table
leds: simatic-ipc-leds-gpio: split up into multiple drivers
leds: simatic-ipc-leds-gpio: introduce more Kconfig switches

 drivers/leds/simple/Kconfig                   |  31 +++-
 drivers/leds/simple/Makefile                  |   5 +-
 .../simple/simatic-ipc-leds-gpio-apollolake.c |  64 ++++++++
 .../leds/simple/simatic-ipc-leds-gpio-core.c  | 103 +++++++++++++
 .../simple/simatic-ipc-leds-gpio-f7188x.c     |  64 ++++++++
 drivers/leds/simple/simatic-ipc-leds-gpio.c   | 139
------------------ drivers/leds/simple/simatic-ipc-leds-gpio.h   |
22 +++ drivers/platform/x86/simatic-ipc.c            |   7 +-
 8 files changed, 288 insertions(+), 147 deletions(-)
 create mode 100644

drivers/leds/simple/simatic-ipc-leds-gpio-apollolake.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-core.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio-f7188x.c delete mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.c create mode 100644 drivers/leds/simple/simatic-ipc-leds-gpio.h

maintainer
#24 lore raw
Quoted 8 lines · Henning Schild

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Looks like there are lots of mail threads in reply to each of the patches. If these culminated in acceptance, please collect all of the Acks you've received until this point and submit a [RESEND]. If there are changes to be made still, please do the same but submit as a new version.

Signature · 1 line
Lee Jones [李琼斯]
#25 lore raw

Am Mon, 15 May 2023 10:50:42 +0100
schrieb Lee Jones <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 8 lines

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

Quoted 8 lines
Quoted 2 lines

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Looks like there are lots of mail threads in reply to each of the patches. If these culminated in acceptance, please collect all of the Acks you've received until this point and submit a [RESEND]. If there are changes to be made still, please do the same but submit as a new version.

Ok i will send it again and include the ACK from Hans. There would be no code change. Please review the code already, if you find it acceptable we might receive a second ACK from Andy.

Henning

maintainer
#26 lore raw
Quoted 21 lines · Henning Schild

Am Mon, 15 May 2023 10:50:42 +0100
schrieb Lee Jones <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 8 lines

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

Quoted 8 lines
Quoted 2 lines

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Looks like there are lots of mail threads in reply to each of the patches. If these culminated in acceptance, please collect all of the Acks you've received until this point and submit a [RESEND]. If there are changes to be made still, please do the same but submit as a new version.

Quoted 3 lines

Ok i will send it again and include the ACK from Hans. There would be no code change. Please review the code already, if you find it acceptable we might receive a second ACK from Andy.

Not sure what you mean by 'already'.

I shall not be reviewing this set until it is resent, thanks.

Signature · 1 line
Lee Jones [李琼斯]
#27 lore raw

Am Mon, 15 May 2023 13:12:47 +0100
schrieb Lee Jones <[email protected]>:

Quoted 23 lines · Henning Schild
Quoted 22 lines

Am Mon, 15 May 2023 10:50:42 +0100
schrieb Lee Jones <[email protected]>:

Quoted 17 lines · Henning Schild
Quoted 10 lines

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Looks like there are lots of mail threads in reply to each of the patches. If these culminated in acceptance, please collect all of the Acks you've received until this point and submit a [RESEND]. If there are changes to be made still, please do the same but submit as a new version.

Quoted 7 lines
Quoted 3 lines

Ok i will send it again and include the ACK from Hans. There would be no code change. Please review the code already, if you find it acceptable we might receive a second ACK from Andy.

Not sure what you mean by 'already'.

I shall not be reviewing this set until it is resent, thanks.

I just sent that v3 you requested. It has one Ack from Hans in p3. And some minor style things from Andy, which i decided to take in when having to rebase and test once more.

Looking forward to your feedback on that v3.

regards,
Henning

maintainer
#28 lore raw
Quoted 32 lines · Henning Schild

Am Mon, 15 May 2023 13:12:47 +0100
schrieb Lee Jones <[email protected]>:

Quoted 29 lines · Henning Schild
Quoted 22 lines

Am Mon, 15 May 2023 10:50:42 +0100
schrieb Lee Jones <[email protected]>:

Quoted 9 lines · Henning Schild
Quoted 8 lines

Ping.

As far as i remember this one should be ready to merge.

ACKed by Hans, and Andy had no objections given the maintainers would accept the patches.

Quoted 8 lines
Quoted 2 lines

So i think it is the maintainers turn now, Pavel and/or Lee i guess.

Looks like there are lots of mail threads in reply to each of the patches. If these culminated in acceptance, please collect all of the Acks you've received until this point and submit a [RESEND]. If there are changes to be made still, please do the same but submit as a new version.

Quoted 3 lines

Ok i will send it again and include the ACK from Hans. There would be no code change. Please review the code already, if you find it acceptable we might receive a second ACK from Andy.

Not sure what you mean by 'already'.

Quoted 7 lines
Quoted 1 line

I shall not be reviewing this set until it is resent, thanks.

I just sent that v3 you requested. It has one Ack from Hans in p3. And some minor style things from Andy, which i decided to take in when having to rebase and test once more.

Looking forward to your feedback on that v3.

Thanks. It's marked for review.

Just to set expectation, you are number 49 in the queue.

Signature · 1 line
Lee Jones [李琼斯]