[RESOLVED] 13" AMD, Linux (Gentoo) backlight keys not generating key or ACPI events

EDIT:
Got it solved. I needed to enable:
CONFIG_I2C_DESIGNWARE_PLATFORM
which made the brightness buttons show up as ACPI events, and the default ACPI rules automatically changed the brightness in response to those on my system. There might be other stuff needed if someone’s got an even more minimal config than mine, but this is the setting my config was missing.

Original post:

Just swapped out my 11th gen Intel board with the AMD one (7840) a few days ago, and while the backlight works fine, and I can manually adjust it via /sys/class/backlight…, the backlight brightness keys on the keyboard aren’t sending key events (tested with “xev”), nor ACPI events (tested with acpi_listen).

The keys do generate ACPI events on Fedora 39, so I’m assuming that I’m missing some needed kernel module or something on my Gentoo install, though I’m not sure which one, as the diff of the lsmod output doesn’t seem to have anything jumping out at me, though I’m not very familiar with the kernel stuff.

(Edit: My Gentoo machine is on kernel 6.1.57, and the Fedora livecd is on 6.2.9. I also tried 6.5.10 on Gentoo, but that didn’t seem to make a difference (though maybe there’s a driver that’s needed which isn’t in 6.1?))

I’m pasting the diff of the lsmod output in case anyone is more familiar with it. And if there’s any other info that would help, let me know. I’m new to ACPI and a novice with the kernel stuff, so there’s decent odds I’m making some simple mistake or overlooking something simple.

lsmod diffs:

< = my Gentoo lsmod
> = the Fedora 39 lsmod

1,3c1,2
< 8021q
< ac
< aesni_intel
---
> ac97_bus
> acpi_cpufreq
5c4,7
< battery
---
> amd_pmc
> amd_pmf
> be2iscsi
> binfmt_misc
6a9,10
> bnep
> bnx2i
11a16
> ccp
12a18
> cec
13a20
> cnic
14a22
> crc32_pclmul
16,17c24,29
< cryptd
< crypto_simd
---
> cros_ec
> cros_ec_lpcs
> cxgb3
> cxgb3i
> cxgb4
> cxgb4i
20d31
< drm_kms_helper
22,25c33,35
< ecc
< ecdh_generic
< efivarfs
< fb_sys_fops
---
> edac_mce_amd
> fuse
> ghash_clmulni_intel
26a37,41
> hid_multitouch
> hid_sensor_als
> hid_sensor_hub
> hid_sensor_iio_common
> hid_sensor_trigger
29c44,61
< ipv6
---
> i2c_piix4
> industrialio
> industrialio_triggered_buffer
> intel_rapl_common
> intel_rapl_msr
> iommu_v2
> ip6_tables
> ip_set
> ip_tables
> irqbypass
> iscsi_boot_sysfs
> iscsi_tcp
> isofs
> joydev
> k10temp
> kfifo_buf
> kvm
> kvm_amd
31c63,72
< mfd_core
---
> libarc4
> libcxgb
> libcxgbi
> libiscsi
> libiscsi_tcp
> loop
> mac80211
> mc
> mdio
> mii
32a74,104
> mt76
> mt76_connac_lib
> mt7921_common
> mt7921e
> nf_conntrack
> nf_conntrack_broadcast
> nf_conntrack_netbios_ns
> nf_defrag_ipv4
> nf_defrag_ipv6
> nf_nat
> nfnetlink
> nf_reject_ipv4
> nf_reject_ipv6
> nf_tables
> nft_chain_nat
> nft_ct
> nft_fib
> nft_fib_inet
> nft_fib_ipv4
> nft_fib_ipv6
> nft_reject
> nft_reject_inet
> nvme
> nvme_common
> nvme_core
> pcspkr
> platform_profile
> polyval_clmulni
> polyval_generic
> qla4xxx
> qrtr
33a106,107
> rapl
> rfcomm
35,36c109,110
< roles
< sha512_generic
---
> scsi_transport_iscsi
> serio_raw
37a112
> snd
38a114
> snd_compress
44a121,122
> snd_hrtimer
> snd_hwdep
45a124
> snd_intel_sdw_acpi
48a128,131
> snd_pci_ps
> snd_pcm
> snd_pcm_dmaengine
> snd_rawmidi
50a134,136
> snd_seq
> snd_seq_device
> snd_seq_dummy
52,55c138,152
< syscopyarea
< sysfillrect
< sysimgblt
< thermal
---
> snd_soc_core
> snd_sof
> snd_sof_amd_acp
> snd_sof_amd_rembrandt
> snd_sof_amd_renoir
> snd_sof_pci
> snd_sof_utils
> snd_sof_xtensa_dsp
> snd_timer
> snd_usb_audio
> snd_usbmidi_lib
> soundcore
> sp5100_tco
> squashfs
> sunrpc
56a154
> tls
59a158
> uas
60a160,161
> uinput
> uio
62,63c163,166
< xhci_hcd
< xhci_pci
---
> usb_storage
> video
> wmi
> zram

Admittedly, I don’t fully understand the config diff, but it seems like you don’t have hid_sensor_hub set on Gentoo, which should be fine. But if you do then there’s a quirk. Have you checked that?

I don’t think the brightness keys were working for me (on Gentoo) before I blacklisted the module but I’m not actually sure now…

I initially had the HID_SENSOR_HUB kernel option disabled. The Fedora livecd had it enabled, so I also tried it with that. Unfortunately neither way made a difference for my Gentoo install.
Fedora also had kernel 6.2.9, while my Gentoo was on 6.1.57, so I also tried 6.5.10 (Gentoo apparently doesn’t have 6.2 available) with and without HID_SENSOR_HUB, but that also made no difference.

Since the Fedora livecd worked, I assume that option is needed on the AMD boards (or at least, works fine), along with probably some other setting or app installed, but I’m not sure what.

I’ll try copying the Fedora config wholesale to see if that works on Gentoo, to try and narrow down if it’s a kernel version thing, a config thing, or possibly a missing program.

Edit: The Fedora kernel config did get the backlight working on Gentoo, so I’ve confirmed it’s a config issue rather than a version issue (though I also needed to replace xbacklight with acpilight, and without acpilight the brightness doesn’t change). So I still need to figure out which kernel options are specifically needed, but at least I know that it can work on this kernel.

1 Like

Sounds like you’re on the right path here. I haven’t touched Gentoo in eons, so I would not be a ton of help here. But it sounds like you’re on the right path.

Got it solved. I needed to enable:
CONFIG_I2C_DESIGNWARE_PLATFORM
which made the brightness buttons show up as ACPI events, and the default ACPI rules automatically changed the brightness in response to those on my system. There might be other stuff needed if someone’s got an even more minimal config than mine, but this is the setting my config was missing.

I’ll see about adding this to the Gentoo wiki for the laptop later today. (Edit: Added.)

I think I might need a mod to mark this as resolved though, as I’m not seeing an option to edit the title or original post anymore for some reason.

1 Like

Fantastic! Delighted to hear this!