button with "gpio-keys" not fired when CONFIG_PM_DEVICE_RUNTIME=y

Hi,

using nrf connect SDK v3.1.1

using nrf54L15 development board.

I am trying to run a simple button event yet callback is not fired when 

CONFIG_PM_DEVICE_RUNTIME=y

when 

CONFIG_PM_DEVICE_RUNTIME=n
it works.
single change in the project.

INPUT_CALLBACK_DEFINE(pad_input,
                      input_cb,
                      NULL);

static void input_cb(struct input_event *evt, void *user_data)
{
    LOG_DBG("Button event code %d: pressed=%d", evt->code, evt->value);

}

	///
	/// Inputs with debouncing.
	///
    pad_input:pad_input {
        compatible = "gpio-keys";
		debounce-interval-ms = <150>;                      /* Debouncing time */
        pad_state_in: pad_state_in {
            gpios = PAD_IN_GPIO_SPEC;
            label = "pad_signal_in";
            zephyr,code = <INPUT_KEY_0>;
        };

thanks

Dan

Parents Reply Children
  • thanks for your very helpful assistants,

    zephyr doc states:

    yet the proj.conf has two define we can play with

    CONFIG_PM_DEVICE=y
    CONFIG_PM_DEVICE_RUNTIME=n
    do I understand correctly?
    if CONFIG_PM_DEVICE_RUNTIME=n
    then use:
    pm_device_action_run(uart, PM_DEVICE_ACTION_SUSPEND);
    pm_device_action_run(uart, PM_DEVICE_ACTION_RESUME);
    if CONFIG_PM_DEVICE_RUNTIME=y
    then use:
    pm_device_runtime_enable(uart);
    pm_device_runtime_put(uart);
    pm_device_runtime_get(uart);
    etc..
    Also the pm_device_runtime_enable won't enable when CONFIG is n.
    What is recommendation when to use one, or both CONFIG settings.
    thanks
    Dan

  • Hi Dan,

     

    Yes, your observations are indeed correct wrt. having CONFIG_PM_DEVICE_RUNTIME either selected or n-selected.

    narfster said:
    What is recommendation when to use one, or both CONFIG settings.

    Both are fine to use in this case, but requires different API handling, unfortunately. Which one to use and implement is based on your own preference on the matter.

     

    Kind regards,

    Håkon

Related