From: Mike Frysinger Date: Mon, 12 Sep 2011 12:35:10 -0400 Subject: [U-Boot] [PATCH 07/15] iMX28: Add SPI driver In-Reply-To: <1315800409-19876-8-git-send-email-marek.vasut@gmail.com> References: <1315800409-19876-1-git-send-email-marek.vasut@gmail.com> <1315800409-19876-8-git-send-email-marek.vasut@gmail.com> Message-ID: <201109121235.11413.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 On Monday, September 12, 2011 00:06:41 Marek Vasut wrote: > +struct spi_slave *spi_setup_slave(unsigned int bus, unsigned int cs, > + unsigned int max_hz, unsigned int mode) > +{ > + > + mx28_reset_block(&ssp_regs->hw_ssp_ctrl0_reg); > + > + writel(SSP_CTRL0_BUS_WIDTH_ONE_BIT, &ssp_regs->hw_ssp_ctrl0); > + > + reg = SSP_CTRL1_SSP_MODE_SPI | SSP_CTRL1_WORD_LENGTH_EIGHT_BITS; > + reg |= (mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0; > + reg |= (mode & SPI_CPHA) ? SSP_CTRL1_PHASE : 0; > + writel(reg, &ssp_regs->hw_ssp_ctrl1); > + > + writel(0, &ssp_regs->hw_ssp_cmd0); > + > + mx28_set_ssp_busclock(bus, max_hz / 1000); these steps should be done in the claim_bus func > +void mxs_spi_start_xfer(struct spi_slave *slave) > +void mxs_spi_end_xfer(struct spi_slave *slave) both should be static -mike -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 836 bytes Desc: This is a digitally signed message part. Url : http://lists.denx.de/pipermail/u-boot/attachments/20110912/9b6bf187/attachment.pgp