You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ag...@apache.org on 2022/01/04 16:44:32 UTC

[incubator-nuttx] branch master updated: sdio: Move sdio utils functions to drivers/mmcsd

This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 828f04f  sdio: Move sdio utils functions to drivers/mmcsd
828f04f is described below

commit 828f04f0e57229363d669cfa96d49b74b3b392cd
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Tue Jan 4 16:28:19 2022 +0800

    sdio: Move sdio utils functions to drivers/mmcsd
    
    so all sdio client driver can reuse them
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 drivers/mmcsd/Make.defs                            |  2 +-
 .../ieee80211/bcm43xxx/mmc_sdio.c => mmcsd/sdio.c} |  4 +-
 drivers/wireless/ieee80211/bcm43xxx/Make.defs      |  1 -
 drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c    |  2 +-
 include/nuttx/sdio.h                               | 23 ++++++++
 include/nuttx/wireless/ieee80211/mmc_sdio.h        | 63 ----------------------
 6 files changed, 27 insertions(+), 68 deletions(-)

diff --git a/drivers/mmcsd/Make.defs b/drivers/mmcsd/Make.defs
index 7e9d66e..b908d71 100644
--- a/drivers/mmcsd/Make.defs
+++ b/drivers/mmcsd/Make.defs
@@ -23,7 +23,7 @@ ifeq ($(CONFIG_MMCSD),y)
 # Include MMC/SD drivers
 
 ifeq ($(CONFIG_MMCSD_SDIO),y)
-CSRCS += mmcsd_sdio.c
+CSRCS += mmcsd_sdio.c sdio.c
 endif
 
 ifeq ($(CONFIG_MMCSD_SPI),y)
diff --git a/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c b/drivers/mmcsd/sdio.c
similarity index 99%
rename from drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c
rename to drivers/mmcsd/sdio.c
index e38034a..b61ed43 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c
+++ b/drivers/mmcsd/sdio.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * drivers/wireless/ieee80211/bcm43xxx/mmc_sdio.c
+ * drivers/mmcsd/sdio.c
  *
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
@@ -22,7 +22,6 @@
  * Included Files
  ****************************************************************************/
 
-#include <nuttx/wireless/ieee80211/mmc_sdio.h>
 #include <debug.h>
 #include <errno.h>
 #include <inttypes.h>
@@ -30,6 +29,7 @@
 
 #include <nuttx/compiler.h>
 #include <nuttx/arch.h>
+#include <nuttx/sdio.h>
 
 /****************************************************************************
  * Pre-processor Definitions
diff --git a/drivers/wireless/ieee80211/bcm43xxx/Make.defs b/drivers/wireless/ieee80211/bcm43xxx/Make.defs
index 959457f..42bf0c5 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/Make.defs
+++ b/drivers/wireless/ieee80211/bcm43xxx/Make.defs
@@ -28,7 +28,6 @@ ifeq ($(CONFIG_IEEE80211_BROADCOM_FULLMAC),y)
   CSRCS += bcmf_netdev.c
 
 ifeq ($(CONFIG_IEEE80211_BROADCOM_FULLMAC_SDIO),y)
-  CSRCS += mmc_sdio.c
   CSRCS += bcmf_sdio.c
   CSRCS += bcmf_core.c
   CSRCS += bcmf_sdpcm.c
diff --git a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
index d602f52..3950270 100644
--- a/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
+++ b/drivers/wireless/ieee80211/bcm43xxx/bcmf_sdio.c
@@ -37,8 +37,8 @@
 #include <nuttx/arch.h>
 #include <nuttx/kthread.h>
 #include <nuttx/wdog.h>
+#include <nuttx/sdio.h>
 
-#include <nuttx/wireless/ieee80211/mmc_sdio.h>
 #include <nuttx/wireless/ieee80211/bcmf_sdio.h>
 #include <nuttx/wireless/ieee80211/bcmf_board.h>
 
diff --git a/include/nuttx/sdio.h b/include/nuttx/sdio.h
index aff00fa..9fa97c8 100644
--- a/include/nuttx/sdio.h
+++ b/include/nuttx/sdio.h
@@ -1013,6 +1013,29 @@ struct sdio_dev_s
  * Public Function Prototypes
  ****************************************************************************/
 
+int sdio_probe(FAR struct sdio_dev_s *dev);
+
+int sdio_set_wide_bus(struct sdio_dev_s *dev);
+
+int sdio_set_blocksize(FAR struct sdio_dev_s *dev, uint8_t function,
+                       uint16_t blocksize);
+
+int sdio_enable_function(FAR struct sdio_dev_s *dev, uint8_t function);
+
+int sdio_enable_interrupt(FAR struct sdio_dev_s *dev, uint8_t function);
+
+int sdio_sendcmdpoll(FAR struct sdio_dev_s *dev,
+                     uint32_t cmd, uint32_t arg);
+
+int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write,
+                      uint8_t function, uint32_t address,
+                      uint8_t inb, uint8_t *outb);
+
+int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write,
+                        uint8_t function, uint32_t address,
+                        bool inc_addr, uint8_t *buf,
+                        unsigned int blocklen, unsigned int nblocks);
+
 #undef EXTERN
 #if defined(__cplusplus)
 #define EXTERN extern "C"
diff --git a/include/nuttx/wireless/ieee80211/mmc_sdio.h b/include/nuttx/wireless/ieee80211/mmc_sdio.h
deleted file mode 100644
index bf8dcaf..0000000
--- a/include/nuttx/wireless/ieee80211/mmc_sdio.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/****************************************************************************
- * include/nuttx/wireless/ieee80211/mmc_sdio.h
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.  The
- * ASF licenses this file to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance with the
- * License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the
- * License for the specific language governing permissions and limitations
- * under the License.
- *
- ****************************************************************************/
-
-#ifndef __INCLUDE_NUTTX_WIRELESS_IEEE80211_MMC_SDIO_H
-#define __INCLUDE_NUTTX_WIRELESS_IEEE80211_MMC_SDIO_H
-
-/****************************************************************************
- * Included Files
- ****************************************************************************/
-
-#include <stdint.h>
-#include <nuttx/sdio.h>
-
-#ifndef caca
-#define caca
-
-/****************************************************************************
- * Public Functions Definitions
- ****************************************************************************/
-
-int sdio_probe(FAR struct sdio_dev_s *dev);
-
-int sdio_set_wide_bus(struct sdio_dev_s *dev);
-
-int sdio_set_blocksize(FAR struct sdio_dev_s *dev, uint8_t function,
-                       uint16_t blocksize);
-
-int sdio_enable_function(FAR struct sdio_dev_s *dev, uint8_t function);
-
-int sdio_enable_interrupt(FAR struct sdio_dev_s *dev, uint8_t function);
-
-int sdio_sendcmdpoll(FAR struct sdio_dev_s *dev,
-                     uint32_t cmd, uint32_t arg);
-
-int sdio_io_rw_direct(FAR struct sdio_dev_s *dev, bool write,
-                      uint8_t function, uint32_t address,
-                      uint8_t inb, uint8_t *outb);
-
-int sdio_io_rw_extended(FAR struct sdio_dev_s *dev, bool write,
-                        uint8_t function, uint32_t address,
-                        bool inc_addr, uint8_t *buf,
-                        unsigned int blocklen, unsigned int nblocks);
-
-#endif
-
-#endif /* __INCLUDE_NUTTX_WIRELESS_IEEE80211_MMC_SDIO_H */