From patchwork Thu Jan 21 05:26:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen-Yu Tsai X-Patchwork-Id: 8077991 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7C0759F744 for ; Thu, 21 Jan 2016 05:35:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEC2D205B7 for ; Thu, 21 Jan 2016 05:35:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BAA77205B5 for ; Thu, 21 Jan 2016 05:35:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935045AbcAUFdl (ORCPT ); Thu, 21 Jan 2016 00:33:41 -0500 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:54846 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758725AbcAUFdj (ORCPT ); Thu, 21 Jan 2016 00:33:39 -0500 Received: from mirror2.csie.ntu.edu.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (Authenticated sender: b93043) by smtp.csie.ntu.edu.tw (Postfix) with ESMTPSA id D53F324F28; Thu, 21 Jan 2016 13:33:30 +0800 (CST) Received: by mirror2.csie.ntu.edu.tw (Postfix, from userid 1000) id 9FAC95F987; Thu, 21 Jan 2016 13:33:30 +0800 (CST) From: Chen-Yu Tsai To: Ulf Hansson , Maxime Ripard Cc: Chen-Yu Tsai , Hans de Goede , linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH RFC 03/15] mmc: sunxi: Block signal voltage switching (CMD11) Date: Thu, 21 Jan 2016 13:26:30 +0800 Message-Id: <1453354002-28366-4-git-send-email-wens@csie.org> X-Mailer: git-send-email 2.7.0.rc3 In-Reply-To: <1453354002-28366-1-git-send-email-wens@csie.org> References: <1453354002-28366-1-git-send-email-wens@csie.org> 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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 Allwinner's mmc controller supports signal voltage switching. This is supported in code in Allwinner's kernel. However, publicly available boards all tie it to a fixed 3.0/3.3V regulator, with options to tie it to 1.8V for eMMC on some. Since Allwinner's kernel is an ancient 3.4, it is hard to say whether adapting it's code to a modern mainline kernel would work. Block signal voltage switching until someone has proper hardware to implement and test this. This only affects SD UHS-1 modes, as eMMC switches the voltage directly without any signaling. Signed-off-by: Chen-Yu Tsai --- drivers/mmc/host/sunxi-mmc.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c index 790f01662b4e..0495ae7da6d6 100644 --- a/drivers/mmc/host/sunxi-mmc.c +++ b/drivers/mmc/host/sunxi-mmc.c @@ -816,6 +816,20 @@ static void sunxi_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq) } } + /* + * TODO Support signal voltage switching + * + * Compared to Allwinner's kernel, recent updates in the mmc core + * mean this should be as easy as setting the flags in cmd_val and + * imask, and waiting for it to finish. However no boards support + * this so this cannot be tested. Block it for now. + */ + if (cmd->opcode == SD_SWITCH_VOLTAGE) { + mrq->cmd->error = -EPERM; + mmc_request_done(mmc, mrq); + return; + } + if (cmd->opcode == MMC_GO_IDLE_STATE) { cmd_val |= SDXC_SEND_INIT_SEQUENCE; imask |= SDXC_COMMAND_DONE;