Re: [PATCH 3/3] Input: cyttsp - add support for Cypress TTSP touchscreen SPI bus interface

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux