Received: by 10.223.148.5 with SMTP id 5csp7534560wrq; Thu, 18 Jan 2018 06:38:11 -0800 (PST) X-Google-Smtp-Source: ACJfBos18o+luacS0mzXI2mdbqVV6WjJ/8+Qx61x8DYCZ0v9d6w24cT1pVquNwJFQBegvXPiU+bW X-Received: by 10.98.100.139 with SMTP id y133mr24566726pfb.68.1516286291182; Thu, 18 Jan 2018 06:38:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516286291; cv=none; d=google.com; s=arc-20160816; b=IwaNHs+HKA6R9FrCy/Q9V2BbFFtY3khL052E6omZ92p2tZPUlfehDhHjfnIIO447np hxTrKpd+wams/mTArSHrlEhMfdRu4+a0HJo/QIxBjqknLr4Y7rPyhArhbYtov3bcX95o 8zy/sD92z+vPL31vNycwmDyr1pW3IjzlJQlQFF6T3pUug9kbwlEgnDwrhqJu4w4xcrWZ 9iM7hRMdVUZH4gyb+6cJXS2MONS6WmcP9gA+wsmxwFq/lMOSbP8MOuxM7/oYzPrwGWb+ Hi28BJWNGhSu/T9WQsNcOaeFcUt/AmsbWEqQ80JWAejIXyRAycx4t6RbBXvD/TWmaw+U jJAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=tbdxoNylQDs8uhtd7Ns10T+neA5HxCCP9E/K6CibXAE=; b=elJN2HI+HzWvWFa3U5cNY3SDZhiGN+WU20xuEnae8TQoErKkG2GW70CwSJkgiDpAX5 8XLtEFrFQa6rU/EplAaU3/DusNMtQQSoM1uFuKF4t/xmx6JpZ1HLFqT0wEUBcG8p7A1m s3kpEUDzQAo0+z8dEp1Um1cDjE/8AaaBBt+L5ZkAvChT5TCvhXvW3vEKpc20dsYeIhWM 5ThwYyIDBEiIumz8IaruwpZlGfgJy6xedLzWuEpic4dy2iQ0hM0kTT3C/5cW3uN3egIe EMk7Z1Bel6lkO/BWoqNEf19OXxbeLhfAsb9hmRJBstj6f9aZpYsKuHZjvFqroB1ykYsm ovVg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k83si6949053pfg.348.2018.01.18.06.37.56; Thu, 18 Jan 2018 06:38:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756634AbeAROgJ (ORCPT + 99 others); Thu, 18 Jan 2018 09:36:09 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:9775 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756574AbeAROgD (ORCPT ); Thu, 18 Jan 2018 09:36:03 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w0IEY961021771; Thu, 18 Jan 2018 15:34:53 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2fgygdmw99-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 18 Jan 2018 15:34:53 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 307EE31; Thu, 18 Jan 2018 14:34:53 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag6node3.st.com [10.75.127.18]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 0E2DC2646; Thu, 18 Jan 2018 14:34:53 +0000 (GMT) Received: from localhost (10.75.127.46) by SFHDAG6NODE3.st.com (10.75.127.18) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 18 Jan 2018 15:34:52 +0100 From: To: Russell King , Ulf Hansson , Michael Turquette , Stephen Boyd , Linus Walleij , Rob Herring , Mark Rutland , Alexandre Torgue CC: , , , , , , Patrice Chotard Subject: [PATCH v3 03/14] mmc: mmci: Don't pretend all variants to have OPENDRAIN bit Date: Thu, 18 Jan 2018 15:34:19 +0100 Message-ID: <1516286070-24927-4-git-send-email-patrice.chotard@st.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1516286070-24927-1-git-send-email-patrice.chotard@st.com> References: <1516286070-24927-1-git-send-email-patrice.chotard@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG8NODE2.st.com (10.75.127.23) To SFHDAG6NODE3.st.com (10.75.127.18) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-18_07:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Patrice Chotard This patch prepares for supporting STM32 variant which doesn't have opendrain bit in MMCIPOWER register. ST others variant (u300, nomadik and ux500) uses MCI_OD bit whereas others variants uses MCI_ROD bit. Signed-off-by: Patrice Chotard --- v3: _ use variant->opendrain instead of host->variant->opendrain _ remove comment about OD and ROD bit v2: _ Replace opendrain bool type by u32 _ Clean opendrain bit management code drivers/mmc/host/mmci.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 8a4fbc2..f0edfe7 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -85,6 +85,7 @@ * @mmcimask1: true if variant have a MMCIMASK1 register. * @start_err: bitmask identifying the STARTBITERR bit inside MMCISTATUS * register. + * @opendrain: bitmask identifying the OPENDRAIN bit inside MMCIPOWER register */ struct variant_data { unsigned int clkreg; @@ -116,6 +117,7 @@ struct variant_data { bool reversed_irq_handling; bool mmcimask1; u32 start_err; + u32 opendrain; }; static struct variant_data variant_arm = { @@ -127,6 +129,7 @@ struct variant_data { .reversed_irq_handling = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_ROD, }; static struct variant_data variant_arm_extended_fifo = { @@ -137,6 +140,7 @@ struct variant_data { .f_max = 100000000, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_ROD, }; static struct variant_data variant_arm_extended_fifo_hwfc = { @@ -148,6 +152,7 @@ struct variant_data { .f_max = 100000000, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_ROD, }; static struct variant_data variant_u300 = { @@ -165,6 +170,7 @@ struct variant_data { .pwrreg_nopower = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_OD, }; static struct variant_data variant_nomadik = { @@ -183,6 +189,7 @@ struct variant_data { .pwrreg_nopower = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_OD, }; static struct variant_data variant_ux500 = { @@ -207,6 +214,7 @@ struct variant_data { .pwrreg_nopower = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_OD, }; static struct variant_data variant_ux500v2 = { @@ -233,6 +241,7 @@ struct variant_data { .pwrreg_nopower = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_OD, }; static struct variant_data variant_qcom = { @@ -253,6 +262,7 @@ struct variant_data { .qcom_dml = true, .mmcimask1 = true, .start_err = MCI_STARTBITERR, + .opendrain = MCI_ROD, }; /* Busy detection for the ST Micro variant */ @@ -1455,17 +1465,8 @@ static void mmci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) ~MCI_ST_DATA2DIREN); } - if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN) { - if (host->hw_designer != AMBA_VENDOR_ST) - pwr |= MCI_ROD; - else { - /* - * The ST Micro variant use the ROD bit for something - * else and only has OD (Open Drain). - */ - pwr |= MCI_OD; - } - } + if (ios->bus_mode == MMC_BUSMODE_OPENDRAIN && variant->opendrain) + pwr |= variant->opendrain; /* * If clock = 0 and the variant requires the MMCIPOWER to be used for -- 1.9.1