From: Keith Packard Date: Mon, 20 May 2013 03:27:05 +0000 (-0700) Subject: altos/lpc: Reset SPI device at startup time X-Git-Tag: 1.2.9.4~189^2~7 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=c1f01cd4406063191a51cb68fc4634eabfc60fc2 altos/lpc: Reset SPI device at startup time Wasn't doing the reset sequence correctly (write 0, then write 1). Signed-off-by: Keith Packard --- diff --git a/src/lpc/ao_spi_lpc.c b/src/lpc/ao_spi_lpc.c index ff107e40..c3587698 100644 --- a/src/lpc/ao_spi_lpc.c +++ b/src/lpc/ao_spi_lpc.c @@ -199,7 +199,8 @@ ao_spi_init(void) /* Turn on the clock */ lpc_scb.ssp1clkdiv = 1; - /* De-assert reset */ + /* Reset the device */ + lpc_scb.presetctrl &= ~(1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); lpc_scb.presetctrl |= (1 << LPC_SCB_PRESETCTRL_SSP1_RST_N); ao_spi_channel_init(1); #endif /* HAS_SPI_1 */