rtucker85 commented on a change in pull request #5835:
URL: https://github.com/apache/incubator-nuttx/pull/5835#discussion_r836909191



##########
File path: arch/risc-v/src/litex/litex_sdio.c
##########
@@ -0,0 +1,1487 @@
+/****************************************************************************
+ * arch/risc-v/src/litex/litex_sdio.c
+ *
+ * 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.
+ *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Included Files
+ ****************************************************************************/
+
+#include <nuttx/config.h>
+
+#include <assert.h>
+#include <debug.h>
+#include <errno.h>
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdint.h>
+#include <string.h>
+
+#include <nuttx/arch.h>
+#include <nuttx/cache.h>
+#include <nuttx/clock.h>
+#include <nuttx/mmcsd.h>
+#include <nuttx/sdio.h>
+#include <nuttx/semaphore.h>
+#include <nuttx/signal.h>
+#include <nuttx/wdog.h>
+#include <nuttx/wqueue.h>
+
+#include <nuttx/irq.h>
+#include <arch/board/board.h>
+
+#include "chip.h"
+#include "riscv_internal.h"
+
+#include "litex_sdio.h"
+#include "litex_clockconfig.h"
+#include "hardware/litex_sdio.h"
+
+/****************************************************************************
+ * Pre-processor Definitions
+ ****************************************************************************/
+
+#define SD_CTL_DATA_XFER_NONE           0
+#define SD_CTL_DATA_XFER_READ           1
+#define SD_CTL_DATA_XFER_WRITE          2
+
+#define SDCARD_CTRL_RESPONSE_NONE       0
+#define SDCARD_CTRL_RESPONSE_SHORT      1
+#define SDCARD_CTRL_RESPONSE_LONG       2
+
+#define LITEX_INT_CARDDETECT            (1 << 0)
+#define LITEX_INT_BLOCK2MEM             (1 << 1)
+#define LITEX_INT_MEM2BLOCK             (1 << 2)
+#define LITEX_INT_CMDDONE               (1 << 3)
+
+#define LITEX_EV_CMDDONE                (1 << 0)
+#define LITEX_EV_WRERROR                (1 << 1)
+#define LITEX_EV_TIMEOUT                (1 << 2)
+#define LITEX_EV_CRCERROR               (1 << 3)
+
+#define MAX_DIVIDER                     256
+
+#ifndef CONFIG_LITEX_IDMODE_FREQ
+#  define CONFIG_LITEX_IDMODE_FREQ 400000    /* 400 KHz, ID mode */
+#endif
+
+#ifndef CONFIG_LITEX_MMCXFR_FREQ
+#  define CONFIG_LITEX_MMCXFR_FREQ 25000000  /* 25MHz MMC, normal clocking */
+#endif
+
+#ifndef CONFIG_LITEX_SD4BIT_FREQ
+#  define CONFIG_LITEX_SD4BIT_FREQ 50000000  /* 25MHz SD 4-bit, normal 
clocking */
+#endif
+
+#define max(x, y) (((x) > (y)) ? (x) : (y))
+#define min(x, y) (((x) < (y)) ? (x) : (y))
+
+/****************************************************************************
+ * Private Types
+ ****************************************************************************/
+
+struct litex_dev_s
+{
+  struct sdio_dev_s  dev;             /* Standard, base SDIO interface */
+
+  /* Event support */
+
+  sem_t              waitsem;         /* Implements event waiting */
+  sdio_eventset_t    waitevents;      /* Set of events to be waited for */
+  uint32_t           waitints;        /* Interrupt enables for event waiting */
+  volatile sdio_eventset_t wkupevent; /* The event that caused the wakeup */
+  struct wdog_s      waitwdog;        /* Watchdog that handles event timeouts 
*/
+
+  /* Callback support */
+
+  sdio_statset_t     cdstatus;        /* Card status */
+  sdio_eventset_t    cbevents;        /* Set of events to be cause callbacks */
+  worker_t           callback;        /* Registered callback function */
+  void              *cbarg;           /* Registered callback argument */
+  struct work_s      cbwork;          /* Callback work queue structure */
+
+  /* Interrupt mode data transfer support */
+
+  uint32_t           xfrints;         /* Interrupt enables for data transfer */
+
+  /* Card interrupt support for SDIO */
+
+  uint32_t           cintints;                /* Interrupt enables for card 
ints */
+  int               (*do_sdio_card)(void *);  /* SDIO card ISR */

Review comment:
       Good point, we dont. The return value has been removed. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to