diff --git a/arch/arm/src/efm32/efm32_spi.h b/arch/arm/src/efm32/efm32_spi.h index 2e5fbdcc66c..315eb0615d7 100644 --- a/arch/arm/src/efm32/efm32_spi.h +++ b/arch/arm/src/efm32/efm32_spi.h @@ -51,6 +51,9 @@ * Public Function Prototypes ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + /**************************************************************************** * Name: efm32_spibus_initialize * @@ -65,7 +68,6 @@ * ****************************************************************************/ -struct spi_dev_s; struct spi_dev_s *efm32_spibus_initialize(int port); /**************************************************************************** diff --git a/arch/arm/src/kl/kl_spi.c b/arch/arm/src/kl/kl_spi.c index f189440c1ef..0b738aedf5e 100644 --- a/arch/arm/src/kl/kl_spi.c +++ b/arch/arm/src/kl/kl_spi.c @@ -1,7 +1,7 @@ /**************************************************************************** * arch/arm/src/kl/kl_spi.c * - * Copyright (C) 2013 Gregory Nutt. All rights reserved. + * Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -622,7 +622,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, size_t ****************************************************************************/ /**************************************************************************** - * Name: up_spiinitialize + * Name: kl_spibus_initialize * * Description: * Initialize the selected SPI port. @@ -635,7 +635,7 @@ static void spi_recvblock(FAR struct spi_dev_s *dev, FAR void *rxbuffer, size_t * ****************************************************************************/ -FAR struct spi_dev_s *up_spiinitialize(int port) +FAR struct spi_dev_s *kl_spibus_initialize(int port) { FAR struct kl_spidev_s *priv; uint32_t regval; diff --git a/arch/arm/src/kl/kl_spi.h b/arch/arm/src/kl/kl_spi.h index 223b6d6e52c..466ab832f8e 100644 --- a/arch/arm/src/kl/kl_spi.h +++ b/arch/arm/src/kl/kl_spi.h @@ -44,10 +44,6 @@ #if defined(CONFIG_KL_SPI0) || defined(CONFIG_KL_SPI1) -/************************************************************************************ - * Pre-processor Declarations - ************************************************************************************/ - /************************************************************************************ * Public Data ************************************************************************************/ @@ -67,8 +63,11 @@ extern "C" * Public Function Prototypes ************************************************************************************/ -/************************************************************************************ - * Name: up_spiinitialize +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + +/**************************************************************************** + * Name: kl_spibus_initialize * * Description: * Initialize the selected SPI port. @@ -79,10 +78,9 @@ extern "C" * Returned Value: * Valid SPI device structure reference on succcess; a NULL on failure * - ************************************************************************************/ + ****************************************************************************/ -struct spi_dev_s; -FAR struct spi_dev_s *up_spiinitialize(int port); +FAR struct spi_dev_s *kl_spibus_initialize(int port); /************************************************************************************ * Name: kl_spi[n]select, kl_spi[n]status, and kl_spi[n]cmddata @@ -91,7 +89,7 @@ FAR struct spi_dev_s *up_spiinitialize(int port); * These external functions must be provided by board-specific logic. They are * implementations of the select, status, and cmddata methods of the SPI interface * defined by struct spi_ops_s (see include/nuttx/spi/spi.h). All other methods - * including up_spiinitialize()) are provided by common Kinetis logic. To use + * including kl_spibus_initialize()) are provided by common Kinetis logic. To use * this common SPI logic on your board: * * 1. Provide logic in kl_boardinitialize() to configure SPI chip select @@ -103,17 +101,15 @@ FAR struct spi_dev_s *up_spiinitialize(int port); * kl_spi[n]cmddata() functions in your board-specific logic. These * functions 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 kl_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 kl_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). * ************************************************************************************/ -enum spi_dev_e; - #ifdef CONFIG_KL_SPI0 void kl_spi0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); uint8_t kl_spi0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); diff --git a/arch/arm/src/sam34/sam_spi.h b/arch/arm/src/sam34/sam_spi.h index 5d8a56d2ede..1d37d340d4e 100644 --- a/arch/arm/src/sam34/sam_spi.h +++ b/arch/arm/src/sam34/sam_spi.h @@ -109,6 +109,9 @@ extern "C" * Public Function Prototypes ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + /**************************************************************************** * Name: sam_spibus_initialize * @@ -159,10 +162,6 @@ struct spi_dev_s *sam_spibus_initialize(int port); * ****************************************************************************/ -#ifdef CONFIG_SAM34_SPI0 -struct spi_dev_s; -enum spi_dev_e; - /**************************************************************************** * Name: sam_spi[0|1]select * @@ -250,7 +249,6 @@ int sam_spi0cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); int sam_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); #endif #endif -#endif /* CONFIG_SAM34_SPI0 */ #undef EXTERN #if defined(__cplusplus) diff --git a/arch/arm/src/sama5/sam_spi.h b/arch/arm/src/sama5/sam_spi.h index c5698a0590c..cf988639372 100644 --- a/arch/arm/src/sama5/sam_spi.h +++ b/arch/arm/src/sama5/sam_spi.h @@ -103,6 +103,9 @@ extern "C" * Public Function Prototypes ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + /**************************************************************************** * Name: sam_spibus_initialize * @@ -152,10 +155,6 @@ struct spi_dev_s *sam_spibus_initialize(int port); * ****************************************************************************/ -#ifdef CONFIG_SAMA5_SPI0 -struct spi_dev_s; -enum spi_dev_e; - /**************************************************************************** * Name: sam_spi[0|1]select * @@ -243,7 +242,6 @@ int sam_spi0cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); int sam_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); #endif #endif -#endif /* CONFIG_SAMA5_SPI0 */ #undef EXTERN #if defined(__cplusplus) diff --git a/arch/arm/src/samdl/sam_spi.h b/arch/arm/src/samdl/sam_spi.h index 36a1cfd8f59..6185a5b3f01 100644 --- a/arch/arm/src/samdl/sam_spi.h +++ b/arch/arm/src/samdl/sam_spi.h @@ -86,6 +86,9 @@ extern "C" * Public Function Prototypes ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + /**************************************************************************** * Name: sam_spibus_initialize * @@ -138,9 +141,6 @@ struct spi_dev_s *sam_spibus_initialize(int port); * ****************************************************************************/ -struct spi_dev_s; -enum spi_dev_e; - /**************************************************************************** * Name: sam_spi[n]select * diff --git a/arch/arm/src/samv7/sam_spi.h b/arch/arm/src/samv7/sam_spi.h index 6ba2b6069ef..e236f3e86c2 100644 --- a/arch/arm/src/samv7/sam_spi.h +++ b/arch/arm/src/samv7/sam_spi.h @@ -111,6 +111,10 @@ extern "C" * Public Function Prototypes ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ +struct spi_sctrlr_s; /* Forward reference */ + /**************************************************************************** * Name: sam_spibus_initialize * @@ -178,9 +182,6 @@ FAR struct spi_sctrlr_s *sam_spi_slave_initialize(int port); * ****************************************************************************/ -struct spi_dev_s; /* Forward reference */ -enum spi_dev_e; /* Forward reference */ - /**************************************************************************** * Name: sam_spi[0|1]select * diff --git a/arch/arm/src/tiva/tiva_ssi.h b/arch/arm/src/tiva/tiva_ssi.h index a17c6422b0a..6ee926d7467 100644 --- a/arch/arm/src/tiva/tiva_ssi.h +++ b/arch/arm/src/tiva/tiva_ssi.h @@ -78,6 +78,7 @@ extern "C" * ****************************************************************************/ +struct spi_dev_s; FAR struct spi_dev_s *tiva_spibus_initialize(int port); /**************************************************************************** diff --git a/arch/mips/src/pic32mx/pic32mx.h b/arch/mips/src/pic32mx/pic32mx.h index 718a9674f9d..ab8e50b491a 100644 --- a/arch/mips/src/pic32mx/pic32mx.h +++ b/arch/mips/src/pic32mx/pic32mx.h @@ -398,6 +398,9 @@ void pic32mx_dumpgpio(uint32_t pinset, const char *msg); * ****************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + FAR struct spi_dev_s *pic32mx_spibus_initialize(int port); /************************************************************************************ diff --git a/arch/mips/src/pic32mz/pic32mz-spi.h b/arch/mips/src/pic32mz/pic32mz-spi.h index f6182d8eef3..f908f63b7c2 100644 --- a/arch/mips/src/pic32mz/pic32mz-spi.h +++ b/arch/mips/src/pic32mz/pic32mz-spi.h @@ -70,6 +70,9 @@ extern "C" * Public Function Prototypes ************************************************************************************/ +struct spi_dev_s; /* Forward reference */ +enum spi_dev_e; /* Forward reference */ + /**************************************************************************** * Name: pic32mz_spibus_initialize *