You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "davids5 (via GitHub)" <gi...@apache.org> on 2023/03/29 06:20:39 UTC

[GitHub] [nuttx] davids5 commented on a diff in pull request #8922: eMMC driver support

davids5 commented on code in PR #8922:
URL: https://github.com/apache/nuttx/pull/8922#discussion_r1151442701


##########
drivers/mmcsd/mmcsd_sdio.c:
##########
@@ -2464,16 +2469,22 @@ static void mmcsd_mediachange(FAR void *arg)
  *
  ****************************************************************************/
 
-static int mmcsd_widebus(FAR struct mmcsd_state_s *priv)
+static int mmcsd_widebus(FAR struct mmcsd_state_s *priv, bool wide)
 {
   int ret;
 
   /* Check if the SD card supports wide bus operation (as reported in the
    * SCR or in the SDIO driver capabililities)
    */
 
-  if ((priv->buswidth & MMCSD_SCR_BUSWIDTH_4BIT) != 0 &&
-      (priv->caps & SDIO_CAPS_1BIT_ONLY) == 0)
+  finfo("Setting BUS width to %s. Card type: %d\n",

Review Comment:
   This looks incorrect for several reasons.
   1. Removing the SDIO_CAPS_1BIT_ONLY is not expectable. It is a hardware trait. I can have a 4 bit interface and only wire 1 bit. This is set by Kconfig.
   2. mmcsd_widebus is changing to wide. The addition of the `wide` looks hack-ish.  
       How can this be better done?
   



-- 
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-unsubscribe@nuttx.apache.org

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