From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761588Ab3JPWUK (ORCPT ); Wed, 16 Oct 2013 18:20:10 -0400 Received: from top.free-electrons.com ([176.31.233.9]:47683 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755830Ab3JPWUI (ORCPT ); Wed, 16 Oct 2013 18:20:08 -0400 From: Alexandre Belloni To: Ludovic Desroches Cc: Chris Ball , linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCHv2] mmc: atmel-mci: add vmmc-supply support Date: Thu, 17 Oct 2013 00:19:59 +0200 Message-Id: <1381961999-8187-1-git-send-email-alexandre.belloni@free-electrons.com> X-Mailer: git-send-email 1.8.1.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Other MMC hosts handle a regulator named vmmc-supply that allows to power the MMC card or SDIO device before communicating on the bus. Signed-off-by: Alexandre Belloni --- Changes in v2: - use mmc_regulator_get_supply instead of devm_regulator_get drivers/mmc/host/atmel-mci.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 69e438e..4ea5333 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -2198,6 +2199,14 @@ static int __init atmci_init_slot(struct atmel_mci *host, host->slot[id] = slot; mmc_add_host(mmc); + mmc_regulator_get_supply(mmc); + if (!IS_ERR(mmc->supply.vmmc)) { + int ret = regulator_enable(mmc->supply.vmmc); + if (ret) + dev_err(&mmc->class_dev, + "failed to enable regulator: %d\n", ret); + } + if (gpio_is_valid(slot->detect_pin)) { int ret; -- 1.8.1.2