[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <t6umftlzqhpiwtq3oi2xgtmmvxc7o4ab2bjxqywvwrp25jpi5a@vlryb74pcvxi>
Date: Mon, 19 May 2025 09:23:03 -0700
From: Dmitry Torokhov <dmitry.torokhov@...il.com>
To: Joseph Guo <qijian.guo@....com>
Cc: Bastien Nocera <hadess@...ess.net>,
Hans de Goede <hdegoede@...hat.com>, "open list:GOODIX TOUCHSCREEN" <linux-input@...r.kernel.org>,
open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] input: goodix: add poll mode for goodix touchscreen
Hi Joseph,
On Mon, May 19, 2025 at 05:57:43PM +0900, Joseph Guo wrote:
> goodix touchscreen only support interrupt mode by default.
> Some panels like waveshare panel which is widely used on raspeberry pi
> don't have interrupt pins and only work on i2c poll mode.
> The waveshare panel 7inch panel use goodix gt911 touchscreen chip.
>
> Update goodix touchscreen to support both interrupt and poll mode.
>
> Signed-off-by: Joseph Guo <qijian.guo@....com>
> ---
> drivers/input/touchscreen/goodix.c | 69 +++++++++++++++++++++++++++---
> drivers/input/touchscreen/goodix.h | 4 ++
> 2 files changed, 67 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
> index aaf79ac50004..87991b56494d 100644
> --- a/drivers/input/touchscreen/goodix.c
> +++ b/drivers/input/touchscreen/goodix.c
> @@ -47,6 +47,7 @@
> #define RESOLUTION_LOC 1
> #define MAX_CONTACTS_LOC 5
> #define TRIGGER_LOC 6
> +#define POLL_INTERVAL_MS 17 /* 17ms = 60fps */
>
> /* Our special handling for GPIO accesses through ACPI is x86 specific */
> #if defined CONFIG_X86 && defined CONFIG_ACPI
> @@ -497,6 +498,23 @@ static void goodix_process_events(struct goodix_ts_data *ts)
> input_sync(ts->input_dev);
> }
>
> +static void goodix_ts_irq_poll_timer(struct timer_list *t)
> +{
> + struct goodix_ts_data *ts = from_timer(ts, t, timer);
> +
> + schedule_work(&ts->work_i2c_poll);
> + mod_timer(&ts->timer, jiffies + msecs_to_jiffies(POLL_INTERVAL_MS));
> +}
Why are you not suing the existing polling infrastructure
(input_setup_polling())?
Thanks.
--
Dmitry
Powered by blists - more mailing lists