Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752258AbbKJJjr (ORCPT ); Tue, 10 Nov 2015 04:39:47 -0500 Received: from mail-bn1on0148.outbound.protection.outlook.com ([157.56.110.148]:13980 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752130AbbKJJjn (ORCPT ); Tue, 10 Nov 2015 04:39:43 -0500 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=freescale.com; From: Haibo Chen To: , CC: , , Subject: [PATCH 2/2] mmc: sdhci-esdhc-imx: correct the tuning-step setting Date: Tue, 10 Nov 2015 17:43:30 +0800 Message-ID: <1447148610-2770-2-git-send-email-haibo.chen@freescale.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447148610-2770-1-git-send-email-haibo.chen@freescale.com> References: <1447148610-2770-1-git-send-email-haibo.chen@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BL2FFO11OLC011;1:ZcTJL3ZJMxsfQNalCsM8aA7jtdmcekDQyRkOUlfaN1iuHHUTC9YNlfyLsL9qDSakJT00ysvh3FhgHQIJBP4OXySsstzBOYOjnGrZeju86sIUsZHRJ6r+jwhRe8xMrIP3fXceUqSyOHU3SElqOlWGsP/43AmWYLO0OcoD/wDuAZqLf4TptST35hJ35kLtdxei6sFe95Bj5yshf2iLRrI1AWP7CYjiqLWevZJKO8Vs2j2ABbsr0a4p+P37znaJSNfovK8tXKiRBKv5EU3p6PSpOeetCQloeYYkjM/CwKmXLhHOPJ41Xink1tHsnTLAjeWK2V3DdfClQLiMxZEyYxuHVLSI8rHWS8nipOAIuj3pVnv64jzFglncF+FhSW7R53v9GylTG8RNlTpHrvLR28AAGA== X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(77096005)(33646002)(5007970100001)(50226001)(2950100001)(19580405001)(6806005)(19580395003)(76176999)(86362001)(50986999)(104016004)(50466002)(92566002)(69596002)(11100500001)(5008740100001)(4001450100002)(48376002)(105606002)(229853001)(47776003)(5003940100001)(189998001)(106466001)(85426001)(81156007)(230783001)(87936001)(36756003)(5001770100001)(97736004)(5001960100002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR03MB1387;H:az84smr01.freescale.net;FPR:;SPF:Fail;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1387;2:tIAIS122vSfM1YheoHp+MlYnpjDO2XrZ3SNAz2mmX4yZHEP0uqwVdJta5frpnbsyafpS0x//xli3j5ZWbxMWBXJW0t5SPB76T1Uu0Ua+gqGZx0zNYiGbqIIuHPKyYEjUkW0F+k6YHbtNwcryA10APZtppC8xLQItTfrbcq1e8PY=;3:UN5P3L+TFNOMANXG05BReUqcJBg7B5jCNfKQTdZVRZHNvCDlzrAheSide05Bc9VCDHB6zeo9DsWcFVxKKRmCPfy8v51+MpzrkM9Lwxidfaw9QdFiORNmKwwA2pq2r1no2jYFk2i+3iLgWZ3WDNIcMSldUfWmOjiBDDD1r2Eq79ELFh7R18HKZCyqvhb9YkBSGmUjfRc7aFfG7hlQNZPXeyjklIuqYAP5XTnookngtLw=;25:YCciyCgfHU20B+R49fuMgSjzKaiIcOKoh1tjkVx4T3WB5jAnCT0wGCYHMBsvL5647czpO8c+bVkuQZ0ha9oWTq3i1cuMFNmXTvgs63OhnTgAGfQG1gWV96GzjkVIyi9dX0shM5ENmwdQucVIlQvHcrYPfABF9BcfSFfyW/7A6zqLUYIQe5Y46z9Bp5L32e5x3DvVKKu5hY1U6p3efSTrC5+GqlgLQYcqZS2akB07J9Pj6JnFgWPZs7w7py6O8TTZe6ArP+uLaVqpB+QGdOgHvQ== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1387; X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1387;20:aT/Ue1qohRfYcnZdVvq1sSFPr6gjHc/BN4jmZxdjmzF/iPPx0dQUVgKvunGC5MRjEWI41F7Js1mCBSr6Dt2XUFe0jukINEOpGghVAgx6WAJf8hHJXLKBMk5/7PqFV82KRXED4QiKWiZGJV8mNscoXvwy1yaRJ3pSy8J7rYw5ROEIg+2w1roiqGI05oj0yu8i7ulqsGzWm6e3wE67fBk9qQexETEAczFXBeVDZf8SinhUex5Z6zatDnzBT1sCWuBDlT4POGPATkjyACN3grm/9Nc5gpKcVZYvooLgSElZ7tjr1ZgcTXzoRGQA1EkFpPsUFUDEEkZaL2Uif8LS8lBnvghO6VXCeHN8lGVo+WgXsH0=;4:keuOfaIfwSiqeH6ZgCyUKwc45wCI7MW2y7HSFxKgB5TbER4Hc2uDuF3gq5zaSx3b4FkvQzH2plyEk1rOFf2MgEIeazF/ZaCfnoiLmk16dPk9Nf6Nlg7UxUinTbMyoLiixmO8ox80jd+xz3vOibzK03dK2GfymqtKk71usOa+FogCZVN+34qpvke94gpRXvyzT2lqNZ1THse6C86SHmI8J5d002rySzTXhUy7a1izau4nuaaz/zL6thoq2QOilZV21m5YZfpELbjjpvDGbqaK5aAdJgVvJb/5qMWP5gjg8HOdBB4poW80qnI+swgyZObk4O94uMimGIpG5da/r2HXAWIgDMeRHbXWB4qmmkjL3sfBkbJMCwjy9ynyOy6+94vj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(101931422205132); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(8121501046)(520078)(5005006)(3002001)(10201501046);SRVR:BY1PR03MB1387;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1387; X-Forefront-PRVS: 07562C22DA X-Microsoft-Exchange-Diagnostics: =?us-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+eXKow5886ye1OE2BW?= =?us-ascii?Q?w/6FnRxqjyapNVtK7VUuLZBuF1creVyZQ5mfj89/vvWDRwMkm0A2nkvL3Z5f?= =?us-ascii?Q?ouk66XvjhrDtL1wiHuYLpe+pmpthnfz/C/CRUjauoNXJhqm5pczwGLBWH156?= =?us-ascii?Q?AtwKeArKaM37suUIAI5waUYcQaFBA2mre/63M9gkUhsAvf5Fg7gACS+Kiuto?= =?us-ascii?Q?Ys/JDhEfrvcduDvUFmFzkf3V/iMxMf51FQzw5p+ohGM4PHvOg=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BY1PR03MB1387;5:HswR/idNb9+1+LKgH9BIuODL5nuHT3744TxfhvT+Xv3G0wu94fYLyb1f+cNxejD1aap7SbDkT2lHpFjgXzVFSjt6dxIj6KnSvKzcQL9A1Vy18UpSE84iSkuMqUGopTY+8QNPb8365G6yb5aSMP2Cpg==;24:JeAejvSx7v4DFAEBK91v0a397NSxEXxKtYGhs1+paXmLbPz52f/9xh57qCdVfvuD5YVrd43SQaXiG+zihikmtvLnMkNSw3GUZM10k/KF15I=;20:NP3A+c32dCrQr/OFC+YEOIizS1UBWRbXaT97cSnxxcd2iNnRlhk+Onco/9OdB4ee3v2QOCoYGejXMqu1luFNrQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2015 09:39:40.2367 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR03MB1387 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1654 Lines: 42 Here we use '|=' to set the tuning-step, but before that, we should clear the tuning-step, otherwise we could got the wrong setting. Signed-off-by: Haibo Chen --- drivers/mmc/host/sdhci-esdhc-imx.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index 1508949..64275c7 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c @@ -76,6 +76,7 @@ #define ESDHC_STD_TUNING_EN (1 << 24) /* NOTE: the minimum valid tuning start tap for mx6sl is 1 */ #define ESDHC_TUNING_START_TAP 0x1 +#define ESDHC_TUNING_STEP_MASK 0x00070000 #define ESDHC_TUNING_STEP_SHIFT 16 /* pinctrl state */ @@ -489,9 +490,11 @@ static void esdhc_writew_le(struct sdhci_host *host, u16 val, int reg) m |= ESDHC_MIX_CTRL_FBCLK_SEL; tuning_ctrl = readl(host->ioaddr + ESDHC_TUNING_CTRL); tuning_ctrl |= ESDHC_STD_TUNING_EN | ESDHC_TUNING_START_TAP; - if (imx_data->boarddata.tuning_step) + if (imx_data->boarddata.tuning_step) { + tuning_ctrl &= ~ESDHC_TUNING_STEP_MASK; tuning_ctrl |= imx_data->boarddata.tuning_step << ESDHC_TUNING_STEP_SHIFT; - writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL); + } + writel(tuning_ctrl, host->ioaddr + ESDHC_TUNING_CTRL); } else { v &= ~ESDHC_MIX_CTRL_EXE_TUNE; } -- 1.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/