From patchwork Fri Mar 24 20:02:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 9643991 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 BA48F601E9 for ; Fri, 24 Mar 2017 20:07:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FE0F271E0 for ; Fri, 24 Mar 2017 20:07:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 925D527E5A; Fri, 24 Mar 2017 20:07:43 +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=-5.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, URIBL_BLACK 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 24BD4271E0 for ; Fri, 24 Mar 2017 20:07:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965943AbdCXUHm (ORCPT ); Fri, 24 Mar 2017 16:07:42 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35720 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965897AbdCXUHm (ORCPT ); Fri, 24 Mar 2017 16:07:42 -0400 Received: by mail-wm0-f66.google.com with SMTP id z133so115292wmb.2 for ; Fri, 24 Mar 2017 13:07:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=sKEG5v1xJlJra9q5eDfWC4DR7EZu55TAtHSE6hW7Bns=; b=ltTr8CFMs3jKeSUCshe2GO1mQu3MHivKxe8yDzrVsU7TOTnf2lL+svy9fDm+iKxoaW PGxaIABW6QuxrYbBqKwSlAfj6SLXnQmoT2y7/X6uAZCz4HTuM0nc8xj/ZfB06dUQJlO5 gpjAWkSUnEJfMqYgJXIrdX/WLvoliXPQLkxaAehyGxDeLNR39q1tdedO/6ua8K0Dcn0U sZWG9DOp5rpCSXTYkKI7zjnIMRurDTxhY2Ui7dQc/t3ImzyvsItcCVLytLqIx4qYKT+W iCS0vHCvTXqMXVsjs8O5qq9M4cOgA2ZB5Js7dzih/Y++QRWKD8noegjBldLquzcoDsD8 AawQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=sKEG5v1xJlJra9q5eDfWC4DR7EZu55TAtHSE6hW7Bns=; b=D3G/aCxwdAGNVw+juRi9jpWa2I66Z54Zw7Yahr4Z5PK+uw5i/6DyqaIPjV/omcFbq5 ZuMNdUedSfOHA1K2wrpL/odq1B78UJzpWubMX+pavoeGMp67vR/pMa6+At8fdEz8Us/H a0MSqMhH5DC3zYYVChLiZ2zT80FGISmRdf7D2YSN/jWgs5/bN/K41P6rHmH2qo3ki2my Xc5C4JcT4YbQQ/rgFDI0CWh1y3LOA2QGPbllUrL8M5SjwsjVRpojpfJkw382BpuPiqR4 aRy56zkuPKm1zuBM8XcBl9JliI2Vja8bzUPtZAZSXzTQUHRVV0y5LLbzlY+KN9QsbhqS Ra4w== X-Gm-Message-State: AFeK/H2X7q6/4ugNFV24/CzWX96Godrmm6YZiW5Avi1YAJl19+0PDPyvPgaKX6H647q3KA== X-Received: by 10.28.187.68 with SMTP id l65mr4674096wmf.24.1490386060219; Fri, 24 Mar 2017 13:07:40 -0700 (PDT) Received: from ?IPv6:2003:c6:ebdc:4000:f190:68e:63eb:6801? (p200300C6EBDC4000F190068E63EB6801.dip0.t-ipconnect.de. [2003:c6:ebdc:4000:f190:68e:63eb:6801]) by smtp.googlemail.com with ESMTPSA id 24sm4113846wrw.46.2017.03.24.13.07.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 24 Mar 2017 13:07:39 -0700 (PDT) Subject: [PATCH v2 1/2] mmc: core: add mmc_get_dma_dir To: Ulf Hansson References: <7f8a382e-ff2f-db2f-ef24-25cdee9d2f68@gmail.com> Cc: "linux-mmc@vger.kernel.org" From: Heiner Kallweit Message-ID: Date: Fri, 24 Mar 2017 21:02:52 +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: <7f8a382e-ff2f-db2f-ef24-25cdee9d2f68@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 Add function for determining DMA direction to core. Signed-off-by: Heiner Kallweit Reviewed-by: Shawn Lin --- v2: - no changes --- include/linux/mmc/host.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 83f1c4a9..21385ac0 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -17,6 +17,7 @@ #include #include #include +#include struct mmc_ios { unsigned int clock; /* clock rate */ @@ -499,6 +500,11 @@ static inline bool mmc_can_retune(struct mmc_host *host) return host->can_retune == 1; } +static inline enum dma_data_direction mmc_get_dma_dir(struct mmc_data *data) +{ + return data->flags & MMC_DATA_WRITE ? DMA_TO_DEVICE : DMA_FROM_DEVICE; +} + int mmc_send_tuning(struct mmc_host *host, u32 opcode, int *cmd_error); int mmc_abort_tuning(struct mmc_host *host, u32 opcode);