Page MenuHomeFreeBSD

Add gpiokeys driver
ClosedPublic

Authored by gonzo on May 9 2016, 8:50 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Feb 28, 10:50 AM
Unknown Object (File)
Wed, Feb 28, 9:02 AM
Unknown Object (File)
Jan 8 2024, 6:19 PM
Unknown Object (File)
Jan 8 2024, 6:19 PM
Unknown Object (File)
Jan 8 2024, 6:19 PM
Unknown Object (File)
Jan 8 2024, 6:18 PM
Unknown Object (File)
Jan 8 2024, 6:06 PM
Unknown Object (File)
Dec 23 2023, 10:59 AM

Details

Reviewers
None
Commits
rS299475: Add gpiokeys driver
Summary

Add gpiokeys driver that implements functional subset of gpiokeys device-tree bindings:

https://www.kernel.org/doc/Documentation/devicetree/bindings/input/gpio-keys.txt

Driver maps linux scancodes for most common keys to FreeBSD scancodes and also extends spec by introducing freebsd,code property to specify FreeBSD-native scancodes.

Test Plan

Use 4DCAPE-43T with vendor-provided DTB to test keys.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

gonzo retitled this revision from to Add gpiokeys driver.
gonzo updated this object.
gonzo edited the test plan for this revision. (Show Details)
gonzo set the repository for this revision to rS FreeBSD src repository - subversion.
gonzo added a subscriber: ARM.
jmcneill added inline comments.
sys/dev/gpio/gpiokeys.c
60 ↗(On Diff #16087)

#define<tab>

272 ↗(On Diff #16087)

This will always be zero -- I would change to (hz*AUTOREPEAT_DELAY)/1000

276 ↗(On Diff #16087)

Same as above.

mmel added inline comments.
sys/dev/gpio/gpiokeys.c
238 ↗(On Diff #16087)

Magic constant ?

348 ↗(On Diff #16087)

ihmo, callout_drain() must be used here.

618 ↗(On Diff #16087)

Whats about

#define  GPIO_ASSERT_LOCKED(_key)   mtx_assert(&(_key)->mtx, MA_OWNED)

and

GPIO_ASSERT_LOCKED(sc);
642 ↗(On Diff #16087)

Lock is missing here -> gpiokey_get_key() must be called with lock.

gonzo removed rS FreeBSD src repository - subversion as the repository for this revision.
  • Add handler for "debounce-interval" key property
  • Replace static gpiokeys_sc with dynamic one which allows us have more than one gpiokeys instance
  • Fix locking
  • Fix arithmetic expressions
  • style(9) fixes
This revision was automatically updated to reflect the committed changes.