How to wakeup from sleep with GPIO?

I am using Hummingboard Pulse evaluation board + IMX8MP SOM with Yocto Kirkstone. I want to configure wake up from sleep with GPIO, for example pin: MX8MP_IOMUXC_SAI2_RXD0__GPIO4_IO23

I modified device tree like this:

pinctrl_gpio_keys: gpiokeys {
fsl,pins = <
MX8MP_IOMUXC_SAI2_RXD0__GPIO4_IO23 0x19
>;
};

gpio-keys {
compatible = “gpio-keys”;
pinctrl-names = “default”;
pinctrl-0 = <&pinctrl_gpio_keys>;

	rec-btn {
		label = "RecButton";
		gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
		/* linux,code = <KEY_SLEEP>; */
                    wakeup-source;
	};

};

After sendind SOM to sleep with command:
echo mem > /sys/power/state

pressing the button(active high) on GPIO doesn’t wake up the system.

Is the device tree modification correct?
What commands, configs am I missing?

I will need additional information to help you debug this issue. Please post your dmesg output, the output of cat /sys/kernel/debug/gpio and a simple schematic diagram or explanation of how your wakeup button is wired.

Dmesg log:

I cut a part otherwise I can't post it, because of character size limitations

[    1.284072] e1000: Intel(R) PRO/1000 Network Driver
[    1.288958] e1000: Copyright (c) 1999-2006 Intel Corporation.
[    1.294741] e1000e: Intel(R) PRO/1000 Network Driver
[    1.299713] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.305671] igb: Intel(R) Gigabit Ethernet Network Driver
[    1.311075] igb: Copyright (c) 2007-2014 Intel Corporation.
[    1.316677] igbvf: Intel(R) Gigabit Virtual Function Network Driver
[    1.322950] igbvf: Copyright (c) 2009 - 2012 Intel Corporation.
[    1.328925] usbcore: registered new interface driver r8152
[    1.334484] usbcore: registered new interface driver qmi_wwan
[    1.340455] VFIO - User Level meta-driver version: 0.3
[    1.350585] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.357144] ehci-pci: EHCI PCI platform driver
[    1.361630] ehci-platform: EHCI generic platform driver
[    1.367072] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.373284] ohci-pci: OHCI PCI platform driver
[    1.377765] ohci-platform: OHCI generic platform driver
[    1.383649] usbcore: registered new interface driver cdc_wdm
[    1.389468] usbcore: registered new interface driver uas
[    1.394829] usbcore: registered new interface driver usb-storage
[    1.400900] usbcore: registered new interface driver usbserial_generic
[    1.407449] usbserial: USB Serial support registered for generic
[    1.413485] usbcore: registered new interface driver ftdi_sio
[    1.419251] usbserial: USB Serial support registered for FTDI USB Serial Device
[    1.426591] usbcore: registered new interface driver usb_serial_simple
[    1.433140] usbserial: USB Serial support registered for carelink
[    1.439253] usbserial: USB Serial support registered for zio
[    1.444931] usbserial: USB Serial support registered for funsoft
[    1.450957] usbserial: USB Serial support registered for flashloader
[    1.457334] usbserial: USB Serial support registered for google
[    1.463273] usbserial: USB Serial support registered for libtransistor
[    1.469820] usbserial: USB Serial support registered for vivopay
[    1.475847] usbserial: USB Serial support registered for moto_modem
[    1.482148] usbserial: USB Serial support registered for motorola_tetra
[    1.488780] usbserial: USB Serial support registered for nokia
[    1.494634] usbserial: USB Serial support registered for novatel_gps
[    1.501007] usbserial: USB Serial support registered for hp4x
[    1.506773] usbserial: USB Serial support registered for suunto
[    1.512712] usbserial: USB Serial support registered for siemens_mpi
[    1.519097] usbcore: registered new interface driver usb_ehset_test
[    1.529192] snvs_rtc 30370000.snvs:snvs-rtc-lp: registered as rtc1
[    1.535538] i2c_dev: i2c /dev entries driver
[    1.543933] EDAC MC: ECC not enabled
[    1.548809] sdhci: Secure Digital Host Controller Interface driver
[    1.555008] sdhci: Copyright(c) Pierre Ossman
[    1.560028] Synopsys Designware Multimedia Card Interface Driver
[    1.566722] sdhci-pltfm: SDHCI platform and OF driver helper
[    1.574511] ledtrig-cpu: registered to indicate activity on CPUs
[    1.581293] SMCCC: SOC_ID: ARCH_SOC_ID not implemented, skipping ....
[    1.588191] usbcore: registered new interface driver usbhid
[    1.593776] usbhid: USB HID core driver
[    1.602125]  cs_system_cfg: CoreSight Configuration manager initialised
[    1.610175] optee: probing for conduit method.
[    1.614648] optee: revision 3.19 (00919403)
[    1.615498] optee: dynamic shared memory is enabled
[    1.624917] optee: initialized driver
[    1.631445] Galcore version 6.4.3.p4.398061
[    1.741276] [drm] Initialized vivante 1.0.0 20170808 for 40000000.mix_gpu_ml on minor 0
[    1.750968] hantrodec 0 : module inserted. Major = 508
[    1.756575] hantrodec 1 : module inserted. Major = 508
[    1.763135] hantroenc: HW at base <0000000038320000> with ID <0x80006200>
[    1.770070] hx280enc: module inserted. Major <507>
[    1.777609] NET: Registered PF_LLC protocol family
[    1.782896] NET: Registered PF_INET6 protocol family
[    1.789796] Segment Routing with IPv6
[    1.793511] In-situ OAM (IOAM) with IPv6
[    1.797488] NET: Registered PF_PACKET protocol family
[    1.803256] Bluetooth: RFCOMM TTY layer initialized
[    1.808148] Bluetooth: RFCOMM socket layer initialized
[    1.813327] Bluetooth: RFCOMM ver 1.11
[    1.817097] Bluetooth: BNEP (Ethernet Emulation) ver 1.3
[    1.822418] Bluetooth: BNEP filters: protocol multicast
[    1.827671] Bluetooth: BNEP socket layer initialized
[    1.832654] Bluetooth: HIDP (Human Interface Emulation) ver 1.2
[    1.838606] Bluetooth: HIDP socket layer initialized
[    1.844652] 8021q: 802.1Q VLAN Support v1.8
[    1.848958] 9pnet: Installing 9P2000 support
[    1.853262] tsn generic netlink module v1 init...
[    1.858048] Key type dns_resolver registered
[    1.863158] Loading compiled-in X.509 certificates
[    1.937574] nxp-pca9450 0-0025: pca9450bc probed.
[    1.942558] i2c i2c-0: IMX I2C adapter registered
[    1.948878] i2c i2c-1: IMX I2C adapter registered
[    1.955051] i2c 2-0036: Fixing up cyclic dependency with 32e40000.csi
[    1.961766] i2c 2-003d: Fixing up cyclic dependency with 32e60000.mipi_dsi
[    1.968955] adv7511 2-003d: supply avdd not found, using dummy regulator
[    1.975755] adv7511 2-003d: supply dvdd not found, using dummy regulator
[    1.982510] adv7511 2-003d: supply pvdd not found, using dummy regulator
[    1.989256] adv7511 2-003d: supply a2vdd not found, using dummy regulator
[    1.996083] adv7511 2-003d: supply v3p3 not found, using dummy regulator
[    2.002826] adv7511 2-003d: supply v1p2 not found, using dummy regulator
[    2.010756] adv7511 2-003d: Probe failed. Remote port 'mipi_dsi@32e60000' disabled
[    2.018736] i2c i2c-2: IMX I2C adapter registered
[    2.024954] i2c 3-0036: Fixing up cyclic dependency with 32e50000.csi
[    2.031550] i2c i2c-3: IMX I2C adapter registered
[    2.036667] imx8mq-usb-phy 381f0040.usb-phy: supply vbus not found, using dummy regulator
[    2.045154] imx8mq-usb-phy 382f0040.usb-phy: supply vbus not found, using dummy regulator
[    2.055333] imx6q-pcie 33800000.pcie: supply epdev_on not found, using dummy regulator
[    2.063785] imx6q-pcie 33800000.pcie: PLL REF_CLK is used!.
[    2.069979] imx6q-pcie 33800000.pcie: PCIe PHY PLL clock is locked.
[    2.076034] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    2.081771] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 1
[    2.089774] xhci-hcd xhci-hcd.1.auto: hcc params 0x0220fe6d hci version 0x110 quirks 0x0000002001010010
[    2.099208] xhci-hcd xhci-hcd.1.auto: irq 75, io mem 0x38100000
[    2.105266] xhci-hcd xhci-hcd.1.auto: xHCI Host Controller
[    2.110766] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 2
[    2.118439] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    2.126093] hub 1-0:1.0: USB hub found
[    2.128376] imx6q-pcie 33800000.pcie: PCIe PLL is locked.
[    2.129878] hub 1-0:1.0: 1 port detected
[    2.135294] imx6q-pcie 33800000.pcie: iATU unroll: enabled
[    2.139461] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.144661] imx6q-pcie 33800000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    2.153509] hub 2-0:1.0: USB hub found
[    2.160330] imx6q-pcie 33800000.pcie: host bridge /soc@0/pcie@33800000 ranges:
[    2.164101] hub 2-0:1.0: 1 port detected
[    2.171306] imx6q-pcie 33800000.pcie:   No bus range found for /soc@0/pcie@33800000, using [bus 00-ff]
[    2.176461] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[    2.184557] imx6q-pcie 33800000.pcie:       IO 0x001ff80000..0x001ff8ffff -> 0x0000000000
[    2.190040] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 3
[    2.198213] imx6q-pcie 33800000.pcie:      MEM 0x0018000000..0x001fefffff -> 0x0018000000
[    2.206216] xhci-hcd xhci-hcd.2.auto: hcc params 0x0220fe6d hci version 0x110 quirks 0x0000002001010010
[    2.214131] imx6q-pcie 33800000.pcie: iATU unroll: enabled
[    2.223480] xhci-hcd xhci-hcd.2.auto: irq 76, io mem 0x38200000
[    2.228933] imx6q-pcie 33800000.pcie: Detected iATU regions: 4 outbound, 4 inbound
[    2.234975] xhci-hcd xhci-hcd.2.auto: xHCI Host Controller
[    2.247918] xhci-hcd xhci-hcd.2.auto: new USB bus registered, assigned bus number 4
[    2.255592] xhci-hcd xhci-hcd.2.auto: Host supports USB 3.0 SuperSpeed
[    2.262937] hub 3-0:1.0: USB hub found
[    2.266724] hub 3-0:1.0: 1 port detected
[    2.270936] usb usb4: We don't know the algorithms for LPM for this host, disabling LPM.
[    2.279732] hub 4-0:1.0: USB hub found
[    2.283513] hub 4-0:1.0: 1 port detected
[    2.287988] imx-cpufreq-dt imx-cpufreq-dt: cpu speed grade 5 mkt segment 0 supported-hw 0x20 0x1
[    2.297690] Hot alarm is canceled. GPU3D clock will return to 64/64
[    2.306932] sdhci-esdhc-imx 30b40000.mmc: allocated mmc-pwrseq
[    2.307672] mxc-mipi-csi2-sam 32e40000.csi: supply mipi-phy not found, using dummy regulator
[    2.307724] sdhci-esdhc-imx 30b50000.mmc: Got CD GPIO
[    2.326682] : mipi_csis_imx8mp_phy_reset, No remote pad found!
[    2.332574] mxc-mipi-csi2-sam 32e40000.csi: lanes: 4, hs_settle: 16, clk_settle: 0, wclk: 0, freq: 266000000
[    2.339132] mmc1: SDHCI controller on 30b50000.mmc [30b50000.mmc] using ADMA
[    2.343249] mxc-mipi-csi2-sam 32e50000.csi: supply mipi-phy not found, using dummy regulator
[    2.356989] mmc0: SDHCI controller on 30b40000.mmc [30b40000.mmc] using ADMA
[    2.358188] : mipi_csis_imx8mp_phy_reset, No remote pad found!
[    2.364973] mmc2: SDHCI controller on 30b60000.mmc [30b60000.mmc] using ADMA
[    2.370835] mxc-mipi-csi2-sam 32e50000.csi: lanes: 4, hs_settle: 16, clk_settle: 0, wclk: 0, freq: 266000000
[    2.390522] dwhdmi-imx 32fd8000.hdmi: Detected HDMI TX controller v2.13a with HDCP (samsung_dw_hdmi_phy2)
[    2.400527] dwhdmi-imx 32fd8000.hdmi: registered DesignWare HDMI I2C bus driver
[    2.401505] mmc1: host does not support reading read-only switch, assuming write-enable
[    2.408835] imx-drm display-subsystem: bound imx-lcdifv3-crtc.0 (ops lcdifv3_crtc_ops)
[    2.423817] imx-drm display-subsystem: bound imx-lcdifv3-crtc.1 (ops lcdifv3_crtc_ops)
[    2.431765] imx-drm display-subsystem: bound imx-lcdifv3-crtc.2 (ops lcdifv3_crtc_ops)
[    2.439834] imx_sec_dsim_drv 32e60000.mipi_dsi: version number is 0x1060200
[    2.440000] mmc1: new ultra high speed SDR104 SDHC card at address aaaa
[    2.446833] [drm:drm_bridge_attach] *ERROR* failed to attach bridge /soc@0/bus@32c00000/mipi_dsi@32e60000 to encoder DSI-40: -19
[    2.453837] mmcblk1: mmc1:aaaa SC16G 14.8 GiB 
[    2.464978] imx_sec_dsim_drv 32e60000.mipi_dsi: Failed to attach bridge: 32e60000.mipi_dsi
[    2.464985] imx_sec_dsim_drv 32e60000.mipi_dsi: failed to bind sec dsim bridge: -19
[    2.472553] mmc0: new ultra high speed SDR104 SDIO card at address 0001
[    2.473126] mmc2: new HS400 Enhanced strobe MMC card at address 0001
[    2.473485] mmcblk2: mmc2:0001 8GTF4R 7.28 GiB 
[    2.473737]  mmcblk1: p1 p2
[    2.474774] mmcblk2boot0: mmc2:0001 8GTF4R 4.00 MiB 
[    2.475438] mmcblk2boot1: mmc2:0001 8GTF4R 4.00 MiB 
[    2.476004] mmcblk2rpmb: mmc2:0001 8GTF4R 512 KiB, chardev (510:0)
[    2.477708] imx-drm display-subsystem: bound 32e60000.mipi_dsi (ops imx_sec_dsim_ops)
[    2.528307] usb 3-1: new high-speed USB device number 2 using xhci-hcd
[    2.529642] imx-drm display-subsystem: bound 32fd8000.hdmi (ops dw_hdmi_imx_ops)
[    2.543746] [drm] Initialized imx-drm 1.0.0 20120507 for display-subsystem on minor 1
[    2.551627] imx-drm display-subsystem: [drm] Cannot find any crtc or sizes
[    2.560318] remoteproc remoteproc0: imx-dsp-rproc is available
[    2.568591] gpio-keys gpio-keys: Button without keycode
[    2.573849] gpio-keys: probe of gpio-keys failed with error -22
[    2.580421] cfg80211: Loading compiled-in X.509 certificates for regulatory database
[    2.589405] cfg80211: Loaded X.509 cert 'sforshee: 00b28ddf47aef9cea7'
[    2.595999] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    2.604661] platform regulatory.0: Falling back to sysfs fallback for: regulatory.db
[    2.742566] hub 3-1:1.0: USB hub found
[    2.746382] hub 3-1:1.0: 4 ports detected
[    2.812367] usb 4-1: new SuperSpeed USB device number 2 using xhci-hcd
[    2.870578] hub 4-1:1.0: USB hub found
[    2.874397] hub 4-1:1.0: 4 ports detected
[    3.234288] imx6q-pcie 33800000.pcie: Phy link never came up
[    3.240016] imx6q-pcie: probe of 33800000.pcie failed with error -110
[    3.546407] EXT4-fs (mmcblk1p2): 1 orphan inode deleted
[    3.551681] EXT4-fs (mmcblk1p2): recovery complete
[    3.567665] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null). Quota mode: none.
[    3.577516] VFS: Mounted root (ext4 filesystem) on device 179:2.
[    3.586670] devtmpfs: mounted
[    3.590110] Freeing unused kernel memory: 2560K
[    3.594686] Run /sbin/init as init process
[    3.598814]   with arguments:
[    3.598816]     /sbin/init
[    3.598819]     $(bootargs)
[    3.598821]   with environment:
[    3.598822]     HOME=/
[    3.598824]     TERM=linux
[    3.789592] systemd[1]: System time before build time, advancing clock.
[    3.817702] systemd[1]: systemd 250.5+ running in system mode (+PAM -AUDIT -SELINUX -APPARMOR +IMA -SMACK +SECCOMP -GCRYPT -GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -BZIP2 -LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=hybrid)
[    3.849691] systemd[1]: Detected architecture arm64.
[    3.927659] systemd[1]: Hostname set to <lite-unit-pf>.
[    3.981346] systemd-sysv-generator[194]: SysV service '/etc/init.d/sendsigs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.007971] systemd-sysv-generator[194]: SysV service '/etc/init.d/save-rtc.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.034910] systemd-sysv-generator[194]: SysV service '/etc/init.d/reboot' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.059007] systemd-sysv-generator[194]: SysV service '/etc/init.d/rc.local' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.083024] systemd-sysv-generator[194]: SysV service '/etc/init.d/halt' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.106824] systemd-sysv-generator[194]: SysV service '/etc/init.d/umountfs' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.130949] systemd-sysv-generator[194]: SysV service '/etc/init.d/single' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.154776] systemd-sysv-generator[194]: SysV service '/etc/init.d/umountnfs.sh' lacks a native systemd unit file. Automatically generating a unit file for compatibility. Please update package to include a native systemd unit file, in order to make it more safe and robust.
[    4.508796] systemd[1]: Queued start job for default target Graphical Interface.
[    4.558659] systemd[1]: Created slice Slice /system/getty.
[    4.583082] systemd[1]: Created slice Slice /system/modprobe.
[    4.607168] systemd[1]: Created slice Slice /system/serial-getty.
[    4.630712] systemd[1]: Created slice User and Session Slice.
[    4.653305] systemd[1]: Started Dispatch Password Requests to Console Directory Watch.
[    4.676710] systemd[1]: Started Forward Password Requests to Wall Directory Watch.
[    4.700806] systemd[1]: Reached target Path Units.
[    4.720427] systemd[1]: Reached target Remote File Systems.
[    4.744461] systemd[1]: Reached target Slice Units.
[    4.764482] systemd[1]: Reached target Swaps.
[    4.793329] systemd[1]: Listening on RPCbind Server Activation Socket.
[    4.816483] systemd[1]: Reached target RPC Port Mapper.
[    4.836892] systemd[1]: Listening on Syslog Socket.
[    4.856693] systemd[1]: Listening on initctl Compatibility Named Pipe.
[    4.881520] systemd[1]: Listening on Journal Audit Socket.
[    4.905492] systemd[1]: Listening on Journal Socket (/dev/log).
[    4.929138] systemd[1]: Listening on Journal Socket.
[    4.952024] systemd[1]: Listening on udev Control Socket.
[    4.973066] systemd[1]: Listening on udev Kernel Socket.
[    4.997000] systemd[1]: Listening on User Database Manager Socket.
[    5.028383] systemd[1]: Mounting Huge Pages File System...
[    5.056420] systemd[1]: Mounting POSIX Message Queue File System...
[    5.084339] systemd[1]: Mounting Kernel Debug File System...
[    5.104793] systemd[1]: Kernel Trace File System was skipped because of a failed condition check (ConditionPathExists=/sys/kernel/tracing).
[    5.123380] systemd[1]: Mounting Temporary Directory /tmp...
[    5.145602] systemd[1]: Started HMI Service.
[    5.173730] systemd[1]: Starting Create List of Static Device Nodes...
[    5.204561] systemd[1]: Starting Load Kernel Module configfs...
[    5.227526] systemd[1]: Starting Load Kernel Module drm...
[    5.247556] systemd[1]: Starting Load Kernel Module fuse...
[    5.251148] random: python3: uninitialized urandom read (24 bytes read)
[    5.260645] fuse: init (API version 7.34)
[    5.282704] systemd[1]: Starting RPC Bind...
[    5.300587] systemd[1]: File System Check on Root Device was skipped because of a failed condition check (ConditionPathIsReadWrite=!/).
[    5.313603] systemd[1]: systemd-journald.service: unit configures an IP firewall, but the local system does not support BPF/cgroup firewalling.
[    5.326531] systemd[1]: (This warning is only shown for the first unit using IP firewalling.)
[    5.339037] systemd[1]: Starting Journal Service...
[    5.361899] systemd[1]: Starting Load Kernel Modules...
[    5.384423] imx-sdma 30bd0000.dma-controller: firmware found.
[    5.385840] systemd[1]: Starting Generate network units from Kernel command line...
[    5.388402] imx-sdma 30e10000.dma-controller: firmware found.
[    5.390400] imx-sdma 30bd0000.dma-controller: loaded firmware 4.6
[    5.427680] systemd[1]: Starting Remount Root and Kernel File Systems...
[    5.442136] EXT4-fs (mmcblk1p2): re-mounted. Opts: (null). Quota mode: none.
[    5.453316] systemd[1]: Starting Coldplug All udev Devices...
[    5.478094] systemd[1]: Started RPC Bind.
[    5.496920] systemd[1]: Started Journal Service.
[    5.784100] systemd-journald[207]: Received client request to flush runtime journal.
[    6.539123] systemd-journald[207]: Oldest entry in /run/log/journal/fa5e0b51b7ad4590971d8391e814cc3d/system.journal is older than the configured file retention duration (1month), suggesting rotation.
[    6.557604] systemd-journald[207]: /run/log/journal/fa5e0b51b7ad4590971d8391e814cc3d/system.journal: Journal header limits reached or header out-of-date, rotating.
[    6.872245] rfkill_gpio rfkill_m2_wdis: m2_wdis device registered.
[    6.882821] caam-snvs 30370000.caam-snvs: violation handlers armed - init state
[    6.893806] rfkill_gpio rfkill_m2_gps: m2_gps device registered.
[    6.908959] rfkill_gpio rfkill_mpcie_wdis: mpcie_wdis device registered.
[    6.961949] at24 0-0050: supply vcc not found, using dummy regulator
[    6.972558] caam 30900000.crypto: device ID = 0x0a16040100000100 (Era 9)
[    6.979429] caam 30900000.crypto: job rings = 1, qi = 0
[    6.992973] random: python3: uninitialized urandom read (24 bytes read)
[    7.007301] basler_camera_driver_vvcam: loading out-of-tree module taints kernel.
[    7.017974] at24 0-0050: 256 byte 24c02 EEPROM, writable, 16 bytes/write
[    7.032572] at24 2-0057: supply vcc not found, using dummy regulator
[    7.036534] i2c_transfer() failed: -6
[    7.042705] basler_read_register_chunk() failed: -6
[    7.047680] basler_read_register() failed: -6
[    7.059245] i2c_transfer() failed: -6
[    7.063198] at24 2-0057: 256 byte 24c02 EEPROM, writable, 8 bytes/write
[    7.072809] basler_read_register_chunk() failed: -6
[    7.078541] random: avahi-daemon: uninitialized urandom read (4 bytes read)
[    7.088996] basler_read_register() failed: -6
[    7.106692] random: python3: uninitialized urandom read (24 bytes read)
[    7.115215] Bluetooth: HCI UART driver ver 2.3
[    7.120351] Bluetooth: HCI UART protocol H4 registered
[    7.129193] Bluetooth: HCI UART protocol Broadcom registered
[    7.129370] hci_uart_bcm serial0-0: supply vbat not found, using dummy regulator
[    7.151307] hci_uart_bcm serial0-0: supply vddio not found, using dummy regulator
[    7.516349] random: crng init done
[    7.516365] random: 5 urandom warning(s) missed due to ratelimiting
[    7.517124] Bluetooth: hci0: BCM: chip id 107
[    7.517494] Bluetooth: hci0: BCM: features 0x2f
[    7.518721] Bluetooth: hci0: BCM4345C0
[    7.518741] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0000
[    7.522726] Bluetooth: hci0: BCM4345C0 'brcm/BCM4345C0.hcd' Patch
[    7.648420] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    7.778154] brcmfmac: brcmf_fw_alloc_request: using brcm/brcmfmac43455-sdio for chip BCM4345/6
[    7.789127] brcmfmac: brcmf_c_preinit_dcmds: Firmware: BCM4345/6 wl0: Mar  3 2019 19:47:25 version 7.45.184 (r712131 CY) FWID 01-b363c0a0
[    7.935061] imx-dwmac 30bf0000.ethernet: IRQ eth_lpi not found
[    7.935188] imx-dwmac 30bf0000.ethernet: force_sf_dma_mode is ignored if force_thresh_dma_mode is set.
[    7.935781] imx-dwmac 30bf0000.ethernet: User ID: 0x10, Synopsys ID: 0x51
[    7.935806] imx-dwmac 30bf0000.ethernet:     DWMAC4/5
[    7.935812] imx-dwmac 30bf0000.ethernet: DMA HW capability register supported
[    7.935817] imx-dwmac 30bf0000.ethernet: RX Checksum Offload Engine supported
[    7.935820] imx-dwmac 30bf0000.ethernet: Wake-Up On Lan supported
[    7.939637] imx-dwmac 30bf0000.ethernet: Enable RX Mitigation via HW Watchdog Timer
[    7.939658] imx-dwmac 30bf0000.ethernet: device MAC address 4a:02:dd:45:82:e7
[    7.939665] imx-dwmac 30bf0000.ethernet: Enabled L3L4 Flow TC (entries=8)
[    7.939670] imx-dwmac 30bf0000.ethernet: Enabled RFS Flow TC (entries=8)
[    7.939683] imx-dwmac 30bf0000.ethernet: Enabling HW TC (entries=256, max_off=256)
[    7.939690] imx-dwmac 30bf0000.ethernet: Using 34 bits DMA width
[    8.242849] Bluetooth: hci0: BCM4345C0 NXP UART 37.4 MHz BT 4.2
[    8.242872] Bluetooth: hci0: BCM4345C0 (003.001.025) build 0337
[    8.349493] wm8904 1-001a: Failed to read ID register: -6
[    8.854065] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[    8.896107] enter viv_dwe_init_module
[    8.897057] enter dwe_hw_probe
[    8.935651] vvcam dewarp driver probed
[    8.935933] enter viv_isp_init_module
[    8.937320] enter isp_hw_probe
[    8.937429] vvcam isp driver registered
[    8.938394] enter isp_hw_probe
[    8.938499] vvcam isp driver registered
[    9.224981] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[    9.251334] enter viv_isp_exit_module
[    9.265915] enter isp_hw_remove
[    9.276345] vvcam isp driver removed
[    9.300422] enter isp_hw_remove
[    9.303728] vvcam isp driver removed
[    9.402299] enter viv_dwe_exit_module
[    9.411070] enter dwe_hw_remove
[    9.415084] enter fake_pdev_release
[    9.419076] vvcam dewarp driver removed
[    9.523790] : Unregistered all entities
[   10.308498] i2c_transfer() failed: -6
[   10.312203] basler_read_register_chunk() failed: -6
[   10.312217] basler_read_register() failed: -6
[   10.313183] i2c_transfer() failed: -6
[   10.337606] basler_read_register_chunk() failed: -6
[   10.342939] basler_read_register() failed: -6
[   10.415770] imx8_media_dev: module is from the staging directory, the quality is unknown, you have been warned.
[   10.445192] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[   10.771976] enter viv_dwe_init_module
[   10.792803] enter dwe_hw_probe
[   10.808489] vvcam dewarp driver probed
[   10.826007] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[   11.014560] enter viv_isp_init_module
[   11.021619] enter isp_hw_probe
[   11.029468] vvcam isp driver registered
[   11.037181] enter isp_hw_probe
[   11.037592] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[   11.051343] vvcam isp driver registered
[   11.056158] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[   11.114569] enter viv_video_init_module
[   11.131824] imx-hdmi sound-hdmi: snd_soc_register_card failed (-517)
[   11.237807] audit: type=1006 audit(1690550571.811:2): pid=661 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=1 res=1
[   11.250209] audit: type=1300 audit(1690550571.811:2): arch=c00000b7 syscall=64 success=yes exit=1 a0=8 a1=ffffdd198f10 a2=1 a3=ffffbb8f3020 items=0 ppid=1 pid=661 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=1 comm="(systemd)" exe="/lib/systemd/systemd" key=(null)
[   11.284373] audit: type=1327 audit(1690550571.811:2): proctitle="(systemd)"
[   11.494277] input: audio-hdmi HDMI Jack as /devices/platform/sound-hdmi/sound/card0/input0
[   11.611901] caam algorithms registered in /proc/crypto
[   11.618791] caam 30900000.crypto: caam pkc algorithms registered in /proc/crypto
[   11.627968] caam 30900000.crypto: rng crypto API alg registered prng-caam
[   11.636553] caam 30900000.crypto: registering rng-caam
[   11.699001] NET: Registered PF_ALG protocol family
[   11.736365] Device caam-keygen registered
[   11.811135] enter isp_mi_stop
[   11.817174] enter isp_mi_stop
[   11.832878] audit: type=1006 audit(1690550572.407:3): pid=477 uid=0 old-auid=4294967295 auid=0 tty=tty7 old-ses=4294967295 ses=2 res=1
[   11.847827] audit: type=1300 audit(1690550572.407:3): arch=c00000b7 syscall=64 success=yes exit=1 a0=8 a1=ffffdd198f10 a2=1 a3=ffffbb8f3020 items=0 ppid=1 pid=477 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=tty7 ses=2 comm="(weston)" exe="/lib/systemd/systemd" key=(null)
[   11.882290] audit: type=1327 audit(1690550572.407:3): proctitle="(weston)"
[   11.990178] imx-dwmac 30bf0000.ethernet eth0: PHY [stmmac-0:00] driver [ADIN1300] (irq=POLL)
[   12.025631] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-0
[   12.033472] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-1
[   12.041235] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-2
[   12.048985] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-3
[   12.056860] imx-dwmac 30bf0000.ethernet eth0: Register MEM_TYPE_PAGE_POOL RxQ-4
[   12.072440] imx-dwmac 30bf0000.ethernet eth0: No Safety Features support found
[   12.079789] imx-dwmac 30bf0000.ethernet eth0: IEEE 1588-2008 Advanced Timestamp supported
[   12.089122] imx-dwmac 30bf0000.ethernet eth0: registered PTP clock
[   12.101861] imx-dwmac 30bf0000.ethernet eth0: FPE workqueue start
[   12.108176] imx-dwmac 30bf0000.ethernet eth0: configuring for phy/rgmii-id link mode
[   12.120148] 8021q: adding VLAN 0 to HW filter on device eth0
[   15.947018] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[   16.041315] audit: type=1325 audit(1690550576.607:4): table=filter family=2 entries=0 op=xt_register pid=790 comm="iptables"
[   16.052602] audit: type=1300 audit(1690550576.607:4): arch=c00000b7 syscall=209 success=yes exit=0 a0=4 a1=0 a2=40 a3=ffffcb394830 items=0 ppid=377 pid=790 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="iptables" exe="/usr/sbin/xtables-legacy-multi" key=(null)
[   16.080788] audit: type=1327 audit(1690550576.607:4): proctitle=2F7573722F7362696E2F69707461626C6573002D2D7461626C650066696C746572002D2D6E65772D636861696E006E6D2D73682D696E2D776C616E30
[   16.097305] audit: type=1325 audit(1690550576.615:5): table=filter family=2 entries=4 op=xt_replace pid=790 comm="iptables"
[   16.194341] imx-dwmac 30bf0000.ethernet eth0: Link is Up - 1Gbps/Full - flow control rx/tx
[   16.202692] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[  659.226699] kauditd_printk_skb: 32 callbacks suppressed
[  659.226712] audit: type=1006 audit(1690788601.309:16): pid=1365 uid=0 old-auid=4294967295 auid=0 tty=(none) old-ses=4294967295 ses=3 res=1
[  659.244522] audit: type=1300 audit(1690788601.309:16): arch=c00000b7 syscall=64 success=yes exit=1 a0=3 a1=ffffe47430d0 a2=1 a3=ffffa2443020 items=0 ppid=260 pid=1365 auid=0 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=3 comm="crond" exe="/usr/sbin/crond" key=(null)
[  659.270374] audit: type=1327 audit(1690788601.309:16): proctitle=2F7573722F7362696E2F63726F6E64002D6E

A part of dmesg which is interesting is:

[    2.568591] gpio-keys gpio-keys: Button without keycode
[    2.573849] gpio-keys: probe of gpio-keys failed with error -22

Output of cat /sys/kernel/debug/gpio:

root@lite-unit-pf:/# cat /sys/kernel/debug/gpio
gpiochip0: GPIOs 0-31, parent: platform/30200000.gpio, 30200000.gpio:
 gpio-1   (                    |reset               ) out hi 
 gpio-5   (                    |shutdown            ) out hi 
 gpio-6   (                    |reset               ) out hi 
 gpio-7   (                    |shutdown            ) out hi 
 gpio-10  (                    |regulator-m2-mpcie-p) out hi 
 gpio-13  (                    |shutdown            ) out hi 
 gpio-14  (                    |regulator-usb1-host-) out hi 
 gpio-15  (                    |regulator-usb1-vbus ) out hi 

gpiochip1: GPIOs 32-63, parent: platform/30210000.gpio, 30210000.gpio:
 gpio-39  (                    |device-wakeup       ) out lo 
 gpio-40  (                    |host-wakeup         ) in  lo IRQ 
 gpio-42  (                    |shutdown            ) out hi 
 gpio-43  (                    |reset               ) out hi ACTIVE LOW
 gpio-44  (                    |cd                  ) in  lo IRQ ACTIVE LOW
 gpio-51  (                    |regulator-usdhc2    ) out lo ACTIVE LOW

gpiochip2: GPIOs 64-95, parent: platform/30220000.gpio, 30220000.gpio:

gpiochip3: GPIOs 96-127, parent: platform/30230000.gpio, 30230000.gpio:
 gpio-108 (                    |PHY reset           ) out hi ACTIVE LOW
 gpio-118 (                    |VPS WIFI BTN        ) in  lo IRQ 
 gpio-119 (                    |VPS REC BTN         ) in  lo IRQ 

gpiochip4: GPIOs 128-159, parent: platform/30240000.gpio, 30240000.gpio:
 gpio-141 (                    |spi1 CS0            ) out hi ACTIVE LOW
 gpio-156 (                    |VPS MCU INTPIN      ) in  hi IRQ 

We use the buttons VPS WIFI BTN and VPS REC BTN to start different tasks. We want to use VPS REC BTN also as wakeup source.

VPS REC BTN is wired as shown below:

That error is most likely the reason you are not getting a wakeup-source. You need to have a keycode bound to the gpio-key for it to be registered and thus be added to the list of wakeup sources.

That solved the problem, thanks!

1 Like