Skip to contentSkip to conversation

rohm-bdi718x7/71828: Use software nodes for gpio-keys

PATCH Applied Dmitry Torokhov 3 participants 13 messages Jun 11 – Jul 16

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v5 cover rohm-bdi718x7/71828: Use software nodes for gpio-keys

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

---
Changes in v5:
Addressed Lee's comments:
- moved static constants out of function to module level
- added #defines for nodes' indexes
- adjusted error message
- renamed "error" to "ret"
- dropped unneeded comments
- Link to v4: https://patch.msgid.link/[email protected]

Changes in v4:
- avoid using compound literals in assignments
- Link to v3: https://patch.msgid.link/[email protected]

Changes in v3:
- Stopped mixing code and variable declarations, use more temps
- Moved assignment to irq_domain closer to where is is being used
- Added missing SOB
- Link to v2: https://patch.msgid.link/[email protected]

v2:
- dropped patch to gpio-keys as it is in the mainline now
- reworked the both drivers to dynamically allocate per-device software nodes

v1:
https://lore.kernel.org/r/[email protected]/

---
Dmitry Torokhov (2):
mfd: rohm-bd71828: Use software nodes for gpio-keys
mfd: rohm-bd718x7: Use software nodes for gpio-keys

 drivers/mfd/rohm-bd71828.c | 125 +++++++++++++++++++++++++++++++++------------
 drivers/mfd/rohm-bd718x7.c | 123 ++++++++++++++++++++++++++++++++------------
 2 files changed, 183 insertions(+), 65 deletions(-)

---
base-commit: ec039126b7fac4e3af35ebccaa7c6f9b6875ba81
change-id: 20260313-rohm-software-nodes-0b4a3d36128c

Thanks.

Signature · 1 line
Dmitry
#1 lore raw

PATCH v5 1/2 mfd: rohm-bd71828: Use software nodes for gpio-keys

Refactor the rohm-bd71828 MFD driver to use software nodes for instantiating the gpio-keys child device, replacing the old platform_data mechanism.

The power key's properties are now defined using software nodes and property entries. The IRQ is passed as a resource attached to the platform device.

This will allow dropping support for using platform data for configuring gpio-keys in the future.

---
 drivers/mfd/rohm-bd71828.c | 125 +++++++++++++++++++++++++++++++++------------
 1 file changed, 93 insertions(+), 32 deletions(-)
drivers/mfd/rohm-bd71828.c +93 -32
index a79f354bf5cb..5fb6142cf087 100644
@@ -5,7 +5,8 @@
  * ROHM BD718[15/28/79] and BD72720 PMIC driver
  */
 
-#include <linux/gpio_keys.h>
+#include <linux/device/devres.h>
+#include <linux/gfp_types.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
@@ -18,6 +19,7 @@
 #include <linux/mfd/rohm-generic.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/types.h>
 
@@ -37,19 +39,6 @@
 		},							   \
 	}
 
-static struct gpio_keys_button button = {
-	.code = KEY_POWER,
-	.gpio = -1,
-	.type = EV_KEY,
-	.wakeup = 1,
-};
-
-static const struct gpio_keys_platform_data bd71828_powerkey_data = {
-	.buttons = &button,
-	.nbuttons = 1,
-	.name = "bd71828-pwrkey",
-};
-
 static const struct resource bd71815_rtc_irqs[] = {
 	DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC0, "bd70528-rtc-alm-0"),
 	DEFINE_RES_IRQ_NAMED(BD71815_INT_RTC1, "bd70528-rtc-alm-1"),
@@ -174,10 +163,6 @@ static struct mfd_cell bd71828_mfd_cells[] = {
 		.name = "bd71828-rtc",
 		.resources = bd71828_rtc_irqs,
 		.num_resources = ARRAY_SIZE(bd71828_rtc_irqs),
-	}, {
-		.name = "gpio-keys",
-		.platform_data = &bd71828_powerkey_data,
-		.pdata_size = sizeof(bd71828_powerkey_data),
 	},
 };
 
@@ -242,11 +227,8 @@ static const struct mfd_cell bd72720_mfd_cells[] = {
 		.name = "bd72720-rtc",
 		.resources = bd72720_rtc_irqs,
 		.num_resources = ARRAY_SIZE(bd72720_rtc_irqs),
-	}, {
-		.name = "gpio-keys",
-		.platform_data = &bd71828_powerkey_data,
-		.pdata_size = sizeof(bd71828_powerkey_data),
 	},
+	/* Power button is registered separately */
 };
 
 static const struct regmap_range bd71815_volatile_ranges[] = {
@@ -877,6 +859,84 @@ static int set_clk_mode(struct device *dev, struct regmap *regmap,
 				  OUT32K_MODE_CMOS);
 }
 
+static const struct property_entry bd71828_powerkey_parent_props[] = {
+	PROPERTY_ENTRY_STRING("label", "bd71828-pwrkey"),
+	{ }
+};
+
+static const struct property_entry bd71828_powerkey_props[] = {
+	PROPERTY_ENTRY_U32("linux,code", KEY_POWER),
+	PROPERTY_ENTRY_BOOL("wakeup-source"),
+	{ }
+};
+
+#define GPIO_KEYS  0	/* Node corresponding to gpio-keys device itself */
+#define PWRON_KEY  1	/* Node describing power button in gpio-keys */
+
+static int bd71828_i2c_register_swnodes(const struct software_node *nodes)
+{
+	const struct software_node * const node_group[] = {
+		&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
+	};
+
+	return software_node_register_node_group(node_group);
+}
+
+static void bd71828_i2c_unregister_swnodes(void *data)
+{
+	const struct software_node *nodes = data;
+	const struct software_node * const node_group[] = {
+		&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
+	};
+
+	software_node_unregister_node_group(node_group);
+}
+
+static int bd71828_i2c_register_pwrbutton(struct device *dev, int button_irq,
+					  struct irq_domain *irq_domain)
+{
+	const struct resource res[] = {
+		DEFINE_RES_IRQ_NAMED(button_irq, "bd71828-pwrkey"),
+	};
+	struct mfd_cell gpio_keys_cell = {
+		.name = "gpio-keys",
+		.resources = res,
+		.num_resources = ARRAY_SIZE(res),
+	};
+	struct software_node *nodes;
+	int ret;
+
+	nodes = devm_kcalloc(dev, 2, sizeof(*nodes), GFP_KERNEL);
+	if (!nodes)
+		return -ENOMEM;
+
+	nodes[GPIO_KEYS].name = devm_kasprintf(dev, GFP_KERNEL, "%s-power-key", dev_name(dev));
+	if (!nodes[GPIO_KEYS].name)
+		return -ENOMEM;
+
+	nodes[GPIO_KEYS].properties = bd71828_powerkey_parent_props;
+
+	nodes[PWRON_KEY].parent = &nodes[GPIO_KEYS];
+	nodes[PWRON_KEY].properties = bd71828_powerkey_props;
+
+	ret = bd71828_i2c_register_swnodes(nodes);
+	if (ret)
+		return ret;
+
+	ret = devm_add_action_or_reset(dev, bd71828_i2c_unregister_swnodes, nodes);
+	if (ret)
+		return ret;
+
+	gpio_keys_cell.swnode = &nodes[GPIO_KEYS];
+
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, &gpio_keys_cell, 1,
+				   NULL, 0, irq_domain);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to register power-button");
+
+	return 0;
+}
+
 static struct i2c_client *bd71828_dev;
 static void bd71828_power_off(void)
 {
@@ -929,6 +989,7 @@ static struct regmap *bd72720_do_regmaps(struct i2c_client *i2c)
 static int bd71828_i2c_probe(struct i2c_client *i2c)
 {
 	struct regmap_irq_chip_data *irq_data;
+	struct irq_domain *irq_domain;
 	int ret;
 	struct regmap *regmap = NULL;
 	const struct regmap_config *regmap_config;
@@ -1022,23 +1083,23 @@ static int bd71828_i2c_probe(struct i2c_client *i2c)
 					"Failed to enable main level IRQs\n");
 		}
 	}
-	if (button_irq) {
-		ret = regmap_irq_get_virq(irq_data, button_irq);
-		if (ret < 0)
-			return dev_err_probe(&i2c->dev, ret,
-					     "Failed to get the power-key IRQ\n");
-
-		button.irq = ret;
-	}
 
 	ret = set_clk_mode(&i2c->dev, regmap, clkmode_reg);
 	if (ret)
 		return ret;
 
+	irq_domain = regmap_irq_get_domain(irq_data);
+
 	ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO, mfd, cells,
-				   NULL, 0, regmap_irq_get_domain(irq_data));
+				   NULL, 0, irq_domain);
 	if (ret)
-		return	dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
+		return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
+
+	if (button_irq) {
+		ret = bd71828_i2c_register_pwrbutton(&i2c->dev, button_irq, irq_domain);
+		if (ret)
+			return ret;
+	}
 
 	if (of_device_is_system_power_controller(i2c->dev.of_node) &&
 	    chip_type == ROHM_CHIP_TYPE_BD71828) {
Signature · 1 line
2.54.0.1099.g489fc7bff1-goog
#2 lore raw

PATCH v5 2/2 mfd: rohm-bd718x7: Use software nodes for gpio-keys

In reply to Dmitry Torokhov

Refactor the rohm-bd7182x7 MFD driver to use software nodes for instantiating the gpio-keys child device, replacing the old platform_data mechanism.

The power key's properties are now defined using software nodes and property entries. The IRQ is passed as a resource attached to the platform device.

This will allow dropping support for using platform data for configuring gpio-keys in the future.

---
 drivers/mfd/rohm-bd718x7.c | 123 +++++++++++++++++++++++++++++++++------------
 1 file changed, 90 insertions(+), 33 deletions(-)
drivers/mfd/rohm-bd718x7.c +90 -33
index ff714fd4f54d..be2acc429fe3 100644
@@ -7,7 +7,8 @@
 // Datasheet for BD71837MWV available from
 // https://www.rohm.com/datasheet/BD71837MWV/bd71837mwv-e
 
-#include <linux/gpio_keys.h>
+#include <linux/device/devres.h>
+#include <linux/gfp_types.h>
 #include <linux/i2c.h>
 #include <linux/input.h>
 #include <linux/interrupt.h>
@@ -15,37 +16,16 @@
 #include <linux/mfd/core.h>
 #include <linux/module.h>
 #include <linux/of.h>
+#include <linux/property.h>
 #include <linux/regmap.h>
 #include <linux/types.h>
 
-static struct gpio_keys_button button = {
-	.code = KEY_POWER,
-	.gpio = -1,
-	.type = EV_KEY,
-};
-
-static struct gpio_keys_platform_data bd718xx_powerkey_data = {
-	.buttons = &button,
-	.nbuttons = 1,
-	.name = "bd718xx-pwrkey",
-};
-
 static struct mfd_cell bd71837_mfd_cells[] = {
-	{
-		.name = "gpio-keys",
-		.platform_data = &bd718xx_powerkey_data,
-		.pdata_size = sizeof(bd718xx_powerkey_data),
-	},
 	{ .name = "bd71837-clk", },
 	{ .name = "bd71837-pmic", },
 };
 
 static struct mfd_cell bd71847_mfd_cells[] = {
-	{
-		.name = "gpio-keys",
-		.platform_data = &bd718xx_powerkey_data,
-		.pdata_size = sizeof(bd718xx_powerkey_data),
-	},
 	{ .name = "bd71847-clk", },
 	{ .name = "bd71847-pmic", },
 };
@@ -125,10 +105,89 @@ static int bd718xx_init_press_duration(struct regmap *regmap,
 	return 0;
 }
 
+static const struct property_entry bd718xx_powerkey_parent_props[] = {
+	PROPERTY_ENTRY_STRING("label", "bd718xx-pwrkey"),
+	{ }
+};
+
+static const struct property_entry bd718xx_powerkey_props[] = {
+	PROPERTY_ENTRY_U32("linux,code", KEY_POWER),
+	{ }
+};
+
+static const struct resource bd718xx_powerkey_resources[] = {
+	DEFINE_RES_IRQ_NAMED(BD718XX_INT_PWRBTN_S, "bd718xx-pwrkey"),
+};
+
+#define GPIO_KEYS  0	/* Node corresponding to gpio-keys device itself */
+#define PWRON_KEY  1	/* Node describing power button in gpio-keys */
+
+static int bd718xx_i2c_register_swnodes(const struct software_node *nodes)
+{
+	const struct software_node * const node_group[] = {
+		&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
+	};
+
+	return software_node_register_node_group(node_group);
+}
+
+static void bd718xx_i2c_unregister_swnodes(void *data)
+{
+	const struct software_node *nodes = data;
+	const struct software_node * const node_group[] = {
+		&nodes[GPIO_KEYS], &nodes[PWRON_KEY], NULL
+	};
+
+	software_node_unregister_node_group(node_group);
+}
+
+static int bd718xx_i2c_register_pwrbutton(struct device *dev,
+					  struct irq_domain *irq_domain)
+{
+	struct mfd_cell gpio_keys_cell = {
+		.name = "gpio-keys",
+		.resources = bd718xx_powerkey_resources,
+		.num_resources = ARRAY_SIZE(bd718xx_powerkey_resources),
+	};
+	struct software_node *nodes;
+	int ret;
+
+	nodes = devm_kcalloc(dev, 2, sizeof(*nodes), GFP_KERNEL);
+	if (!nodes)
+		return -ENOMEM;
+
+	nodes[GPIO_KEYS].name = devm_kasprintf(dev, GFP_KERNEL, "%s-power-key", dev_name(dev));
+	if (!nodes[GPIO_KEYS].name)
+		return -ENOMEM;
+
+	nodes[GPIO_KEYS].properties = bd718xx_powerkey_parent_props;
+
+	nodes[PWRON_KEY].parent = &nodes[GPIO_KEYS];
+	nodes[PWRON_KEY].properties = bd718xx_powerkey_props;
+
+	ret = bd718xx_i2c_register_swnodes(nodes);
+	if (ret)
+		return ret;
+
+	ret = devm_add_action_or_reset(dev, bd718xx_i2c_unregister_swnodes, nodes);
+	if (ret)
+		return ret;
+
+	gpio_keys_cell.swnode = &nodes[GPIO_KEYS];
+
+	ret = devm_mfd_add_devices(dev, PLATFORM_DEVID_AUTO, &gpio_keys_cell, 1,
+				   NULL, 0, irq_domain);
+	if (ret)
+		return dev_err_probe(dev, ret, "Failed to register power-button");
+
+	return 0;
+}
+
 static int bd718xx_i2c_probe(struct i2c_client *i2c)
 {
 	struct regmap *regmap;
 	struct regmap_irq_chip_data *irq_data;
+	struct irq_domain *irq_domain;
 	int ret;
 	unsigned int chip_type;
 	struct mfd_cell *mfd;
@@ -169,20 +228,18 @@ static int bd718xx_i2c_probe(struct i2c_client *i2c)
 	if (ret)
 		return ret;
 
-	ret = regmap_irq_get_virq(irq_data, BD718XX_INT_PWRBTN_S);
-
-	if (ret < 0)
-		return dev_err_probe(&i2c->dev, ret, "Failed to get the IRQ\n");
-
-	button.irq = ret;
+	irq_domain = regmap_irq_get_domain(irq_data);
 
 	ret = devm_mfd_add_devices(&i2c->dev, PLATFORM_DEVID_AUTO,
-				   mfd, cells, NULL, 0,
-				   regmap_irq_get_domain(irq_data));
+				   mfd, cells, NULL, 0, irq_domain);
+	if (ret)
+		return dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
+
+	ret = bd718xx_i2c_register_pwrbutton(&i2c->dev, irq_domain);
 	if (ret)
-		dev_err_probe(&i2c->dev, ret, "Failed to create subdevices\n");
+		return ret;
 
-	return ret;
+	return 0;
 }
 
 static const struct of_device_id bd718xx_of_match[] = {
Signature · 1 line
2.54.0.1099.g489fc7bff1-goog
maintainer
#3 lore raw
In reply to Dmitry Torokhov
Quoted 6 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Quoted 8 lines

---> Changes in v5:
Addressed Lee's comments:
- moved static constants out of function to module level
- added #defines for nodes' indexes
- adjusted error message
- renamed "error" to "ret"
- dropped unneeded comments
- Link to v4: https://patch.msgid.link/[email protected]

I think I did already review these? Is there a reason my tags were dropped?

Yours,
-- Matti

maintainer
#4 lore raw
Quoted 17 lines · Matti Vaittinen
Quoted 6 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Quoted 9 lines

---> Changes in v5:
Addressed Lee's comments:
- moved static constants out of function to module level
- added #defines for nodes' indexes
- adjusted error message
- renamed "error" to "ret"
- dropped unneeded comments
- Link to v4: https://patch.msgid.link/20260427-rohm-software-nodes-
[email protected]

Quoted 1 line

I think I did already review these? Is there a reason my tags were dropped?

"These" referring to these patches, not the v5 changes (which seem minor to drop the tags). Furthermore, is there a reason I was not CC'd? Especially if there was a reason to drop the tags.

-- Matti

Signature · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
#5 lore raw

Hi Matti,

Quoted 18 lines · Matti Vaittinen
Quoted 17 lines · Matti Vaittinen
Quoted 15 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

---> Changes in v5:
Addressed Lee's comments:
- moved static constants out of function to module level
- added #defines for nodes' indexes
- adjusted error message
- renamed "error" to "ret"
- dropped unneeded comments
- Link to v4: https://patch.msgid.link/20260427-rohm-software-nodes-
[email protected]

Quoted 4 lines
Quoted 1 line

I think I did already review these? Is there a reason my tags were dropped?

"These" referring to these patches, not the v5 changes (which seem minor to drop the tags).

Sorry, I decided to exercise caution and not carry over the tags. I apologize for the mistake.

Quoted 2 lines

Furthermore, is there a reason I was not CC'd? Especially if there was a reason to drop the tags.

I see the following on the emails:

Quoted 1 line

To: Matti Vaittinen <[email protected]>, Lee Jones <[email protected]>

so I am not sure why they did not reach you...

Thanks.

Signature · 1 line
Dmitry
maintainer
#6 lore raw
Quoted 21 lines · Dmitry Torokhov

Hi Matti,

Quoted 18 lines · Matti Vaittinen
Quoted 17 lines · Matti Vaittinen
Quoted 15 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

---> Changes in v5:
Addressed Lee's comments:
- moved static constants out of function to module level
- added #defines for nodes' indexes
- adjusted error message
- renamed "error" to "ret"
- dropped unneeded comments
- Link to v4: https://patch.msgid.link/20260427-rohm-software-nodes-
[email protected]

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

I think I did already review these? Is there a reason my tags were dropped?

"These" referring to these patches, not the v5 changes (which seem minor to drop the tags).

Sorry, I decided to exercise caution and not carry over the tags.

Understood. I think there is no generally accepted "golden rule" when to drop the tags. I just personally prefer keeping tags unless there are functional changes. That helps me avoid going "Deja Vu" -reviews.

The patches look good to me.

Quoted 8 lines
Quoted 2 lines

Furthermore, is there a reason I was not CC'd? Especially if there was a reason to drop the tags.

I see the following on the emails:

Quoted 1 line

To: Matti Vaittinen <[email protected]>, Lee Jones <[email protected]>

so I am not sure why they did not reach you...

Ah. This is 100% my bad. I was only checking the CC-field. I need to fix my filters. Yours,
-- Matti

Signature · 5 lines
Matti Vaittinen
Linux kernel developer at ROHM Semiconductors
Oulu Finland

~~ When things go utterly wrong vim users can always type :help! ~~
maintainer Applied
#7 lore raw
In reply to Dmitry Torokhov
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Applied, thanks!

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e

--
Lee Jones [李琼斯]

maintainer
#8 lore raw
Quoted 6 lines · Lee Jones
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Quoted 6 lines

Applied, thanks!

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e

It's a shame to have so much duplicated code, but I think I've asked enough of you at this point.

Signature · 1 line
Lee Jones
#9 lore raw
Quoted 10 lines · Lee Jones
Quoted 8 lines · Lee Jones
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Applied, thanks!

Quoted 7 lines
Quoted 4 lines

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e

It's a shame to have so much duplicated code, but I think I've asked enough of you at this point.

Now that we have gnomes working for us it is pretty easy. Posted a followup patch factoring this into a helper.

BTW, would it be possible to have these 2 in an immutable branch? That would make it easier landing Arnd's changes disabling legacy gpio support.

Thanks.

Signature · 1 line
Dmitry
maintainer
#10 lore raw
Quoted 16 lines · Dmitry Torokhov
Quoted 15 lines · Lee Jones
Quoted 12 lines · Lee Jones
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Applied, thanks!

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e
Quoted 5 lines
Quoted 2 lines

It's a shame to have so much duplicated code, but I think I've asked enough of you at this point.

Now that we have gnomes working for us it is pretty easy. Posted a followup patch factoring this into a helper.

:)

Quoted 3 lines

BTW, would it be possible to have these 2 in an immutable branch? That would make it easier landing Arnd's changes disabling legacy gpio support.

Sure. Won't be until next week now though.

Note to self: This ^

Signature · 1 line
Lee Jones
#11 lore raw
Quoted 24 lines · Lee Jones
Quoted 16 lines · Dmitry Torokhov
Quoted 15 lines · Lee Jones
Quoted 12 lines · Lee Jones
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Applied, thanks!

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e
Quoted 5 lines
Quoted 2 lines

It's a shame to have so much duplicated code, but I think I've asked enough of you at this point.

Now that we have gnomes working for us it is pretty easy. Posted a followup patch factoring this into a helper.

Quoted 7 lines

:)

Quoted 3 lines

BTW, would it be possible to have these 2 in an immutable branch? That would make it easier landing Arnd's changes disabling legacy gpio support.

Sure. Won't be until next week now though.

Lee, just checking if I missed that immutable branch creation notice...

Thanks.

Signature · 1 line
Dmitry
maintainer
#12 lore raw
Quoted 27 lines · Dmitry Torokhov
Quoted 26 lines · Lee Jones
Quoted 16 lines · Dmitry Torokhov
Quoted 15 lines · Lee Jones
Quoted 12 lines · Lee Jones
Quoted 4 lines · Dmitry Torokhov

Now that gpio-keys can use platform resources to identify interrupts assigned to buttons we can convert ROHM power buttons to use software nodes and device properties for configuration, removing the need to use platform data.

Applied, thanks!

[1/2] mfd: rohm-bd71828: Use software nodes for gpio-keys

      commit: 320580a6d87705a705bb9802b13cd565880fe2ed
[2/2] mfd: rohm-bd718x7: Use software nodes for gpio-keys
      commit: 94e077e9e27b63e6c81a10e43362b683f1e82b8e
Quoted 5 lines
Quoted 2 lines

It's a shame to have so much duplicated code, but I think I've asked enough of you at this point.

Now that we have gnomes working for us it is pretty easy. Posted a followup patch factoring this into a helper.

:)

Quoted 7 lines
Quoted 5 lines
Quoted 3 lines

BTW, would it be possible to have these 2 in an immutable branch? That would make it easier landing Arnd's changes disabling legacy gpio support.

Sure. Won't be until next week now though.

Lee, just checking if I missed that immutable branch creation notice...

Nope, I've just been super busy - it's created now, just sent for testing.

Signature · 1 line
Lee Jones