From: Mike Frysinger Date: Tue, 5 Feb 2008 23:34:46 -0500 Subject: [U-Boot-Users] [PATCH v2] spi: Kill spi_chipsel table and introduce spi_setup() In-Reply-To: <1202214493-11719-1-git-send-email-hskinnemoen@atmel.com> References: <1202214493-11719-1-git-send-email-hskinnemoen@atmel.com> Message-ID: <200802052334.46831.vapier@gentoo.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de so the new SPI interface has this API: - void spi_init(void); - int spi_setup(int cs, unsigned int max_hz, unsigned int mode); - int spi_xfer(int cs, int bitlen, uchar *dout, uchar *din); - int spi_cs_is_valid(int cs); - void spi_cs_activate(int cs); - void spi_cs_deactivate(int cs); there isnt a function to pair up with spi_setup() ? for example, the normal communication flow with a SPI flash: - spi_setup - turn on SPI - spi_cs_activate - assert CS - spi_xfer - - op code (read/write/erase) - address - actual block data - spi_cs_deactivate - deassert CS - ??? - turn off SPI you dont want to have the deactivate func to turn off SPI in case you need to toggle the CS during communication ... some SPI peripherals have undefined (floating) behavior with pins when it is actually turned off which is bad mojo ... also, what's the deal with spi_xfer() taking a length in # of bits ? is it realistic to transmit anything less tan 8 bits ? the Linux kernel driver does not support this, so it cant be a big need ... -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 827 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20080205/47ed3ca7/attachment.pgp