Re: [spi-devel-general] [patch 05/14] mfd: PCAP2 driver

From: Daniel Ribeiro
Date: Sun Nov 23 2008 - 02:06:29 EST


Em SÃb, 2008-11-22 Ãs 20:59 -0800, David Brownell escreveu:
> > I tried spi_write_then_read before, but it didn't work. I supposed it
> > was because it was doing 2 transfers as the second transfer rx_buf
> > always came zeroed.
>
> You may have been using it wrong. Also, verify against
> current kernels ... there have been bugfixes to pxa2xx_spi.
>
> > I see that commit
> > f9b90e39cbc5c4d6ef60022fd1f25d541df0aad1 changed it to do a single
> > transfer, so i will try it again.
>
> Unless it needs the full duplex capability of SPI, then
> you should be able to make write_then_read work ... on
> the other hand, if you do need full duplex, then you
> should address the DMA. (And byteswapping, either way.)

Well, i guess it is full duplex, as i set spi_transfer.len to 4 bytes,
write 4 bytes _and_ read 4 bytes to/from the chip.

I'm looking at write_then_read and if I read it correctly, it sends n_tx
bytes of data plus n_rx bytes of nothing, and discards n_tx bytes from
the start of the receive buffer considering only n_rx bytes from the end
of the receive buffer. This is not what i want.

Can you be more descriptive on "address the DMA"? Im not familiar on
what is the issue here.

I will take care of byte swapping for the next patch.

--
Daniel Ribeiro

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