From patchwork Wed Mar 22 21:34:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9640109 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6826060327 for ; Wed, 22 Mar 2017 21:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5989C2521E for ; Wed, 22 Mar 2017 21:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4E7D0262F2; Wed, 22 Mar 2017 21:34:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E00D72521E for ; Wed, 22 Mar 2017 21:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752775AbdCVVem (ORCPT ); Wed, 22 Mar 2017 17:34:42 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:34933 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753759AbdCVVeZ (ORCPT ); Wed, 22 Mar 2017 17:34:25 -0400 Received: by mail-wm0-f65.google.com with SMTP id z133so13143852wmb.2 for ; Wed, 22 Mar 2017 14:34:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:cc:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=koJS8rhjuJ64oJm3SAsz/McZHLM/fQLHH5DQtzqT9fQ=; b=u+f5PJpcJP3/MeQv42j+80dRIT33R8c5Gnz62wBueTL0geFSLK04Cp/UTySMU+U2zq a7cHzpj8Uw+MlZqyGpY1Udpc/yrcoB8aIiCJUXbQwa3Ft+mOiEiBxgYPFKj6zsha4eFq 5Aw11q93p/OgopEj9+DGQgvahpL2OhWBIR4a28X+iEo1Hvtp9SVDyLc89MXRQtZbGOSX t9Zdvm+TM8jlXpwB4vMna04l3+xyAAsHoSdPRY6nACUtk6J2+MbG48TH5hQalnpWXByk 03lLWS3uh5SyR+Ww5W2KrgjbCz4O1IvrOIoHjxjkHDJOD8CZi8gzbOfx/uYARqsxPv07 FGWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:cc:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=koJS8rhjuJ64oJm3SAsz/McZHLM/fQLHH5DQtzqT9fQ=; b=UEfZZq8IfMOS7jc+0NHcSzVrFhK8MKN9x50j/hoNqt0jMQwEN+ftAL2RpumeQkuaV/ RXBJ46GJP8ouKoFO8tU9isq3Ur5KUIWXLwy6ppte6Vu4gDGpan4cpC6Tdjl5/w2A7Afl Q6HfipQqnpnCvwyOW5splusTomQp6MjBkfR576R4GygMfGTB6sKNRtAXJFS/8mqKyANX CX1/KnQH79KmW0cbMuxAFltPRKQKcb+nKLXYonmLydQbhWKMKvIifxjuaM9vZZOY1HxG Kq6cqlojTOVWJQWM5eo91CtbMni5x5wJUAt6/LTlIalWNrwnhRnzKnMmdZWarVp8CB/7 wURw== X-Gm-Message-State: AFeK/H0oGI9jKFBiwJXQyEaTFSpqq+YM/zwNP8wsJEmRY+vz5bOTc5H0KhShd/WbwSX8xA== X-Received: by 10.28.166.208 with SMTP id p199mr9943393wme.25.1490218458088; Wed, 22 Mar 2017 14:34:18 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:94d5:56f1:aebf:596a? (p200300C6EBDC400094D556F1AEBF596A.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:94d5:56f1:aebf:596a]) by smtp.googlemail.com with ESMTPSA id p185sm1812720wme.20.2017.03.22.14.34.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 14:34:17 -0700 (PDT) From: Heiner Kallweit Subject: [PATCH 6/6] mmc: meson-gx: simplify setting timeout configuration parameters To: Ulf Hansson , Kevin Hilman References: <8bf58a83-d8d7-615c-c89b-87a62a3c9c40@gmail.com> Cc: "linux-mmc@vger.kernel.org" , linux-amlogic@lists.infradead.org Message-ID: <8105b3e7-9c80-038e-9cfe-53139d6892ce@gmail.com> Date: Wed, 22 Mar 2017 22:34:01 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <8bf58a83-d8d7-615c-c89b-87a62a3c9c40@gmail.com> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We don't need variable cmd_cfg_timeout, so remove it and simplify the code a little. Signed-off-by: Heiner Kallweit --- drivers/mmc/host/meson-gx-mmc.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c index 87303404..b917765c 100644 --- a/drivers/mmc/host/meson-gx-mmc.c +++ b/drivers/mmc/host/meson-gx-mmc.c @@ -426,7 +426,7 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) struct meson_host *host = mmc_priv(mmc); struct mmc_data *data = cmd->data; u32 cfg, cmd_cfg = 0, cmd_data = 0; - u8 blk_len, cmd_cfg_timeout; + u8 blk_len; unsigned int xfer_bytes = 0; /* Setup descriptors */ @@ -454,6 +454,9 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) /* data? */ if (data) { cmd_cfg |= CMD_CFG_DATA_IO; + cmd_cfg |= ilog2(SD_EMMC_CMD_TIMEOUT_DATA) << + CMD_CFG_TIMEOUT_SHIFT; + if (data->blocks > 1) { cmd_cfg |= CMD_CFG_BLOCK_MODE; cmd_cfg |= (data->blocks & CMD_CFG_LENGTH_MASK) << @@ -488,13 +491,9 @@ static void meson_mmc_start_cmd(struct mmc_host *mmc, struct mmc_command *cmd) } cmd_data = host->bounce_dma_addr & CMD_DATA_MASK; - - cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT_DATA); } else { - cmd_cfg_timeout = ilog2(SD_EMMC_CMD_TIMEOUT); + cmd_cfg |= ilog2(SD_EMMC_CMD_TIMEOUT) << CMD_CFG_TIMEOUT_SHIFT; } - cmd_cfg |= (cmd_cfg_timeout & CMD_CFG_TIMEOUT_MASK) << - CMD_CFG_TIMEOUT_SHIFT; host->cmd = cmd;