From patchwork Mon Mar 30 05:24:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 244515 List-Id: U-Boot discussion From: xypron.glpk at gmx.de (Heinrich Schuchardt) Date: Mon, 30 Mar 2020 07:24:17 +0200 Subject: [PATCH 2/4] mmc: export mmc_send_ext_csd() In-Reply-To: <20200330052419.3804-1-xypron.glpk@gmx.de> References: <20200330052419.3804-1-xypron.glpk@gmx.de> Message-ID: <20200330052419.3804-3-xypron.glpk@gmx.de> Export function mmc_send_ext_csd() for reading the extended CSD register. Signed-off-by: Heinrich Schuchardt --- drivers/mmc/mmc.c | 2 +- include/mmc.h | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) -- 2.25.1 diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 3e36566693..bfcdaa665d 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -718,7 +718,7 @@ static int mmc_complete_op_cond(struct mmc *mmc) } -static int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd) +int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd) { struct mmc_cmd cmd; struct mmc_data data; diff --git a/include/mmc.h b/include/mmc.h index 4ecd6c744c..85fc3497a1 100644 --- a/include/mmc.h +++ b/include/mmc.h @@ -896,6 +896,17 @@ int mmc_get_env_dev(void); */ struct blk_desc *mmc_get_blk_desc(struct mmc *mmc); +/** + * mmc_send_ext_csd() - read the extended CSD register + * + * @mmc: MMC device + * @ext_csd a cache aligned buffer of length MMC_MAX_BLOCK_LEN allocated by + * the caller, e.g. using + * ALLOC_CACHE_ALIGN_BUFFER(u8, ext_csd, MMC_MAX_BLOCK_LEN) + * Return: 0 for success + */ +int mmc_send_ext_csd(struct mmc *mmc, u8 *ext_csd); + static inline enum dma_data_direction mmc_get_dma_dir(struct mmc_data *data) { return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE;