sdio: Move sdio utils functions to drivers/mmcsd

so all sdio client driver can reuse them

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-01-04 16:28:19 +08:00 committed by Abdelatif Guettouche
parent 3a0e86c99b
commit 828f04f0e5
6 changed files with 27 additions and 68 deletions

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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>

View File

@ -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"

View File

@ -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 */