summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2022-04-24 20:42:09 -0700
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2022-05-05 10:23:49 -0700
commitec648fc0a00378359dbf719371ed36657d6ccf4a (patch)
treeb27dfe2e4b09c8e382f4f4a200e0e4e8ca8481a7 /drivers/input
parentac2d5b43ea1676ca99397eb355ca68fab44172e4 (diff)
Input: sun4i-lradc-keys - add support for R329 and D1
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> Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20220414002349.24332-3-samuel@sholland.org Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/sun4i-lradc-keys.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
index e52505667df3..15c15c0958b0 100644
--- a/drivers/input/keyboard/sun4i-lradc-keys.c
+++ b/drivers/input/keyboard/sun4i-lradc-keys.c
@@ -80,6 +80,12 @@ static const struct lradc_variant r_lradc_variant_a83t = {
.divisor_denominator = 4
};
+static const struct lradc_variant lradc_variant_r329 = {
+ .divisor_numerator = 3,
+ .divisor_denominator = 4,
+ .has_clock_reset = true,
+};
+
struct sun4i_lradc_keymap {
u32 voltage;
u32 keycode;
@@ -337,6 +343,8 @@ static const struct of_device_id sun4i_lradc_of_match[] = {
.data = &lradc_variant_a10 },
{ .compatible = "allwinner,sun8i-a83t-r-lradc",
.data = &r_lradc_variant_a83t },
+ { .compatible = "allwinner,sun50i-r329-lradc",
+ .data = &lradc_variant_r329 },
{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sun4i_lradc_of_match);