ANDROID: mmc: core: Export core functions for kernel modules usage

Export core functions for kernel modules usage.

Bug: 343311916
Link:
https://patchwork.kernel.org/project/linux-mmc/patch/20230401165723.19762-3-quic_sartgarg@quicinc.com/

Change-Id: Ia7904a5da3207e6f39590e092a7805e5260cd752
Signed-off-by: Sarthak Garg <quic_sartgarg@quicinc.com>
This commit is contained in:
Sarthak Garg 2023-03-26 17:30:26 +05:30 committed by Carlos Llamas
parent 46fb90cb69
commit 75892d27bc
5 changed files with 21 additions and 6 deletions

View File

@ -921,6 +921,7 @@ void mmc_set_clock(struct mmc_host *host, unsigned int hz)
host->ios.clock = hz; host->ios.clock = hz;
mmc_set_ios(host); mmc_set_ios(host);
} }
EXPORT_SYMBOL_GPL(mmc_set_clock);
int mmc_execute_tuning(struct mmc_card *card) int mmc_execute_tuning(struct mmc_card *card)
{ {
@ -955,6 +956,7 @@ int mmc_execute_tuning(struct mmc_card *card)
return err; return err;
} }
EXPORT_SYMBOL_GPL(mmc_execute_tuning);
/* /*
* Change the bus mode (open drain/push-pull) of a host. * Change the bus mode (open drain/push-pull) of a host.
@ -964,6 +966,7 @@ void mmc_set_bus_mode(struct mmc_host *host, unsigned int mode)
host->ios.bus_mode = mode; host->ios.bus_mode = mode;
mmc_set_ios(host); mmc_set_ios(host);
} }
EXPORT_SYMBOL_GPL(mmc_set_bus_mode);
/* /*
* Change data bus width of a host. * Change data bus width of a host.
@ -973,6 +976,7 @@ void mmc_set_bus_width(struct mmc_host *host, unsigned int width)
host->ios.bus_width = width; host->ios.bus_width = width;
mmc_set_ios(host); mmc_set_ios(host);
} }
EXPORT_SYMBOL_GPL(mmc_set_bus_width);
/* /*
* Set initial state after a power cycle or a hw_reset. * Set initial state after a power cycle or a hw_reset.
@ -1006,6 +1010,7 @@ void mmc_set_initial_state(struct mmc_host *host)
mmc_crypto_set_initial_state(host); mmc_crypto_set_initial_state(host);
} }
EXPORT_SYMBOL_GPL(mmc_set_initial_state);
/** /**
* mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number * mmc_vdd_to_ocrbitnum - Convert a voltage to the OCR bit number
@ -1275,6 +1280,7 @@ void mmc_set_timing(struct mmc_host *host, unsigned int timing)
host->ios.timing = timing; host->ios.timing = timing;
mmc_set_ios(host); mmc_set_ios(host);
} }
EXPORT_SYMBOL_GPL(mmc_set_timing);
/* /*
* Select appropriate driver type for host. * Select appropriate driver type for host.

View File

@ -166,6 +166,7 @@ void mmc_retune_hold(struct mmc_host *host)
host->retune_now = 1; host->retune_now = 1;
host->hold_retune += 1; host->hold_retune += 1;
} }
EXPORT_SYMBOL(mmc_retune_hold);
void mmc_retune_release(struct mmc_host *host) void mmc_retune_release(struct mmc_host *host)
{ {

View File

@ -1002,7 +1002,7 @@ static void mmc_set_bus_speed(struct mmc_card *card)
* If the bus width is changed successfully, return the selected width value. * If the bus width is changed successfully, return the selected width value.
* Zero is returned instead of error value if the wide width is not supported. * Zero is returned instead of error value if the wide width is not supported.
*/ */
static int mmc_select_bus_width(struct mmc_card *card) int mmc_select_bus_width(struct mmc_card *card)
{ {
static unsigned ext_csd_bits[] = { static unsigned ext_csd_bits[] = {
EXT_CSD_BUS_WIDTH_8, EXT_CSD_BUS_WIDTH_8,
@ -1069,11 +1069,12 @@ static int mmc_select_bus_width(struct mmc_card *card)
return err; return err;
} }
EXPORT_SYMBOL_GPL(mmc_select_bus_width);
/* /*
* Switch to the high-speed mode * Switch to the high-speed mode
*/ */
static int mmc_select_hs(struct mmc_card *card) int mmc_select_hs(struct mmc_card *card)
{ {
int err; int err;
@ -1087,11 +1088,12 @@ static int mmc_select_hs(struct mmc_card *card)
return err; return err;
} }
EXPORT_SYMBOL_GPL(mmc_select_hs);
/* /*
* Activate wide bus and DDR if supported. * Activate wide bus and DDR if supported.
*/ */
static int mmc_select_hs_ddr(struct mmc_card *card) int mmc_select_hs_ddr(struct mmc_card *card)
{ {
struct mmc_host *host = card->host; struct mmc_host *host = card->host;
u32 bus_width, ext_csd_bits; u32 bus_width, ext_csd_bits;
@ -1160,8 +1162,9 @@ static int mmc_select_hs_ddr(struct mmc_card *card)
return err; return err;
} }
EXPORT_SYMBOL_GPL(mmc_select_hs_ddr);
static int mmc_select_hs400(struct mmc_card *card) int mmc_select_hs400(struct mmc_card *card)
{ {
struct mmc_host *host = card->host; struct mmc_host *host = card->host;
unsigned int max_dtr; unsigned int max_dtr;
@ -1255,6 +1258,7 @@ out_err:
__func__, err); __func__, err);
return err; return err;
} }
EXPORT_SYMBOL_GPL(mmc_select_hs400);
int mmc_hs200_to_hs400(struct mmc_card *card) int mmc_hs200_to_hs400(struct mmc_card *card)
{ {
@ -1535,7 +1539,7 @@ err:
/* /*
* Activate High Speed, HS200 or HS400ES mode if supported. * Activate High Speed, HS200 or HS400ES mode if supported.
*/ */
static int mmc_select_timing(struct mmc_card *card) int mmc_select_timing(struct mmc_card *card)
{ {
int err = 0; int err = 0;
@ -1570,12 +1574,13 @@ bus_speed:
mmc_set_bus_speed(card); mmc_set_bus_speed(card);
return 0; return 0;
} }
EXPORT_SYMBOL_GPL(mmc_select_timing);
/* /*
* Execute tuning sequence to seek the proper bus operating * Execute tuning sequence to seek the proper bus operating
* conditions for HS200 and HS400, which sends CMD21 to the device. * conditions for HS200 and HS400, which sends CMD21 to the device.
*/ */
static int mmc_hs200_tuning(struct mmc_card *card) int mmc_hs200_tuning(struct mmc_card *card)
{ {
struct mmc_host *host = card->host; struct mmc_host *host = card->host;
@ -1590,6 +1595,7 @@ static int mmc_hs200_tuning(struct mmc_card *card)
return mmc_execute_tuning(card); return mmc_execute_tuning(card);
} }
EXPORT_SYMBOL_GPL(mmc_hs200_tuning);
/* /*
* Handle the detection and initialisation of a card. * Handle the detection and initialisation of a card.

View File

@ -118,6 +118,7 @@ int mmc_select_card(struct mmc_card *card)
return _mmc_select_card(card->host, card); return _mmc_select_card(card->host, card);
} }
EXPORT_SYMBOL_GPL(mmc_select_card);
int mmc_deselect_cards(struct mmc_host *host) int mmc_deselect_cards(struct mmc_host *host)
{ {

View File

@ -69,6 +69,7 @@ enum mmc_issue_type mmc_issue_type(struct mmc_queue *mq, struct request *req)
return MMC_ISSUE_SYNC; return MMC_ISSUE_SYNC;
} }
EXPORT_SYMBOL_GPL(mmc_issue_type);
static void __mmc_cqe_recovery_notifier(struct mmc_queue *mq) static void __mmc_cqe_recovery_notifier(struct mmc_queue *mq)
{ {