From nobody Sat Jul 11 14:00:17 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 9E8783B4EAA; Fri, 10 Jul 2026 21:19:07 +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=1783718348; cv=none; b=AB3WK8ZGDzTaWV4RKms+kC63InLG96QjOgXTnT12u+pCc4Id8LWMykn3TzO+Kh3GzeviBmXbIf/74KksxmQwrJeG1OOHJwyEHCLNXSu8un0lJ6xaNZJox5XfOHoKM4RR+btnEanW6x5KhauOctpJgh5ZxIq3dPdnZfAGomERolQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718348; c=relaxed/simple; bh=rRpuGGpA1n7ztGc/QpkwkeAxpt5qro269Sj/gA+9ojM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Chl3eVus8Tec/5jUICGo08Y4keGa5eadz1CFvDGQvglJU6ziA5CeeR4xgG61qvL6bCrkFOOPYX2alsW0r4kQjmfbfitoetSYj5pJztU90y5qlDa8z4QvbLzj3KY1mWGPw3zvo3WuqbWh99kKCGyeWawOpxe/I5Mli57sKelzIWE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iz4zFz1H; 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="iz4zFz1H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5ED651F00A3A; Fri, 10 Jul 2026 21:19:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718347; bh=VqoRWtbSdRYWkK8l3vZejtzyP7685EcW/OvuSEMQC1I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=iz4zFz1H85iDeZ48qPyL6Mvu5J+nMS05c/A18Tm3MptFK8nEMnqRmOS/hH+DFsBIU xHfiuA89aRSgKVmJn0hNEJv9rNtc88J5TXbHRupwBPSLVO/o0zM1qOIfYXPd3TKxep H9XbumDE6itxl6lQElT7Tf9SxyI+nI2DZQ4Rg0b0DnwgBjPt+bjDE9MeEYnLty73R7 hP6bDqMlm9R9yyqIARw4yrb5t5Srr6ovWAcE0a7fsxzOE9RPK6yjrEkhU5SuOahqZw X4VzjA5Scb6yzyGKnt7s5L9OZUnXnneorohPTnCskUKOR/mh8261JvxYcf9mgYoLIR ihgCp+BjhF7DQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 1/6] [v6] Input: soc_button_array - select CONFIG_GPIOLIB_LEGACY Date: Fri, 10 Jul 2026 23:18:49 +0200 Message-Id: <20260710211854.1371746-2-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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 This driver converts information from ACPI in x86 based tablets and laptops into platform_data for the gpio_keys driver, using the obsolete gpio number based interfaces. This should really be converted to some other method, but since the conversion is nontrivial, have this one select GPIOLIB_LEGACY for the time being. This enables turning GPIOLIB_LEGACY off by default on most kernel builds. Since the driver is only used on x86 portables, add a CONFIG_X86 dependency, which means non-x86 allmodconfig builds usuallly build without the legacy gpio support. Link: https://lore.kernel.org/all/ah-1z9LhVG0wtfBw@google.com/ Acked-by: Bartosz Golaszewski Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v5: This was part of an earlier "x86/platform: select legacy gpiolib interfaces where used" patch that covered several drivers. This is the only one left as of linux-7.2-rc1 --- drivers/input/misc/Kconfig | 3 +++ drivers/input/misc/soc_button_array.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 1f6c57dba030..9c66e3a67127 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -892,6 +892,9 @@ config INPUT_IDEAPAD_SLIDEBAR config INPUT_SOC_BUTTON_ARRAY tristate "Windows-compatible SoC Button Array" depends on KEYBOARD_GPIO && ACPI + depends on X86 + depends on GPIOLIB + select GPIOLIB_LEGACY help Say Y here if you have a SoC-based tablet that originally runs Windows 8 or a Microsoft Surface Book 2, Pro 5, Laptop 1 or later. diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc= _button_array.c index b8cad415c62c..a6c984205123 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -15,7 +15,6 @@ #include #include #include -#include #include =20 static bool use_low_level_irq; --=20 2.39.5 From nobody Sat Jul 11 14:00:17 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 7A2003B4EAA; Fri, 10 Jul 2026 21:19:11 +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=1783718352; cv=none; b=th3y5KvPa+d6rJyCGZ5QG0fkOmIIjFHu3awcbzgSbKnBGVzpZ2m0eIDSzLvR+kfBf7ISuYBTVjCdKz8p1g7N+NvFdzOj3bWsqjeMfAGgNv3s4UdhNzQ0WSnQuoNvwIazmLspHkdSL0uQaS2yV0gww4TxwYqHk5HSWQ1QIz9GEIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718352; c=relaxed/simple; bh=9t2rX193IBbII/SkD1sZ6b1S6Kg5U6adn3TSbDt1o7o=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=S5vtrW372scmJl2Ih8qMXksPXVFCicKpL7YyHV3JDDIL6Ppf6odKRXT9/iZYBbwqeWqhzadnlJ1XuC+mtjXACUz0JMSbsXWt/JeJf4otPwQxbMO8a9V6wfcKPzFX5F2NNtwrgz6GzY1QgW1cScFlWIQKu+6H4wah71dZ5RUrr/s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ObhtfZcz; 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="ObhtfZcz" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 985741F000E9; Fri, 10 Jul 2026 21:19:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718351; bh=m5zCJ35nUw+Ql++3UWFF1hzVFzNhspySX+1bZiFa+dY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=ObhtfZczMIqCiXI1u6WScaZcB7ywyXfILXUucikWo1uU0jIvHpbgDEfWUiE9YSK4u hGrMxq5NYybGhaUet239t7i+Es3h1bIHOTzyUu9WDdQFzVxuNcmUH7ve6LbWMkE2FP ZMwYyLud22CSnD+Bfg93ZtuVE65MJ/6z+0wG+l80Bpa44jGBYUeANUel3Ac0XjvGAw +iLdLbTwkuut1DYAp9qCLjTbYntAomrhHXHO4syecua4jhSHE1CSZOowHubJzAHhBD 3aHmBG+oAba4QOVRFIlGuQO9iSGHc7hq8oUQvCuLxqn8lZEJxV+Z6BRrtnk3yOOEl8 anxIZsmEY6qBw== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 2/6] [v6] Input: gpio-keys: make legacy gpiolib optional Date: Fri, 10 Jul 2026 23:18:50 +0200 Message-Id: <20260710211854.1371746-3-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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/ Link: https://lore.kernel.org/all/ajQ-CtU131FAJ9ES@google.com/ Acked-by: Bartosz Golaszewski Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v3..v5: resend v2: skip the fake GPIO number passing from mfd This patch now has a small conflict with the rework of the rohm drivers to use software nodes. That patch is the one we want, and then the drivers/mfd changes here can get dropped, but the two need to get merged in the correct order. --- drivers/input/keyboard/gpio_keys.c | 9 +++++---- drivers/input/keyboard/gpio_keys_polled.c | 4 +++- drivers/mfd/rohm-bd71828.c | 1 - drivers/mfd/rohm-bd718x7.c | 1 - include/linux/gpio_keys.h | 2 ++ 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gp= io_keys.c index e19617485679..e988657f97cb 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -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..4e7a366ff05b 100644 --- a/drivers/input/keyboard/gpio_keys_polled.c +++ b/drivers/input/keyboard/gpio_keys_polled.c @@ -18,8 +18,8 @@ #include #include #include -#include #include +#include #include #include =20 @@ -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 Sat Jul 11 14:00:17 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 2C8DC3B4EAA; Fri, 10 Jul 2026 21:19:15 +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=1783718357; cv=none; b=kSp/yGVph+8QoxNQxh5L2xSdhk1Ev7FvNYDo/a8jkxLl5UrNrHu1lgt1hrYdKqu7kMhXzcvH/2necVrtCVbLVOvGTBIVV1bmUizv0zRKSUJdU977MfYalikKT8qFlCO8xrevwszFVYwxRGwhRBnwvSZ9MRtHmic+drHGYdQmGsE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718357; c=relaxed/simple; bh=ZxnRrZtRPuAIq8NlMUIxxH+gHJOLJ3rFA3IW5TGDwuk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jqBuhtn65CM2shI0YuHV0DFnx6rPKuoeyZX4BirMQAaXyBBR1RkodVJlwor7NtraRqOEA2QveY7WpJy1NbbZB50xHQf9VF8aXSTqLqzmFKOp5K83bqN2xP+19CqUkTtJcU/7lkrJafwhXbutAMnuqzpC/aznqMRvWFX9tAoT7vg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UYfBr9rY; 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="UYfBr9rY" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D05711F00A3A; Fri, 10 Jul 2026 21:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718355; bh=UX90iQ3LkDmO8fRydgIUY2muq8ufm1s4/Q3CAMMdDfo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=UYfBr9rYqJ3+zhU7JqhDQxcZAlQI/LzCnnEyzpRqtui+m4dKf9bJUQDvuL/gyoXQw J/DeSKg0VPHHYLle3QzaAeH7FABooKcd/PjkMVuQ40A3KS/al5Cf/K9zgNGUTX4e0n I3um47bsI5gzjY1Iy7Pzv4gqp1yweyHAqhZvAfqfROVeC0U9YACY48B3vvy7Q6Nv7M WS6/p7e7rrRYDu8Q+l4EWBgPPl8o3sagLPzzsGqlikNMF/o2dqIcnRQ4APs3BvLO53 mSpNZQHP0ZH2G9UXQFVhWx2uLCORI4q0VYbbv4N1CwM5hh3xLTmbrz0srEMkdGmpNo ojfp5Ln736G4w== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Bartosz Golaszewski , Andy Shevchenko Subject: [PATCH 3/6] [v6] leds: gpio: make legacy gpiolib interface optional Date: Fri, 10 Jul 2026 23:18:51 +0200 Message-Id: <20260710211854.1371746-4-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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 Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v5: no changes 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 --- drivers/leds/leds-gpio.c | 52 +++++++++++++++++++++++++++------------- include/linux/leds.h | 2 ++ 2 files changed, 37 insertions(+), 17 deletions(-) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index a3428b22de3a..9cbcf7e40a15 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -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 @@ -223,16 +222,29 @@ static struct gpio_desc *gpio_led_get_gpiod(struct de= vice *dev, int idx, gpiod =3D devm_gpiod_get_index_optional(dev, NULL, idx, GPIOD_OUT_LOW); if (IS_ERR(gpiod)) return gpiod; - if (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. - */ + gpiod_set_consumer_name(gpiod, template->name); + 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 +264,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 +289,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 Sat Jul 11 14:00:17 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 609F43B4EAA; Fri, 10 Jul 2026 21:19:20 +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=1783718361; cv=none; b=mOdj9O1KgFx9mbBZ/qwj/95pbvIBLX1o91ZhtykQFCi/fSemXT5XjPdIrbIhFllUysGoX5vqVf4POMh96i30+5DWxuwYQv/Figr4m+GH+8QmYh8Bot00Pqh/bJwa8g1aY3551XgOSIp3BauJbUuWdfnzhT7r+5lO9m3GZ2GcGe4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718361; c=relaxed/simple; bh=5yuCVrsdmW7GP09VmUk5T/IkNUy2JXijexTG3M9gZW0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=s1lJ1anMhymuT8rzCxg18ifSbRgDN4fUh8rMWX1+Q/ZLaOHgP7EdS1+Ljnzf9YhRst511B092cTcdypOF0hYlXWw0nrOxALXo875MEsk7EmWYC5A1V/e/kp2F7L7ZDoNYx6ufBkBQdifljQid0ki8kiDKMpk32bNSxqGIRn6IPY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=J4qLeCiE; 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="J4qLeCiE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3DC0B1F000E9; Fri, 10 Jul 2026 21:19:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718360; bh=pZ5y0dl8W1JKKZaG8rVHhaTMkHFeg/XNiwE3WC0P7V8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=J4qLeCiEFoo2eDmnXfMNiqSseHqjg+3dBwWM3rtA0vrgXwH/ksNqiNjuBlHor5Cg1 OFah7a39vkkuRog6YShsG+dV0tAFrqMKuho+7+1JVwW+/1ZzicS6LajSpqXsmW1Fhm 4Q+myoPc2fdhlE1yAKdPTdAd2TtgnNysStsegEIVhkOp1EqCFxfzst9YQVmjEfL40E I5iuecenkQxycWYzZDK5pm1oxEeue1cJrAUF3+JC4751+QYonkcUv17piqUPr5Aw7k 0bv9HuvJOtENNNW2rJkM5WbMhwx974Slc3G4wCifwNwoyNJLiiVGsyS6bm+zKNx9Ul Y5D5Gnik/9TwQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 4/6] [v6] sh: select legacy gpiolib interface Date: Fri, 10 Jul 2026 23:18:52 +0200 Message-Id: <20260710211854.1371746-5-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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 Acked-by: Bartosz Golaszewski Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v2..v5: no changes. The patch did not make it into v7.2-rc1, so I'm keeping it with the rest of the series --- 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 Sat Jul 11 14:00:17 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 B31553B4EAA; Fri, 10 Jul 2026 21:19: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=1783718366; cv=none; b=YKdNAiW4TEEapJgMsZJH0Mn5y/Q7pPBuouCjqkMWpJEM/0r1VpwciZv2TvSo2pXhPLF1y3cWHRH9HdLuLfQ9dY8IdH5AFAxj2ccZI+nysNu3BVBizExh/bTDJFSHOggFnqk2d8jh1rOvM7AzqWiPOWHFMenwKgsnBVtJR6UUYYU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718366; c=relaxed/simple; bh=KCoIXftqxvMIlbHd/+Q6zDopubqMGimatUiAU9Ob5KM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=BKUyL9nGHmuDojtlqGxjl98ot+I4x1421fBxbdkSeFLLsZ/RX73qsdbVZOqAIkCEiB4ghkvCQ44FgS1swLVTtboHo6pMCPSI69/qydWON3JIYkJEUr9GGRdXZh7/pIgiRovDgRYd5kU7r2akcm5mKd4+Qd7YLwuv2OUgF6mRVuk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=frHDnkcm; 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="frHDnkcm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 742011F00A3A; Fri, 10 Jul 2026 21:19:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718364; bh=eZanIfnrkhP9ZJDH71JStizixWoWH6JYnaCWx4Prg74=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=frHDnkcmDBR2gIGW6aGRXiWv4G5ZYB91kx0gxe8CdCfdQHmI79WhcGESdkJhQ63pg 5lsf0E7xuFouqbEeXSxoX3TUa0W1f/9CmjtipWDlzEaPSvapFKNjrKlCu6KU3MoA45 pXfNZkt9PF9di3zH/XlFp+dEwptS3eo/oAPFrhCMQsroaznqd6t57BArO61pquqBJM y+bSH7vEgNLCJlL2e5NRz0qZh8ElTB2o0dKC7beZJliROAiPe9bjY3g050Mely+5oQ odTg0N/kxyryN/aMIw29GZ613D/2u77+e2S4nFhXZHQUr38MzBxuByIsLMK9xgU9ji jVuAySxP6lxlQ== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Takashi Iwai , Bartosz Golaszewski Subject: [PATCH 5/6] [v6] x86/olpc: select GPIOLIB_LEGACY Date: Fri, 10 Jul 2026 23:18:53 +0200 Message-Id: <20260710211854.1371746-6-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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 Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v3..v5: no changes v2: update changelog text --- arch/x86/Kconfig | 1 + arch/x86/platform/olpc/olpc-xo1-sci.c | 2 +- sound/pci/Kconfig | 1 + sound/pci/cs5535audio/cs5535audio_olpc.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index bdad90f210e4..4ad8a7bbd93d 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig @@ -2976,6 +2976,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/arch/x86/platform/olpc/olpc-xo1-sci.c b/arch/x86/platform/olpc= /olpc-xo1-sci.c index 30751b42d54e..a5b47960ba32 100644 --- a/arch/x86/platform/olpc/olpc-xo1-sci.c +++ b/arch/x86/platform/olpc/olpc-xo1-sci.c @@ -9,7 +9,7 @@ =20 #include #include -#include +#include #include #include #include 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 diff --git a/sound/pci/cs5535audio/cs5535audio_olpc.c b/sound/pci/cs5535aud= io/cs5535audio_olpc.c index 122170a410d9..cfdcc5bf4341 100644 --- a/sound/pci/cs5535audio/cs5535audio_olpc.c +++ b/sound/pci/cs5535audio/cs5535audio_olpc.c @@ -9,7 +9,7 @@ #include #include #include -#include +#include =20 #include #include "cs5535audio.h" --=20 2.39.5 From nobody Sat Jul 11 14:00:17 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 B688F3B6BE3; Fri, 10 Jul 2026 21:19:28 +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=1783718369; cv=none; b=sFQvEWODAh+XwPNvvDlVOFum/vYfwY5E7h4LBxJo+W433l+NzwGQXWfxBl+aj8njCkT8KGmhyQKlXsMT5uVtC7ot+nZbwWTeGb6hvwQDQVkssZoRgH3A0KjUCAx+iBTZ44IqtVXfIzXLD55K/CWW9rEZ8Pl4+aem6+amDZT+QMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783718369; c=relaxed/simple; bh=CGIgemArU5dJAVzaKv+UGu8qpVYophNCYabUFgiHvyU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Z3WAnASKP+/+3Bcs0GqHX9JQ7wdtsSpXx8dhI9DD/vQ8Ra3JKv0aRL85DsgxQYojPGW/8NGxUrPaliLjxtdtwLXEDugpdzWSHK060ksOH95bzLqSVhjQnuNQ7Erag7K0IxS6akny2rXnjbCAF9gauomDJOEuK7L4EjJGcURQvC0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nzqRqQM9; 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="nzqRqQM9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D646C1F000E9; Fri, 10 Jul 2026 21:19:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1783718368; bh=QghtmwXZxb5W4DunHwzaT7QrfF2R8OUV76vdsj6iuCc=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nzqRqQM9UKEcb6u3h7LdWZkyvgPVkTqE+sURmz7WxBKi3vnQpaBD1OM7zuRXY8kHG uDiD2nVCO9iQbCLJ3zrRFC3Rwm7j+mvPplpJxiVZ1U/AAKBvOEj/qM6Z5R2le7aAIe R9X5EBTMexGXw1QrMfXdjutnJsf1Hrc3qVd0w8s3kIDCid7euVPJk7UAyRsyKTQ/XP GFyu2qxiPsvhEg/fA6k+JlcRIj3IpFcQMczd9yIlQ7XPwThdVEmnmOzYJd6NdD2HHO bSpRFqNiAQzf9nbLurHE2bxeWi3YQ1lMtQBSzt7cknUW+BL7nujlhF8YIRNbNrUyBv 9wGTv6wB7wpSg== From: Arnd Bergmann To: linux-gpio@vger.kernel.org, Linus Walleij , Bartosz Golaszewski Cc: Arnd Bergmann , John Paul Adrian Glaubitz , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Dmitry Torokhov , Lee Jones , Pavel Machek , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH 6/6] [v6] gpiolib: turn off legacy interface by default Date: Fri, 10 Jul 2026 23:18:54 +0200 Message-Id: <20260710211854.1371746-7-arnd@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260710211854.1371746-1-arnd@kernel.org> References: <20260710211854.1371746-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. Acked-by: Bartosz Golaszewski Acked-by: Dmitry Torokhov # for input Signed-off-by: Arnd Bergmann --- v5: added patch, now that we are getting closer to completing the series --- drivers/gpio/Kconfig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index 28cf6d2e83c2..f063bdfd111b 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