Sandeep,
On Thu, Jul 30, 2009 at 18:19:08, Paulraj, Sandeep wrote:
>
>
> > -----Original Message-----
> > From: Sudhakar Rajashekhara [mailto:[email protected]]
> > Sent: Thursday, July 30, 2009 12:30 AM
> > To: Paulraj, Sandeep; [email protected]
> > Subject: RE: [PATCH 1/6] DaVinci: SPI Driver for DaVinci and DA8xx SOC's
> >
> > Sandeep,
> >
> > On Thu, Jul 16, 2009 at 02:08:02, [email protected] wrote:
> > > From: Sandeep Paulraj <[email protected]>
> > >
> > > The patch adds support for SPI driver in DaVinci series
> > > SOC's.
> > >
> > > Signed-off-by: Sandeep Paulraj <[email protected]>
> > > ---
> > > arch/arm/mach-davinci/include/mach/spi.h | 45 ++
> > > drivers/spi/Kconfig | 7 +
> > > drivers/spi/Makefile | 1 +
> > > drivers/spi/davinci_spi.c | 751
> > ++++++++++++++++++++++++++++++
> > > drivers/spi/davinci_spi.h | 163 +++++++
> > > 5 files changed, 967 insertions(+), 0 deletions(-)
> > > create mode 100644 arch/arm/mach-davinci/include/mach/spi.h
> > > create mode 100644 drivers/spi/davinci_spi.c
> > > create mode 100644 drivers/spi/davinci_spi.h
> > >
[...]
> >
> > > +
> > > +static int davinci_spi_check_error(struct davinci_spi *davinci_spi,
> > > + int int_status)
> > > +{
> > > +
> > > + if (int_status & SPIFLG_TIMEOUT_MASK) {
> > > + dev_dbg(sdev, "SPI Time-out Error\n");
> > > + return -ETIMEDOUT;
> > > + }
> > > + if (int_status & SPIFLG_DESYNC_MASK) {
> > > + dev_dbg(sdev, "SPI Desynchronization Error\n");
> > > + return -EIO;
> > > + }
> > > + if (int_status & SPIFLG_BITERR_MASK) {
> > > + dev_dbg(sdev, "SPI Bit error\n");
> > > + return -EIO;
> > > + }
> > > +
> > > + if (davinci_spi->version == SPI_VERSION_2) {
> > > + if (int_status & SPIFLG_DLEN_ERR_MASK) {
> > > + dev_dbg(sdev, "SPI Data Length Error\n");
> > > + return -EIO;
> > > + }
> > > + if (int_status & SPIFLG_PARERR_MASK) {
> > > + dev_dbg(sdev, "SPI Parity Error\n");
> > > + return -EIO;
> > > + }
> > > + if (int_status & SPIFLG_OVRRUN_MASK) {
> > > + dev_dbg(sdev, "SPI Data Overrun error\n");
> > > + return -EIO;
> > > + }
> > > + if (int_status & SPIFLG_TX_INTR_MASK) {
> > > + dev_dbg(sdev, "SPI TX intr bit set\n");
> > > + return -EIO;
> > > + }
> >
> > Do you really need to check for the above flag? This is not
> > an error condition. This flag shows that transmit buffer is
> > empty and a new data can be written to it.
> [Sandeep] The doc says "an interrupt is pending to fill the transmitter"
> so it is being checked.
You can check for the flag, but I do not think it is
a case where you need to return an error.
Regards, Sudhakar
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source