From: Samuel Holland <samuel@sholland.org> Date: 2021-09-08 03:40:34
This series adds R329 and D1 SoC support to the LRADC driver. These SoCs
do not change the register interface, only the platform integration.
I have another series[1] which adds wakeup support to this driver.
It has been reviewed/acked and is waiting to be merged for several
months[2]. That series merges cleanly with this one.
[1]: https://patchwork.kernel.org/project/linux-input/cover/20210805051241.47168-1-samuel@sholland.org/
[2]: https://patchwork.kernel.org/project/linux-input/cover/20210430042003.4591-1-samuel@sholland.org/
Samuel Holland (3):
dt-bindings: input: sun4i-lradc-keys: Add R329 and D1 compatibles
Input: sun4i-lradc-keys: Add optional clock/reset support
Input: sun4i-lradc-keys: Add support for R329 and D1
.../input/allwinner,sun4i-a10-lradc-keys.yaml | 22 +++++++++++++
drivers/input/keyboard/sun4i-lradc-keys.c | 31 +++++++++++++++++++
2 files changed, 53 insertions(+)
--
2.31.1
From: Samuel Holland <samuel@sholland.org> Date: 2021-09-08 03:40:43
Until the R329, the LRADC hardware was always active. Now it requires
enabling a clock gate and deasserting a reset line. Do this if the clock
and reset are provided in the device tree, but keep them optional to
maintain support for the existing binding.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/input/keyboard/sun4i-lradc-keys.c | 29 +++++++++++++++++++++++
1 file changed, 29 insertions(+)
From: Samuel Holland <samuel@sholland.org> Date: 2021-09-08 03:40:47
The R329 and D1 SoCs each contain an LRADC with a programming interface
compatible to earlier LRADCs. However, the LRADC now has its own clock
gate and reset line, instead of being always active.
To support this, add clock/reset properties to the binding, and require
them for the variant in the new SoCs.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../input/allwinner,sun4i-a10-lradc-keys.yaml | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)
From: Samuel Holland <samuel@sholland.org> Date: 2021-09-08 03:40:51
This LRADC variant uses the same 3/4*AVCC reference voltage as the A83T
variant. The R329 and D1 LRADCs appear to be identical, so D1 support is
accomplished through having the R329 LRADC as a fallback compatible.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/input/keyboard/sun4i-lradc-keys.c | 2 ++
1 file changed, 2 insertions(+)
From: Maxime Ripard <hidden> Date: 2021-09-08 05:51:45
On Tue, Sep 07, 2021 at 10:40:14PM -0500, Samuel Holland wrote:
The R329 and D1 SoCs each contain an LRADC with a programming interface
compatible to earlier LRADCs. However, the LRADC now has its own clock
gate and reset line, instead of being always active.
To support this, add clock/reset properties to the binding, and require
them for the variant in the new SoCs.
Signed-off-by: Samuel Holland <samuel@sholland.org>
From: Philipp Zabel <p.zabel@pengutronix.de> Date: 2021-09-08 06:33:55
On Tue, 2021-09-07 at 22:40 -0500, Samuel Holland wrote:
Until the R329, the LRADC hardware was always active. Now it requires
enabling a clock gate and deasserting a reset line. Do this if the clock
and reset are provided in the device tree, but keep them optional to
maintain support for the existing binding.
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
regards
Philipp
From: Maxime Ripard <hidden> Date: 2021-09-14 07:28:35
Hi Samuel,
On Tue, Sep 07, 2021 at 10:40:15PM -0500, Samuel Holland wrote:
quoted hunk
Until the R329, the LRADC hardware was always active. Now it requires
enabling a clock gate and deasserting a reset line. Do this if the clock
and reset are provided in the device tree, but keep them optional to
maintain support for the existing binding.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
drivers/input/keyboard/sun4i-lradc-keys.c | 29 +++++++++++++++++++++++
1 file changed, 29 insertions(+)
@@ -243,6 +264,14 @@ static int sun4i_lradc_probe(struct platform_device *pdev)return-EINVAL;}+lradc->clk=devm_clk_get_optional(dev,NULL);+if(IS_ERR(lradc->clk))+returnPTR_ERR(lradc->clk);++lradc->reset=devm_reset_control_get_optional_exclusive(dev,NULL);+if(IS_ERR(lradc->reset))+returnPTR_ERR(lradc->reset);+
This wouldn't report an error if the clocks are missing on the R329 (and
D1), even though they are required. The way we usually deal with this is
through a flag in the variant structure (at least to guard clk_get /
reset_control_get)
Maxime
From: Rob Herring <robh@kernel.org> Date: 2021-09-20 22:33:23
On Tue, 07 Sep 2021 22:40:14 -0500, Samuel Holland wrote:
The R329 and D1 SoCs each contain an LRADC with a programming interface
compatible to earlier LRADCs. However, the LRADC now has its own clock
gate and reset line, instead of being always active.
To support this, add clock/reset properties to the binding, and require
them for the variant in the new SoCs.
Signed-off-by: Samuel Holland <samuel@sholland.org>
---
.../input/allwinner,sun4i-a10-lradc-keys.yaml | 22 +++++++++++++++++++
1 file changed, 22 insertions(+)