* [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes
@ 2026-07-13 21:58 Dmitry Torokhov
2026-07-13 21:58 ` [PATCH v2 1/3] bcma: gpio: Add and register software node for GPIO controller Dmitry Torokhov
` (3 more replies)
0 siblings, 4 replies; 8+ messages in thread
From: Dmitry Torokhov @ 2026-07-13 21:58 UTC (permalink / raw)
To: Rafał Miłecki, Michael Buesch, Hauke Mehrtens,
Thomas Bogendoerfer
Cc: Bartosz Golaszewski, Arnd Bergmann, linux-wireless, linux-kernel,
linux-mips, Bartosz Golaszewski
This series converts the legacy gpio-keys platform device on BCM47XX
boards to use software nodes and static properties.
To do this properly without relying on legacy name-based matching
(which is being removed from gpiolib), we introduce and register
software nodes for the underlying GPIO controllers (BCMA and SSB)
and reference them in the button properties.
The first two patches add the software nodes to bcma-gpio and
ssb-gpio respectively. The third patch performs the conversion
for the BCM47XX buttons.
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
As Johannes mentioned on v1 this best should go through MIPS tree.
Changes in v2:
- Restrict software node registration to host SoC devices in both ssb
and bcma drivers to avoid conflicts when secondary buses (e.g. PCI
wireless cards) are present
- Fix dangling pointer panic in buttons driver by allocating software
node references on the heap instead of stack
- Link to v1: https://patch.msgid.link/20260704-b4-bcm47xx-swnode-v1-0-730d59340237@gmail.com
---
Dmitry Torokhov (3):
bcma: gpio: Add and register software node for GPIO controller
ssb: gpio: Add and register software node for GPIO controller
MIPS: BCM47XX: Convert buttons to software nodes
arch/mips/bcm47xx/buttons.c | 442 +++++++++++++++++++++++++-------------------
drivers/bcma/driver_gpio.c | 43 ++++-
drivers/ssb/driver_gpio.c | 48 ++++-
include/linux/bcma/bcma.h | 2 +
include/linux/ssb/ssb.h | 2 +
5 files changed, 337 insertions(+), 200 deletions(-)
---
base-commit: 49362394dad7df66c274c867a271394c10ca2bb8
change-id: 20260627-b4-bcm47xx-swnode-99836e552166
Thanks.
--
Dmitry
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH v2 1/3] bcma: gpio: Add and register software node for GPIO controller 2026-07-13 21:58 [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes Dmitry Torokhov @ 2026-07-13 21:58 ` Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 2/3] ssb: " Dmitry Torokhov ` (2 subsequent siblings) 3 siblings, 0 replies; 8+ messages in thread From: Dmitry Torokhov @ 2026-07-13 21:58 UTC (permalink / raw) To: Rafał Miłecki, Michael Buesch, Hauke Mehrtens, Thomas Bogendoerfer Cc: Bartosz Golaszewski, Arnd Bergmann, linux-wireless, linux-kernel, linux-mips We want to convert the legacy gpio-keys platform device on BCM47XX boards to use software nodes. To do this properly and allow referencing the GPIO controller by address rather than relying on name-based matching (which is being removed from the gpiolib core), we need to associate the GPIO controller with a software node. Introduce bcma_gpio_swnode, register it if the device does not already have a firmware node, and associate it with the gpio_chip. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/bcma/driver_gpio.c | 43 +++++++++++++++++++++++++++++++++++++------ include/linux/bcma/bcma.h | 2 ++ 2 files changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/bcma/driver_gpio.c b/drivers/bcma/driver_gpio.c index 658c7e2ac8bf..ea45222f2fa0 100644 --- a/drivers/bcma/driver_gpio.c +++ b/drivers/bcma/driver_gpio.c @@ -19,6 +19,11 @@ #define BCMA_GPIO_MAX_PINS 32 +const struct software_node bcma_gpio_swnode = { + .name = "bcma-gpio", +}; +EXPORT_SYMBOL_GPL(bcma_gpio_swnode); + static int bcma_gpio_get_value(struct gpio_chip *chip, unsigned gpio) { struct bcma_drv_cc *cc = gpiochip_get_data(chip); @@ -190,7 +195,20 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) chip->direction_input = bcma_gpio_direction_input; chip->direction_output = bcma_gpio_direction_output; chip->parent = bus->dev; - chip->fwnode = dev_fwnode(&cc->core->dev); + + /* + * Register software node only for the host SoC bus, unless there is + * already a firmware node assigned. There is only one SoC instance + * in the system, so there are no concerns with registration conflicts. + */ + if (bus->hosttype == BCMA_HOSTTYPE_SOC && !dev_fwnode(&cc->core->dev)) { + err = software_node_register(&bcma_gpio_swnode); + if (err) + return err; + chip->fwnode = software_node_fwnode(&bcma_gpio_swnode); + } else { + chip->fwnode = dev_fwnode(&cc->core->dev); + } switch (bus->chipinfo.id) { case BCMA_CHIP_ID_BCM4707: @@ -219,20 +237,33 @@ int bcma_gpio_init(struct bcma_drv_cc *cc) err = bcma_gpio_irq_init(cc); if (err) - return err; + goto err_unregister_swnode; err = gpiochip_add_data(chip, cc); - if (err) { - bcma_gpio_irq_exit(cc); - return err; - } + if (err) + goto err_irq_exit; return 0; + +err_irq_exit: + bcma_gpio_irq_exit(cc); +err_unregister_swnode: + if (bus->hosttype == BCMA_HOSTTYPE_SOC && + chip->fwnode && is_software_node(chip->fwnode)) { + software_node_unregister(&bcma_gpio_swnode); + chip->fwnode = NULL; + } + return err; } int bcma_gpio_unregister(struct bcma_drv_cc *cc) { bcma_gpio_irq_exit(cc); gpiochip_remove(&cc->gpio); + if (cc->core->bus->hosttype == BCMA_HOSTTYPE_SOC && + cc->gpio.fwnode && is_software_node(cc->gpio.fwnode)) { + software_node_unregister(&bcma_gpio_swnode); + cc->gpio.fwnode = NULL; + } return 0; } diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index f02cb3909375..17fc50190014 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h @@ -486,4 +486,6 @@ extern u32 bcma_core_dma_translation(struct bcma_device *core); extern unsigned int bcma_core_irq(struct bcma_device *core, int num); +extern const struct software_node bcma_gpio_swnode; + #endif /* LINUX_BCMA_H_ */ -- 2.55.0.795.g602f6c329a-goog ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/3] ssb: gpio: Add and register software node for GPIO controller 2026-07-13 21:58 [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 1/3] bcma: gpio: Add and register software node for GPIO controller Dmitry Torokhov @ 2026-07-13 21:58 ` Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 3/3] MIPS: BCM47XX: Convert buttons to software nodes Dmitry Torokhov 2026-07-14 7:12 ` [PATCH v2 0/3] MIPS: BCM47XX: convert " Arnd Bergmann 3 siblings, 0 replies; 8+ messages in thread From: Dmitry Torokhov @ 2026-07-13 21:58 UTC (permalink / raw) To: Rafał Miłecki, Michael Buesch, Hauke Mehrtens, Thomas Bogendoerfer Cc: Bartosz Golaszewski, Arnd Bergmann, linux-wireless, linux-kernel, linux-mips We want to convert the legacy gpio-keys platform device on BCM47XX boards to use software nodes. To do this properly and allow referencing the GPIO controller by address rather than relying on name-based matching (which is being removed from the gpiolib core), we need to associate the GPIO controller with a software node. Introduce ssb_gpio_swnode, register it, and associate it with the gpio_chip. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- drivers/ssb/driver_gpio.c | 48 ++++++++++++++++++++++++++++++++++++++++------- include/linux/ssb/ssb.h | 2 ++ 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/drivers/ssb/driver_gpio.c b/drivers/ssb/driver_gpio.c index 905657c925bc..87922479946c 100644 --- a/drivers/ssb/driver_gpio.c +++ b/drivers/ssb/driver_gpio.c @@ -15,8 +15,14 @@ #include <linux/interrupt.h> #include <linux/irqdomain.h> #include <linux/export.h> +#include <linux/property.h> #include <linux/ssb/ssb.h> +const struct software_node ssb_gpio_swnode = { + .name = "ssb-gpio", +}; +EXPORT_SYMBOL_GPL(ssb_gpio_swnode); + /************************************************** * Shared @@ -232,6 +238,8 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus) chip->to_irq = ssb_gpio_to_irq; #endif chip->ngpio = 16; + if (bus->bustype == SSB_BUSTYPE_SSB) + chip->fwnode = software_node_fwnode(&ssb_gpio_swnode); /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get * a random base number. @@ -433,10 +441,12 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus) * deterministic to address them more easily. The other buses could get * a random base number. */ - if (bus->bustype == SSB_BUSTYPE_SSB) - chip->base = 0; - else - chip->base = -1; + if (bus->bustype == SSB_BUSTYPE_SSB) { + chip->base = 0; + chip->fwnode = software_node_fwnode(&ssb_gpio_swnode); + } else { + chip->base = -1; + } err = ssb_gpio_irq_extif_domain_init(bus); if (err) @@ -464,11 +474,33 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus) int ssb_gpio_init(struct ssb_bus *bus) { + int err = 0; + + /* + * Register software node only for the host SoC bus. There is only + * one SoC instance in the system, so there are no concerns with + * registration conflicts. + */ + if (bus->bustype == SSB_BUSTYPE_SSB) { + err = software_node_register(&ssb_gpio_swnode); + if (err) + return err; + } + if (ssb_chipco_available(&bus->chipco)) - return ssb_gpio_chipco_init(bus); + err = ssb_gpio_chipco_init(bus); else if (ssb_extif_available(&bus->extif)) - return ssb_gpio_extif_init(bus); - return -1; + err = ssb_gpio_extif_init(bus); + else + err = -ENODEV; + + if (err) { + if (bus->bustype == SSB_BUSTYPE_SSB) + software_node_unregister(&ssb_gpio_swnode); + return err; + } + + return 0; } int ssb_gpio_unregister(struct ssb_bus *bus) @@ -476,6 +508,8 @@ int ssb_gpio_unregister(struct ssb_bus *bus) if (ssb_chipco_available(&bus->chipco) || ssb_extif_available(&bus->extif)) { gpiochip_remove(&bus->gpio); + if (bus->bustype == SSB_BUSTYPE_SSB) + software_node_unregister(&ssb_gpio_swnode); return 0; } return -1; diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 7fee9afa9458..67cb66f6f5ed 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h @@ -671,4 +671,6 @@ int ssb_pcibios_plat_dev_init(struct pci_dev *dev); int ssb_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); #endif /* CONFIG_SSB_EMBEDDED */ +extern const struct software_node ssb_gpio_swnode; + #endif /* LINUX_SSB_H_ */ -- 2.55.0.795.g602f6c329a-goog ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/3] MIPS: BCM47XX: Convert buttons to software nodes 2026-07-13 21:58 [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 1/3] bcma: gpio: Add and register software node for GPIO controller Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 2/3] ssb: " Dmitry Torokhov @ 2026-07-13 21:58 ` Dmitry Torokhov 2026-07-14 7:12 ` [PATCH v2 0/3] MIPS: BCM47XX: convert " Arnd Bergmann 3 siblings, 0 replies; 8+ messages in thread From: Dmitry Torokhov @ 2026-07-13 21:58 UTC (permalink / raw) To: Rafał Miłecki, Michael Buesch, Hauke Mehrtens, Thomas Bogendoerfer Cc: Bartosz Golaszewski, Arnd Bergmann, linux-wireless, linux-kernel, linux-mips, Bartosz Golaszewski Convert the legacy gpio-keys platform device on BCM47XX boards to use software nodes/properties. This allows us to describe the GPIO keys and their GPIO bindings using software nodes, so that support for platform data can eventually be removed from the gpio-keys driver. Detect the active bus type (BCMA or SSB) and reference the corresponding GPIO controller's software node (bcma_gpio_swnode or ssb_gpio_swnode) in the button properties. Reviewed-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com> Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> --- arch/mips/bcm47xx/buttons.c | 442 +++++++++++++++++++++++++------------------- 1 file changed, 255 insertions(+), 187 deletions(-) diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c index 46994f9bb821..151a4ee2803f 100644 --- a/arch/mips/bcm47xx/buttons.c +++ b/arch/mips/bcm47xx/buttons.c @@ -1,9 +1,14 @@ // SPDX-License-Identifier: GPL-2.0 #include "bcm47xx_private.h" -#include <linux/input.h> -#include <linux/gpio_keys.h> +#include "linux/err.h" +#include <linux/gpio/machine.h> +#include <linux/gpio/property.h> +#include <linux/input-event-codes.h> #include <linux/interrupt.h> +#include <linux/platform_device.h> +#include <linux/property.h> + #include <bcm47xx_board.h> #include <bcm47xx.h> @@ -11,29 +16,34 @@ * Database **************************************************/ -#define BCM47XX_GPIO_KEY(_gpio, _code) \ - { \ - .code = _code, \ - .gpio = _gpio, \ - .active_low = 1, \ +struct bcm47xx_gpio_key { + u16 code; + u8 pin; + u8 flags; +}; + +#define BCM47XX_GPIO_KEY(_gpio, _code) \ + { \ + .code = _code, \ + .pin = _gpio, \ + .flags = GPIO_ACTIVE_LOW, \ } -#define BCM47XX_GPIO_KEY_H(_gpio, _code) \ - { \ - .code = _code, \ - .gpio = _gpio, \ +#define BCM47XX_GPIO_KEY_H(_gpio, _code) \ + { \ + .code = _code, \ + .pin = _gpio, \ + .flags = GPIO_ACTIVE_HIGH, \ } /* Asus */ -static const struct gpio_keys_button -bcm47xx_buttons_asus_rtn10u[] __initconst = { +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_rtn10u[] __initconst = { BCM47XX_GPIO_KEY(20, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(21, KEY_RESTART), }; -static const struct gpio_keys_button -bcm47xx_buttons_asus_rtn12[] __initconst = { +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_rtn12[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(1, KEY_RESTART), BCM47XX_GPIO_KEY(4, BTN_0), /* Router mode */ @@ -41,74 +51,73 @@ bcm47xx_buttons_asus_rtn12[] __initconst = { BCM47XX_GPIO_KEY(6, BTN_2), /* AP mode */ }; -static const struct gpio_keys_button -bcm47xx_buttons_asus_rtn16[] __initconst = { +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_rtn16[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_rtn66u[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(9, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl300g[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl320ge[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl330ge[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl500g[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl500gd[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl500gpv1[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_RESTART), BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl500gpv2[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RESTART), BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl500w[] __initconst = { BCM47XX_GPIO_KEY_H(6, KEY_RESTART), BCM47XX_GPIO_KEY_H(7, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl520gc[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RESTART), BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl520gu[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RESTART), BCM47XX_GPIO_KEY(3, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wl700ge[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_POWER), /* Hard disk power switch */ BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), /* EZSetup */ @@ -116,21 +125,21 @@ bcm47xx_buttons_asus_wl700ge[] __initconst = { BCM47XX_GPIO_KEY(7, KEY_RESTART), /* Hard reset */ }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_asus_wlhdd[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; /* Huawei */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_huawei_e970[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; /* Belkin */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_belkin_f7d4301[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), @@ -138,44 +147,44 @@ bcm47xx_buttons_belkin_f7d4301[] __initconst = { /* Buffalo */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_whr2_a54g54[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_whr_g125[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode switch */ }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_whr_g54s[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY_H(4, KEY_RESTART), BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode switch */ }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_whr_hp_g54[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(5, BTN_0), /* Router / AP mode switch */ }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_wzr_g300n[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_wzr_rs_g54[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(4, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(4, KEY_RESTART), @@ -183,20 +192,20 @@ bcm47xx_buttons_buffalo_wzr_rs_g54hp[] __initconst = { /* Dell */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_dell_tm2300[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_RESTART), }; /* D-Link */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_dlink_dir130[] __initconst = { BCM47XX_GPIO_KEY(3, KEY_RESTART), BCM47XX_GPIO_KEY(7, KEY_UNKNOWN), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_dlink_dir330[] __initconst = { BCM47XX_GPIO_KEY(3, KEY_RESTART), BCM47XX_GPIO_KEY(7, KEY_UNKNOWN), @@ -204,127 +213,127 @@ bcm47xx_buttons_dlink_dir330[] __initconst = { /* Linksys */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e1000v1[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e1000v21[] __initconst = { BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(10, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e2000v1[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e2500v3[] __initconst = { BCM47XX_GPIO_KEY(9, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(10, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e3000v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e3200v1[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_RESTART), BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_e4200v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt150nv1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt150nv11[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt160nv1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt160nv3[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt300n_v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt300nv11[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_UNKNOWN), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt310nv1[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), BCM47XX_GPIO_KEY(8, KEY_UNKNOWN), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt310n_v2[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt320n_v1[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt54g3gv2[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_WIMAX), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt54g_generic[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt610nv1[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), BCM47XX_GPIO_KEY(8, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrt610nv2[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(6, KEY_RESTART), @@ -332,154 +341,154 @@ bcm47xx_buttons_linksys_wrtsl54gs[] __initconst = { /* Luxul */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_abr_4400_v1[] = { BCM47XX_GPIO_KEY(14, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xap_310_v1[] = { BCM47XX_GPIO_KEY(20, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xap_1210_v1[] = { BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xap_1230_v1[] = { BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xap_1240_v1[] = { BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xap_1500_v1[] = { BCM47XX_GPIO_KEY(14, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xbr_4400_v1[] = { BCM47XX_GPIO_KEY(14, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xvw_p30_v1[] = { BCM47XX_GPIO_KEY(20, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xwr_600_v1[] = { BCM47XX_GPIO_KEY(8, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_luxul_xwr_1750_v1[] = { BCM47XX_GPIO_KEY(14, KEY_RESTART), }; /* Microsoft */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_microsoft_nm700[] __initconst = { BCM47XX_GPIO_KEY(7, KEY_RESTART), }; /* Motorola */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_motorola_we800g[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_motorola_wr850gp[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_motorola_wr850gv2v3[] __initconst = { BCM47XX_GPIO_KEY(5, KEY_RESTART), }; /* Netgear */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_r6200_v1[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RFKILL), BCM47XX_GPIO_KEY(3, KEY_RESTART), BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_r6300_v1[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wn2500rp_v1[] __initconst = { BCM47XX_GPIO_KEY(12, KEY_RESTART), BCM47XX_GPIO_KEY(31, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wndr3400v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(8, KEY_RFKILL), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wndr3400_v3[] __initconst = { BCM47XX_GPIO_KEY(12, KEY_RESTART), BCM47XX_GPIO_KEY(23, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wndr3700v3[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_RFKILL), BCM47XX_GPIO_KEY(3, KEY_RESTART), BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wndr4500v1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(5, KEY_RFKILL), BCM47XX_GPIO_KEY(6, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wnr1000_v3[] __initconst = { BCM47XX_GPIO_KEY(2, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(3, KEY_RESTART), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wnr3500lv1[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wnr3500lv2[] __initconst = { BCM47XX_GPIO_KEY(4, KEY_RESTART), BCM47XX_GPIO_KEY(6, KEY_WPS_BUTTON), BCM47XX_GPIO_KEY(8, KEY_RFKILL), }; -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_netgear_wnr834bv2[] __initconst = { BCM47XX_GPIO_KEY(6, KEY_RESTART), }; /* SimpleTech */ -static const struct gpio_keys_button +static const struct bcm47xx_gpio_key bcm47xx_buttons_simpletech_simpleshare[] __initconst = { BCM47XX_GPIO_KEY(0, KEY_RESTART), }; @@ -488,31 +497,96 @@ bcm47xx_buttons_simpletech_simpleshare[] __initconst = { * Init **************************************************/ -static struct gpio_keys_platform_data bcm47xx_button_pdata; - -static struct platform_device bcm47xx_buttons_gpio_keys = { - .name = "gpio-keys", - .dev = { - .platform_data = &bcm47xx_button_pdata, +static int __init +bcm47xx_buttons_add(const struct bcm47xx_gpio_key *buttons, int nbuttons) +{ + struct platform_device *pdev; + const struct software_node *gpio_swnode; + struct property_entry *p; + int error; + int i; + + switch (bcm47xx_bus_type) { +#ifdef CONFIG_BCM47XX_BCMA + case BCM47XX_BUS_TYPE_BCMA: + gpio_swnode = &bcma_gpio_swnode; + break; +#endif +#ifdef CONFIG_BCM47XX_SSB + case BCM47XX_BUS_TYPE_SSB: + gpio_swnode = &ssb_gpio_swnode; + break; +#endif + default: + return -ENODEV; } -}; -/* Copy data from __initconst */ -static int __init bcm47xx_buttons_copy(const struct gpio_keys_button *buttons, - size_t nbuttons) -{ - size_t size = nbuttons * sizeof(*buttons); + /* 1 node for gpio-keys device, 1 node for each button, 1 terminator */ + const struct software_node **node_group __free(kfree) = + kcalloc(1 + nbuttons + 1, sizeof(*node_group), GFP_KERNEL); + if (!node_group) + return -ENOMEM; - bcm47xx_button_pdata.buttons = kmemdup(buttons, size, GFP_KERNEL); - if (!bcm47xx_button_pdata.buttons) + /* 1 code property, 1 gpio property, 1 terminator */ + struct property_entry *props __free(kfree) = + kcalloc(nbuttons * 3, sizeof(*props), GFP_KERNEL); + if (!props) return -ENOMEM; - bcm47xx_button_pdata.nbuttons = nbuttons; + /* 1 node for gpio-keys device, 1 node for each button */ + struct software_node *nodes __free(kfree) = + kcalloc(1 + nbuttons, sizeof(*nodes), GFP_KERNEL); + if (!nodes) + return -ENOMEM; + + struct software_node_ref_args *ref_args __free(kfree) = + kcalloc(nbuttons, sizeof(*ref_args), GFP_KERNEL); + if (!ref_args) + return -ENOMEM; + + /* gpio-keys node */ + nodes[0].name = "bcm47xx-gpio-buttons"; + + p = props; + for (i = 0; i < nbuttons; i++) { + const struct bcm47xx_gpio_key *button = &buttons[i]; + struct software_node *node = &nodes[1 + i]; + struct software_node_ref_args *ref = &ref_args[i]; + + node->parent = &nodes[0]; + node->properties = p; + + *ref = SOFTWARE_NODE_REFERENCE(gpio_swnode, button->pin, button->flags); + *p++ = PROPERTY_ENTRY_REF("gpios", &ref_args[i]); + *p++ = PROPERTY_ENTRY_U32("linux,code", button->code); + p++; + } + + for (i = 0; i < nbuttons + 1; i++) + node_group[i] = &nodes[i]; + + error = software_node_register_node_group(node_group); + if (error) + return error; + + pdev = platform_device_register_full(&(struct platform_device_info){ + .name = "gpio-keys", + .swnode = &nodes[0], + }); + error = PTR_ERR_OR_ZERO(pdev); + if (error) { + software_node_unregister_node_group(node_group); + return error; + } + + retain_and_null_ptr(props); + retain_and_null_ptr(nodes); + retain_and_null_ptr(ref_args); return 0; } -#define bcm47xx_copy_bdata(dev_buttons) \ - bcm47xx_buttons_copy(dev_buttons, ARRAY_SIZE(dev_buttons)); +#define bcm47xx_add_bdata(dev_buttons) \ + bcm47xx_buttons_add(dev_buttons, ARRAY_SIZE(dev_buttons)) int __init bcm47xx_buttons_register(void) { @@ -521,52 +595,52 @@ int __init bcm47xx_buttons_register(void) switch (board) { case BCM47XX_BOARD_ASUS_RTN10U: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn10u); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_rtn10u); break; case BCM47XX_BOARD_ASUS_RTN12: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn12); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_rtn12); break; case BCM47XX_BOARD_ASUS_RTN16: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn16); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_rtn16); break; case BCM47XX_BOARD_ASUS_RTN66U: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_rtn66u); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_rtn66u); break; case BCM47XX_BOARD_ASUS_WL300G: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl300g); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl300g); break; case BCM47XX_BOARD_ASUS_WL320GE: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl320ge); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl320ge); break; case BCM47XX_BOARD_ASUS_WL330GE: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl330ge); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl330ge); break; case BCM47XX_BOARD_ASUS_WL500G: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500g); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl500g); break; case BCM47XX_BOARD_ASUS_WL500GD: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gd); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl500gd); break; case BCM47XX_BOARD_ASUS_WL500GPV1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl500gpv1); break; case BCM47XX_BOARD_ASUS_WL500GPV2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500gpv2); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl500gpv2); break; case BCM47XX_BOARD_ASUS_WL500W: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl500w); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl500w); break; case BCM47XX_BOARD_ASUS_WL520GC: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gc); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl520gc); break; case BCM47XX_BOARD_ASUS_WL520GU: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl520gu); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl520gu); break; case BCM47XX_BOARD_ASUS_WL700GE: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wl700ge); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wl700ge); break; case BCM47XX_BOARD_ASUS_WLHDD: - err = bcm47xx_copy_bdata(bcm47xx_buttons_asus_wlhdd); + err = bcm47xx_add_bdata(bcm47xx_buttons_asus_wlhdd); break; case BCM47XX_BOARD_BELKIN_F7D3301: @@ -574,193 +648,193 @@ int __init bcm47xx_buttons_register(void) case BCM47XX_BOARD_BELKIN_F7D4301: case BCM47XX_BOARD_BELKIN_F7D4302: case BCM47XX_BOARD_BELKIN_F7D4401: - err = bcm47xx_copy_bdata(bcm47xx_buttons_belkin_f7d4301); + err = bcm47xx_add_bdata(bcm47xx_buttons_belkin_f7d4301); break; case BCM47XX_BOARD_BUFFALO_WHR2_A54G54: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr2_a54g54); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_whr2_a54g54); break; case BCM47XX_BOARD_BUFFALO_WHR_G125: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g125); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_whr_g125); break; case BCM47XX_BOARD_BUFFALO_WHR_G54S: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_g54s); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_whr_g54s); break; case BCM47XX_BOARD_BUFFALO_WHR_HP_G54: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_whr_hp_g54); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_whr_hp_g54); break; case BCM47XX_BOARD_BUFFALO_WZR_G300N: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_g300n); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_wzr_g300n); break; case BCM47XX_BOARD_BUFFALO_WZR_RS_G54: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54); break; case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP: - err = bcm47xx_copy_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp); + err = bcm47xx_add_bdata(bcm47xx_buttons_buffalo_wzr_rs_g54hp); break; case BCM47XX_BOARD_DELL_TM2300: - err = bcm47xx_copy_bdata(bcm47xx_buttons_dell_tm2300); + err = bcm47xx_add_bdata(bcm47xx_buttons_dell_tm2300); break; case BCM47XX_BOARD_DLINK_DIR130: - err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir130); + err = bcm47xx_add_bdata(bcm47xx_buttons_dlink_dir130); break; case BCM47XX_BOARD_DLINK_DIR330: - err = bcm47xx_copy_bdata(bcm47xx_buttons_dlink_dir330); + err = bcm47xx_add_bdata(bcm47xx_buttons_dlink_dir330); break; case BCM47XX_BOARD_HUAWEI_E970: - err = bcm47xx_copy_bdata(bcm47xx_buttons_huawei_e970); + err = bcm47xx_add_bdata(bcm47xx_buttons_huawei_e970); break; case BCM47XX_BOARD_LINKSYS_E1000V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e1000v1); break; case BCM47XX_BOARD_LINKSYS_E1000V21: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e1000v21); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e1000v21); break; case BCM47XX_BOARD_LINKSYS_E2000V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2000v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e2000v1); break; case BCM47XX_BOARD_LINKSYS_E2500V3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e2500v3); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e2500v3); break; case BCM47XX_BOARD_LINKSYS_E3000V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3000v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e3000v1); break; case BCM47XX_BOARD_LINKSYS_E3200V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e3200v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e3200v1); break; case BCM47XX_BOARD_LINKSYS_E4200V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_e4200v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_e4200v1); break; case BCM47XX_BOARD_LINKSYS_WRT150NV1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt150nv1); break; case BCM47XX_BOARD_LINKSYS_WRT150NV11: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt150nv11); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt150nv11); break; case BCM47XX_BOARD_LINKSYS_WRT160NV1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt160nv1); break; case BCM47XX_BOARD_LINKSYS_WRT160NV3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt160nv3); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt160nv3); break; case BCM47XX_BOARD_LINKSYS_WRT300N_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300n_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt300n_v1); break; case BCM47XX_BOARD_LINKSYS_WRT300NV11: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt300nv11); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt300nv11); break; case BCM47XX_BOARD_LINKSYS_WRT310NV1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310nv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt310nv1); break; case BCM47XX_BOARD_LINKSYS_WRT310NV2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt310n_v2); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt310n_v2); break; case BCM47XX_BOARD_LINKSYS_WRT320N_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt320n_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt320n_v1); break; case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt54g3gv2); break; case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0101: case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0467: case BCM47XX_BOARD_LINKSYS_WRT54G_TYPE_0708: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt54g_generic); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt54g_generic); break; case BCM47XX_BOARD_LINKSYS_WRT610NV1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt610nv1); break; case BCM47XX_BOARD_LINKSYS_WRT610NV2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrt610nv2); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrt610nv2); break; case BCM47XX_BOARD_LINKSYS_WRTSL54GS: - err = bcm47xx_copy_bdata(bcm47xx_buttons_linksys_wrtsl54gs); + err = bcm47xx_add_bdata(bcm47xx_buttons_linksys_wrtsl54gs); break; case BCM47XX_BOARD_LUXUL_ABR_4400_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_abr_4400_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_abr_4400_v1); break; case BCM47XX_BOARD_LUXUL_XAP_310_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_310_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xap_310_v1); break; case BCM47XX_BOARD_LUXUL_XAP_1210_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1210_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xap_1210_v1); break; case BCM47XX_BOARD_LUXUL_XAP_1230_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1230_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xap_1230_v1); break; case BCM47XX_BOARD_LUXUL_XAP_1240_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1240_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xap_1240_v1); break; case BCM47XX_BOARD_LUXUL_XAP_1500_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xap_1500_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xap_1500_v1); break; case BCM47XX_BOARD_LUXUL_XBR_4400_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xbr_4400_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xbr_4400_v1); break; case BCM47XX_BOARD_LUXUL_XVW_P30_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xvw_p30_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xvw_p30_v1); break; case BCM47XX_BOARD_LUXUL_XWR_600_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_600_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xwr_600_v1); break; case BCM47XX_BOARD_LUXUL_XWR_1750_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_luxul_xwr_1750_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_luxul_xwr_1750_v1); break; case BCM47XX_BOARD_MICROSOFT_MN700: - err = bcm47xx_copy_bdata(bcm47xx_buttons_microsoft_nm700); + err = bcm47xx_add_bdata(bcm47xx_buttons_microsoft_nm700); break; case BCM47XX_BOARD_MOTOROLA_WE800G: - err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_we800g); + err = bcm47xx_add_bdata(bcm47xx_buttons_motorola_we800g); break; case BCM47XX_BOARD_MOTOROLA_WR850GP: - err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gp); + err = bcm47xx_add_bdata(bcm47xx_buttons_motorola_wr850gp); break; case BCM47XX_BOARD_MOTOROLA_WR850GV2V3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_motorola_wr850gv2v3); + err = bcm47xx_add_bdata(bcm47xx_buttons_motorola_wr850gv2v3); break; case BCM47XX_BOARD_NETGEAR_R6200_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6200_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_r6200_v1); break; case BCM47XX_BOARD_NETGEAR_R6300_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_r6300_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_r6300_v1); break; case BCM47XX_BOARD_NETGEAR_WN2500RP_V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wn2500rp_v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wn2500rp_v1); break; case BCM47XX_BOARD_NETGEAR_WNDR3400V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wndr3400v1); break; case BCM47XX_BOARD_NETGEAR_WNDR3400_V3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3400_v3); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wndr3400_v3); break; case BCM47XX_BOARD_NETGEAR_WNDR3700V3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr3700v3); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wndr3700v3); break; case BCM47XX_BOARD_NETGEAR_WNDR4500V1: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wndr4500v1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wndr4500v1); break; case BCM47XX_BOARD_NETGEAR_WNR1000_V3: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr1000_v3); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wnr1000_v3); break; case BCM47XX_BOARD_NETGEAR_WNR3500L: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv1); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wnr3500lv1); break; case BCM47XX_BOARD_NETGEAR_WNR3500L_V2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr3500lv2); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wnr3500lv2); break; case BCM47XX_BOARD_NETGEAR_WNR834BV2: - err = bcm47xx_copy_bdata(bcm47xx_buttons_netgear_wnr834bv2); + err = bcm47xx_add_bdata(bcm47xx_buttons_netgear_wnr834bv2); break; case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: - err = bcm47xx_copy_bdata(bcm47xx_buttons_simpletech_simpleshare); + err = bcm47xx_add_bdata(bcm47xx_buttons_simpletech_simpleshare); break; default: @@ -769,13 +843,7 @@ int __init bcm47xx_buttons_register(void) } if (err) - return -ENOMEM; - - err = platform_device_register(&bcm47xx_buttons_gpio_keys); - if (err) { - pr_err("Failed to register platform device: %d\n", err); return err; - } return 0; } -- 2.55.0.795.g602f6c329a-goog ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes 2026-07-13 21:58 [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes Dmitry Torokhov ` (2 preceding siblings ...) 2026-07-13 21:58 ` [PATCH v2 3/3] MIPS: BCM47XX: Convert buttons to software nodes Dmitry Torokhov @ 2026-07-14 7:12 ` Arnd Bergmann 2026-07-14 22:49 ` Waldemar Brodkorb 3 siblings, 1 reply; 8+ messages in thread From: Arnd Bergmann @ 2026-07-14 7:12 UTC (permalink / raw) To: Dmitry Torokhov, Rafał Miłecki, Michael Büsch, Hauke Mehrtens, Thomas Bogendoerfer, Waldemar Brodkorb Cc: Bartosz Golaszewski, linux-wireless, linux-kernel, linux-mips, Bartosz Golaszewski On Mon, Jul 13, 2026, at 23:58, Dmitry Torokhov wrote: > This series converts the legacy gpio-keys platform device on BCM47XX > boards to use software nodes and static properties. > > To do this properly without relying on legacy name-based matching > (which is being removed from gpiolib), we introduce and register > software nodes for the underlying GPIO controllers (BCMA and SSB) > and reference them in the button properties. > > The first two patches add the software nodes to bcma-gpio and > ssb-gpio respectively. The third patch performs the conversion > for the BCM47XX buttons. > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > --- > As Johannes mentioned on v1 this best should go through MIPS tree. Adding Waldemar to Cc. He has recently done some work to get this platform working again in FreeWRT and should be able to test your patches on hardware. Arnd ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes 2026-07-14 7:12 ` [PATCH v2 0/3] MIPS: BCM47XX: convert " Arnd Bergmann @ 2026-07-14 22:49 ` Waldemar Brodkorb 2026-07-15 6:09 ` Dmitry Torokhov 0 siblings, 1 reply; 8+ messages in thread From: Waldemar Brodkorb @ 2026-07-14 22:49 UTC (permalink / raw) To: Arnd Bergmann Cc: Dmitry Torokhov, Rafał Miłecki, Michael Büsch, Hauke Mehrtens, Thomas Bogendoerfer, Waldemar Brodkorb, Bartosz Golaszewski, linux-wireless, linux-kernel, linux-mips, Bartosz Golaszewski [-- Attachment #1: Type: text/plain, Size: 1765 bytes --] Hi, Arnd Bergmann wrote, > On Mon, Jul 13, 2026, at 23:58, Dmitry Torokhov wrote: > > This series converts the legacy gpio-keys platform device on BCM47XX > > boards to use software nodes and static properties. > > > > To do this properly without relying on legacy name-based matching > > (which is being removed from gpiolib), we introduce and register > > software nodes for the underlying GPIO controllers (BCMA and SSB) > > and reference them in the button properties. > > > > The first two patches add the software nodes to bcma-gpio and > > ssb-gpio respectively. The third patch performs the conversion > > for the BCM47XX buttons. > > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > --- > > As Johannes mentioned on v1 this best should go through MIPS tree. > > Adding Waldemar to Cc. He has recently done some work to > get this platform working again in FreeWRT and should > be able to test your patches on hardware. I normally use LTS kernel on the hardware (Linksys WRT54GS v1.0). But for testing I updated to 7.1.3. Attached is the dmesg without Dmitry's patches. Button works, I can go into failsafe mode after pressing the reset button on bootup. With Dmitry's three patches applied I directly getting into failsafe mode without pressing any button. Dmesg looks similar, but I get following kernel message: platform gpio-keys.0: deferred probe pending: gpio-keys: failed to get gpio Looking at /dev I see no /dev/input/event0 device node anymore. Attached is the small failsafe script I use on bootup. Hope this helps. Do I need to change my failsafe script for the new stuff or is something else broken now? Do I miss some new kernel config option? Or is the patch only for latest Linus git repo. best regards Waldemar [-- Attachment #2: dmesg.txt --] [-- Type: text/plain, Size: 10303 bytes --] Linux version 7.1.3 (wbx@macbook) (mipsel-freewrt-linux-uclibc-gcc (GCC) 16.1.0, GNU ld (GNU Binutils) 2.46.1) #1 Tue Jul 14 22:54:31 CEST 2026 printk: legacy bootconsole [early0] enabled CPU0 revision is: 00029007 (Broadcom BMIPS3300) bcm47xx: Using ssb bus ssb: Found chip with id 0x4712, rev 0x01 and package 0x00 can not parse nvram name (null)ag0(null) with value 255 got -34 ssb: Sonics Silicon Backplane found at address 0x18000000 Primary instruction cache 8kB, VIPT, 2-way, linesize 16 bytes. Primary data cache 4kB, 2-way, VIPT, no aliases, linesize 16 bytes Zone ranges: Normal [mem 0x0000000000000000-0x0000000001ffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x0000000001ffffff] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: [0] 0 Kernel command line: root=/dev/mtdblock4 rootfstype=squashfs init=/etc/preinit noinitrd console=ttyS0,115200 Unknown kernel command line parameters "noinitrd", will be passed to user space. printk: log buffer data + meta data: 131072 + 409600 = 540672 bytes Dentry cache hash table entries: 4096 (order: 2, 16384 bytes, linear) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes, linear) Built 1 zonelists, mobility grouping on. Total pages: 8192 mem auto-init: stack:all(zero), heap alloc:off, heap free:off SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS: 256 MIPS: machine is Linksys WRT54G/GS/GL clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns Console: colour dummy device 80x25 Calibrating delay loop... 198.65 BogoMIPS (lpj=397312) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) VFS: Finished mounting rootfs on nullfs Memory: 25676K/32768K available (4010K kernel code, 555K rwdata, 956K rodata, 228K init, 268K bss, 6348K reserved, 0K cma-reserved) devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns posixtimers hash table entries: 512 (order: 0, 2048 bytes, linear) futex hash table entries: 256 (4096 bytes on 1 NUMA nodes, total 4 KiB, linear). NET: Registered PF_NETLINK/PF_ROUTE protocol family clocksource: Switched to clocksource MIPS PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff] pci_bus 0000:00: root bus resource [io 0x0100-0x07ff] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] pci 0000:00:00.0: PCI: Fixing up bridge 0000:00:00.0 pci 0000:00:00.0: PCI: Fixing up device 0000:00:00.0 pci 0000:00:00.0: PCI: Fixing latency timer of device 0000:00:00.0 to 168 pci 0000:00:00.0: ssb_pcicore_fixup_pcibridge+0x0/0xf8 took 17926 usecs pci 0000:00:00.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:00.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:00.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:01.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:01.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:01.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:02.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:02.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:02.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:03.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:03.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:03.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:04.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:04.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:04.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:05.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:05.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:05.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:06.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:06.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:06.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:07.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:07.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:07.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:08.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:08.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:08.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:09.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:09.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:09.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0a.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0a.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0a.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0b.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0b.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0b.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0c.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0c.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0c.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0d.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0d.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0d.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0e.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0e.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0e.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0f.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0f.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0f.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00 gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. NET: Registered PF_INET protocol family IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear) tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear) Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear) TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 1, 8192 bytes, linear) NET: Registered PF_UNIX/PF_LOCAL protocol family PCI: CLS 0 bytes, default 16 Initialise system trusted keyrings workingset: timestamp_bits=30 (anon: 26) max_order=13 bucket_order=0 (anon: 0) squashfs: version 4.0 (2009/01/31) Phillip Lougher Key type asymmetric registered Asymmetric key parser 'x509' registered io scheduler mq-deadline registered Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled printk: legacy console [ttyS0] disabled serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 3, base_baud = 3125000) is a 16550A printk: legacy console [ttyS0] enabled printk: legacy bootconsole [early0] disabled serial8250.0: ttyS1 at MMIO 0xb8000400 (irq = 3, base_baud = 3125000) is a 16550A physmap-flash physmap-flash.0: physmap platform flash device: [mem 0x1c000000-0x1e000000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x000017 physmap-flash.0: Found an alias at 0x800000 for the chip at 0x0 physmap-flash.0: Found an alias at 0x1000000 for the chip at 0x0 physmap-flash.0: Found an alias at 0x1800000 for the chip at 0x0 Intel/Sharp Extended Query Table at 0x0031 Intel/Sharp Extended Query Table at 0x0031 Using buffer write method cfi_cmdset_0001: Erase suspend on write enabled erase region 0: offset=0x0,size=0x20000,blocks=64 4 bcm47xxpart partitions found on MTD device physmap-flash.0 Creating 4 MTD partitions on "physmap-flash.0": 0x000000000000-0x000000040000 : "boot" 0x000000040000-0x0000007c0000 : "firmware" failed to parse "brcm,trx-magic" DT attribute, using default: -89 3 trx partitions found on MTD device firmware Creating 3 MTD partitions on "firmware": 0x00000000001c-0x000000000938 : "loader" mtd: partition "loader" doesn't start on an erase/write block boundary -- force read-only 0x000000000938-0x0000001c0800 : "linux" mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only 0x0000001c0800-0x000000780000 : "rootfs" mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only 0x0000007c0000-0x0000007e0000 : "fwcf" 0x0000007e0000-0x000000800000 : "nvram" b44 ssb0:1: could not find PHY at 30, use fixed one Generic PHY fixed-0:00: attached PHY driver (mii_bus:phy_addr=fixed-0:00, irq=POLL) b44 ssb0:1 eth0: Broadcom 44xx/47xx 10/100 PCI ethernet driver 00:0f:66:c8:74:47 NET: Registered PF_PACKET protocol family 8021q: 802.1Q VLAN Support v1.8 Loading compiled-in X.509 certificates input: gpio-keys as /devices/platform/gpio-keys.0/input/input0 VFS: Mounted root (squashfs filesystem) readonly on device 31:4. devtmpfs: mounted VFS: Pivoted into new rootfs Freeing unused kernel image (initmem) memory: 228K This architecture does not have kernel memory protection. Run /etc/preinit as init process with arguments: /etc/preinit noinitrd with environment: HOME=/ TERM=linux random: crng init done b44 ssb0:1 eth0: Link is up at 100 Mbps, half duplex b44 ssb0:1 eth0: Flow control is off for TX and off for RX b44 ssb0:1 eth0: Link is Up - 100Mbps/Full - flow control off cfg80211: Loading compiled-in X.509 certificates for regulatory database Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7' Loaded X.509 cert 'wens: 61c038651aabdcf94bd0ac7ff06c7248db18c600' faux_driver regulatory: Direct firmware load for regulatory.db failed with error -2 cfg80211: failed to load regulatory.db adm6996: adm6996_gpio: ADM6996L model PHY found. b43-phy0: Broadcom 4712 WLAN found (core revision 7) b43-phy0: Found PHY: Analog 2, Type 2 (G), Revision 2 b43-phy0: Found Radio: Manuf 0x17F, ID 0x2050, Revision 2, Version 0 Broadcom 43xx driver loaded [ Features: PL ] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht' [-- Attachment #3: failsafe --] [-- Type: text/plain, Size: 1318 bytes --] #!/bin/sh # detect router id=$(nvram get productid) case "$id" in WL500*) LED_PATH="/sys/class/leds/bcm47xx:unk:power" ;; *) LED_PATH="/sys/class/leds/bcm47xx:green:dmz" ;; esac # CONFIGURE EVENT_DEV="/dev/input/event0" # change if your reset button is on a different event device KEY_CODE="KEY_RESTART" # as reported by evtest FAILSAFE_IP="192.168.1.1" FAILSAFE_BCAST="192.168.1.255" # Bring up LAN ip link set up dev eth0 ip addr add ${FAILSAFE_IP}/24 broadcast ${FAILSAFE_BCAST} dev eth0 # Warn the user netmsg ${FAILSAFE_BCAST} "Press reset now, to enter Failsafe!" echo "Press reset now to enter Failsafe!" sleep 2 & # Check for reset press during the 2s window # We'll read the event stream for KEY_RESTART with value 1 (press) pressed=0 timeout 2 sh -c " evtest ${EVENT_DEV} 2>/dev/null | \ grep -m1 '${KEY_CODE}.*value 1' && exit 0 || exit 1 " if [ $? -eq 0 ]; then pressed=1 fi if [ "$pressed" -eq 1 ]; then # Blink LED in background ( while :; do echo 1 > ${LED_PATH}/brightness sleep 0.5 echo 0 > ${LED_PATH}/brightness sleep 0.5 done ) & netmsg ${FAILSAFE_BCAST} "Entering Failsafe!" telnetd -l /bin/sh exit 1 else ip addr flush dev eth0 killall evtest fi ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes 2026-07-14 22:49 ` Waldemar Brodkorb @ 2026-07-15 6:09 ` Dmitry Torokhov 2026-07-15 10:16 ` Waldemar Brodkorb 0 siblings, 1 reply; 8+ messages in thread From: Dmitry Torokhov @ 2026-07-15 6:09 UTC (permalink / raw) To: Arnd Bergmann, Rafał Miłecki, Michael Büsch, Hauke Mehrtens, Thomas Bogendoerfer, Waldemar Brodkorb, Bartosz Golaszewski, linux-wireless, linux-kernel, linux-mips, Bartosz Golaszewski Hi Waldemar, On Wed, Jul 15, 2026 at 12:49:47AM +0200, Waldemar Brodkorb wrote: > Hi, > Arnd Bergmann wrote, > > > On Mon, Jul 13, 2026, at 23:58, Dmitry Torokhov wrote: > > > This series converts the legacy gpio-keys platform device on BCM47XX > > > boards to use software nodes and static properties. > > > > > > To do this properly without relying on legacy name-based matching > > > (which is being removed from gpiolib), we introduce and register > > > software nodes for the underlying GPIO controllers (BCMA and SSB) > > > and reference them in the button properties. > > > > > > The first two patches add the software nodes to bcma-gpio and > > > ssb-gpio respectively. The third patch performs the conversion > > > for the BCM47XX buttons. > > > > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > > --- > > > As Johannes mentioned on v1 this best should go through MIPS tree. > > > > Adding Waldemar to Cc. He has recently done some work to > > get this platform working again in FreeWRT and should > > be able to test your patches on hardware. > > I normally use LTS kernel on the hardware (Linksys WRT54GS v1.0). > But for testing I updated to 7.1.3. Attached is the dmesg without > Dmitry's patches. Button works, I can go into failsafe mode after > pressing the reset button on bootup. > > With Dmitry's three patches applied I directly getting into failsafe > mode without pressing any button. Dmesg looks similar, but I get > following kernel message: > platform gpio-keys.0: deferred probe pending: gpio-keys: failed to get gpio > > Looking at /dev I see no /dev/input/event0 device node anymore. > > Attached is the small failsafe script I use on bootup. > Hope this helps. > > Do I need to change my failsafe script for the new stuff or is > something else broken now? Do I miss some new kernel config option? > Or is the patch only for latest Linus git repo. Thank you very much for testing. I think 7.1 should work. Could you please apply the test patch below and send me new dmesg? Hopefully I'll be able to figure out where I messed up. diff --git a/arch/mips/bcm47xx/buttons.c b/arch/mips/bcm47xx/buttons.c index 151a4ee2803f..72524dc390dd 100644 --- a/arch/mips/bcm47xx/buttons.c +++ b/arch/mips/bcm47xx/buttons.c @@ -521,6 +521,9 @@ bcm47xx_buttons_add(const struct bcm47xx_gpio_key *buttons, int nbuttons) return -ENODEV; } + pr_info("XXX: bcm47xx_buttons_add called, bus_type=%d, gpio_swnode=%p (&ssb_gpio_swnode=%p)\n", + bcm47xx_bus_type, gpio_swnode, &ssb_gpio_swnode); + /* 1 node for gpio-keys device, 1 node for each button, 1 terminator */ const struct software_node **node_group __free(kfree) = kcalloc(1 + nbuttons + 1, sizeof(*node_group), GFP_KERNEL); diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 869228a65cb3..20f89e6a57f6 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -561,8 +561,11 @@ software_node_get_reference_args(const struct fwnode_handle *fwnode, else return -EINVAL; - if (!refnode) + if (!refnode) { + pr_info("XXX: software_node_get_reference_args: refnode is NULL for swnode=%p (%s), fwnode=%p\n", + ref->swnode, ref->swnode ? ref->swnode->name : "none", ref->fwnode); return -ENOTCONN; + } if (nargs_prop) { error = fwnode_property_read_u32(refnode, nargs_prop, &nargs_prop_val); diff --git a/drivers/ssb/driver_gpio.c b/drivers/ssb/driver_gpio.c index 87922479946c..28de62a42140 100644 --- a/drivers/ssb/driver_gpio.c +++ b/drivers/ssb/driver_gpio.c @@ -238,8 +238,10 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus) chip->to_irq = ssb_gpio_to_irq; #endif chip->ngpio = 16; - if (bus->bustype == SSB_BUSTYPE_SSB) + if (bus->bustype == SSB_BUSTYPE_SSB) { chip->fwnode = software_node_fwnode(&ssb_gpio_swnode); + pr_info("XXX: chipcommon chip->fwnode set to %p\n", chip->fwnode); + } /* There is just one SoC in one device and its GPIO addresses should be * deterministic to address them more easily. The other buses could get * a random base number. @@ -444,6 +446,7 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus) if (bus->bustype == SSB_BUSTYPE_SSB) { chip->base = 0; chip->fwnode = software_node_fwnode(&ssb_gpio_swnode); + pr_info("XXX: extif chip->fwnode set to %p\n", chip->fwnode); } else { chip->base = -1; } @@ -481,8 +484,10 @@ int ssb_gpio_init(struct ssb_bus *bus) * one SoC instance in the system, so there are no concerns with * registration conflicts. */ + pr_info("XXX: ssb_gpio_init called, bustype=%d\n", bus->bustype); if (bus->bustype == SSB_BUSTYPE_SSB) { err = software_node_register(&ssb_gpio_swnode); + pr_info("XXX: software_node_register(&ssb_gpio_swnode) returned %d\n", err); if (err) return err; } Thanks. -- Dmitry ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes 2026-07-15 6:09 ` Dmitry Torokhov @ 2026-07-15 10:16 ` Waldemar Brodkorb 0 siblings, 0 replies; 8+ messages in thread From: Waldemar Brodkorb @ 2026-07-15 10:16 UTC (permalink / raw) To: Dmitry Torokhov Cc: Arnd Bergmann, Rafał Miłecki, Michael Büsch, Hauke Mehrtens, Thomas Bogendoerfer, Waldemar Brodkorb, Bartosz Golaszewski, linux-wireless, linux-kernel, linux-mips, Bartosz Golaszewski [-- Attachment #1: Type: text/plain, Size: 2308 bytes --] H Dmitry, Dmitry Torokhov wrote, > Hi Waldemar, > > On Wed, Jul 15, 2026 at 12:49:47AM +0200, Waldemar Brodkorb wrote: > > Hi, > > Arnd Bergmann wrote, > > > > > On Mon, Jul 13, 2026, at 23:58, Dmitry Torokhov wrote: > > > > This series converts the legacy gpio-keys platform device on BCM47XX > > > > boards to use software nodes and static properties. > > > > > > > > To do this properly without relying on legacy name-based matching > > > > (which is being removed from gpiolib), we introduce and register > > > > software nodes for the underlying GPIO controllers (BCMA and SSB) > > > > and reference them in the button properties. > > > > > > > > The first two patches add the software nodes to bcma-gpio and > > > > ssb-gpio respectively. The third patch performs the conversion > > > > for the BCM47XX buttons. > > > > > > > > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> > > > > --- > > > > As Johannes mentioned on v1 this best should go through MIPS tree. > > > > > > Adding Waldemar to Cc. He has recently done some work to > > > get this platform working again in FreeWRT and should > > > be able to test your patches on hardware. > > > > I normally use LTS kernel on the hardware (Linksys WRT54GS v1.0). > > But for testing I updated to 7.1.3. Attached is the dmesg without > > Dmitry's patches. Button works, I can go into failsafe mode after > > pressing the reset button on bootup. > > > > With Dmitry's three patches applied I directly getting into failsafe > > mode without pressing any button. Dmesg looks similar, but I get > > following kernel message: > > platform gpio-keys.0: deferred probe pending: gpio-keys: failed to get gpio > > > > Looking at /dev I see no /dev/input/event0 device node anymore. > > > > Attached is the small failsafe script I use on bootup. > > Hope this helps. > > > > Do I need to change my failsafe script for the new stuff or is > > something else broken now? Do I miss some new kernel config option? > > Or is the patch only for latest Linus git repo. > > Thank you very much for testing. I think 7.1 should work. Could you > please apply the test patch below and send me new dmesg? Hopefully I'll > be able to figure out where I messed up. > > Thanks. Attached. Should we shorten the CC List next time? best regards Waldemar [-- Attachment #2: dmesg-debug.txt --] [-- Type: text/plain, Size: 10136 bytes --] Linux version 7.1.3 (wbx@macbook) (mipsel-freewrt-linux-uclibc-gcc (GCC) 16.1.0, GNU ld (GNU Binutils) 2.46.1) #1 Wed Jul 15 11:24:45 CEST 2026 printk: legacy bootconsole [early0] enabled CPU0 revision is: 00029007 (Broadcom BMIPS3300) bcm47xx: Using ssb bus ssb: Found chip with id 0x4712, rev 0x01 and package 0x00 can not parse nvram name (null)ag0(null) with value 255 got -34 ssb: Sonics Silicon Backplane found at address 0x18000000 Primary instruction cache 8kB, VIPT, 2-way, linesize 16 bytes. Primary data cache 4kB, 2-way, VIPT, no aliases, linesize 16 bytes Zone ranges: Normal [mem 0x0000000000000000-0x0000000001ffffff] Movable zone start for each node Early memory node ranges node 0: [mem 0x0000000000000000-0x0000000001ffffff] Initmem setup node 0 [mem 0x0000000000000000-0x0000000001ffffff] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 pcpu-alloc: [0] 0 Kernel command line: root=/dev/mtdblock4 rootfstype=squashfs init=/etc/preinit noinitrd console=ttyS0,115200 Unknown kernel command line parameters "noinitrd", will be passed to user space. printk: log buffer data + meta data: 131072 + 409600 = 540672 bytes Dentry cache hash table entries: 4096 (order: 2, 16384 bytes, linear) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes, linear) Built 1 zonelists, mobility grouping on. Total pages: 8192 mem auto-init: stack:all(zero), heap alloc:off, heap free:off SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS: 256 MIPS: machine is Linksys WRT54G/GS/GL clocksource: MIPS: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604467 ns sched_clock: 32 bits at 100MHz, resolution 10ns, wraps every 21474836475ns Console: colour dummy device 80x25 Calibrating delay loop... 198.65 BogoMIPS (lpj=397312) pid_max: default: 32768 minimum: 301 Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear) VFS: Finished mounting rootfs on nullfs Memory: 25676K/32768K available (4009K kernel code, 556K rwdata, 956K rodata, 228K init, 268K bss, 6348K reserved, 0K cma-reserved) devtmpfs: initialized clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns posixtimers hash table entries: 512 (order: 0, 2048 bytes, linear) futex hash table entries: 256 (4096 bytes on 1 NUMA nodes, total 4 KiB, linear). NET: Registered PF_NETLINK/PF_ROUTE protocol family clocksource: Switched to clocksource MIPS PCI host bridge to bus 0000:00 pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff] pci_bus 0000:00: root bus resource [io 0x0100-0x07ff] pci_bus 0000:00: No busn resource found for root bus, will use [bus 00-ff] pci 0000:00:00.0: PCI: Fixing up bridge 0000:00:00.0 pci 0000:00:00.0: PCI: Fixing up device 0000:00:00.0 pci 0000:00:00.0: PCI: Fixing latency timer of device 0000:00:00.0 to 168 pci 0000:00:00.0: ssb_pcicore_fixup_pcibridge+0x0/0xf8 took 17901 usecs pci 0000:00:00.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:00.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:00.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:01.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:01.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:01.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:02.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:02.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:02.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:03.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:03.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:03.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:04.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:04.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:04.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:05.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:05.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:05.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:06.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:06.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:06.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:07.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:07.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:07.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:08.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:08.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:08.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:09.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:09.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:09.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0a.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0a.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0a.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0b.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0b.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0b.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0c.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0c.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0c.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0d.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0d.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0d.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0e.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0e.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0e.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci 0000:00:0f.0: [14e4:4712] type 00 class 0x060000 conventional PCI endpoint pci 0000:00:0f.0: BAR 0 [mem 0x00000000-0x00001fff] pci 0000:00:0f.0: BAR 1 [mem 0x00000000-0x07ffffff pref] pci_bus 0000:00: busn_res: [bus 00-ff] end is updated to 00 ssb: XXX: ssb_gpio_init called, bustype=0 ssb: XXX: software_node_register(&ssb_gpio_swnode) returned 0 ssb: XXX: chipcommon chip->fwnode set to (ptrval) gpio gpiochip0: Static allocation of GPIO base is deprecated, use dynamic allocation. NET: Registered PF_INET protocol family IP idents hash table entries: 2048 (order: 2, 16384 bytes, linear) tcp_listen_portaddr_hash hash table entries: 1024 (order: 0, 4096 bytes, linear) Table-perturb hash table entries: 65536 (order: 6, 262144 bytes, linear) TCP established hash table entries: 1024 (order: 0, 4096 bytes, linear) TCP bind hash table entries: 1024 (order: 1, 8192 bytes, linear) TCP: Hash tables configured (established 1024 bind 1024) UDP hash table entries: 256 (order: 1, 8192 bytes, linear) NET: Registered PF_UNIX/PF_LOCAL protocol family PCI: CLS 0 bytes, default 16 bcm47xx: XXX: bcm47xx_buttons_add called, bus_type=0, gpio_swnode=(ptrval) (&ssb_gpio_swnode=(ptrval)) Initialise system trusted keyrings workingset: timestamp_bits=30 (anon: 26) max_order=13 bucket_order=0 (anon: 0) squashfs: version 4.0 (2009/01/31) Phillip Lougher Key type asymmetric registered Asymmetric key parser 'x509' registered io scheduler mq-deadline registered Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled printk: legacy console [ttyS0] disabled serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 3, base_baud = 3125000) is a 16550A printk: legacy console [ttyS0] enabled printk: legacy bootconsole [early0] disabled serial8250.0: ttyS1 at MMIO 0xb8000400 (irq = 3, base_baud = 3125000) is a 16550A physmap-flash physmap-flash.0: physmap platform flash device: [mem 0x1c000000-0x1e000000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000089 Chip ID 0x000017 physmap-flash.0: Found an alias at 0x800000 for the chip at 0x0 physmap-flash.0: Found an alias at 0x1000000 for the chip at 0x0 physmap-flash.0: Found an alias at 0x1800000 for the chip at 0x0 Intel/Sharp Extended Query Table at 0x0031 Intel/Sharp Extended Query Table at 0x0031 Using buffer write method cfi_cmdset_0001: Erase suspend on write enabled erase region 0: offset=0x0,size=0x20000,blocks=64 4 bcm47xxpart partitions found on MTD device physmap-flash.0 Creating 4 MTD partitions on "physmap-flash.0": 0x000000000000-0x000000040000 : "boot" 0x000000040000-0x0000007c0000 : "firmware" failed to parse "brcm,trx-magic" DT attribute, using default: -89 3 trx partitions found on MTD device firmware Creating 3 MTD partitions on "firmware": 0x00000000001c-0x000000000938 : "loader" mtd: partition "loader" doesn't start on an erase/write block boundary -- force read-only 0x000000000938-0x0000001c0800 : "linux" mtd: partition "linux" doesn't start on an erase/write block boundary -- force read-only 0x0000001c0800-0x000000780000 : "rootfs" mtd: partition "rootfs" doesn't start on an erase/write block boundary -- force read-only 0x0000007c0000-0x0000007e0000 : "fwcf" 0x0000007e0000-0x000000800000 : "nvram" b44 ssb0:1: could not find PHY at 30, use fixed one Generic PHY fixed-0:00: attached PHY driver (mii_bus:phy_addr=fixed-0:00, irq=POLL) b44 ssb0:1 eth0: Broadcom 44xx/47xx 10/100 PCI ethernet driver 00:0f:66:c8:74:47 NET: Registered PF_PACKET protocol family 8021q: 802.1Q VLAN Support v1.8 Loading compiled-in X.509 certificates XXX: software_node_get_reference_args: refnode is NULL for swnode=(ptrval) (gpio-keys), fwnode=(ptrval) VFS: Mounted root (squashfs filesystem) readonly on device 31:4. devtmpfs: mounted VFS: Pivoted into new rootfs Freeing unused kernel image (initmem) memory: 228K This architecture does not have kernel memory protection. Run /etc/preinit as init process with arguments: /etc/preinit noinitrd with environment: HOME=/ TERM=linux random: crng init done b44 ssb0:1 eth0: Link is up at 100 Mbps, half duplex b44 ssb0:1 eth0: Flow control is off for TX and off for RX b44 ssb0:1 eth0: Link is Up - 100Mbps/Full - flow control off XXX: software_node_get_reference_args: refnode is NULL for swnode=8d67cb1c ((efault)), fwnode=b3963255 platform gpio-keys.0: deferred probe pending: gpio-keys: failed to get gpio ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-07-15 10:16 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-13 21:58 [PATCH v2 0/3] MIPS: BCM47XX: convert buttons to software nodes Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 1/3] bcma: gpio: Add and register software node for GPIO controller Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 2/3] ssb: " Dmitry Torokhov 2026-07-13 21:58 ` [PATCH v2 3/3] MIPS: BCM47XX: Convert buttons to software nodes Dmitry Torokhov 2026-07-14 7:12 ` [PATCH v2 0/3] MIPS: BCM47XX: convert " Arnd Bergmann 2026-07-14 22:49 ` Waldemar Brodkorb 2026-07-15 6:09 ` Dmitry Torokhov 2026-07-15 10:16 ` Waldemar Brodkorb
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox