From e792b0983060711273a07a70b67a53d491d8a059 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Tue, 26 Jan 2016 13:03:12 -0600 Subject: [PATCH] For SAM MCUs, rename up_spiinitialize to sam_spibus_initialize --- configs/sam3u-ek/src/sam_spi.c | 10 +++++----- configs/sam3u-ek/src/sam_touchscreen.c | 6 ++++-- configs/sam4e-ek/src/sam_ads7843e.c | 6 ++++-- configs/sam4e-ek/src/sam_at25.c | 2 +- configs/sam4e-ek/src/sam_spi.c | 10 +++++----- configs/sam4l-xplained/src/sam_mmcsd.c | 4 +++- configs/sam4l-xplained/src/sam_spi.c | 10 +++++----- configs/sam4l-xplained/src/sam_ug2832hsweg04.c | 4 +++- configs/sama5d3-xplained/src/sam_at25.c | 2 +- configs/sama5d3-xplained/src/sam_spi.c | 10 +++++----- configs/sama5d3x-ek/src/sam_at25.c | 2 +- configs/sama5d3x-ek/src/sam_spi.c | 10 +++++----- configs/sama5d4-ek/src/sam_at25.c | 2 +- configs/sama5d4-ek/src/sam_spi.c | 10 +++++----- configs/samd20-xplained/src/sam_mmcsd.c | 4 +++- configs/samd20-xplained/src/sam_spi.c | 10 +++++----- configs/samd20-xplained/src/sam_ug2832hsweg04.c | 4 +++- configs/samd21-xplained/src/sam_mmcsd.c | 4 +++- configs/samd21-xplained/src/sam_spi.c | 10 +++++----- configs/samd21-xplained/src/sam_ug2832hsweg04.c | 4 +++- configs/same70-xplained/src/sam_spi.c | 10 +++++----- configs/saml21-xplained/src/sam_mmcsd.c | 4 +++- configs/saml21-xplained/src/sam_spi.c | 10 +++++----- configs/saml21-xplained/src/sam_ug2832hsweg04.c | 4 +++- configs/samv71-xult/src/sam_spi.c | 10 +++++----- 25 files changed, 91 insertions(+), 71 deletions(-) diff --git a/configs/sam3u-ek/src/sam_spi.c b/configs/sam3u-ek/src/sam_spi.c index 57021e5b93..014dff6635 100644 --- a/configs/sam3u-ek/src/sam_spi.c +++ b/configs/sam3u-ek/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAM3U-EK board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { /* The ZigBee module connects used NPCS0. However, there is not yet any * ZigBee support. @@ -117,7 +117,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi0status and sam_spic0mddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -130,9 +130,9 @@ void weak_function sam_spiinitialize(void) * sam_spic0mddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/sam3u-ek/src/sam_touchscreen.c b/configs/sam3u-ek/src/sam_touchscreen.c index a4794c535e..f45efa1ea7 100644 --- a/configs/sam3u-ek/src/sam_touchscreen.c +++ b/configs/sam3u-ek/src/sam_touchscreen.c @@ -51,6 +51,8 @@ #include #include "sam_gpio.h" +#include "sam_spi.h" + #include "sam3u-ek.h" /**************************************************************************** @@ -250,7 +252,7 @@ int board_tsc_setup(int minor) /* Get an instance of the SPI interface for the touchscreen chip select */ - dev = up_spiinitialize(TSC_CSNUM); + dev = sam_spibus_initialize(TSC_CSNUM); if (!dev) { idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); @@ -263,7 +265,7 @@ int board_tsc_setup(int minor) if (ret < 0) { idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); - /* up_spiuninitialize(dev); */ + /* sam_spibus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_ads7843e.c b/configs/sam4e-ek/src/sam_ads7843e.c index 3448590191..70f83e94ef 100644 --- a/configs/sam4e-ek/src/sam_ads7843e.c +++ b/configs/sam4e-ek/src/sam_ads7843e.c @@ -51,6 +51,8 @@ #include #include "sam_gpio.h" +#include "sam_spi.h" + #include "sam4e-ek.h" #if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E) @@ -247,7 +249,7 @@ int board_tsc_setup(int minor) /* Get an instance of the SPI interface for the touchscreen chip select */ - dev = up_spiinitialize(TSC_CSNUM); + dev = sam_spibus_initialize(TSC_CSNUM); if (!dev) { idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); @@ -260,7 +262,7 @@ int board_tsc_setup(int minor) if (ret < 0) { idbg("Failed to initialize SPI chip select %d\n", TSC_CSNUM); - /* up_spiuninitialize(dev); */ + /* sam_spibus_uninitialize(dev); */ return -ENODEV; } diff --git a/configs/sam4e-ek/src/sam_at25.c b/configs/sam4e-ek/src/sam_at25.c index 371232fa17..2b3473d6d9 100644 --- a/configs/sam4e-ek/src/sam_at25.c +++ b/configs/sam4e-ek/src/sam_at25.c @@ -85,7 +85,7 @@ int sam_at25_automount(int minor) { /* No.. Get the SPI port driver */ - spi = up_spiinitialize(FLASH_CSNUM); + spi = sam_spibus_initialize(FLASH_CSNUM); if (!spi) { fdbg("ERROR: Failed to initialize SPI port %d\n", FLASH_CSNUM); diff --git a/configs/sam4e-ek/src/sam_spi.c b/configs/sam4e-ek/src/sam_spi.c index 704bca6000..01b3860828 100644 --- a/configs/sam4e-ek/src/sam_spi.c +++ b/configs/sam4e-ek/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAM4E-EK board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { #if defined(CONFIG_INPUT) && defined(CONFIG_INPUT_ADS7843E) /* The touchscreen connects using NPCS0 (PA11). */ @@ -119,7 +119,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi0status and sam_spic0mddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -132,9 +132,9 @@ void weak_function sam_spiinitialize(void) * sam_spic0mddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/sam4l-xplained/src/sam_mmcsd.c b/configs/sam4l-xplained/src/sam_mmcsd.c index e080775451..bc5fd368c7 100644 --- a/configs/sam4l-xplained/src/sam_mmcsd.c +++ b/configs/sam4l-xplained/src/sam_mmcsd.c @@ -46,6 +46,8 @@ #include #include +#include "sam_spi.h" + #include "sam4l-xplained.h" #ifdef CONFIG_SAM4L_XPLAINED_IOMODULE @@ -94,7 +96,7 @@ int sam_sdinitialize(int minor) fvdbg("Initializing SPI chip select %d\n", SD_CSNO); - spi = up_spiinitialize(SD_CSNO); + spi = sam_spibus_initialize(SD_CSNO); if (!spi) { fdbg("Failed to initialize SPI chip select %d\n", SD_CSNO); diff --git a/configs/sam4l-xplained/src/sam_spi.c b/configs/sam4l-xplained/src/sam_spi.c index c461c325bf..8c45e010e3 100644 --- a/configs/sam4l-xplained/src/sam_spi.c +++ b/configs/sam4l-xplained/src/sam_spi.c @@ -81,14 +81,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select GPIO pins for the SAM3U10E-EVAL board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { /* The I/O module containing the SD connector may or may not be installed. And, if * it is installed, it may be in connector EXT1 or EXT2. @@ -118,7 +118,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi0status and sam_spic0mddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -131,9 +131,9 @@ void weak_function sam_spiinitialize(void) * sam_spic0mddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c index b76a260013..1d60b6710c 100644 --- a/configs/sam4l-xplained/src/sam_ug2832hsweg04.c +++ b/configs/sam4l-xplained/src/sam_ug2832hsweg04.c @@ -86,6 +86,8 @@ #include #include "sam_gpio.h" +#include "sam_spi.h" + #include "sam4l-xplained.h" #ifdef CONFIG_SAM4L_XPLAINED_OLED1MODULE @@ -152,7 +154,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(OLED_CSNO); + spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/sama5d3-xplained/src/sam_at25.c b/configs/sama5d3-xplained/src/sam_at25.c index 9a756134cd..a6ef86fc06 100644 --- a/configs/sama5d3-xplained/src/sam_at25.c +++ b/configs/sama5d3-xplained/src/sam_at25.c @@ -84,7 +84,7 @@ int sam_at25_automount(int minor) { /* No.. Get the SPI port driver */ - spi = up_spiinitialize(AT25_PORT); + spi = sam_spibus_initialize(AT25_PORT); if (!spi) { fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); diff --git a/configs/sama5d3-xplained/src/sam_spi.c b/configs/sama5d3-xplained/src/sam_spi.c index 0c4e7fe1f4..24672d8c33 100644 --- a/configs/sama5d3-xplained/src/sam_spi.c +++ b/configs/sama5d3-xplained/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAMA5D3-Xplained board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { #ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_MTD_AT25 @@ -118,7 +118,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -131,9 +131,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/sama5d3x-ek/src/sam_at25.c b/configs/sama5d3x-ek/src/sam_at25.c index ca501db53e..14a77b9493 100644 --- a/configs/sama5d3x-ek/src/sam_at25.c +++ b/configs/sama5d3x-ek/src/sam_at25.c @@ -84,7 +84,7 @@ int sam_at25_automount(int minor) { /* No.. Get the SPI port driver */ - spi = up_spiinitialize(AT25_PORT); + spi = sam_spibus_initialize(AT25_PORT); if (!spi) { fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); diff --git a/configs/sama5d3x-ek/src/sam_spi.c b/configs/sama5d3x-ek/src/sam_spi.c index 434fa1991b..9a0ba344a8 100644 --- a/configs/sama5d3x-ek/src/sam_spi.c +++ b/configs/sama5d3x-ek/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAMA5D3x-EK board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { #ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_MTD_AT25 @@ -118,7 +118,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -131,9 +131,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/sama5d4-ek/src/sam_at25.c b/configs/sama5d4-ek/src/sam_at25.c index e74cf8c675..f2a4c4d1d8 100644 --- a/configs/sama5d4-ek/src/sam_at25.c +++ b/configs/sama5d4-ek/src/sam_at25.c @@ -89,7 +89,7 @@ int sam_at25_automount(int minor) { /* No.. Get the SPI port driver */ - spi = up_spiinitialize(AT25_PORT); + spi = sam_spibus_initialize(AT25_PORT); if (!spi) { fdbg("ERROR: Failed to initialize SPI port %d\n", AT25_PORT); diff --git a/configs/sama5d4-ek/src/sam_spi.c b/configs/sama5d4-ek/src/sam_spi.c index b04a6f7e47..a56c477507 100644 --- a/configs/sama5d4-ek/src/sam_spi.c +++ b/configs/sama5d4-ek/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAMA5D4-EK board. * ************************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { #ifdef CONFIG_SAMA5_SPI0 #ifdef CONFIG_MTD_AT25 @@ -118,7 +118,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -131,9 +131,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/samd20-xplained/src/sam_mmcsd.c b/configs/samd20-xplained/src/sam_mmcsd.c index 4849cf0915..b183eda742 100644 --- a/configs/samd20-xplained/src/sam_mmcsd.c +++ b/configs/samd20-xplained/src/sam_mmcsd.c @@ -47,6 +47,8 @@ #include #include "sam_config.h" +#include "sam_spi.h" + #include "samd20-xplained.h" #ifdef CONFIG_SAMD20_XPLAINED_IOMODULE @@ -95,7 +97,7 @@ int sam_sdinitialize(int port, int minor) fvdbg("Initializing SERCOM SPI%d\n", port); - spi = up_spiinitialize(port); + spi = sam_spibus_initialize(port); if (!spi) { fdbg("Failed to initialize SPI%d\n", port); diff --git a/configs/samd20-xplained/src/sam_spi.c b/configs/samd20-xplained/src/sam_spi.c index dc358b6896..21a9f681fa 100644 --- a/configs/samd20-xplained/src/sam_spi.c +++ b/configs/samd20-xplained/src/sam_spi.c @@ -84,7 +84,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAMD20 Xplained @@ -92,7 +92,7 @@ * ****************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { /* The I/O module containing the SD connector may or may not be installed. And, if * it is installed, it may be in connector EXT1 or EXT2. @@ -123,7 +123,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[n]status and sam_spi[n]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAMD/L logic. + * sam_spibus_initialize()) are provided by common SAMD/L logic. * * Where [n] is the SERCOM number for the SPI module. * @@ -138,9 +138,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[n]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind + * 4. The handle returned by sam_spibus_initialize() may then be used to bind * the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/samd20-xplained/src/sam_ug2832hsweg04.c b/configs/samd20-xplained/src/sam_ug2832hsweg04.c index d3ec794d1a..ee1f37d0f6 100644 --- a/configs/samd20-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd20-xplained/src/sam_ug2832hsweg04.c @@ -116,6 +116,8 @@ #include #include "sam_port.h" +#include "sam_spi.h" + #include "samd20-xplained.h" #ifdef CONFIG_SAMD20_XPLAINED_OLED1MODULE @@ -182,7 +184,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(OLED_CSNO); + spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/samd21-xplained/src/sam_mmcsd.c b/configs/samd21-xplained/src/sam_mmcsd.c index 4c2a66500e..f763f44c0a 100644 --- a/configs/samd21-xplained/src/sam_mmcsd.c +++ b/configs/samd21-xplained/src/sam_mmcsd.c @@ -47,6 +47,8 @@ #include #include "sam_config.h" +#include "sam_spi.h" + #include "samd21-xplained.h" #ifdef CONFIG_SAMD21_XPLAINED_IOMODULE @@ -95,7 +97,7 @@ int sam_sdinitialize(int port, int minor) fvdbg("Initializing SERCOM SPI%d\n", port); - spi = up_spiinitialize(port); + spi = sam_spibus_initialize(port); if (!spi) { fdbg("Failed to initialize SPI%d\n", port); diff --git a/configs/samd21-xplained/src/sam_spi.c b/configs/samd21-xplained/src/sam_spi.c index 0eb4ea4b2e..6352367dcc 100644 --- a/configs/samd21-xplained/src/sam_spi.c +++ b/configs/samd21-xplained/src/sam_spi.c @@ -84,7 +84,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAMD21 Xplained @@ -92,7 +92,7 @@ * ****************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { /* The I/O module containing the SD connector may or may not be installed. And, if * it is installed, it may be in connector EXT1 or EXT2. @@ -123,7 +123,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[n]status and sam_spi[n]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAMD/L logic. + * sam_spibus_initialize()) are provided by common SAMD/L logic. * * Where [n] is the SERCOM number for the SPI module. * @@ -138,9 +138,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[n]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind + * 4. The handle returned by sam_spibus_initialize() may then be used to bind * the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/samd21-xplained/src/sam_ug2832hsweg04.c b/configs/samd21-xplained/src/sam_ug2832hsweg04.c index 4e24dbd4d2..b5cfcf26e7 100644 --- a/configs/samd21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/samd21-xplained/src/sam_ug2832hsweg04.c @@ -116,6 +116,8 @@ #include #include "sam_port.h" +#include "sam_spi.h" + #include "samd21-xplained.h" #ifdef CONFIG_SAMD21_XPLAINED_OLED1MODULE @@ -182,7 +184,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(OLED_CSNO); + spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/same70-xplained/src/sam_spi.c b/configs/same70-xplained/src/sam_spi.c index bf305ba726..df0ba7b489 100644 --- a/configs/same70-xplained/src/sam_spi.c +++ b/configs/same70-xplained/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spi_initialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAME70-XPLD board. * ************************************************************************************/ -void sam_spi_initialize(void) +void sam_spidev_initialize(void) { #ifdef CONFIG_SAMV7_SPI0_MASTER #endif @@ -119,7 +119,7 @@ void sam_spi_initialize(void) * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -132,9 +132,9 @@ void sam_spi_initialize(void) * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/saml21-xplained/src/sam_mmcsd.c b/configs/saml21-xplained/src/sam_mmcsd.c index 2435ff08cd..a8ca098282 100644 --- a/configs/saml21-xplained/src/sam_mmcsd.c +++ b/configs/saml21-xplained/src/sam_mmcsd.c @@ -47,6 +47,8 @@ #include #include "sam_config.h" +#include "sam_spi.h" + #include "saml21-xplained.h" #ifdef CONFIG_SAML21_XPLAINED_IOMODULE @@ -95,7 +97,7 @@ int sam_sdinitialize(int port, int minor) fvdbg("Initializing SERCOM SPI%d\n", port); - spi = up_spiinitialize(port); + spi = sam_spibus_initialize(port); if (!spi) { fdbg("Failed to initialize SPI%d\n", port); diff --git a/configs/saml21-xplained/src/sam_spi.c b/configs/saml21-xplained/src/sam_spi.c index 0182179270..00eea22563 100644 --- a/configs/saml21-xplained/src/sam_spi.c +++ b/configs/saml21-xplained/src/sam_spi.c @@ -84,7 +84,7 @@ ****************************************************************************/ /**************************************************************************** - * Name: sam_spiinitialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PORT pins for the SAML21 Xplained @@ -92,7 +92,7 @@ * ****************************************************************************/ -void weak_function sam_spiinitialize(void) +void weak_function sam_spidev_initialize(void) { /* The I/O module containing the SD connector may or may not be installed. And, if * it is installed, it may be in connector EXT1 or EXT2. @@ -123,7 +123,7 @@ void weak_function sam_spiinitialize(void) * o sam_spi[n]status and sam_spi[n]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAMD/L logic. + * sam_spibus_initialize()) are provided by common SAMD/L logic. * * Where [n] is the SERCOM number for the SPI module. * @@ -138,9 +138,9 @@ void weak_function sam_spiinitialize(void) * sam_spi[n]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using GPIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind + * 4. The handle returned by sam_spibus_initialize() may then be used to bind * the SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). diff --git a/configs/saml21-xplained/src/sam_ug2832hsweg04.c b/configs/saml21-xplained/src/sam_ug2832hsweg04.c index d643dbfd8c..3e67622d16 100644 --- a/configs/saml21-xplained/src/sam_ug2832hsweg04.c +++ b/configs/saml21-xplained/src/sam_ug2832hsweg04.c @@ -116,6 +116,8 @@ #include #include "sam_port.h" +#include "sam_spi.h" + #include "saml21-xplained.h" #ifdef CONFIG_SAML21_XPLAINED_OLED1MODULE @@ -182,7 +184,7 @@ FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno) /* Get the SPI1 port interface */ - spi = up_spiinitialize(OLED_CSNO); + spi = sam_spibus_initialize(OLED_CSNO); if (!spi) { lcddbg("Failed to initialize SPI port 1\n"); diff --git a/configs/samv71-xult/src/sam_spi.c b/configs/samv71-xult/src/sam_spi.c index 0c44122c98..03dd5ead1e 100644 --- a/configs/samv71-xult/src/sam_spi.c +++ b/configs/samv71-xult/src/sam_spi.c @@ -86,14 +86,14 @@ ************************************************************************************/ /************************************************************************************ - * Name: sam_spi_initialize + * Name: sam_spidev_initialize * * Description: * Called to configure SPI chip select PIO pins for the SAMV71-XULT board. * ************************************************************************************/ -void sam_spi_initialize(void) +void sam_spidev_initialize(void) { #ifdef CONFIG_SAMV7_SPI0_MASTER #endif @@ -119,7 +119,7 @@ void sam_spi_initialize(void) * o sam_spi[0|1]status and sam_spi[0|1]cmddata: Implementations of the status * and cmddata methods of the SPI interface defined by struct spi_ops_ * (see include/nuttx/spi/spi.h). All other methods including - * up_spiinitialize()) are provided by common SAM3/4 logic. + * sam_spibus_initialize()) are provided by common SAM3/4 logic. * * To use this common SPI logic on your board: * @@ -132,9 +132,9 @@ void sam_spi_initialize(void) * sam_spi[0|1]cmddata() functions in your board-specific logic. This * function will perform cmd/data selection operations using PIOs in * the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. Add a call to sam_spibus_initialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 4. The handle returned by sam_spibus_initialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver).