lkml.org 
[lkml]   [2011]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 3/3] Input: cyttsp - add support for Cypress TTSP touchscreen SPI bus interface
From
Date
Hello Dmitry,

On Sun, 2011-08-21 at 19:44 -0700, Dmitry Torokhov wrote:
> Hi Javier,
>
> > +
> > + memset((void *)xfer, 0, sizeof(xfer));
> > + spi_message_init(&msg);
> > + xfer[0].tx_buf = wr_buf;
> > + xfer[0].rx_buf = rd_buf;
>
> Since we are setting both TX and RX buffer here does this mean that the
> device will not work with controllers in half-duplex mode? What is the
> amount of data that will be placed in rd_buf?
>

Both TX and RX buffers are set because Cypress requires full duplex
operation always.

> > + retval = spi_sync_tmo(ts, &msg);
> > + if (retval < 0) {
> > + dev_dbg(ts->ops.dev, "%s: spi sync error %d, len=%d, op=%d\n",
> > + __func__, retval, xfer[1].len, op);
> > + retval = 0;
>
> Why do we ignore the error?
>

Fixed: In next version a following ACK check code return the status to
the cyttsp core so it can retry after waiting with an msleep() call.

> > + }
> > +
> > + if (op == CY_SPI_RD_OP) {
> > + if ((rd_buf[CY_SPI_SYNC_BYTE] == CY_SPI_SYNC_ACK1) &&
> > + (rd_buf[CY_SPI_SYNC_BYTE+1] == CY_SPI_SYNC_ACK2))
> > + retval = 0;
>
> What about write operation? Does the device send anything in rd_buf for
> write command?
>

Fixed: Both read and write operations check the ACK bytes now.

> > +
> > + if (op == CY_SPI_RD_OP) {
> > + for (tries = CY_NUM_RETRY; tries; tries--) {
> > + retval = cyttsp_spi_xfer_(op, ts, reg, buf, length);
> > + if (retval == 0)
> > + break;
> > + else
> > + msleep(20);
>
> Why do we need retry in SPI case but do not need it when device is
> connected via I2C? And not on writes?
>

Fixed: The retries now are made in the cyttsp core so it works both for
SPI and I2C.

> > +
> > + if (retval == -EIO)
> > + return 0;
>
> Why is -EIO special?
>

Fixed: Now special EIO has been fixed to show meaning.

> > + else
> > + return retval;
> > +}
> > +
>
> Thanks.
>
> --
> Dmitry

Best regards,

Javier Martinez Canillas



\
 
 \ /
  Last update: 2011-09-03 07:35    [W:0.037 / U:6.832 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site