From patchwork Wed Jan 30 08:59:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Liu X-Patchwork-Id: 2066351 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 9A4CB3FE4B for ; Wed, 30 Jan 2013 08:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752422Ab3A3I7T (ORCPT ); Wed, 30 Jan 2013 03:59:19 -0500 Received: from na3sys009aog111.obsmtp.com ([74.125.149.205]:36351 "EHLO na3sys009aog111.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753393Ab3A3I7S (ORCPT ); Wed, 30 Jan 2013 03:59:18 -0500 Received: from MSI-MTA.marvell.com ([65.219.4.132]) (using TLSv1) by na3sys009aob111.postini.com ([74.125.148.12]) with SMTP ID DSNKUQjg0huKMM3+ojV0eAwfc4yyzmMuuReU@postini.com; Wed, 30 Jan 2013 00:59:18 PST Received: from maili.marvell.com ([10.68.76.210]) by MSI-MTA.marvell.com with Microsoft SMTPSVC(6.0.3790.4675); Wed, 30 Jan 2013 00:58:54 -0800 Received: from kliu5-desktop.marvell.com (unknown [10.38.36.240]) by maili.marvell.com (Postfix) with ESMTP id 48BEA4E517; Wed, 30 Jan 2013 00:58:49 -0800 (PST) From: Kevin Liu To: linux-mmc@vger.kernel.org, Chris Ball , Sujit Reddy Thumma , Jaehoon Chung , Andy Shevchenko , Aaron Lu , Ulf Hansson , Alexander Stein Cc: Nicolas Pitre , Adrian Hunter , Philip Rakity , Shawn Guo , Johan Rudholm , Daniel Drake , Guennadi Liakhovetski , Jerry Huang , Girish K S , Haijun Zhang , Viresh Kumar , Heiko Stuebner , Thomas Abraham , Chander Kashyap , Sebastian Hesselbarth , Zhangfei Gao , Haojian Zhuang , Chao Xie , Kevin Liu , Kevin Liu , Philip Rakity Subject: [PATCH 6/7] mmc: sdhci: add regulator notifier for vqmmc Date: Wed, 30 Jan 2013 16:59:47 +0800 Message-Id: <1359536388-7896-7-git-send-email-kliu5@marvell.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1359536388-7896-1-git-send-email-kliu5@marvell.com> References: <1359536388-7896-1-git-send-email-kliu5@marvell.com> X-OriginalArrivalTime: 30 Jan 2013 08:58:54.0210 (UTC) FILETIME=[07D7A620:01CDFEC8] Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org Some soc/platform need specific handling for signal voltage switch. For example, mmp2/mmp3 need to set the AIB IO domain control register accordingly. Use regulator notifier to do this. Signed-off-by: Philip Rakity Signed-off-by: Kevin Liu --- drivers/mmc/host/sdhci.c | 6 ++++++ include/linux/mmc/sdhci.h | 1 + 2 files changed, 7 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 81a4bfa..107ac15 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -2944,6 +2944,9 @@ int sdhci_add_host(struct sdhci_host *host) caps[1] &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50); + if (host->nb_vqmmc) + regulator_register_notifier(host->vqmmc, + host->nb_vqmmc); } if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) @@ -3265,6 +3268,9 @@ void sdhci_remove_host(struct sdhci_host *host, int dead) } if (host->vqmmc) { + if (host->nb_vqmmc) + regulator_unregister_notifier(host->vqmmc, + host->nb_vqmmc); regulator_disable(host->vqmmc); regulator_put(host->vqmmc); } diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h index b838ffc..c3ef3b6 100644 --- a/include/linux/mmc/sdhci.h +++ b/include/linux/mmc/sdhci.h @@ -103,6 +103,7 @@ struct sdhci_host { struct regulator *vmmc; /* Power regulator (vmmc) */ struct regulator *vqmmc; /* Signaling regulator (vccq) */ + struct notifier_block *nb_vqmmc; /* Regulator notifier (vccq) */ /* Internal data */ struct mmc_host *mmc; /* MMC structure */