blob: 777489f5d8e9c63750849d91b78c55f572054db4 [file] [log] [blame]
Simon Glass1e8eb1b2015-06-23 15:38:48 -06001/*
2 * Copyright (C) 2015 Google, Inc
3 * Written by Simon Glass <sjg@chromium.org>
4 *
5 * SPDX-License-Identifier: GPL-2.0+
6 */
7
8#include <common.h>
9#include <mmc.h>
10#include <dm.h>
11#include <dm/lists.h>
12#include <dm/root.h>
13
14struct mmc *mmc_get_mmc_dev(struct udevice *dev)
15{
16 struct mmc_uclass_priv *upriv;
17
18 if (!device_active(dev))
19 return NULL;
20 upriv = dev_get_uclass_priv(dev);
21 return upriv->mmc;
22}
23
24U_BOOT_DRIVER(mmc) = {
25 .name = "mmc",
26 .id = UCLASS_MMC,
27};
28
29UCLASS_DRIVER(mmc) = {
30 .id = UCLASS_MMC,
31 .name = "mmc",
32 .flags = DM_UC_FLAG_SEQ_ALIAS,
33 .per_device_auto_alloc_size = sizeof(struct mmc_uclass_priv),
34};