[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <10163666.lvqk35OSZv@diego>
Date: Mon, 30 Jun 2025 13:49:21 +0200
From: Heiko StĂĽbner <heiko@...ech.de>
To: Dmitry Torokhov <dmitry.torokhov@...il.com>,
Rob Herring <robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Cc: kernel@...labora.com, linux-input@...r.kernel.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-rockchip@...ts.infradead.org,
Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
Subject:
Re: [PATCH 2/4] Input: adc-keys - support types that aren't just keyboard
keys
Am Montag, 30. Juni 2025, 12:19:25 Mitteleuropäische Sommerzeit schrieb Nicolas Frattaroli:
> Instead of doing something like what gpio-keys is doing, adc-keys
> hardcodes that all keycodes must be of type EV_KEY.
>
> This limits the usefulness of adc-keys, and overcomplicates the code
> with manual bit-setting logic.
>
> Instead, refactor the code to read the linux,input-type fwnode property,
> and get rid of the custom bit setting logic, replacing it with
> input_set_capability instead. input_report_key is replaced with
> input_event, which allows us to explicitly pass the type.
>
> Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@...labora.com>
> ---
> drivers/input/keyboard/adc-keys.c | 16 ++++++++++++----
> 1 file changed, 12 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/input/keyboard/adc-keys.c b/drivers/input/keyboard/adc-keys.c
> index f1753207429db02ce6510e5ec0da9b24d9edb61d..339dd4d4a0842108da2c6136b1e0098cd1f6a3cd 100644
> --- a/drivers/input/keyboard/adc-keys.c
> +++ b/drivers/input/keyboard/adc-keys.c
> @@ -19,12 +19,14 @@
> struct adc_keys_button {
> u32 voltage;
> u32 keycode;
nit: consistency ... the above is still "keycode"
Naming things "code" like in gpio-keys might make sense maybe?
Though I guess, it could also just be needless churn
> + u32 type;
> };
>
> struct adc_keys_state {
> struct iio_channel *channel;
> u32 num_keys;
> u32 last_key;
^^ same
I'v checked that the function transistions
- __set_bit -> input_set_capability
- input_report_key -> input_event
do the right thing,
Reviewed-by: Heiko Stuebner <heiko@...ech.de>
Powered by blists - more mailing lists