Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5330383imm; Tue, 12 Jun 2018 06:20:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLvpCQU6RZNB/IytCq14DuXrM73egt8/b1WqcSWZLVGvmfrfxQGRL/+MfYkTjEmGPItWBK5 X-Received: by 2002:a17:902:740a:: with SMTP id g10-v6mr412020pll.246.1528809654217; Tue, 12 Jun 2018 06:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528809654; cv=none; d=google.com; s=arc-20160816; b=1Goj5Ui1zwecD5tbDt6Y7bv2k3e+fIUSwzw1wzdXRym2hMVfw8nDcbp/AR3BPyJeAm 3YFJ6CB2W3pkoTAFEKvNLmSaXMY/7geZ088rKUL93o1MnFbdHrXX+q/ir+pvEhkwAkKy ovwc/lycnc/a2ua6Kpq7DWts8uI11Y0izx3JnvYEevbJ/kUtP3L8DDYCrYRzJalAyKhg zlz4zFlRaaXEL7wyxhNRl2fqtHPB4Avg4k2deKUD9Ag2x3r+JZqI8uEkef2bQlBrV7J9 YpIaGyJJ4oTuRORPz7QCG92nPpzu8vZdwe4saC4U41DffgAAwXLmwXbo8wG0EI37atd2 tt4w== 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=wCyvoDWl9wqZPdPlzvCdxNdNr8ASsqav3/voeDR5gRQ=; b=n+I8cMYrDfmIfi7go4Cjzc8Z6Qb/hJRqZV9CLTNV4Mf+5rZ7QbmjjR4mltboq0ag1w bCjLLkCtQWiOxsSnF/a1Qe91KGLVZtLKAKmgyFlIsqiRI0RKjw3ExaO8wlT8hMMsSYkE XhldGY0iQFkrgLNN510ZOcJkajZ0p8VZV7U1G1L1OC596iYtnZ8UqsqxkifZyYl4t+jz 1xOOjAoXQ9UvWD4N4EJvbis7eF6Pw1dyzL6adx3me7VBx+yREvevfoJt+Wzi0x+QJ7kL nWJNx8Z2ToAU/Qck0YuPou4O1cJ4o8jZLon0Bjq1w7GuBhD23Mhc11I6AgamOwlqSYrT LRGg== 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 v10-v6si104455pfd.341.2018.06.12.06.20.39; Tue, 12 Jun 2018 06:20:54 -0700 (PDT) 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 S934216AbeFLNSu (ORCPT + 99 others); Tue, 12 Jun 2018 09:18:50 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:64992 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934005AbeFLNQu (ORCPT ); Tue, 12 Jun 2018 09:16:50 -0400 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w5CDE3wc017831; Tue, 12 Jun 2018 15:16:06 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2jjegrr43v-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 12 Jun 2018 15:16:06 +0200 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 4460848; Tue, 12 Jun 2018 13:16:03 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id DF5FEA543; Tue, 12 Jun 2018 13:16:01 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.44) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 12 Jun 2018 15:16:01 +0200 Received: from lmecxl0923.lme.st.com (10.48.0.237) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Tue, 12 Jun 2018 15:16:01 +0200 From: Ludovic Barre To: Ulf Hansson , Rob Herring CC: Maxime Coquelin , Alexandre Torgue , Gerald Baeza , , , , , Ludovic Barre Subject: [PATCH 11/19] mmc: mmci: add variant property to check specific data constraint Date: Tue, 12 Jun 2018 15:14:32 +0200 Message-ID: <1528809280-31116-12-git-send-email-ludovic.Barre@st.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1528809280-31116-1-git-send-email-ludovic.Barre@st.com> References: <1528809280-31116-1-git-send-email-ludovic.Barre@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.48.0.237] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-12_01:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ludovic Barre This patch adds a function pointer to check specific data constraint follow hardware variant. Needed to support the STM32 sdmmc variant which has alignment constraint. Signed-off-by: Ludovic Barre --- drivers/mmc/host/mmci.c | 5 +++++ drivers/mmc/host/mmci.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index abddad7..9c00804 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -312,6 +312,8 @@ static int mmci_card_busy(struct mmc_host *mmc) static int mmci_validate_data(struct mmci_host *host, struct mmc_data *data) { + struct variant_data *variant = host->variant; + if (!data) return 0; @@ -321,6 +323,9 @@ static int mmci_validate_data(struct mmci_host *host, return -EINVAL; } + if (variant->validate_data) + return variant->validate_data(host, data); + return 0; } diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index 12ee2e6..30d3f53 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -284,6 +284,7 @@ struct mmci_host; * register. * @opendrain: bitmask identifying the OPENDRAIN bit inside MMCIPOWER register * @mmci_dma: Pointer to platform-specific DMA callbacks. + * @validate_data: if hardware block has specific constraint on validate data * @set_clk_ios: if clock procedure of variant is specific * @set_pwr_ios: if power procedure of variant is specific */ @@ -328,6 +329,7 @@ struct variant_data { u32 start_err; u32 opendrain; struct mmci_dma_ops *mmci_dma; + int (*validate_data)(struct mmci_host *host, struct mmc_data *data); void (*set_clkreg)(struct mmci_host *host, unsigned int desired); void (*set_pwrreg)(struct mmci_host *host, unsigned char power_mode, unsigned int pwr); -- 2.7.4