bug: Headset jack state not reported after Linux boot: flipper-one-input does not read the MCU's state at probe

Aperta Adatta ai principianti
#211 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
74/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
c, linux
Ambito
embedded-iot

Direzione di ricerca

Individua il driver flipper-one-input e la sua funzione probe, poi leggi come gestisce gli interrupt del MCU e segnala SW_HEADPHONE_INSERT e SW_MICROPHONE_INSERT. Leggi il registro 0x0208 durante probe e segnala gli stati iniziali degli switch prima di abilitare l’interrupt. Il lavoro è completato quando una presa già inserita all’avvio viene segnalata correttamente senza doverla inserire o rimuovere.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

With a plug in the 3.5 mm jack, SW_HEADPHONE_INSERT of the "Flipper One Headset" input device reads 0 after Linux boots, until the plug is pulled and inserted again.

The MCU tracks the jack correctly: it keeps the state in its I2C intercom register 0x0208 (bit 0 headphones, bit 1 microphone) and raises an interrupt only on a change. The MCU is not reset when Linux reboots, so after boot no change happens and no interrupt comes. The flipper-one-input driver does not read 0x0208 at probe, so the switch stays at its default 0.

Steps to reproduce (image 1312, kernel 7.4.0-rc1):

Insert a plug into the jack and boot Linux (or reboot it; the MCU keeps running).
evtest --query /dev/input/eventN EV_SW SW_HEADPHONE_INSERT returns 0, i.e. not inserted. The MCU log shows [HeadphonesSrv] Headphones status changed: 00000001.
Pull the plug and insert it again: the event SW_HEADPHONE_INSERT 1 arrives and the query returns 10, i.e. inserted.
Expected: after probe, the input device reports the current jack state.

Fix: in flipper-one-input, read register 0x0208 at probe and report the initial SW_HEADPHONE_INSERT and SW_MICROPHONE_INSERT before enabling the interrupt.

Lingua principale
Shell
Stelle
84
Fork
38
Merge medio
1g 15m
PR unite (30g)
7

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di flipperdevices/flipperone-linux-build-scripts

Tutte le issue di flipperdevices/flipperone-linux-build-scripts

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.