Commit Graph

15 Commits

Author SHA1 Message Date
Joseph Chen 0f9d23ea98 dm: key: allow power key to skip irq handler init
At sometime, its parent driver would setup the main interrupt(e.g. PMIC).

Change-Id: I8d24266c48f515fc92c3529a5b6aa7a18d181af1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:32:47 +08:00
Joseph Chen 1a9c8b1b4c dm: key: add pwrkey download support
User can press and release pwrkey for times to enter download mode,
set it disabled by default.

Change-Id: Id2fd9d12756bb1584a4d25b6df0c16a8a85d1e9a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-18 08:39:39 +08:00
Joseph Chen c2e7a0d483 dm: key: add irq thread for key drivers
- only power key can request irq thread;
- this makes key framework be able to manage all key interrupt event;

Change-Id: I9f99607ed7ff9bcd261d3918150e4a4489e0f472
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-06-18 08:39:39 +08:00
Joseph Chen 5a54baa793 dm: key: refactor code
- use standard dm framework to implement all key drivers;
- all key node to be children and attach to key bus;
- dm key uclass takes over most work;
- reduce a lot of driver code size;

Change-Id: I9ea4515249d493eb4434890b90350f694c07404f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-04-09 10:54:14 +08:00
Joseph Chen 9f1dd9df85 dm: key: make kernel dtb key has higher priority than U-Boot keys
We add recovery key node with property "u-boot,dm-pre-reloc"
in uboot dts in order to make sure recovery key works normally
even when kernel dtb is load failed. But There are too many
boards for a platform(eg. RK3399/RK3399PRO), which may cause
a mistake key match between boards via U-Boot dts key nodes,
so that we make kernel dtb key has higher priority.

Change-Id: I771d72860aa626e4a6a1638117cb1876fe5d1a44
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-18 17:03:59 +08:00
Joseph Chen 68995a9bef dm: key: remove deprecated platform_read_key()
Change-Id: I88af911581b94f59504124786cb1adaa82dae12f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:21:21 +08:00
Joseph Chen 64048c537e dm: key: optimise framework and update drivers
1. dm key framework takes over more generic jobs;
2. key drivers remove unused codes and match new framework;
3. only power key is registered as interrupt key;

Change-Id: Icdda86f588af721b685f801ed251581f2fd85793
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-21 12:20:43 +08:00
Joseph Chen deedd3562a include: key.h: remove unused definition
Change-Id: I9797dba18237cd31aee2cc232af75a623e2ee9c2
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-20 20:11:49 +08:00
Joseph Chen 0abc377938 include: key.h: use linux-event-codes.h
linux-event-codes.h defines more key code than
input.h

Change-Id: Ib9c9946bb78420fdd6b1dbcdad48e46007cc4752
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-15 15:53:11 +08:00
Joseph Chen 3fb8400061 dm: key: add universal interface to parse gpio and adc key event
Change-Id: I9a1b9d0a36d8fe34ea68bb4f15bf217cae407bf0
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-01 16:29:12 +08:00
Joseph Chen 6d82ce07fa include: key.h: clean up
Change-Id: Id5cec38070c09494643bad2244d14633b93d4d0f
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-24 11:51:29 +08:00
Joseph Chen a2df960601 dm: key: provide universal key read interface
clean up code.

Change-Id: I532be111dc971ff0fdd9014e7e01a13ea50483fd
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen c315aab89c dm: key.h: add key state
add KEY_PRESS_LONG_DOWN and KEY_LONG_DOWN_MS.

Change-Id: I3877a3562779a44b29c31820c583f187530778f8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-05 09:34:48 +08:00
Joseph Chen 6e14addfbc dm: key: add key type and key name interface
Change-Id: Ifd054c609d92557b15acb8e53580dddd72325ff8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-31 16:13:03 +08:00
Joseph Chen b398a9a7fa dm: input: add implementation of driver model key uclass
Change-Id: I379b694dfaee14ed23cc7abfa05aff77933bb725
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-09-27 11:38:44 +08:00