From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753226AbdK1ADI (ORCPT ); Mon, 27 Nov 2017 19:03:08 -0500 Received: from mail-wr0-f195.google.com ([209.85.128.195]:43427 "EHLO mail-wr0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752988AbdK1ADF (ORCPT ); Mon, 27 Nov 2017 19:03:05 -0500 X-Google-Smtp-Source: AGs4zMYK+s/76tJ7Qsm2WRupNTwlWys5E10n5X+0YwC9xyhjvWyeuwf811FqUCRcp+po9umslXYcug== From: Milan Stevanovic To: michal.simek@xilinx.com, adrian.hunter@intel.com, ulf.hansson@linaro.org Cc: linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, milan.o.stevanovic@gmail.com Subject: [PATCH] mmc: sdhci-of-arasan: Add sdhci_arasan_set_power Date: Tue, 28 Nov 2017 01:02:57 +0100 Message-Id: <1511827377-2021-1-git-send-email-milan.o.stevanovic@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The power register needs to have a valid voltage set even when the power supply is managed by an external regulator. Signed-off-by: Milan Stevanovic --- drivers/mmc/host/sdhci-of-arasan.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/mmc/host/sdhci-of-arasan.c b/drivers/mmc/host/sdhci-of-arasan.c index 0720ea7..fb57206 100644 --- a/drivers/mmc/host/sdhci-of-arasan.c +++ b/drivers/mmc/host/sdhci-of-arasan.c @@ -262,6 +262,17 @@ static int sdhci_arasan_voltage_switch(struct mmc_host *mmc, return -EINVAL; } +static void sdhci_arasan_set_power(struct sdhci_host *host, unsigned char mode, + unsigned short vdd) +{ + if (!IS_ERR(host->mmc->supply.vmmc)) { + struct mmc_host *mmc = host->mmc; + + mmc_regulator_set_ocr(mmc, mmc->supply.vmmc, vdd); + } + sdhci_set_power_noreg(host, mode, vdd); +} + static const struct sdhci_ops sdhci_arasan_ops = { .set_clock = sdhci_arasan_set_clock, .get_max_clock = sdhci_pltfm_clk_get_max_clock, @@ -269,6 +280,7 @@ static const struct sdhci_ops sdhci_arasan_ops = { .set_bus_width = sdhci_set_bus_width, .reset = sdhci_arasan_reset, .set_uhs_signaling = sdhci_set_uhs_signaling, + .set_power = sdhci_arasan_set_power, }; static const struct sdhci_pltfm_data sdhci_arasan_pdata = { -- 2.7.4