altos/lpc: Reset SPI device at startup time
authorKeith Packard <keithp@keithp.com>
Mon, 20 May 2013 03:27:05 +0000 (20:27 -0700)
committerKeith Packard <keithp@keithp.com>
Mon, 20 May 2013 03:39:19 +0000 (20:39 -0700)
Wasn't doing the reset sequence correctly (write 0, then write 1).

Signed-off-by: Keith Packard <keithp@keithp.com>
src/lpc/ao_spi_lpc.c

index ff107e40dd0339fb01eed124f30c282116e1bf7a..c3587698e1d26f55ac1b7b583b2ab76f7707b6ed 100644 (file)
@@ -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 */