From patchwork Thu Apr 5 20:19:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 132891 Delivered-To: patches@linaro.org Received: by 10.46.84.29 with SMTP id i29csp6712617ljb; Thu, 5 Apr 2018 13:20:17 -0700 (PDT) X-Received: by 10.46.131.86 with SMTP id l22mr12117105ljh.82.1522959616865; Thu, 05 Apr 2018 13:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522959616; cv=none; d=google.com; s=arc-20160816; b=YYS6SzQ4HQs9vXm33dURcm/PlgSQZl7jAs4Ia8hWT+U75Gy/v1A15+9dpDyP0wTGm7 g7uaunD6V+q3kii23kA3l+KXDc68a4Ggs7Nu6rLR5bQBomrPhIWRk1w2GB5uoctXpeXD VyVAR/YRJ1k3T8F62WzM2QHJ9Y5KmzINQPcBrUHhP8cydYN8lnGU7AvoWfFI7UWfCqIS EJ0OmnfIL3nQVuO1Hx8JALAgy5MxPm0Rb+/wZz+yqdIKYmduTe35/ahZSgNAeSHWe0rT uqZ6rpx145uilY9IYcgfOjuUSz3LMMafJYrecyxt3QwpJ1ye7FLDDbL2lMvvSL1Q5aQF bYtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=52tzABuodpZcB+ctMAWGAnP3SmQEmLuAxhIk0ERWGk8=; b=nL3Jc9p2wCBFS9J8JU5rufg2Idfh8QLwc2hROrrxKdKweX08qlMzU3zFujUjrYgT+B mv8SoEnGRESrcGiIrEh0e+VMFfJ50qwRi0iSpdVpWpypdRWKh4+HSRjoZ8122eKSI1Uu nKBjEGwev+dXoWxfpxD1LaD2mBUGRKf2btHySqp69UQrCYeY/T5Xbb3N/UC2mVDqXu74 oYASjRkNNXIT1m0sSJcP1IxBA4p0G/88IwcPDGbV/iCjG4s+b4qBunH4lyvzXYKrHb5S DuIrpVNdHDaFfhB/6Btir4mgKVtl7NEJQELd5fy2/3Lne4cEYKLLYa2B8Fh5OAlDZKDr je8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F1rQuhIv; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v23sor2159010ljc.114.2018.04.05.13.20.16 for (Google Transport Security); Thu, 05 Apr 2018 13:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=F1rQuhIv; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=52tzABuodpZcB+ctMAWGAnP3SmQEmLuAxhIk0ERWGk8=; b=F1rQuhIvouOrYJX5xEhK5YoZQM/jrX8tsupZwsxWwfAdsEBi5b+K1tZdlBFzPGY4oO ExxsOt7Pvssbz5kgGrJio4KmN1LiTJzY01m3YqBO2TgPqMhyqBWYxTUYtSRtxOFb6odd JS7UOb50UXFaUrAUxicgRpWOGDqIUvrTwNHjE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=52tzABuodpZcB+ctMAWGAnP3SmQEmLuAxhIk0ERWGk8=; b=H2OsOkyzCmJFDyZbnr5Ad4rCJ0ME0QIzkNY24r7HzPHfl8mBasjT2wqQ1DPgMLa/3E X+G/BIHT76cqk9iEUrXWYlgWHqI3Pv3EB/fhcA5P5TciCGKlJJ9IMDIBtYSt5HM2J2jp 9/+FWgNK5mOCnVXPK6bO4TJYo40Inb160SUnIoeSaUwqovo0qNPrvyfm3G5ruTdYHLSs Ey+o78AuwD7EuoKn6J245RLOTHFyGIPJV9vF1Ts0LfRZly5iF2XoMj4UUH1dAQ8VIZ1N rQPiktaqyLxWYm6IORuz0uJ+ihlU3OWheQl65nk9/YUlU0c2BVnfKyWCjoU8hfDEYbcp 26wA== X-Gm-Message-State: ALQs6tCG1jgVeZk/kfmJ9eesONklxRYW8D+os9BDCE/bhA/x1F0kS0DK XqG9tmz/ncMszrGpl3Z50vnqR/Lz X-Google-Smtp-Source: AIpwx48LtnwiCCl0teXnPKyJfQeedY7y/kAuYI5na0jH1oQ1Vylj/hHPExR7xxu6bSt8zhPslU4ldA== X-Received: by 10.46.25.28 with SMTP id p28mr7817780lje.127.1522959616658; Thu, 05 Apr 2018 13:20:16 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-158-174-22-210.NA.cust.bahnhof.se. [158.174.22.210]) by smtp.gmail.com with ESMTPSA id h66-v6sm1687533lfi.89.2018.04.05.13.20.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 05 Apr 2018 13:20:16 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Adrian Hunter , Brian Norris , Shawn Lin , Doug Anderson , Hans de Goede , Quentin Schulz Subject: [PATCH 5/5] mmc: core: Implement ->sw_reset bus ops for SDIO Date: Thu, 5 Apr 2018 22:19:54 +0200 Message-Id: <1522959594-3411-6-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1522959594-3411-1-git-send-email-ulf.hansson@linaro.org> References: <1522959594-3411-1-git-send-email-ulf.hansson@linaro.org> Let's implement the ->sw_reset() bus ops to allow SDIO func drivers, in particular, to make a SW reset without doing a full power cycle of the SDIO card. Signed-off-by: Ulf Hansson --- drivers/mmc/core/sdio.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.7.4 diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c index 0124e0e..088c80c 100644 --- a/drivers/mmc/core/sdio.c +++ b/drivers/mmc/core/sdio.c @@ -1044,6 +1044,18 @@ static int mmc_sdio_hw_reset(struct mmc_host *host) return mmc_sdio_power_restore(host); } +static int mmc_sdio_sw_reset(struct mmc_host *host) +{ + mmc_set_clock(host, host->f_init); + sdio_reset(host); + mmc_go_idle(host); + + mmc_set_initial_state(host); + mmc_set_initial_signal_voltage(host); + + return mmc_sdio_reinit_card(host, 0); +} + static const struct mmc_bus_ops mmc_sdio_ops = { .remove = mmc_sdio_remove, .detect = mmc_sdio_detect, @@ -1055,6 +1067,7 @@ static const struct mmc_bus_ops mmc_sdio_ops = { .power_restore = mmc_sdio_power_restore, .alive = mmc_sdio_alive, .hw_reset = mmc_sdio_hw_reset, + .sw_reset = mmc_sdio_sw_reset, };