Re: [PATCH] Input: ads7846 - consolidate coordinate filtering logic

From: Dmitry Torokhov

Date: Thu May 07 2026 - 15:35:35 EST


Hi Kris,

On Thu, May 07, 2026 at 10:48:57AM -0700, Kris Bahnsen wrote:
> On 5/4/26 9:54 PM, Dmitry Torokhov wrote:
> > The ads7846 driver has two separate filtering functions,
> > ads7846_filter() and ads7846_filter_one(), for the full-duplex and
> > half-duplex SPI paths, respectively.
> >
> > They can be consolidated by extracting the core filtering logic for a
> > single command into a helper function, ads7846_filter_cmd(), which
> > iterates from l->skip to l->count. The half-duplex setup function is
> > updated to set l->skip = l->count - 1 so that the helper only processes
> > the last sample, preserving the original half-duplex behavior.
> >
> > Assisted-by: Gemini:gemini-3.1-pro
> > Signed-off-by: Dmitry Torokhov <dmitry.torokhov@xxxxxxxxx>
> > ---
> >
> > Not tested so will appreciate if someone could give it a spin.
>
> Forgive my ignorance, but I am unsure of the base commit this applies
> to and I'm unable to apply it to current HEAD of linux, linux-next,
> or your input tree.
>
> I also am not easily able to test this if it doesn't cleanly apply
> to the latest LTS, but will do what I can once I know what other
> patches I would need to pull in to our tree.

I think if you pull 'next' branch of my tree, then the following patches
seem to apply cleanly on 7.0:

c68bc840f06c ("Input: ads7846 - restore half-duplex support")
011bdf9f3a9d ("Input: ads7846 - consolidate coordinate filtering logic")

I hope they also build ;)

c68bc840f06c should appear in linux-next soon too.

Thanks.

--
Dmitry