Add capabilities() method to SDIO interface. Remove CONFIG_SDIO_WIDTH_D1_ONLY. That should not be a global propertie, but rather a capability/limitation of single slot when there may be multiple slots.

This commit is contained in:
Gregory Nutt
2017-01-31 09:16:01 -06:00
parent 4c39b68505
commit 9ac00a355f
59 changed files with 198 additions and 118 deletions
-8
View File
@@ -42,14 +42,6 @@
#include <nuttx/config.h>
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
/****************************************************************************
* Public Types
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
+38 -2
View File
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/sdio.h
*
* Copyright (C) 2009, 2011-2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2009, 2011-2013, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -362,6 +362,28 @@
#define SDIO_RESET(dev) ((dev)->reset(dev))
/****************************************************************************
* Name: SDIO_CAPABILITIES
*
* Description:
* Get capabilities (and limitations) of the SDIO driver (optional)
*
* Input Parameters:
* dev - Device-specific state data
*
* Returned Value:
* Returns a bitset of status values (see SDIO_CAPS_* defines)
*
****************************************************************************/
#define SDIO_CAPABILITIES(dev) \
(((dev)->status != NULL) ? (dev)->capabilities(dev) : 0)
/* SDIO capability bits */
#define SDIO_CAPS_1BIT_ONLY 0x01 /* Bit 0=1: Supports only 1-bit operation */
/****************************************************************************
* Name: SDIO_STATUS
*
@@ -820,6 +842,19 @@ enum sdio_clock_e
typedef uint8_t sdio_eventset_t;
/* Capabilities set. A uint8_t is big enough to hold a set of
* 8-capabilities/limitations. If more are needed, change this to a
* uint16_t.
*/
typedef uint8_t sdio_capset_t;
/* Status set. A uint8_t is big enough to hold a set of 8 status bits.
* If more are needed, change this to a uint16_t.
*/
typedef uint8_t sdio_statset_t;
/* This structure defines the interface between the NuttX SDIO driver and
* the chip- or board-specific SDIO interface. This interface is only used
* in architectures that support SDIO 1- or 4-bit data buses. For SDIO
@@ -842,7 +877,8 @@ struct sdio_dev_s
/* Initialization/setup */
void (*reset)(FAR struct sdio_dev_s *dev);
uint8_t (*status)(FAR struct sdio_dev_s *dev);
sdio_capset_t (*capabilities)(FAR struct sdio_dev_s *dev);
sdio_statset_t (*status)(FAR struct sdio_dev_s *dev);
void (*widebus)(FAR struct sdio_dev_s *dev, bool enable);
void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);
int (*attach)(FAR struct sdio_dev_s *dev);