This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

  • Resolved

LP5562 - firmware load option via sysfs

Prodigy 180 points

Replies: 4

Views: 1644

Hello,

I have LP5562 integrated into a custom beaglebone black PCB and loaded with a yocto based distro. With this setup, I have successfully enabled compilation of lp5562 driver into the linux kernel via kernel config, with these options:

CONFIG_LEDS_LP55XX_COMMON=y
CONFIG_LEDS_LP5562=y
CONFIG_NEW_LEDS=y
CONFIG_LEDS_CLASS=y
CONFIG_LEDS_TRIGGERS=y

However, when I try to follow the instructions in https://www.kernel.org/doc/Documentation/leds/leds-lp5562.txt 

echo 2 > /sys/bus/i2c/devices/xxxx/select_engine  
echo "RGB" > /sys/bus/i2c/devices/xxxx/engine_mux 
echo 1 > /sys/class/firmware/lp5562/loading

As soon as I execute the first instruction, I see the following in dmesg:

[22704.521017] lp5562 0-0030: Direct firmware load failed with status -2
[22704.527652] lp5562 0-0030: Falling back to user helper
[22704.542048] lp5562 0-0030: firmware request failed

I don't see "/sys/class/firmware/lp5562/" . I tried adding CONFIG_FW_LOADER=y to Kconfig to no avail.

Any idea what I could be doing wrong or what kernel config I am missing?

thanks,

Arun

  • Hello Arun,

        Please enable user helper firmware loader option in your dot config file.
        CONFIG_FW_LOADER_USER_HELPER=y

    Thanks.

    Best Regards,

    Tomi Koskela

    Find the right power solution for your processor or FPGA. Visit www.ti.com/SoCPower today!

  • In reply to Tomi Koskela:

    Hi Tomi,

    Thanks for your suggestion. I tried this option and see the same error as before. I also verified that this option was set in the kernel config file that was generated.

    thanks,
    Arun
  • In reply to Arun Sivakumaran:

    Hi Arun,

    Our driver expert could reproduce this and it seems that this is the side effect of the kernel feature - 'firmware loader user helper'.
    The uevent option of request_firmware_nowait() should be disabled to load binary data manually.
    If uevent is set, then firmware class node(/sys/class/firmware/lp5562) will be removed by firmware_class_timeout_work().
    So, please apply the diff patch below.

    diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
    index f23c315..94b2cda 100644
    --- a/drivers/leds/leds-lp55xx-common.c
    +++ b/drivers/leds/leds-lp55xx-common.c
    @@ -237,7 +237,7 @@ static int lp55xx_request_firmware(struct lp55xx_chip *chip)
         const char *name = chip->cl->name;
         struct device *dev = &chip->cl->dev;
     
    -    return request_firmware_nowait(THIS_MODULE, true, name, dev,
    +    return request_firmware_nowait(THIS_MODULE, false, name, dev,
                     GFP_KERNEL, chip, lp55xx_firmware_loaded);
     }

    Best Regards,

    Tomi Koskela

    Find the right power solution for your processor or FPGA. Visit www.ti.com/SoCPower today!

  • In reply to Tomi Koskela:

    Hi Tomi,

    Thanks for such a quick response! I have confirmed the patch you provided works at my end as well.

    regards,
    Arun

This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.