mfd: flipper-one-mcu: register the SW button interrupt - #17
Merged
alchark merged 1 commit intoJul 28, 2026
Conversation
alchark
requested changes
Jul 28, 2026
alchark
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for spotting this! It wasn’t working indeed, and I haven’t yet gad chance to debug.
Could you please amend the commit with your full name in the sign-off line per kernel requirements? I’ll then merge at once, and fold it into a co-developed-by upon next rebase+squash.
Signed-off-by: Cole Munz <Munzzyy1@proton.me>
munzzyy
force-pushed
the
mfd-fomcu-swbtn-irq
branch
from
July 28, 2026 04:03
277f94d to
38c59b0
Compare
Author
|
Done — commit is now signed off as Cole Munz, same diff otherwise. Good to hear the button really was dead on your end. Thanks for the quick turnaround! |
alchark
approved these changes
Jul 28, 2026
alchark
left a comment
Collaborator
There was a problem hiding this comment.
Thanks a lot for your contribution!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fomcu_irqs[]has no entry forFOMCU_INT_INPUT_SWBTN, so the SW button interrupt is allocated but can never fire.REGMAP_IRQ_REG()is a designated initialiser —[_irq] = { .reg_offset = ..., .mask = ... }— so the enum value is the array index, not the position in the list. The enum runsBTN, TOUCH, HEADSET, SWBTN, UCSI_EVENT, and the array initialises 0, 1, 2 and 4. Index 3 is left as an implicit zero.Because
UCSI_EVENTis index 4,ARRAY_SIZE()is still 5, sonum_irqslooks right and nothing complains. Building the array exactly as it is onflipper-devel:A
.maskof 0 meansregmap_irq_thread()ANDs the status word with 0 for that irq, so it never calls the handler, and masking and unmasking it write nothing.Nothing fails loudly, which is what makes it awkward to spot.
fo_input_irqsdeclares the resource, the domain hands out a virq for index 3,platform_get_irq_byname(pdev, "flipper-one-input-swbtn")succeeds,devm_request_threaded_irq()succeeds and the input device registers advertisingKEY_POWER. Probe is clean. The button just does nothing.FOMCU_INTSTS_INPUT_SWBTNis already defined asBIT(3)in the header, so this is only a missing line in the table. With it, index 3 getsmask=0x08and the array size is unchanged.Caveat on testing: there's no aarch64 cross-compiler on this machine and I don't have the hardware, so I haven't built the kernel or pressed the button. The reasoning is from the macro expansion and regmap-irq's mask handling, and the numbers above come from compiling the real table. Worth a quick confirmation from someone with a board that
KEY_POWERstarts arriving.