[U-Boot] [PATCH 07/15 V2] iMX28: Add SPI driver

Mike Frysinger
2011-09-14T02:50:09Z

On Tuesday, September 13, 2011 18:26:19 Marek Vasut wrote:
> +int spi_claim_bus(struct spi_slave *slave)
> +{
> + struct mxs_spi_slave *mxs_slave = to_mxs_slave(slave);
> + struct mx28_ssp_regs *ssp_regs = mxs_slave->regs;
> + uint32_t reg = 0;
> +
> + 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 |= (mxs_slave->mode & SPI_CPOL) ? SSP_CTRL1_POLARITY : 0;
> + reg |= (mxs_slave->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(slave->bus, mxs_slave->max_khz);

this turns on the hardware ...

> +void spi_release_bus(struct spi_slave *slave)
> +{
> +}

... so shouldn't this turn it off ?

i dont have the datasheet for the controller, so i have no idea :)
-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/20110913/310bfd73/attachment.pgp