From e7ecf7cb5a6b873daf2d88daf03034d51fad4acc Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Tue, 23 Jun 2015 15:38:48 -0600 Subject: dm: mmc: Add an MMC uclass Add basic support for MMC, providing a uclass which can set up an MMC device. This allows MMC drivers to move to using driver model. Signed-off-by: Simon Glass --- include/dm/uclass-id.h | 1 + include/mmc.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+) (limited to 'include') diff --git a/include/dm/uclass-id.h b/include/dm/uclass-id.h index a961648..cba7c0a 100644 --- a/include/dm/uclass-id.h +++ b/include/dm/uclass-id.h @@ -36,6 +36,7 @@ enum uclass_id { UCLASS_LED, /* Light-emitting diode (LED) */ UCLASS_LPC, /* x86 'low pin count' interface */ UCLASS_MASS_STORAGE, /* Mass storage device */ + UCLASS_MMC, /* SD / MMC card or chip */ UCLASS_MOD_EXP, /* RSA Mod Exp device */ UCLASS_PCH, /* x86 platform controller hub */ UCLASS_PCI, /* PCI bus */ diff --git a/include/mmc.h b/include/mmc.h index dd98b3b..cda9a19 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -266,6 +266,28 @@ #define MMC_NUM_BOOT_PARTITION 2 #define MMC_PART_RPMB 3 /* RPMB partition number */ +/* Driver model support */ + +/** + * struct mmc_uclass_priv - Holds information about a device used by the uclass + */ +struct mmc_uclass_priv { + struct mmc *mmc; +}; + +/** + * mmc_get_mmc_dev() - get the MMC struct pointer for a device + * + * Provided that the device is already probed and ready for use, this value + * will be available. + * + * @dev: Device + * @return associated mmc struct pointer if available, else NULL + */ +struct mmc *mmc_get_mmc_dev(struct udevice *dev); + +/* End of driver model support */ + struct mmc_cid { unsigned long psn; unsigned short oid; -- cgit v1.1