From patchwork Mon Jan 25 19:15:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 8114781 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Original-To: patchwork-linux-renesas-soc@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 17D46BEEE5 for ; Mon, 25 Jan 2016 19:16:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E9E8201F4 for ; Mon, 25 Jan 2016 19:16:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D8CFA202E5 for ; Mon, 25 Jan 2016 19:16:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758097AbcAYTQ2 (ORCPT ); Mon, 25 Jan 2016 14:16:28 -0500 Received: from sauhun.de ([89.238.76.85]:33086 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757953AbcAYTP3 (ORCPT ); Mon, 25 Jan 2016 14:15:29 -0500 Received: from p4fe25a15.dip0.t-ipconnect.de ([79.226.90.21]:38053 helo=localhost) by pokefinder.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1aNmbn-0006Wi-D6; Mon, 25 Jan 2016 20:15:27 +0100 From: Wolfram Sang To: linux-mmc@vger.kernel.org Cc: Wolfram Sang , linux-renesas-soc@vger.kernel.org, linux-sh@vger.kernel.org, Kuninori Morimoto , Magnus Damm , Yoshihiro Shimoda , Dirk Behme Subject: [PATCH 8/9] mmc: tmio: disable clock before changing it Date: Mon, 25 Jan 2016 20:15:15 +0100 Message-Id: <1453749316-1848-9-git-send-email-wsa@the-dreams.de> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1453749316-1848-1-git-send-email-wsa@the-dreams.de> References: <1453749316-1848-1-git-send-email-wsa@the-dreams.de> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@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=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 From: Wolfram Sang Rcar2 & 3 docs state that for going to and coming from the 0xff setting, the clock must first be disabled before the DIV bits are changed. Instead of tracking this, let's just do this unconditionally. Signed-off-by: Wolfram Sang --- drivers/mmc/host/tmio_mmc_pio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c index 7f6b5adf12094b..03f6e74c190691 100644 --- a/drivers/mmc/host/tmio_mmc_pio.c +++ b/drivers/mmc/host/tmio_mmc_pio.c @@ -174,6 +174,8 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, if (host->set_clk_div) host->set_clk_div(host->pdev, (clk >> 22) & 1); + sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, ~CLK_CTL_SCLKEN & + sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, clk & CLK_CTL_DIV_MASK); if (!(host->pdata->flags & TMIO_MMC_FAST_CLK_CHG)) msleep(10);