aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorAdrian Hunter <adrian.hunter@intel.com>2011-08-29 09:42:14 -0400
committerChris Ball <cjb@laptop.org>2011-10-26 16:32:07 -0400
commit2311344c33cb8add492881900ca427b62f5a7eae (patch)
tree081fdccc56181878b8feca59088bb8622d0d309e /drivers/mmc/card
parent0f2016558e4f9a8d2f9b1202064915205f4dd450 (diff)
mmc: mmc-test: add eMMC hardware reset test
MMC core provides a checking function that checks if the reset has happended. Add a test to use that function. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/mmc_test.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/mmc/card/mmc_test.c b/drivers/mmc/card/mmc_test.c
index 2bf229acd3b8..9cdce6367136 100644
--- a/drivers/mmc/card/mmc_test.c
+++ b/drivers/mmc/card/mmc_test.c
@@ -2328,6 +2328,31 @@ static int mmc_test_profile_sglen_r_nonblock_perf(struct mmc_test_card *test)
2328 return mmc_test_rw_multiple_sg_len(test, &test_data); 2328 return mmc_test_rw_multiple_sg_len(test, &test_data);
2329} 2329}
2330 2330
2331/*
2332 * eMMC hardware reset.
2333 */
2334static int mmc_test_hw_reset(struct mmc_test_card *test)
2335{
2336 struct mmc_card *card = test->card;
2337 struct mmc_host *host = card->host;
2338 int err;
2339
2340 err = mmc_hw_reset_check(host);
2341 if (!err)
2342 return RESULT_OK;
2343
2344 if (err == -ENOSYS)
2345 return RESULT_FAIL;
2346
2347 if (err != -EOPNOTSUPP)
2348 return err;
2349
2350 if (!mmc_can_reset(card))
2351 return RESULT_UNSUP_CARD;
2352
2353 return RESULT_UNSUP_HOST;
2354}
2355
2331static const struct mmc_test_case mmc_test_cases[] = { 2356static const struct mmc_test_case mmc_test_cases[] = {
2332 { 2357 {
2333 .name = "Basic write (no data verification)", 2358 .name = "Basic write (no data verification)",
@@ -2650,6 +2675,11 @@ static const struct mmc_test_case mmc_test_cases[] = {
2650 .run = mmc_test_profile_sglen_r_nonblock_perf, 2675 .run = mmc_test_profile_sglen_r_nonblock_perf,
2651 .cleanup = mmc_test_area_cleanup, 2676 .cleanup = mmc_test_area_cleanup,
2652 }, 2677 },
2678
2679 {
2680 .name = "eMMC hardware reset",
2681 .run = mmc_test_hw_reset,
2682 },
2653}; 2683};
2654 2684
2655static DEFINE_MUTEX(mmc_test_lock); 2685static DEFINE_MUTEX(mmc_test_lock);