From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 25E8140912F; Wed, 20 May 2026 18:38:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302332; cv=none; b=SmA6WK9u3tUlzUjY9CRPRnfHEUJO4jUarrtM7JJWoGSZE9ZQXu1JWBqCI/U6Nl3pZGraBZI3Rhn9YXgRAboXkAUDa/7xQ1pTbCwP8DxRmlY2wz5TqEu2Ytjfcew1mbPwjEBaVAnpDheuXZ3X9FSWBH8yr7Ix9x/dkqZ6xb0xnMc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302332; c=relaxed/simple; bh=1uIYsBlYCCURxvKJdpYbZfhrVZG+Ug+sWEkN8fOwQu4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ZT0wgcGKyhYVqHOY+UzRRwk2/slmwe6SjBFTRFCJLAZSQzDSq9m/iYtT8ivqzU/VGdSrkji3OXwPCrh4gYM5+RjeVUawtriN4fOR1QIZ+ShZhEoOoq5IShCshOTYvOYBdljzWITaMCDeYnrn48cOn8Nh2iWoH6uico4l65RCxIA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KXZeHaPR; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KXZeHaPR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDED81F000E9; Wed, 20 May 2026 18:38:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302330; bh=OihGU8GjnijwcJjYa7+wFrCgBMw2htDhLPLO3V9LDKo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KXZeHaPRR8PFRf6v3WbMGaE4h2e+phVAjclh6YrbU8/Lh30S1WnQh6D2cAZsKIvx3 ooj+c0nJ5zgvzWmRJtXqVxMBBqg9VEHsMzArwyApKImyeWf4TQYfxl+Uo9OuezgSS4 gHjbr0aoTi1PDTKJd0y2VdCVlbE/5NcqLEvW7W0Pvet4GQJvAYRxypzeWuWo2SHz0Q 20hjYFyodZ8pxrxtrPPKTwGKsDOCTTBMWx68/BeTG134a3OwHTK/ypOJ5GqSXxa9oz cHUc0Iawh0eeXsRkWgBW5jl1dOmZpPBPpo/qu8NUpG6lAJP5it3ASNgYGBDT+qSeAD htUD0N1w+PRRw== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 01/10] [v2] [net-next] net: dsa: b53: hide legacy gpiolib usage on non-mips Date: Wed, 20 May 2026 20:38:06 +0200 Message-Id: <20260520183815.2510387-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The MIPS bcm53xx platform still uses the legacy gpiolib interfaces based on gpio numbers, but other platforms do not. Hide these interfaces inside of the existing #ifdef block and use the modern interfaces in the common parts of the driver to allow building it when the gpio_set_value() is left out of the kernel. Reviewed-by: Jonas Gorski Reviewed-by: Linus Walleij Reviewed-by: Florian Fainelli Reviewed-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann --- drivers/net/dsa/b53/b53_common.c | 17 +++++------------ drivers/net/dsa/b53/b53_priv.h | 25 +++++++++++++++++++------ 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/drivers/net/dsa/b53/b53_common.c b/drivers/net/dsa/b53/b53_com= mon.c index 2c4131ed7e30..d838511ae674 100644 --- a/drivers/net/dsa/b53/b53_common.c +++ b/drivers/net/dsa/b53/b53_common.c @@ -19,7 +19,7 @@ =20 #include #include -#include +#include #include #include #include @@ -965,17 +965,17 @@ EXPORT_SYMBOL(b53_configure_vlan); =20 static void b53_switch_reset_gpio(struct b53_device *dev) { - int gpio =3D dev->reset_gpio; + struct gpio_desc *gpio =3D dev->reset_gpio; =20 - if (gpio < 0) + if (IS_ERR(gpio)) return; =20 /* Reset sequence: RESET low(50ms)->high(20ms) */ - gpio_set_value(gpio, 0); + gpiod_set_value(gpio, 0); mdelay(50); =20 - gpio_set_value(gpio, 1); + gpiod_set_value(gpio, 1); mdelay(20); =20 dev->current_page =3D 0xff; @@ -3092,7 +3092,6 @@ static int b53_switch_init(struct b53_device *dev) { u32 chip_id =3D dev->chip_id; unsigned int i; - int ret; =20 if (is63xx(dev)) chip_id =3D BCM63XX_DEVICE_ID; @@ -3173,12 +3172,6 @@ static int b53_switch_init(struct b53_device *dev) return -ENOMEM; =20 dev->reset_gpio =3D b53_switch_get_reset_gpio(dev); - if (dev->reset_gpio >=3D 0) { - ret =3D devm_gpio_request_one(dev->dev, dev->reset_gpio, - GPIOF_OUT_INIT_HIGH, "robo_reset"); - if (ret) - return ret; - } =20 return 0; } diff --git a/drivers/net/dsa/b53/b53_priv.h b/drivers/net/dsa/b53/b53_priv.h index bd6849e5bb93..cd27a7344e89 100644 --- a/drivers/net/dsa/b53/b53_priv.h +++ b/drivers/net/dsa/b53/b53_priv.h @@ -148,7 +148,7 @@ struct b53_device { u8 duplex_reg; u8 jumbo_pm_reg; u8 jumbo_size_reg; - int reset_gpio; + struct gpio_desc *reset_gpio; u8 num_arl_bins; u16 num_arl_buckets; enum dsa_tag_protocol tag_protocol; @@ -467,23 +467,36 @@ static inline void b53_arl_search_read(struct b53_dev= ice *dev, u8 idx, #ifdef CONFIG_BCM47XX =20 #include +#include #include -static inline int b53_switch_get_reset_gpio(struct b53_device *dev) +static inline struct gpio_desc *b53_switch_get_reset_gpio(struct b53_devic= e *dev) { enum bcm47xx_board board =3D bcm47xx_board_get(); + int gpio, ret; =20 switch (board) { case BCM47XX_BOARD_LINKSYS_WRT300NV11: case BCM47XX_BOARD_LINKSYS_WRT310NV1: - return 8; + gpio =3D 8; + break; default: - return bcm47xx_nvram_gpio_pin("robo_reset"); + gpio =3D bcm47xx_nvram_gpio_pin("robo_reset"); } + + if (!gpio_is_valid(gpio)) + return ERR_PTR(-EINVAL); + + ret =3D devm_gpio_request_one(dev->dev, gpio, + GPIOF_OUT_INIT_HIGH, "robo_reset"); + if (ret) + return ERR_PTR(ret); + + return gpio_to_desc(gpio); } #else -static inline int b53_switch_get_reset_gpio(struct b53_device *dev) +static inline struct gpio_desc *b53_switch_get_reset_gpio(struct b53_devic= e *dev) { - return -ENOENT; + return ERR_PTR(-ENODEV); } #endif =20 --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BD663FC5DA; Wed, 20 May 2026 18:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302340; cv=none; b=uSz+uL0b9KPh1Z7SqgP722Wncj2SFa1eh9BXp3hJ+FibtJP972zl5ONGrOwbIWQ+QkjyAKie9NS96GjoyMr8/pPwIUQ4wxD+WyaeciKSHKBR6xuyVjvojibP7gRiCBCMxwPKD0HTmcLyiapau6DLg4w2LPJDSq/Y5+cLtFl69q8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302340; c=relaxed/simple; bh=E3999r5PntjenilrrxvyJKJ6sUyiktWDefVKeKpvYFM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jl+yfH4xh4c5tlDON2RHu8vH2FIBNp/SyjRkFFVVbqhZQI1I6LpdLzaBrtQlGaJCoXuhfrJV6qiZkZOjGgGNN1y2jOPXHwk3v7tpnn8atfNxiOwv5jZ5l/JxgDzJDy/q9LGaTLTGlYvsBI9VN4a99gzS2iqBKWUhIp8+cW5pzu4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gu3hqgNX; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gu3hqgNX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 51C5D1F00897; Wed, 20 May 2026 18:38:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302339; bh=Auptu0K+asnu6CU+7KJoQdTihUUvVzhdRIPr56LBhZc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gu3hqgNXSSBWSAzl/z5ypBW6SYI9CfaDgDSK+ol9/yh3aXlQqypeyxw5U0WBnSPdp 2iiS8Xhxq8S9lt0lcYHEfu5LP5ONnku5RNmA56DjbtuA9NEblnYvnKQPP+9ev+vn9p bUcoLs3Gx0/qfFzNGjiaz+szHCox6BJoGmac9lWtkK6jpILryIfbPFBRU7BS4PBCLg J81yFkxfiWCP+HCQaY1nrR9iqiguW6REipqVDMOOyry/Gt0/VcQ6teqSz7EfN4HIp1 1n6VbeTwTsDVVJBTKewkiBwr7cG7zNyX2VwF7BF/+UJ/DnJbOQh46qHApQCUufqTrt 51N8Flosokb+Q== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 02/10] [v3] input: gpio-keys: make legacy gpiolib optional Date: Wed, 20 May 2026 20:38:07 +0200 Message-Id: <20260520183815.2510387-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Most users of gpio-keys and gpio-keys-polled use modern gpiolib interfaces, but there are still number of ancient sh, arm32 and x86 machines that have never been converted. Add an #ifdef block for the parts of the driver that are only used on those legacy machines. The two Rohm PMIC drivers use a gpio-keys device without an actual GPIO, passing an IRQ number instead. In order to keep this working both with and with CONFIG_GPIOLIB_LEGACY, change the gpio-keys driver to ignore the gpio number if an IRQ is passed. Link: https://lore.kernel.org/all/b3c94552-c104-42e3-be15-7e8362e8039e@gmai= l.com/ Link: https://lore.kernel.org/all/afJXG4_rtaj3l2Dk@google.com/ Signed-off-by: Arnd Bergmann Reviewed-by: Bartosz Golaszewski Reviewed-by: Matti Vaittinen --- v3: resend v2: skip the fake GPIO number passing from mfd The removal of the arm platforms using this is not yet going to happen for 7.2, and Dmitry's changes for the Rohm drivers have not yet made it into linux-next as of 2026-05-20, so for the moment I would still like to see this patch get merged, even if we are closing in on completely removing the legacy gpio support in the gpio_keys driver, so we can make CONFIG_GPIOLIB_LEGACY default-disabled sooner. --- drivers/input/keyboard/gpio_keys.c | 7 ++++--- drivers/input/keyboard/gpio_keys_polled.c | 2 ++ drivers/mfd/rohm-bd71828.c | 1 - drivers/mfd/rohm-bd718x7.c | 1 - include/linux/gpio_keys.h | 2 ++ 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gp= io_keys.c index e19617485679..d748a54dc51c 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -528,7 +528,8 @@ static int gpio_keys_setup_key(struct platform_device *= pdev, */ bdata->gpiod =3D NULL; } - } else if (gpio_is_valid(button->gpio)) { +#ifdef CONFIG_GPIOLIB_LEGACY + } else if (!button->irq && gpio_is_valid(button->gpio)) { /* * Legacy GPIO number, so request the GPIO here and * convert it to descriptor. @@ -546,6 +547,7 @@ static int gpio_keys_setup_key(struct platform_device *= pdev, =20 if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) gpiod_toggle_active_low(bdata->gpiod); +#endif } =20 if (bdata->gpiod) { @@ -583,8 +585,7 @@ static int gpio_keys_setup_key(struct platform_device *= pdev, if (irq < 0) { error =3D irq; dev_err_probe(dev, error, - "Unable to get irq number for GPIO %d\n", - button->gpio); + "Unable to get irq number for GPIO\n"); return error; } bdata->irq =3D irq; diff --git a/drivers/input/keyboard/gpio_keys_polled.c b/drivers/input/keyb= oard/gpio_keys_polled.c index e6707d72210e..0ae0e53910ea 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -301,6 +301,7 @@ static int gpio_keys_polled_probe(struct platform_devic= e *pdev) return dev_err_probe(dev, PTR_ERR(bdata->gpiod), "failed to get gpio\n"); } +#ifdef CONFIG_GPIOLIB_LEGACY } else if (gpio_is_valid(button->gpio)) { /* * Legacy GPIO number so request the GPIO here and @@ -323,6 +324,7 @@ static int gpio_keys_polled_probe(struct platform_devic= e *pdev) =20 if (button->active_low ^ gpiod_is_active_low(bdata->gpiod)) gpiod_toggle_active_low(bdata->gpiod); +#endif } =20 bdata->last_state =3D -1; diff --git a/drivers/mfd/rohm-bd71828.c b/drivers/mfd/rohm-bd71828.c index a79f354bf5cb..df6dad762ec9 100644 --- a/drivers/mfd/rohm-bd71828.c +++ b/drivers/mfd/rohm-bd71828.c @@ -39,7 +39,6 @@ =20 static struct gpio_keys_button button =3D { .code =3D KEY_POWER, - .gpio =3D -1, .type =3D EV_KEY, .wakeup =3D 1, }; diff --git a/drivers/mfd/rohm-bd718x7.c b/drivers/mfd/rohm-bd718x7.c index ff714fd4f54d..dd774aa8828b 100644 --- a/drivers/mfd/rohm-bd718x7.c +++ b/drivers/mfd/rohm-bd718x7.c @@ -20,7 +20,6 @@ =20 static struct gpio_keys_button button =3D { .code =3D KEY_POWER, - .gpio =3D -1, .type =3D EV_KEY, }; =20 diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index 80fa930b04c6..e8d6dc290efb 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h @@ -25,7 +25,9 @@ struct device; */ struct gpio_keys_button { unsigned int code; +#ifdef CONFIG_GPIOLIB_LEGACY int gpio; +#endif int active_low; const char *desc; unsigned int type; --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5AAAC43C047; Wed, 20 May 2026 18:39:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302349; cv=none; b=DEizNhStvKOXNRK0UDwPxb+dwUdTae6pwAvSOI5OQ3MvSDPTTVhs50z2+isFJBARecHWNLySDn9Qf9+iqrjIXF6glxRIaQ5e9ufv2H65Dnyhni1QnS+DfPv4WoJOPKOXH4tx59o78D5ovgPzD3TMTTZhopPSOFO2I8716ky1U2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302349; c=relaxed/simple; bh=967F8hrVOnB4Hww9rm86dUaEzAI2OE1eBN0raABGfak=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RME38Zf2WqUoytN5Ilc5Ejw4iS9+sT4glo/CbC4b0mqewv2BSQfdxUhuwWgnOt7bQMblDgks48W3cTq8ID/hXcidONRYFrj7SJMtQ60e/7fksqJcuOA/iZWGUAboftlFwR2hSWQifq9jz/4nQW0wZz+t9ixqoaQWpmD8NzbMeQg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HKpc212v; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HKpc212v" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93A241F0089A; Wed, 20 May 2026 18:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302347; bh=zBKnbJ1ea1Z90t+GzmUXY9pAo9IwWEqoCQVtXT4GR4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=HKpc212v1htgkd2muuhHOLKo7sEU0dSVAxRvPcXa/MBPcSliJPv7GUDyfwo3U4Htk GvzDJofIJw75L/nBdmuwi+uS/dbsuBQR3R4HdtjmjO3FoDWGtsSw+U61bhyFu4n2qE bUVMbBgBCE1iEh6PuFZs1CxOT4IN6AdO39k2B9JrXaJmTJCdv46yqqkKaSqimAy29e MmP3HotLS6MdZBB6cczDXlQlmIiPhXZAx74SWcH8Vx5+YlJPWXbzN2eYRBMpiZLOOH ajeAbHFeh9chkBiAAl/RN+Uqx7xvkaCRP/WKdkZ3pJVCEsw9jt/eEtbzXQaVE2aX58 e5h/8CVaLx9lA== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Takashi Iwai , Bartosz Golaszewski Subject: [PATCH 03/10] [v2] x86/olpc: select GPIOLIB_LEGACY Date: Wed, 20 May 2026 20:38:08 +0200 Message-Id: <20260520183815.2510387-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The OLPC GPIO controller sets up a fixed number space that is used by at least two drivers: arch/x86/platform/olpc/olpc-xo1-sci.c: In function 'setup_ec_sci': arch/x86/platform/olpc/olpc-xo1-sci.c:358:13: error: implicit declaration o= f function 'gpio_request' [-Wimplicit-function-declaration] 358 | r =3D gpio_request(OLPC_GPIO_ECSCI, "OLPC-ECSCI"); | ^~~~~~~~~~~~ sound/pci/cs5535audio/cs5535audio_olpc.c: In function 'olpc_analog_input': sound/pci/cs5535audio/cs5535audio_olpc.c:41:9: error: implicit declaration = of function 'gpio_set_value'; did you mean 'gpiod_set_value'? [-Wimplicit-f= unction-declaration] 41 | gpio_set_value(OLPC_GPIO_MIC_AC, on); The AMD Geode platform that this is based on is now marked as 'Orphaned' in Kconfig, and it is likely that there are no XO1 users on modern kernels, but so far there is no consensus on removing it entirely. Select CONFIG_GPIOLIB_LEGACY for this platform and make sure the sound driver portion cannot be compiled without this. Acked-by: Borislav Petkov (AMD) Acked-by: Takashi Iwai Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann --- v2: update changelog text --- arch/x86/Kconfig | 1 + sound/pci/Kconfig | 1 + 2 files changed, 2 insertions(+) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index f24810015234..69089d2f5dad 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2978,6 +2978,7 @@ config OLPC bool "One Laptop Per Child support" depends on !X86_PAE select GPIOLIB + select GPIOLIB_LEGACY select OF select OF_PROMTREE select IRQ_DOMAIN diff --git a/sound/pci/Kconfig b/sound/pci/Kconfig index e0996a9d90b0..6366f72b3667 100644 --- a/sound/pci/Kconfig +++ b/sound/pci/Kconfig @@ -300,6 +300,7 @@ config SND_CS5535AUDIO tristate "CS5535/CS5536 Audio" depends on X86_32 || MIPS || COMPILE_TEST depends on HAS_IOPORT + depends on GPIOLIB_LEGACY || !OLPC select SND_PCM select SND_AC97_CODEC help --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 619FD3FE347; Wed, 20 May 2026 18:39:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302357; cv=none; b=AIcgfycvsIMw2PAxJT7PoLi2GTPMEM7LS6GPQryzbmZ6aGfkHOCBqtr5WzhVw8A/VVtCrpY3np3HeJaoQ+cPl66TaJYr4czckRsZzsOBBTy75ULzQTsEVyyqrxHURhbj1Q6syfIDlv0j7jXtBJJMVbPSWdwWs3izhYzW4d9QafQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302357; c=relaxed/simple; bh=aNAlqkthpe10xYpNkC2BmzB2OQKzPr8kINA577EZeVo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=hqNLiTkhotKhWdcXvEnwprDtHzGWPenbGA94S8peeTqdH1WJTxxX5oB4dN30bpS6oaligq1gEXCFJviI8aRAvhgyrA9WOI1eMaUjFPwydpofgU8cuxcHuaVxdXKAiruQ9JqAjVg8NwV+vCyakQqPvE656R9WnbM6W7PPhIt8K8E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CqMa3b0K; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CqMa3b0K" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5B2541F00896; Wed, 20 May 2026 18:39:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302356; bh=mIbLYIR4qOinVPSLahPalENeT18/s9zq2XWQrVCVaRU=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=CqMa3b0K6yilhMP8W6/z8wMrypYc8Bx3ZdaOFKtCffLHlXg6yDY4Uf4N9Yh4Otc+r 0czwFzNB+xyJSwDOfoq+kfnNnGx/6SFS4Y5+Y0oB65KBe4R4XoROpy/hzeSI1r+Or7 h4ZQ7eGVSNOfAPhXVrjb2Urbghf/Whrbl26oESPLWHlpgZY5fPPR5fDcuzZw56Jph3 eap+xYP1AcFJy7mrot9mcJs/Pn48b4MD6EZdOYZuUhPv1zVMgxk1m8HdZssHE6fLJG f5GuqEvoG+Vt0o/Fv8y5DwaW9MdkgLlRlaEGURyv7e2LXyJZqY+D4TdACo+R4aYlUZ ZW3tF7mNaDaUA== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 04/10] [v2] sh: select legacy gpiolib interface Date: Wed, 20 May 2026 20:38:09 +0200 Message-Id: <20260520183815.2510387-5-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Many board files on sh reference the legacy gpiolib interfaces that are becoming optional. To ensure the boards can keep building, select CONFIG_GPIOLIB_LEGACY on each of the boards that have one of the hardcoded calls. Cc: John Paul Adrian Glaubitz Signed-off-by: Arnd Bergmann --- v2: no changes. Adrian said he'll pick it up for 7.2, but so far the patch is not in linux-next yet, so I'm including it for completeness here. --- arch/sh/Kconfig | 1 + arch/sh/boards/Kconfig | 8 ++++++++ arch/sh/boards/mach-highlander/Kconfig | 1 + arch/sh/boards/mach-rsk/Kconfig | 3 +++ 4 files changed, 13 insertions(+) diff --git a/arch/sh/Kconfig b/arch/sh/Kconfig index d5795067befa..d60f1d5a94c0 100644 --- a/arch/sh/Kconfig +++ b/arch/sh/Kconfig @@ -462,6 +462,7 @@ config CPU_SUBTYPE_SHX3 select CPU_SHX3 select GENERIC_CLOCKEVENTS_BROADCAST if SMP select GPIOLIB + select GPIOLIB_LEGACY select PINCTRL =20 # SH4AL-DSP Processor Support diff --git a/arch/sh/boards/Kconfig b/arch/sh/boards/Kconfig index 1af93be61b1f..d89b74177233 100644 --- a/arch/sh/boards/Kconfig +++ b/arch/sh/boards/Kconfig @@ -80,6 +80,7 @@ config SH_7724_SOLUTION_ENGINE select SOLUTION_ENGINE depends on CPU_SUBTYPE_SH7724 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR imply SND_SOC_AK4642 if SND_SIMPLE_CARD help @@ -199,6 +200,7 @@ config SH_SH7757LCR bool "SH7757LCR" depends on CPU_SUBTYPE_SH7757 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR =20 config SH_SH7785LCR @@ -226,6 +228,7 @@ config SH_URQUELL bool "Urquell" depends on CPU_SUBTYPE_SH7786 select GPIOLIB + select GPIOLIB_LEGACY select HAVE_PCI select NO_IOPORT_MAP if !PCI =20 @@ -233,6 +236,7 @@ config SH_MIGOR bool "Migo-R" depends on CPU_SUBTYPE_SH7722 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR help Select Migo-R if configuring for the SH7722 Migo-R platform @@ -242,6 +246,7 @@ config SH_AP325RXA bool "AP-325RXA" depends on CPU_SUBTYPE_SH7723 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR help Renesas "AP-325RXA" support. @@ -251,6 +256,7 @@ config SH_KFR2R09 bool "KFR2R09" depends on CPU_SUBTYPE_SH7724 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR help "Kit For R2R for 2009" support. @@ -259,6 +265,7 @@ config SH_ECOVEC bool "EcoVec" depends on CPU_SUBTYPE_SH7724 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR imply SND_SOC_DA7210 if SND_SIMPLE_CARD help @@ -329,6 +336,7 @@ config SH_MAGIC_PANEL_R2 bool "Magic Panel R2" depends on CPU_SUBTYPE_SH7720 select GPIOLIB + select GPIOLIB_LEGACY select REGULATOR_FIXED_VOLTAGE if REGULATOR help Select Magic Panel R2 if configuring for Magic Panel R2. diff --git a/arch/sh/boards/mach-highlander/Kconfig b/arch/sh/boards/mach-h= ighlander/Kconfig index b0abd03cac4e..cd3a553ce30c 100644 --- a/arch/sh/boards/mach-highlander/Kconfig +++ b/arch/sh/boards/mach-highlander/Kconfig @@ -20,6 +20,7 @@ config SH_R7785RP bool "R7785RP board support" depends on CPU_SUBTYPE_SH7785 select GPIOLIB + select GPIOLIB_LEGACY =20 endchoice =20 diff --git a/arch/sh/boards/mach-rsk/Kconfig b/arch/sh/boards/mach-rsk/Kcon= fig index f0299bc4416f..3810937aa5d4 100644 --- a/arch/sh/boards/mach-rsk/Kconfig +++ b/arch/sh/boards/mach-rsk/Kconfig @@ -12,16 +12,19 @@ config SH_RSK7201 config SH_RSK7203 bool "RSK7203" select GPIOLIB + select GPIOLIB_LEGACY depends on CPU_SUBTYPE_SH7203 =20 config SH_RSK7264 bool "RSK2+SH7264" select GPIOLIB + select GPIOLIB_LEGACY depends on CPU_SUBTYPE_SH7264 =20 config SH_RSK7269 bool "RSK2+SH7269" select GPIOLIB + select GPIOLIB_LEGACY depends on CPU_SUBTYPE_SH7269 =20 endchoice --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C483E3D1CA0; Wed, 20 May 2026 18:39:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302365; cv=none; b=Q9IVCFAaT4vPnB70IQPB7NZecvAY/NeREe70i7T/tGqTS1uyzcIH7bKOankTGAU1FJC8dcjKfOQxy8/z+Ey5k5FUlBOkGtW1uTm6vCDDGcnwYt1AopIj8+1F5FefXP560HIWx9g5WK4L6Ns7uUYPApG09hP9hRV2lzcNj1+P/eo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302365; c=relaxed/simple; bh=1rBsdHO5ii6LAwx4TaDAiy+62lktJt4MM8CtSkPPwkk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=OmZasYugYRtPqcm7WisfjcXjPofjV8s8RrlLzgNi6m6C90EccMbpYNMRDF9nyQBfDhhTizofZKQuYg9uS/58Q546o9lQisrVjib80tRp/1RsKOp/DNy+nXvNf+no42syvOAwjycOgK1WCUZR09xmzQkRh5ICKKas7yx31bcSSXs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JLCEdIhj; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JLCEdIhj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9B8921F0089D; Wed, 20 May 2026 18:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302364; bh=TV0+qdcdmk/5gJ3OGKgI5SQDH91h3lWhZ4d8lGRbL9E=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=JLCEdIhj+ggOrppkcYTTrQNTM5KqIoCtxO1KENxrD+9U8PWht6Vy6TAMPqqiknlxb 6a1MobDRSDwonLHkb8k6hipwd6d7okdssLui9BmALeqBm36GRhcBjxVXezpAYhtc3P nMTGo+V4DYSSFLuRGdYBj4xSWfM8HAPTM0kpSBxtn78GbWehT1cK1V9zzYmqM/FNKE Or49PD8deMVtSMSljqB0Zu+RaI7Rj2FQRkH4sZHZtZ/lBsn3Z0sAfD84FsIflSjV5l nTzEA0Jh7v/sS3RlFlLhW2mz5htjnN1eTc3joHVAhGl7tXJh8xU5n1O9t7dhqWVbHO MfjrowIjjlgwg== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 05/10] [v2] mips: select legacy gpiolib interfaces where used Date: Wed, 20 May 2026 20:38:10 +0200 Message-Id: <20260520183815.2510387-6-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann A few old machines have not been converted away from the old-style gpiolib interfaces. Make these select the new CONFIG_GPIOLIB_LEGACY symbol so the code still works where it is needed but can be left out otherwise. This is the list of all gpio_request() calls in mips: arch/mips/alchemy/devboards/db1000.c: gpio_request(19, "sd0_cd"= ); arch/mips/alchemy/devboards/db1000.c: gpio_request(20, "sd1_cd"= ); arch/mips/alchemy/devboards/db1200.c: gpio_request(215, "otg-vbus"); arch/mips/bcm47xx/workarounds.c: err =3D gpio_request_one(usb_powe= r, GPIOF_OUT_INIT_HIGH, "usb_power"); arch/mips/bcm63xx/boards/board_bcm963xx.c: gpio_request_one(= board.ephy_reset_gpio, arch/mips/txx9/rbtx4927/setup.c: gpio_request(15, "sio-dtr"); Most of these should be easy enough to change to modern gpio descriptors or remove if they are no longer in use. Reviewed-by: Bartosz Golaszewski Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann --- v2: no changes. There was no discussion on this, but the patch has so far not made it into the linux-mips tree, so I'm including it for completeness. --- arch/mips/Kconfig | 5 +++++ arch/mips/alchemy/Kconfig | 1 - arch/mips/txx9/Kconfig | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 4364f3dba688..b91e62d69a5d 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -206,6 +206,8 @@ config MIPS_ALCHEMY select CSRC_R4K select IRQ_MIPS_CPU select DMA_NONCOHERENT # Au1000,1500,1100 aren't, rest is + select GPIOLIB + select GPIOLIB_LEGACY select MIPS_FIXUP_BIGPHYS_ADDR if PCI select SYS_HAS_CPU_MIPS32_R1 select SYS_SUPPORTS_32BIT_KERNEL @@ -307,6 +309,7 @@ config BCM47XX select SYS_HAS_EARLY_PRINTK select USE_GENERIC_EARLY_PRINTK_8250 select GPIOLIB + select GPIOLIB_LEGACY select LEDS_GPIO_REGISTER select BCM47XX_NVRAM select BCM47XX_SPROM @@ -330,6 +333,7 @@ config BCM63XX select SYS_HAS_CPU_BMIPS4380 select SWAP_IO_SPACE select GPIOLIB + select GPIOLIB_LEGACY select MIPS_L1_CACHE_SHIFT_4 select HAVE_LEGACY_CLK help @@ -999,6 +1003,7 @@ config MIKROTIK_RB532 select SWAP_IO_SPACE select BOOT_RAW select GPIOLIB + select GPIOLIB_LEGACY select MIPS_L1_CACHE_SHIFT_4 help Support the Mikrotik(tm) RouterBoard 532 series, diff --git a/arch/mips/alchemy/Kconfig b/arch/mips/alchemy/Kconfig index 6ca81e1bd35c..cf5ad52c0a0f 100644 --- a/arch/mips/alchemy/Kconfig +++ b/arch/mips/alchemy/Kconfig @@ -12,7 +12,6 @@ config MIPS_MTX1 =20 config MIPS_DB1XXX bool "Alchemy DB1XXX / PB1XXX boards" - select GPIOLIB select HAVE_PCI select HAVE_PATA_PLATFORM select SYS_SUPPORTS_LITTLE_ENDIAN diff --git a/arch/mips/txx9/Kconfig b/arch/mips/txx9/Kconfig index 7335efa4d528..92b759a434c0 100644 --- a/arch/mips/txx9/Kconfig +++ b/arch/mips/txx9/Kconfig @@ -37,6 +37,7 @@ config SOC_TX4927 select IRQ_TXX9 select PCI_TX4927 select GPIO_TXX9 + select GPIOLIB_LEGACY =20 config SOC_TX4938 bool --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F7DE3FE66D; Wed, 20 May 2026 18:39:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302374; cv=none; b=cu6HHSCIGQlNDGmXEYioAyPZplIUQ8IxgM0GUHZBPH9cUR6k/uqLesLeWBEqwHzH0aMgB4NKsXyJoERC7xFsaLBKaKJ8BTMhSgAH+8PeV6I7dCKxoPF/gv9sQs6S0+uRLv9UZYSa9AZW8v5t/6ocC3w60EMboxCtSdCY2gT0RsM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302374; c=relaxed/simple; bh=/dw3Bj3qEtbY3UGw59TiDqCEQ67ekEoGdNXRX+RmKeM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=W/X3GYNHAZzRcrJVDkmeuZwbpfo5X+M2FxZzcl7ID3H9/k6h0nRnLVALe692QhAB7T1s6H3gAtSyDBF3Odu7ZIdRC3XxBmM5N7qyCdsKqB8Dzj0I+PSq1uPdh1Wl0NPosAhlekNr4aI4q1IYDiN+gXrOFm3XH9HvensTyQYxafY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M/QzPQdc; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M/QzPQdc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 103C51F00896; Wed, 20 May 2026 18:39:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302373; bh=y7ad9YS8GKFX6PUFbYIYBW6JWmL7J5wY6hoTgHoU3QQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=M/QzPQdcsRJdC6Ljg5UpTwgWtuxhkJstW01aGvTw4RUpEjn4DFc4JGJpClJWMiTyX Uax1ukCuzqo2DkHStJzSrNzBoOhBtgAf3d6pbUgvxDAaC5mAvLB0WWupx2hCr+raMW 0bT1SX3UQeTWwOp/CHqXdJ30GDCmBaZ6F8y2ndgaKy3NoIGD7FTS7rWNHDqHaZu016 ldOM8cp2fpMe0/Kbnxdc4R5EzBeQ99FWzB9/fhSXFDKlN7MNCjxGtX9jtGpn3Lnew3 uTm16eyJm403jVRTftzcSx//sTI5vPNcxIfQg5Kw1FqrlqBH74zoUjxqbeeJqhRyHp 8DIOJqZ2M2Aqg== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH 06/10] [v4] leds: gpio: make legacy gpiolib interface optional Date: Wed, 20 May 2026 20:38:11 +0200 Message-Id: <20260520183815.2510387-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann There are still a handful of ancient mips/armv5/sh boards that use the gpio_led:gpio member to pass an old-style gpio number, but all modern users have been converted to gpio descriptors. While the CONFIG_GPIOLIB_LEGACY option that guards devm_gpio_request_one() and related helpers is currently turned on in all kernel builds, the plan is to only enable it on the few platforms that actually pass gpio numbers in any platform_data. Split out the legacy portion of the platform_data handling into a custom helper function that is guarded with in #ifdef block, to allow the the leds-gpio driver to compile cleanly when CONFIG_GPIOLIB_LEGACY gets turned off. Once the last user is converted, this function can be removed. Link: https://lore.kernel.org/all/e9252384-a55c-4a91-9c61-06e05a0b2ce4@app.= fastmail.com/ Reviewed-by: Linus Walleij Reviewed-by: Bartosz Golaszewski Reviewed-by: Andy Shevchenko Signed-off-by: Arnd Bergmann --- v4: whitespace changes only v3: simplify gpio_led_get_gpiod v2: rework a little bit to keep the legacy code path more separate, extend changelog description Related to this, we may also want to remove support for passing a gpio descriptor in the ->gpiod flag. The only user doing this at the moment was introduced in commit 1892e87a3e91 ("powerpc/warp: switch to using gpiod API"). --- drivers/leds/leds-gpio.c | 51 ++++++++++++++++++++++++++-------------- include/linux/leds.h | 2 ++ 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index a3428b22de3a..d6a0369eeb92 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -212,7 +212,6 @@ static struct gpio_desc *gpio_led_get_gpiod(struct devi= ce *dev, int idx, const struct gpio_led *template) { struct gpio_desc *gpiod; - int ret; =20 /* * This means the LED does not come from the device tree @@ -221,18 +220,30 @@ static struct gpio_desc *gpio_led_get_gpiod(struct de= vice *dev, int idx, * the GPIO from there. */ gpiod =3D devm_gpiod_get_index_optional(dev, NULL, idx, GPIOD_OUT_LOW); - if (IS_ERR(gpiod)) - return gpiod; - if (gpiod) { + if (!IS_ERR(gpiod)) gpiod_set_consumer_name(gpiod, template->name); - return gpiod; - } =20 - /* - * This is the legacy code path for platform code that - * still uses GPIO numbers. Ultimately we would like to get - * rid of this block completely. - */ + return gpiod; +} + +#ifdef CONFIG_GPIOLIB_LEGACY +/* + * This is the legacy code path for platform code that still uses + * GPIO numbers, mainly MIPS and SuperH board files. + * Ultimately we would like to get rid of this block completely. + * + * ppc44x-warp sets the template->gpiod directly instead of + * adding a lookup table or device properties. This is not + * much better. + */ +static struct gpio_desc *gpio_led_get_legacy_gpiod(struct device *dev, int= idx, + const struct gpio_led *template) +{ + struct gpio_desc *gpiod; + int ret; + + if (template->gpiod) + return template->gpiod; =20 /* skip leds that aren't available */ if (!gpio_is_valid(template->gpio)) @@ -252,6 +263,13 @@ static struct gpio_desc *gpio_led_get_gpiod(struct dev= ice *dev, int idx, =20 return gpiod; } +#else +static struct gpio_desc *gpio_led_get_legacy_gpiod(struct device *dev, int= idx, + const struct gpio_led *template) +{ + return template->gpiod ?: ERR_PTR(-ENOENT); +} +#endif =20 static int gpio_led_probe(struct platform_device *pdev) { @@ -270,14 +288,13 @@ static int gpio_led_probe(struct platform_device *pde= v) const struct gpio_led *template =3D &pdata->leds[i]; struct gpio_led_data *led_dat =3D &priv->leds[i]; =20 - if (template->gpiod) - led_dat->gpiod =3D template->gpiod; - else + led_dat->gpiod =3D gpio_led_get_gpiod(dev, i, template); + if (!led_dat->gpiod) led_dat->gpiod =3D - gpio_led_get_gpiod(dev, i, template); + gpio_led_get_legacy_gpiod(dev, i, template); if (IS_ERR(led_dat->gpiod)) { - dev_info(dev, "Skipping unavailable LED gpio %d (%s)\n", - template->gpio, template->name); + dev_info(dev, "Skipping unavailable LED gpio %s\n", + template->name); continue; } =20 diff --git a/include/linux/leds.h b/include/linux/leds.h index b16b803cc1ac..e646bffcd8e7 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -676,8 +676,10 @@ typedef int (*gpio_blink_set_t)(struct gpio_desc *desc= , int state, struct gpio_led { const char *name; const char *default_trigger; +#ifdef CONFIG_GPIOLIB_LEGACY unsigned gpio; unsigned active_low : 1; +#endif unsigned retain_state_suspended : 1; unsigned panic_indicator : 1; unsigned default_state : 2; --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B8FED3FE66D; Wed, 20 May 2026 18:39:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302382; cv=none; b=CqLLjrQowEsQ+GEpDA8gZULy+9l9YvJ6+bN82sy3eUp8qy2lMJ6bpn4ot4x2fH4ab+EdsTHUFqw/TTuPusBR2v08vfHIRqzPHzIetOV7Dr/rDlYQRfTq4NmH2iSoXXeWiXBBWrc0EV+yGSpYS35Ynv8c6qRAzUnPykhALZx82qU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302382; c=relaxed/simple; bh=QnhxnHtucHKw6Uua/rQwPfSkr3Npc8iASaSu0+j3ytM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=e3n55OptMuPWlya9bGB07ZCJJDWMyrEjvFhnsWAMkWgi03TIEpL+V6frX0c7bITaUab+h5ZG5V9ztRZyYVKPWl3Gq2nr+2NQpWjYP/18kxVtH9HXs5C7xmdF9+0oS5OJMF4fHlZkvTOQl/Y7Epdr6VBUe+rGGp5EMR2kzbeFF/0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Nj4jdjHy; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Nj4jdjHy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8FC9F1F00897; Wed, 20 May 2026 18:39:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302381; bh=Kx7bWM1kJr6AOGlca9EF/UDaya3vcfDIi8gsI0tM7xo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Nj4jdjHyclmkGQphNLKvljHh2Oh2mJxYSFwUYxk8N4A0juSC3p4zrdZpAPwmwED7O XNvE3oLYFJqleRrk3PSuNs9F/+FEieEzGuJ4abKxgNQ7KZofHNo33I9+e4ddCwocbQ x3I+o46EultDco4KSYYQ0w7dRLVfrr9n8XmrLqTu4cOXhRdfRt0ccSS/0kq4in+3Yp GywhzsoRU74CftCcgAA1LsEUDjPBejWNSDXZa3t+tk+agf6MR7ileZJ/V3tETZEwIR y1sisiWPqk3zz9juYnIctU7rYebD9DyJ+XBcLeX5utyxkwMHQqsFdSzNGQWrHFbyCL T/r7hTlGIBNXA== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Christian Lamparter , Conor Dooley Subject: [PATCH 07/10] [v6 net-next] dt-bindings: net: add st,stlc4560/p54spi binding Date: Wed, 20 May 2026 20:38:12 +0200 Message-Id: <20260520183815.2510387-8-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The SPI version of Prism54 was sold under a couple of different names and supported by the Linux p54spi driver, but there was never a DT binding for it. Document the four known names of this device and the properties that are sufficient for its use on the Nokia N8x0 tablet. As I don't have this hardware or documentation for it, this is purely based on existing usage in the driver. Link: https://lore.kernel.org/all/e8dc9acb-6f85-e0a9-a145-d101ca6da201@gmai= l.com/ Acked-by: Christian Lamparter Acked-by: Conor Dooley Signed-off-by: Arnd Bergmann Reviewed-by: Bartosz Golaszewski --- v6: no changes v5: fix name in MAINTAINERS file v4: renamed file to st,stlc4560, matching the primary compatible string require st,stlc4560 string --- .../bindings/net/wireless/st,stlc4560.yaml | 61 +++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 62 insertions(+) create mode 100644 Documentation/devicetree/bindings/net/wireless/st,stlc4= 560.yaml diff --git a/Documentation/devicetree/bindings/net/wireless/st,stlc4560.yam= l b/Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml new file mode 100644 index 000000000000..a32265c07350 --- /dev/null +++ b/Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/wireless/st,stlc4560.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ST/Intersil/Conexant stlc45xx/p54spi/cx3110x SPI wireless device + +maintainers: + - Christian Lamparter + +description: + The SPI variant of the Intersil Prism54 wireless device was sold + under a variety of names, including Conexant CX3110x and + ST Microelectronics STLC4560. + +allOf: + - $ref: ieee80211.yaml# + - $ref: /schemas/spi/spi-peripheral-props.yaml# + +properties: + compatible: + oneOf: + - const: st,stlc4560 + - items: + - enum: + - cnxt,3110x + - isil,p54spi + - st,stlc4550 + - const: st,stlc4560 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + powerdown-gpios: + maxItems: 1 + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + + wifi@0 { + compatible =3D "st,stlc4560"; + reg =3D <0>; + spi-max-frequency =3D <48000000>; + interrupts-extended =3D <&gpio 23>; + powerdown-gpios =3D <&gpio 1>; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index 8063cb56feef..93cf1fb72357 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -20306,6 +20306,7 @@ M: Christian Lamparter L: linux-wireless@vger.kernel.org S: Maintained W: https://wireless.wiki.kernel.org/en/users/Drivers/p54 +F: Documentation/devicetree/bindings/net/wireless/st,stlc4560.yaml F: drivers/net/wireless/intersil/ =20 PACKET SOCKETS --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 69E553F9F25; Wed, 20 May 2026 18:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302391; cv=none; b=Eccv6nPE6AooEO61u976MexsbxwucuPbbgsNkaTcgPQK64kYmpWRXfPP+rjjeSpYRWvO0dvISupcfsaISK7mlwHW4BRPcpJa7p6aoPJajQl5DKBRr8GkeqAMRgoPUHU01hTtfPnMJs3L6N8safKM3PaVovCLXmf8IFxomOfszis= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302391; c=relaxed/simple; bh=cRcnB5Pb3wxx2TsV06no27kmx1bIhXlHSw1NYetcqqs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=r10zk0UhFZcKd0iFQ8085vxW9gyrQhMpeO4AZAYcepgCSco4o9i5lvcTdfkCQUYKxXJvIVadTJ6wPaUPsyABhwTGtQNblHxVkTlx9WUmS5Os28FswCn866KCklk0nHyfAn2gDU7H2/zwcS9sPo3RsyurbzZB9yvbXuUT+/JvNyA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=c8+2xhO5; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="c8+2xhO5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DA691F000E9; Wed, 20 May 2026 18:39:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302390; bh=HHUWFmbh3ImfDe6wOM7pvhSPGQimsw8ZMlhl9gdClj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=c8+2xhO5RnbVl3GQjSFxhQSreCyaoMFISEf7aB3AuPaI1I5olVwoDdS3CppiqIsM9 6qBOSA+AxNPflL+q+Hoe/UW5p8MBI1dB9kxFKTs3Cz+voCT1d2DJ9/qDxKFXosezrK S5XM2FT4gjomdQ6L+3Hzf72v8c+StbK1lJyg8IICM4Bh50XuRVqfMsLzOi95egM1Gb tmBT37YhgafXKSw3GENUYIzK9zQwwXgDbDOlQ6CBuhpl1DzLVIQrk1jWoJIF5lc/9O F2ctOYy8/waqsSBiKjbEKqwq+ereYdA3N60sCCZVymbKSBbDM8UbdzVAqW+chfh6ej qi7MZ6eQS/VVA== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Christian Lamparter , Bartosz Golaszewski Subject: [PATCH 08/10] [v6 net-next] p54spi: convert to devicetree Date: Wed, 20 May 2026 20:38:13 +0200 Message-Id: <20260520183815.2510387-9-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann The Prism54 SPI driver hardcodes GPIO numbers and expects users to pass them as module parameters, apparently a relic from its life as a staging driver. This works because there is only one user, the Nokia N8x0 tablet. Convert this to the gpio descriptor interface and DT based probing to improve this and simplify the code at the same time. Acked-by: Christian Lamparter Reviewed-by: Linus Walleij Reviewed-by: Bartosz Golaszewski Signed-off-by: Arnd Bergmann --- v6: - no changes. Sashiko comments about incorrect on-stack SPI transfers and error handling in the IRQ registration turned out to be irrelevant for this submission. v5: - fix irq assignment # https://sashiko.dev/#/patchset/20260430081242.36869= 93-1-arnd%40kernel.org v4: - make gpio line optional again - fix EPROBE_DEFER handling - match only st,stlc4560 compatible value, with binding change v3: - rebase an older patch --- arch/arm/mach-omap2/board-n8x0.c | 18 ------ drivers/net/wireless/intersil/p54/p54spi.c | 67 ++++++++-------------- drivers/net/wireless/intersil/p54/p54spi.h | 3 + 3 files changed, 26 insertions(+), 62 deletions(-) diff --git a/arch/arm/mach-omap2/board-n8x0.c b/arch/arm/mach-omap2/board-n= 8x0.c index 969265d5d5c6..d9acd32c5457 100644 --- a/arch/arm/mach-omap2/board-n8x0.c +++ b/arch/arm/mach-omap2/board-n8x0.c @@ -20,7 +20,6 @@ #include #include #include -#include #include #include =20 @@ -106,21 +105,6 @@ static void __init n8x0_usb_init(void) {} =20 #endif /*CONFIG_USB_MUSB_TUSB6010 */ =20 - -static struct omap2_mcspi_device_config p54spi_mcspi_config =3D { - .turbo_mode =3D 0, -}; - -static struct spi_board_info n800_spi_board_info[] __initdata =3D { - { - .modalias =3D "p54spi", - .bus_num =3D 2, - .chip_select =3D 0, - .max_speed_hz =3D 48000000, - .controller_data =3D &p54spi_mcspi_config, - }, -}; - #if defined(CONFIG_MENELAUS) && IS_ENABLED(CONFIG_MMC_OMAP) =20 /* @@ -524,7 +508,5 @@ omap_late_initcall(n8x0_late_initcall); void * __init n8x0_legacy_init(void) { board_check_revision(); - spi_register_board_info(n800_spi_board_info, - ARRAY_SIZE(n800_spi_board_info)); return &mmc1_data; } diff --git a/drivers/net/wireless/intersil/p54/p54spi.c b/drivers/net/wirel= ess/intersil/p54/p54spi.c index 9d66dcae54e0..d18be2545028 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.c +++ b/drivers/net/wireless/intersil/p54/p54spi.c @@ -8,6 +8,7 @@ */ =20 #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include #include -#include +#include #include =20 #include "p54spi.h" @@ -30,19 +31,6 @@ MODULE_FIRMWARE("3826.arm"); MODULE_FIRMWARE("3826.eeprom"); =20 -/* gpios should be handled in board files and provided via platform data, - * but because it's currently impossible for p54spi to have a header file - * in include/linux, let's use module parameters for now - */ - -static int p54spi_gpio_power =3D 97; -module_param(p54spi_gpio_power, int, 0444); -MODULE_PARM_DESC(p54spi_gpio_power, "gpio number for power line"); - -static int p54spi_gpio_irq =3D 87; -module_param(p54spi_gpio_irq, int, 0444); -MODULE_PARM_DESC(p54spi_gpio_irq, "gpio number for irq line"); - static void p54spi_spi_read(struct p54s_priv *priv, u8 address, void *buf, size_t len) { @@ -262,14 +250,14 @@ static int p54spi_upload_firmware(struct ieee80211_hw= *dev) =20 static void p54spi_power_off(struct p54s_priv *priv) { - disable_irq(gpio_to_irq(p54spi_gpio_irq)); - gpio_set_value(p54spi_gpio_power, 0); + disable_irq(priv->irq); + gpiod_set_value(priv->gpio_powerdown, 1); } =20 static void p54spi_power_on(struct p54s_priv *priv) { - gpio_set_value(p54spi_gpio_power, 1); - enable_irq(gpio_to_irq(p54spi_gpio_irq)); + gpiod_set_value(priv->gpio_powerdown, 0); + enable_irq(priv->irq); =20 /* need to wait a while before device can be accessed, the length * is just a guess @@ -608,31 +596,20 @@ static int p54spi_probe(struct spi_device *spi) goto err_free; } =20 - ret =3D gpio_request(p54spi_gpio_power, "p54spi power"); - if (ret < 0) { - dev_err(&priv->spi->dev, "power GPIO request failed: %d", ret); + priv->gpio_powerdown =3D gpiod_get_optional(&spi->dev, "powerdown", GPIOD= _OUT_HIGH); + if (IS_ERR(priv->gpio_powerdown)) { + ret =3D dev_err_probe(&priv->spi->dev, PTR_ERR(priv->gpio_powerdown), + "powerdown GPIO request failed\n"); goto err_free; } =20 - ret =3D gpio_request(p54spi_gpio_irq, "p54spi irq"); - if (ret < 0) { - dev_err(&priv->spi->dev, "irq GPIO request failed: %d", ret); - goto err_free_gpio_power; - } - - gpio_direction_output(p54spi_gpio_power, 0); - gpio_direction_input(p54spi_gpio_irq); - - ret =3D request_irq(gpio_to_irq(p54spi_gpio_irq), - p54spi_interrupt, IRQF_NO_AUTOEN, "p54spi", - priv->spi); + ret =3D request_irq(spi->irq, p54spi_interrupt, IRQF_NO_AUTOEN, "p54spi",= priv->spi); if (ret < 0) { dev_err(&priv->spi->dev, "request_irq() failed"); - goto err_free_gpio_irq; + goto err_free_gpio_power; } =20 - irq_set_irq_type(gpio_to_irq(p54spi_gpio_irq), IRQ_TYPE_EDGE_RISING); - + priv->irq =3D spi->irq; INIT_WORK(&priv->work, p54spi_work); init_completion(&priv->fw_comp); INIT_LIST_HEAD(&priv->tx_pending); @@ -659,11 +636,9 @@ static int p54spi_probe(struct spi_device *spi) =20 err_free_common: release_firmware(priv->firmware); - free_irq(gpio_to_irq(p54spi_gpio_irq), spi); -err_free_gpio_irq: - gpio_free(p54spi_gpio_irq); + free_irq(priv->irq, spi); err_free_gpio_power: - gpio_free(p54spi_gpio_power); + gpiod_put(priv->gpio_powerdown); err_free: p54_free_common(priv->hw); return ret; @@ -675,10 +650,8 @@ static void p54spi_remove(struct spi_device *spi) =20 p54_unregister_common(priv->hw); =20 - free_irq(gpio_to_irq(p54spi_gpio_irq), spi); - - gpio_free(p54spi_gpio_power); - gpio_free(p54spi_gpio_irq); + free_irq(priv->irq, spi); + gpiod_put(priv->gpio_powerdown); release_firmware(priv->firmware); =20 mutex_destroy(&priv->mutex); @@ -686,10 +659,16 @@ static void p54spi_remove(struct spi_device *spi) p54_free_common(priv->hw); } =20 +static const struct of_device_id p54spi_of_ids[] =3D { + { .compatible =3D "st,stlc4560", }, + { }, +}; +MODULE_DEVICE_TABLE(of, p54spi_of_ids); =20 static struct spi_driver p54spi_driver =3D { .driver =3D { .name =3D "p54spi", + .of_match_table =3D p54spi_of_ids, }, =20 .probe =3D p54spi_probe, diff --git a/drivers/net/wireless/intersil/p54/p54spi.h b/drivers/net/wirel= ess/intersil/p54/p54spi.h index e5619a13fd61..118785cc635a 100644 --- a/drivers/net/wireless/intersil/p54/p54spi.h +++ b/drivers/net/wireless/intersil/p54/p54spi.h @@ -107,6 +107,9 @@ struct p54s_priv { =20 enum fw_state fw_state; const struct firmware *firmware; + + struct gpio_desc *gpio_powerdown; + int irq; }; =20 #endif /* P54SPI_H */ --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB6013F9F25; Wed, 20 May 2026 18:39:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302400; cv=none; b=T5Gf1NRTXF7bymaSAUrND2uoaWTOzBl1qf46shYE8m0ATCWjWHqfv8U9OeMDADWzhJ8+vSjaHfybG+23I8DMqDOm6YN/ZPv4rZs+gi/QqfvpiJsTPGv23rH9COdmj3uculJ5LqM7u2QDPN2S6Zy0Y+l8Rl0JPBJIhr4fUCOlf3A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302400; c=relaxed/simple; bh=nx6CKUotEXycIcA4vFZIxP7wYoL6UwIjQA6phycHux8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=SuuFE76elkLqdw0nEp8T8YeyBgY+bZzwFw89ZL3Kb2XZ6+ALtnOvZB03pyNisDdkcLNdGfsSr2hIWwGrpro8mP4lY5uIc0GFId+U2uUVDiqiQ9TvB0W95NA3VfAJ0tcGJ3o77gl5T0IdFu8nD7gDqTPi0bAyJxB70t5ilmxDtfo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fxl+zUsG; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fxl+zUsG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A8E881F00894; Wed, 20 May 2026 18:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302398; bh=xNZ6LFpDqSiliRDQZffjOR3z3XDTMAtPwuRo7ubH7Vo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=fxl+zUsGxVFhG/PBg4Zy8jA+vL8kZdsM59y/NtRfPOp7u/r/LABun0NFwYqtoCLxJ oItN3JvNyGnPnk2pYUmY0QD+rpHJXhT6IPSHV/0E2KWzxkSoGcqjFsdapG3hn4TS5i cto8atcvmCtdhnYhh7qxKXci7nMrRI3qeqwHmZF70tRPs9PkleaVlOEfDvFQs4HOZC kpbbjeYFjfO2xROIXOd5Yvej42l57BYPpRoSGk1wyCzRLl82f/cP2fNGrvjXdAsSyQ M3wcIkyvpYUAb4VY3eAlV3sRxNwRfVLyLh4X10HOmxql3sXhmPVx86tuyiCD8y+BA5 6naBM/eFbkhuw== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org, Krzysztof Kozlowski Subject: [PATCH 09/10] [v6 omap] ARM: dts: omap2: add stlc4560 spi-wireless node Date: Wed, 20 May 2026 20:38:14 +0200 Message-Id: <20260520183815.2510387-10-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann Converted from the platform_device creation in board-n8x0.c. Link: https://lore.kernel.org/all/20230314163201.955689-1-arnd@kernel.org/ Reviewed-by: Krzysztof Kozlowski Reviewed-by: Linus Walleij Signed-off-by: Arnd Bergmann Reviewed-by: Andreas Kemnade --- v6: no changes v1 through v5: adaptations that correspond to the binding updates --- arch/arm/boot/dts/ti/omap/omap2.dtsi | 4 ++++ arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/arch/arm/boot/dts/ti/omap/omap2.dtsi b/arch/arm/boot/dts/ti/om= ap/omap2.dtsi index afabb36a8ac1..fdc1790adf43 100644 --- a/arch/arm/boot/dts/ti/omap/omap2.dtsi +++ b/arch/arm/boot/dts/ti/omap/omap2.dtsi @@ -129,6 +129,8 @@ i2c2: i2c@48072000 { }; =20 mcspi1: spi@48098000 { + #address-cells =3D <1>; + #size-cells =3D <0>; compatible =3D "ti,omap2-mcspi"; ti,hwmods =3D "mcspi1"; reg =3D <0x48098000 0x100>; @@ -140,6 +142,8 @@ mcspi1: spi@48098000 { }; =20 mcspi2: spi@4809a000 { + #address-cells =3D <1>; + #size-cells =3D <0>; compatible =3D "ti,omap2-mcspi"; ti,hwmods =3D "mcspi2"; reg =3D <0x4809a000 0x100>; diff --git a/arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi b/arch/arm= /boot/dts/ti/omap/omap2420-n8x0-common.dtsi index 63b0b4921e4e..fe9dd8bbfc85 100644 --- a/arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi +++ b/arch/arm/boot/dts/ti/omap/omap2420-n8x0-common.dtsi @@ -109,3 +109,15 @@ partition@5 { }; }; }; + +&mcspi2 { + status =3D "okay"; + + wifi@0 { + reg =3D <0>; + compatible =3D "st,stlc4560"; + spi-max-frequency =3D <48000000>; + interrupts-extended =3D <&gpio3 23 IRQ_TYPE_EDGE_RISING>; + powerdown-gpios =3D <&gpio4 1 GPIO_ACTIVE_LOW>; /* gpio 97 */ + }; +}; --=20 2.39.5 From nobody Sun May 24 22:35:48 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E55E400E1D; Wed, 20 May 2026 18:40:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302408; cv=none; b=jISA3eoemvuUIbfeM7cdhnQdmWUBXKTGiBAqGDYb16SwOHaJiLDefYJenj+lWtFfZQ0ZmCWAKo2PHHPD8yz5Jjh2lLqlZHX+EviNVxsNlNhF9z2GVa74uFdVvTI2XCBknprq4WS/7bF3nXwjravE3hqeH/6PCdA2DzW4d+SXdvg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779302408; c=relaxed/simple; bh=DkSZfXOAffCCtFwAjz7g6qmQiQIlMDMjpPdApHgp6TE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=pRUFecsEeEN3IRyBst/STNE6jz0/pjXzZ0VUsVFNPlAml3p/3WAUUN/8QzuiwiOAVLEfVyqHdGU7sZxTlA9YBZjd6d+YntRmgytd0/4K0nggH94BAWskBAwzoy5hcs9L8UiQR7VQwi5T/0OyEIe/6dZ+yr5XJbZ+JuS++Q8cmaA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TxJsYXWd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TxJsYXWd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19B121F0089A; Wed, 20 May 2026 18:39:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1779302406; bh=02+6d8dOXhR9E+F29QDQjM2pWkqHo3wDZDJjMa+yUu0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=TxJsYXWdfmza+UhP3R5pB3RwB3VkdHYGSwnVCeXIfZWjcwPv5hyYy1pozAEtav9zc ST23wnlxbaQNSejo3rEHwIRi3+Vsb+rGxZgXDu6Wg2SRyCm1gKgYG9kyT1s0+eLdMh jLq+3jUpE8uIKfQfhWYcZI1RUu3KhaTsvYTa7fcRh4jeGeHIn1KWH1IQXk1A+GPle+ /fk//MJVx/io/TegeiPOyqkC6PuFHo2UABrmL27yz5Omg47Zm8XFMz0oUKynX/ZKE6 XwChghHVCC5r3gWZlyQSDgbWCdunVnBYtGrwFl8Zgn+l6bnK9CSl/JfztXE0nTPRKy fbtvXvNZAq/IQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Arnd Bergmann , Christian Lamparter , Johannes Berg , Aaro Koskinen , Andreas Kemnade , Kevin Hilman , Roger Quadros , Tony Lindgren , Thomas Bogendoerfer , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Linus Walleij , Bartosz Golaszewski , Dmitry Torokhov , Lee Jones , Pavel Machek , Matti Vaittinen , Florian Fainelli , Jonas Gorski , Andrew Lunn , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-wireless@vger.kernel.org, linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mips@vger.kernel.org, linux-sh@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 10/10] gpiolib: turn off legacy interface by default Date: Wed, 20 May 2026 20:38:15 +0200 Message-Id: <20260520183815.2510387-11-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260520183815.2510387-1-arnd@kernel.org> References: <20260520183815.2510387-1-arnd@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Arnd Bergmann All users of the legacy interface now select CONFIG_GPIOLIB_LEGACY, so it can be turned off by default and only get built on platforms that still have one unconverted driver. Allow turning it on manually for compile testing, in order to keep the build coverage of the legacy drivers in allmodconfig and randconfig. Signed-off-by: Arnd Bergmann --- drivers/gpio/Kconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) This patch depends on patches 1 through 9 to be applied first. diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 00fcab5d09a4..eec17089eaa6 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig @@ -4,7 +4,14 @@ # =20 config GPIOLIB_LEGACY - def_bool y + bool "Legacy GPIO interfaces" if COMPILE_TEST + help + There are a few legacy platforms that use the traditional GPIO + number based interfaces instead of GPIO descriptors. + Say Y here to enable build testing drivers that are specific + to those platforms. + + If unsure, say N. =20 config HAVE_SHARED_GPIOS bool --=20 2.39.5