samv71-xult: Fix SP0 vs. TWHS0 in mrf24j40-starhub/defconfig; fix copy-paste errors in SPI initialization logic.

This commit is contained in:
Gregory Nutt 2017-07-02 18:33:31 -06:00
parent a8f43e1216
commit 56801c3389
2 changed files with 18 additions and 11 deletions

View File

@ -219,8 +219,8 @@ CONFIG_SAMV7_HAVE_USBHS=y
CONFIG_SAMV7_HAVE_USART0=y CONFIG_SAMV7_HAVE_USART0=y
CONFIG_SAMV7_HAVE_USART1=y CONFIG_SAMV7_HAVE_USART1=y
CONFIG_SAMV7_HAVE_USART2=y CONFIG_SAMV7_HAVE_USART2=y
# CONFIG_SAMV7_SPI is not set CONFIG_SAMV7_SPI=y
# CONFIG_SAMV7_SPI_MASTER is not set CONFIG_SAMV7_SPI_MASTER=y
# CONFIG_SAMV7_SPI_SLAVE is not set # CONFIG_SAMV7_SPI_SLAVE is not set
# #
@ -246,7 +246,7 @@ CONFIG_SAMV7_HSMCI0=y
# CONFIG_SAMV7_RTT is not set # CONFIG_SAMV7_RTT is not set
# CONFIG_SAMV7_SDRAMC is not set # CONFIG_SAMV7_SDRAMC is not set
# CONFIG_SAMV7_SMC is not set # CONFIG_SAMV7_SMC is not set
# CONFIG_SAMV7_SPI0 is not set CONFIG_SAMV7_SPI0=y
# CONFIG_SAMV7_SPI1 is not set # CONFIG_SAMV7_SPI1 is not set
# CONFIG_SAMV7_SSC0 is not set # CONFIG_SAMV7_SSC0 is not set
# CONFIG_SAMV7_TC0 is not set # CONFIG_SAMV7_TC0 is not set
@ -254,7 +254,7 @@ CONFIG_SAMV7_HSMCI0=y
# CONFIG_SAMV7_TC2 is not set # CONFIG_SAMV7_TC2 is not set
# CONFIG_SAMV7_TC3 is not set # CONFIG_SAMV7_TC3 is not set
# CONFIG_SAMV7_TRNG is not set # CONFIG_SAMV7_TRNG is not set
CONFIG_SAMV7_TWIHS0=y # CONFIG_SAMV7_TWIHS0 is not set
# CONFIG_SAMV7_TWIHS1 is not set # CONFIG_SAMV7_TWIHS1 is not set
# CONFIG_SAMV7_TWIHS2 is not set # CONFIG_SAMV7_TWIHS2 is not set
# CONFIG_SAMV7_UART0 is not set # CONFIG_SAMV7_UART0 is not set
@ -285,10 +285,16 @@ CONFIG_SAMV7_GPIOD_IRQ=y
# CONFIG_SAMV7_PROGMEM is not set # CONFIG_SAMV7_PROGMEM is not set
# #
# TWIHS device driver options # SPI Device Driver Configuration
# #
CONFIG_SAMV7_TWIHS0_FREQUENCY=100000 CONFIG_SAMV7_SPI0_MASTER=y
CONFIG_SAMV7_TWIHS0_GLITCH_FILTER=1
#
# SPI Master Configuration
#
# CONFIG_SAMV7_SPI_CS_DECODING is not set
# CONFIG_SAMV7_SPI_VARSELECT is not set
# CONFIG_SAMV7_SPI_DMA is not set
# #
# HSMCI device driver options # HSMCI device driver options

View File

@ -74,14 +74,15 @@ void sam_spidev_initialize(void)
#ifdef CONFIG_SAMV71XULT_MB1_SPI #ifdef CONFIG_SAMV71XULT_MB1_SPI
/* Enable chip select for mikroBUS1 */ /* Enable chip select for mikroBUS1 */
(void)stm32_configgpio(CLICK_MB1_CS); (void)sam_configgpio(CLICK_MB1_CS);
#endif #endif
#ifdef CONFIG_SAMV71XULT_MB2_SPI #ifdef CONFIG_SAMV71XULT_MB2_SPI
/* Enable chip select for mikroBUS2 */ /* Enable chip select for mikroBUS2 */
(void)stm32_configgpio(CLICK_MB2_CS); (void)sam_configgpio(CLICK_MB2_CS);
#endif #endif
#endif /* CONFIG_SAMV7_SPI0_MASTER */
#ifdef CONFIG_SAMV7_SPI0_SLAVE #ifdef CONFIG_SAMV7_SPI0_SLAVE
#endif #endif
@ -163,9 +164,9 @@ void sam_spi0select(uint32_t devid, bool selected)
/* Set the GPIO low to select and high to de-select */ /* Set the GPIO low to select and high to de-select */
#if defined(CONFIG_SAMV71XULT_MB1_BEE) #if defined(CONFIG_SAMV71XULT_MB1_BEE)
stm32_gpiowrite(CLICK_MB1_CS, !selected); sam_gpiowrite(CLICK_MB1_CS, !selected);
#elif defined(CONFIG_SAMV71XULT_MB2_BEE) #elif defined(CONFIG_SAMV71XULT_MB2_BEE)
stm32_gpiowrite(CLICK_MB2_CS, !selected); sam_gpiowrite(CLICK_MB2_CS, !selected);
#endif #endif
break; break;
#endif #endif