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 <[email protected]>
---
 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

Reply via email to