+// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2015 Google, Inc
* Written by Simon Glass <sjg@chromium.org>
- *
- * SPDX-License-Identifier: GPL-2.0+
*/
#include <common.h>
#include <dm/lists.h>
#include "mmc_private.h"
-DECLARE_GLOBAL_DATA_PTR;
-
int dm_mmc_send_cmd(struct udevice *dev, struct mmc_cmd *cmd,
struct mmc_data *data)
{
cfg->host_caps |= MMC_MODE_1BIT;
break;
default:
- debug("warning: %s invalid bus-width property. using 1-bit\n",
- dev_read_name(dev));
- cfg->host_caps |= MMC_MODE_1BIT;
- break;
+ dev_err(dev, "Invalid \"bus-width\" value %u!\n", val);
+ return -EINVAL;
}
- cfg->f_max = dev_read_u32_default(dev, "max-frequency", 52000000);
+ /* f_max is obtained from the optional "max-frequency" property */
+ dev_read_u32(dev, "max-frequency", &cfg->f_max);
if (dev_read_bool(dev, "cap-sd-highspeed"))
cfg->host_caps |= MMC_CAP(SD_HS);