diff mbox series

[v2,3/3] Input: sun4i-lradc-keys: Add support for R329 and D1

Message ID 20220414002349.24332-3-samuel@sholland.org (mailing list archive)
State New, archived
Headers show
Series [v2,1/3] dt-bindings: input: sun4i-lradc-keys: Add R329 and D1 compatibles | expand

Commit Message

Samuel Holland April 14, 2022, 12:23 a.m. UTC
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>
---

Changes in v2:
 - Set the new flag for the R329 variant.

 drivers/input/keyboard/sun4i-lradc-keys.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Jernej Škrabec April 15, 2022, 6:21 p.m. UTC | #1
Dne četrtek, 14. april 2022 ob 02:23:48 CEST je Samuel Holland napisal(a):
> 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>

Best regards,
Jernej

> ---
> 
> Changes in v2:
>  - Set the new flag for the R329 variant.
> 
>  drivers/input/keyboard/sun4i-lradc-keys.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c
> b/drivers/input/keyboard/sun4i-lradc-keys.c index
> 5630334a6c09..8f9bfb05244d 100644
> --- a/drivers/input/keyboard/sun4i-lradc-keys.c
> +++ b/drivers/input/keyboard/sun4i-lradc-keys.c
> @@ -78,6 +78,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;
> @@ -323,6 +329,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);
Dmitry Torokhov April 25, 2022, 3:42 a.m. UTC | #2
On Wed, Apr 13, 2022 at 07:23:48PM -0500, Samuel Holland wrote:
> 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>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/keyboard/sun4i-lradc-keys.c b/drivers/input/keyboard/sun4i-lradc-keys.c
index 5630334a6c09..8f9bfb05244d 100644
--- a/drivers/input/keyboard/sun4i-lradc-keys.c
+++ b/drivers/input/keyboard/sun4i-lradc-keys.c
@@ -78,6 +78,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;
@@ -323,6 +329,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);