mmc: porting legacy tactices into 5.10
Change-Id: Ieb0e609f5cad4e889be6194f8fd8a54057a1174b Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
This commit is contained in:
@@ -2873,6 +2873,9 @@ static void mmc_blk_remove_debugfs(struct mmc_card *card,
|
||||
|
||||
#endif /* CONFIG_DEBUG_FS */
|
||||
|
||||
struct mmc_card *this_card;
|
||||
EXPORT_SYMBOL(this_card);
|
||||
|
||||
static int mmc_blk_probe(struct mmc_card *card)
|
||||
{
|
||||
struct mmc_blk_data *md, *part_md;
|
||||
@@ -2908,6 +2911,11 @@ static int mmc_blk_probe(struct mmc_card *card)
|
||||
|
||||
dev_set_drvdata(&card->dev, md);
|
||||
|
||||
#if defined(CONFIG_MMC_DW_ROCKCHIP) || defined(CONFIG_MMC_SDHCI_OF_ARASAN)
|
||||
if (card->type == MMC_TYPE_MMC)
|
||||
this_card = card;
|
||||
#endif
|
||||
|
||||
if (mmc_add_disk(md))
|
||||
goto out;
|
||||
|
||||
@@ -2944,6 +2952,12 @@ static void mmc_blk_remove(struct mmc_card *card)
|
||||
struct mmc_blk_data *md = dev_get_drvdata(&card->dev);
|
||||
|
||||
mmc_blk_remove_debugfs(card, md);
|
||||
|
||||
#if defined(CONFIG_MMC_DW_ROCKCHIP)
|
||||
if (card->type == MMC_TYPE_MMC)
|
||||
this_card = NULL;
|
||||
#endif
|
||||
|
||||
mmc_blk_remove_parts(card, md);
|
||||
pm_runtime_get_sync(&card->dev);
|
||||
if (md->part_curr != md->part_type) {
|
||||
|
||||
@@ -17,4 +17,6 @@ struct work_struct;
|
||||
|
||||
void mmc_blk_mq_complete_work(struct work_struct *work);
|
||||
|
||||
extern struct mmc_card *this_card;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -61,6 +61,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.o
|
||||
obj-$(CONFIG_MMC_DW_K3) += dw_mmc-k3.o
|
||||
obj-$(CONFIG_MMC_DW_PCI) += dw_mmc-pci.o
|
||||
obj-$(CONFIG_MMC_DW_ROCKCHIP) += dw_mmc-rockchip.o
|
||||
obj-$(CONFIG_MMC_DW_ROCKCHIP) += rk_sdmmc_ops.o
|
||||
obj-$(CONFIG_MMC_DW_ZX) += dw_mmc-zx.o
|
||||
obj-$(CONFIG_MMC_SH_MMCIF) += sh_mmcif.o
|
||||
obj-$(CONFIG_MMC_JZ4740) += jz4740_mmc.o
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
#include <linux/seq_file.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/miscdevice.h>
|
||||
#include <linux/module.h>
|
||||
#include "../core/block.h"
|
||||
#include "../core/card.h"
|
||||
#include "../core/core.h"
|
||||
#include "../core/mmc_ops.h"
|
||||
#include "rk_sdmmc_ops.h"
|
||||
|
||||
#define BLKSZ 512
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
/*
|
||||
* Copyright (C) 2021 Rockchip Inc.
|
||||
*/
|
||||
|
||||
#ifndef _RK_SDMMC_OPS_H_
|
||||
#define _RK_SDMMC_OPS_H_
|
||||
|
||||
int rk_emmc_transfer(u8 *buffer, unsigned int addr, unsigned int blksz, int write);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user