Re: [PATCH v2 1/2] Input: ads7846 - restore half-duplex support

From: Aaro Koskinen

Date: Mon Apr 20 2026 - 15:32:35 EST


Hi,

On Sun, Apr 19, 2026 at 05:13:56PM -0700, Dmitry Torokhov wrote:
> > +static void ads7846_halfd_read_state(struct ads7846 *ts)
> > +{
> > + struct ads7846_packet *packet = ts->packet;
> > + int msg_idx = 0;
> > +
> > + packet->ignore = false;
> > +
> > + while (msg_idx < ts->msg_count) {
> > + int error;
> > +
> > + ads7846_wait_for_hsync(ts);
> > +
> > + error = spi_sync(ts->spi, &ts->msg[msg_idx]);
> > + if (error) {
> > + dev_err_ratelimited(&ts->spi->dev, "spi_sync --> %d\n",
> > + error);
> > + packet->ignore = true;
> > + return;
>
> Sashiko recommends trying to power down ADC on errors, what do you
> think?

If we want to re-work error handling, then I guess it should be done the
same way for both full and half-duplex modes, and belongs to a separate
change set. This code has been in use quite a while, maybe 20 years,
and I haven't seen those errors in real use anyway, and AFAIK there
hasn't been any bug/problem reports by others either.

Maybe it wasn't so clearly stated in the commit message, but the patch
just restores the old code verbatim that was working fine for half-duplex
mode.

(Thanks for introducing Sashiko, I wasn't aware.)

A.