Commit Graph

146 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 fd85085a4b Merge branch 'next-dev' into thunder-boot 2020-04-23 14:13:56 +08:00
Lei Chen f21c060e4b driver: input: update RK remote control driver
This patch updates the RC driver to accommodate the new framework

Signed-off-by: Lei Chen <lei.chen@rock-chips.com>
Change-Id: I3ff2b5844ce5f1776ac2f94b3cbd42eb5d73cc41
2020-04-23 10:23:19 +08:00
Joseph Chen 98894c7310 Merge branch 'next-dev' into thunder-boot 2020-04-21 16:19:07 +08:00
Joseph Chen abedddcfae input: add spl adc key driver
Providing a mininum adc key driver for SPL, which does not
depend on key uclass, but ADC uclass is still required.

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I80f861780acd9c47d345b95762a4dd39d19ea6fc
2020-04-21 16:15:22 +08:00
Joseph Chen 3509e794f3 input: Makefile: clean for SPL build
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I8ea0bd45ef86802e2992a44793a91eb8bb7b08fc
2020-04-21 16:15:22 +08:00
Joseph Chen e1e9b173e4 Merge branch 'next-dev' into thunder-boot 2020-03-28 15:01:31 +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
Jason Zhu cd4d895a73 dm: key: isolate the unused irq code in spl
Since the irq is not planned to use in spl.

Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: Ia6433f3d9c3b2cc9862ddff781b6fe71b3bec0f0
2020-03-23 17:00:24 +08:00
Simon Glass f4462f85e6 UPSTREAM: spl: input: Allow input in SPL and TPL
In some cases it is necessary to read the keyboard in early phases of
U-Boot. Update the config to allow this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Jason Zhu <jason.zhu@rock-chips.com>
Change-Id: I0f166e55c84c9f10ced9e4580e6b7c7a6f980a79
2020-03-23 17:00:24 +08:00
Joseph Chen 930ceb12e0 driver: core/input: treat 'u-boot,dm-spl' as 'u-boot,dm-pre-reloc'
It works when CONFIG_USING_KERNEL_DTB is enabled, because we can
set either 'u-boot,dm-spl' or 'u-boot,dm-pre-reloc' for the node
that we can to leave in the u-boot.dtb.

Change-Id: Id3cec0c64ee55ca9bc1e5871e7ad5a2ebb4b1b6a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2019-10-24 10:52:45 +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 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 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 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 adba3792a7 dm: key: support register multiple same key code
Due to some board use the same u-boot rkxx-evb.dts, dm key had
better support parse same key code for times.

Change-Id: Ifeeb75bef90e52e2747ef2858cec500a928c806d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-12-17 20:50:38 +08:00
Joseph Chen b11786b4f0 input: rk key: fix missing register key into dm input uclass
Change-Id: I3237923ed14724e838a8b79a40db4ac45dde5f16
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-08-06 11:15:19 +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 fb6848b749 input: Kconfig: add rk817 help descripiton for RK8XX_PWRKEY
Change-Id: Ic5e0265cb046c5c5796542f6f12d1f588b7fa05c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Joseph Chen a0ad9ed129 input: rk key: fix compile warning
Change-Id: I357db633bbd904d00757a909665f8f624ef2b50d
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Joseph Chen 7b0adbaa7d input: gpio key: fix compile warning
Change-Id: I897c625d623365a7f9bc49fb4ceb1ed9057cd103
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-07-03 10:52:29 +08:00
Joseph Chen 333857218c dm: key: fix compile error with DEBUG enabled
Change-Id: I3e5aeb6598c8601efb669329203ad59a825c2b32
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-06 15:30:05 +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 d7a503edb0 input: gpio_key: use dm universal interface to parse event
Change-Id: Ic3b7fca99be30ab7b1bb8a37fd54b603c1da223a
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-01 16:29:12 +08:00
Joseph Chen 6cef563abc input: rk_key: use dm universal interface to parse event
Change-Id: I80c7a75a4150f1a8ebbf3d70541aa737cd687f91
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-01 16:29:12 +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 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 28d30d4c66 input: Kconfig: do not enable key driver
Change-Id: I4c32843d74039e46f629915bce16853540b6f575
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-02-06 18:04:25 +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 debee64a8e input: key: add rk key driver
rk key device node can contain adc key and gpio key.

Change-Id: I6e3bd4022bba6324c35d2c317183a6a2cb69ed06
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen c8be85008a input: key: add gpio key driver
use gpio interrupt to detect key event.

Change-Id: I5eea25ef6da26f6aaefd99458ee08189b696df87
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +08:00
Joseph Chen 68ed833817 input: key: add adc key driver
Change-Id: I07c044942aa89309c48c79e26a86c3a61437deec
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-31 18:13:53 +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 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 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
Zhangbin Tong bdbf80c832 input: Add RK remote control driver
This patch adds support to RK RC driver, which is basically a IR
receiver. This IP (PWM) is common across all the RK parts for
settop box platforms.
It implements a simple NEC protocol decoder.

Change-Id: I057a341acaeb14d0165bd6187c4074dd230b079f
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-10-25 20:39:04 +08:00
Zhangbin Tong 0948688932 dm: input: add driver model rc uclass
Change-Id: I1e9b067d49e81bd09c2d1e6c9612f0831480ce73
Signed-off-by: Zhangbin Tong <zebulun.tong@rock-chips.com>
2017-10-24 16:22:17 +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
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
Simon Glass 00caae6d47 env: Rename getenv/_f() to env_get()
We are now using an env_ prefix for environment functions. Rename these
two functions for consistency. Also add function comments in common.h.

Quite a few places use getenv() in a condition context, provoking a
warning from checkpatch. These are fixed up in this patch also.

Suggested-by: Wolfgang Denk <wd@denx.de>
Signed-off-by: Simon Glass <sjg@chromium.org>
2017-08-16 08:30:24 -04:00
Heiko Schocher 064b55cfcb powerpc, 5xxx, 512x: remove support for mpc5xxx and mpc512x
There was for long time no activity in the mpx5xxx area.
We need to go further and convert to Kconfig, but it
turned out, nobody is interested anymore in mpc5xxx,
so remove it.

Signed-off-by: Heiko Schocher <hs@denx.de>
2017-06-16 10:14:55 -04:00