Commit Graph

16 Commits

Author SHA1 Message Date
Joseph Chen a91da5984b input: rk8xx: always enable key interrupt
We use it to exit charge animation while system is in runtime.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: Ia6bc3f7a20310f73e060418f0a0ab01ef8745b11
2020-07-24 11:00:18 +08:00
Joseph Chen d532d22e94 input: rk8xx: enable interrupt only in suspend
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I4d5a2e38b8a73d11aa86cd9a0f18ca32b218d892
2020-03-26 16:07:42 +08:00
Joseph Chen 01c5bab161 input: rk8xx pwrkey: refactor to match irq chip framework
The PIMC as parent has register the interrupt controller as a irq chip,
and as a children, this driver only cares about the rise/fall event.

Change-Id: I934901a786b70920cd413e1fb15c8a5c372ea399
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-08-09 17:46:01 +08:00
Joseph Chen 868ca499ba input: rk8xx_pwrkey: register irq thread into key framework
Change-Id: Idbc90a55af76001afba218c7cfe0eb750dd24629
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 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 9cacbc7899 input: rk8xx: drivers/input/rk8xx_pwrkey.c
Change-Id: I920b761825f2f3114d38b17fa377bcb19e88bb18
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-01 16:29:12 +08:00
Joseph Chen 1b6b965c67 pmic: add rk809 support
include sub modules: pmic, regulator, pwrkey

Change-Id: I840983ceafc7677840674e7d1aebab703e3a537d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-25 16:49:53 +08:00
Joseph Chen 1c223666dc pmic: rk8xx: add init register setting for rk817
1. set pmic_sleep as sleep function;
2. set pmic_int active low.

Change-Id: I4bc4034e18b19dc9b1b328870db652d11173fe3a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-25 16:49:44 +08:00
Joseph Chen 35d17bf709 input: rk8xx: support plugout interrupt for rk816 and rk817
Change-Id: I474236292025f5656673191b10ad25f5362970b1
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-09 14:28:12 +08:00
Joseph Chen 7f18d96c70 pmic: add RK817 support
include sub modules: pmic, regulator, pwrkey

Change-Id: I3a1cbaa3c4d069cbac17124f9c0fe3b01184697c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-09 14:28:01 +08:00
Joseph Chen a7b534a020 input: rk8xx: refactor code
match key uclass framework.

Change-Id: Ib3677514483d7f6f08479100fae2046e4f3bdb4e
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen 618d619d02 input: rk8xx pwrkey: replace printf with debug
I forgot to do this.

Change-Id: I4db233255a633cd403f4a279970d069b39124fe6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-28 15:23:35 +08:00
Joseph Chen 3ccaecfa6f input: rk8xx pwrkey: use irq to detect key event
because we support U-Boot system suspend and trap into ATF,
we have to make pwrkey as wakeup source, so that we must
register pmic_int as an irq.

we found reading 'get_timer(0)' will return a large value in
the interrupt routine and I don't find out what happend now,
so I add the 'get_ms()' which reads arm gerneric timer tick
direcly.

we clean all PMIC interrupt status for safety to avoid pmic_int
hold in low level which make PMIC can't respond to interrupt any
more.

Change-Id: I46ff81030696f4672faa9fc81141952e52fd5ba9
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-12-05 09:34:48 +08:00
Joseph Chen 9745ade23b input: rk8xx pwrkey: add some optimization
1. add key name and type;
2. clear both fall and rise interrupt when detect rise.

Change-Id: I0698f3decc4b92cf32ce564a1827eedb5ee19a01
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-31 16:13:15 +08:00
Joseph Chen 436d684c02 input: add rk8xx pwrkey support
RK805/816 provide pwrkey function while RK808/818 is not.

Change-Id: Ia6cd9fcb0a360d81cff54cf49a1f1c9c653488e6
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-12 09:41:08 +08:00