From patchwork Fri Jan 9 11:41:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Yang X-Patchwork-Id: 5599191 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CB55C058D for ; Fri, 9 Jan 2015 11:42:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F1104204FB for ; Fri, 9 Jan 2015 11:42:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18F4D204EC for ; Fri, 9 Jan 2015 11:42:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757069AbbAILmx (ORCPT ); Fri, 9 Jan 2015 06:42:53 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:63047 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755101AbbAILmw (ORCPT ); Fri, 9 Jan 2015 06:42:52 -0500 Received: by mail-pd0-f175.google.com with SMTP id g10so17111445pdj.6 for ; Fri, 09 Jan 2015 03:42:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=rPrHUq9tLp/4bpD68eV14Wei9F4LUvld/ZYDBhZvWWs=; b=KICQnSa9Lw7C6FBVp9zHjMrfYUb2ZBh4kIg0ri8BKl/85SJxxfQ1N9QBp+awILxXV0 NCaUvE0Dd+95bAYgV8YkyJm/g39EeCdlBJGZfGe+sVtSZwcxPZOqWs/zhyX0MM5WDzNY 1TIA4c2KB0FRltIYvrSck9IpkY1LfZjSAhCqdEdi1VY+9P+naaN0+oI7Rt4ofX4OxqSY ZgR/jpPNqriprSuSDYTH8Bh42djRSdPU/hlHY5N5wxmV3IMbeET/NOYtKxpzTrycKnPx yBJBhlBy1LsXNBC4bnuFNTUJJAR8oJyO6ntkryIm/d+EoExFEXZSknEJkkdQO1l2Oyqw xMvQ== X-Received: by 10.68.220.201 with SMTP id py9mr23158446pbc.33.1420803772128; Fri, 09 Jan 2015 03:42:52 -0800 (PST) Received: from localhost.localdomain ([124.219.7.128]) by mx.google.com with ESMTPSA id uq15sm7025260pab.8.2015.01.09.03.42.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 09 Jan 2015 03:42:51 -0800 (PST) From: Vincent Yang X-Google-Original-From: Vincent Yang To: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: linux@arm.linux.org.uk, chris@printf.net, ulf.hansson@linaro.org, andy.green@linaro.org, patches@linaro.org, jaswinder.singh@linaro.org, Vincent Yang Subject: [PATCH v3 1/4] mmc: sdhci: add a voltage switch callback function Date: Fri, 9 Jan 2015 19:41:42 +0800 Message-Id: <1420803705-4539-2-git-send-email-Vincent.Yang@tw.fujitsu.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: <1420803705-4539-1-git-send-email-Vincent.Yang@tw.fujitsu.com> References: <1420803705-4539-1-git-send-email-Vincent.Yang@tw.fujitsu.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds a callback function to do controller-specific actions when switching voltages. It is a preparation and will be used by Fujitsu SDHCI controller f_sdh30 driver. Signed-off-by: Vincent Yang --- drivers/mmc/host/sdhci.c | 4 ++++ drivers/mmc/host/sdhci.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index cbb245b..cd1f311 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -1827,6 +1827,10 @@ static int sdhci_do_start_signal_voltage_switch(struct sdhci_host *host, ctrl |= SDHCI_CTRL_VDD_180; sdhci_writew(host, ctrl, SDHCI_HOST_CONTROL2); + /* Some controller need to do more when switching */ + if (host->ops->voltage_switch) + host->ops->voltage_switch(host); + /* 1.8V regulator output should be stable within 5 ms */ ctrl = sdhci_readw(host, SDHCI_HOST_CONTROL2); if (ctrl & SDHCI_CTRL_VDD_180) diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index 41a2c34..0315e18 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -339,6 +339,7 @@ struct sdhci_ops { void (*adma_workaround)(struct sdhci_host *host, u32 intmask); void (*platform_init)(struct sdhci_host *host); void (*card_event)(struct sdhci_host *host); + void (*voltage_switch)(struct sdhci_host *host); }; #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS