U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rockchip: boot_mode: fix download key detection
@ 2026-06-10  3:01 Tianling Shen
  2026-06-10 13:25 ` Jonas Karlman
  0 siblings, 1 reply; 5+ messages in thread
From: Tianling Shen @ 2026-06-10  3:01 UTC (permalink / raw)
  To: Jonas Karlman, Kever Yang, Philipp Tomsich, Quentin Schulz,
	Simon Glass, Tom Rini
  Cc: Tianling Shen, u-boot

rockchip_dnl_key_pressed() looks for the ADC device by checking
whether the device name starts with "saradc".

On RK3328, RK3576, RK3588 etc., the SARADC node is named "adc@...",
so the device name no longer has the "saradc" prefix. As a result,
U-Boot fails to find the SARADC device and does not sample the
download key state.

Do not rely on the DT node name. Match the bound Rockchip SARADC
driver instead, which works for both "saradc@..." and "adc@..."
node names.

Signed-off-by: Tianling Shen <cnsztl@gmail.com>
---
 arch/arm/mach-rockchip/boot_mode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/mach-rockchip/boot_mode.c b/arch/arm/mach-rockchip/boot_mode.c
index 55e9456668ae..363fad523cbd 100644
--- a/arch/arm/mach-rockchip/boot_mode.c
+++ b/arch/arm/mach-rockchip/boot_mode.c
@@ -51,7 +51,7 @@ __weak int rockchip_dnl_key_pressed(void)
 
 	ret = -ENODEV;
 	uclass_foreach_dev(dev, uc) {
-		if (!strncmp(dev->name, "saradc", 6)) {
+		if (!strcmp(dev->driver->name, "rockchip_saradc")) {
 			ret = adc_channel_single_shot(dev->name, 1, &val);
 			break;
 		}
-- 
2.54.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-07-02  6:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-10  3:01 [PATCH] rockchip: boot_mode: fix download key detection Tianling Shen
2026-06-10 13:25 ` Jonas Karlman
2026-06-11  7:45   ` Tianling Shen
2026-06-26 11:52     ` Quentin Schulz
2026-07-02  6:55       ` Tianling Shen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox