From patchwork Tue Mar 27 13:42:46 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 7499 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 2ECA023E01 for ; Tue, 27 Mar 2012 14:20:17 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id EA981A188EE for ; Tue, 27 Mar 2012 14:20:16 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so13026392iag.11 for ; Tue, 27 Mar 2012 07:20:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :in-reply-to:to:message-id:mime-version:x-mailer:references :x-mailman-approved-at:cc:subject:x-beenthere:x-mailman-version :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:content-type:content-transfer-encoding :sender:errors-to:x-gm-message-state; bh=hp/UaACoalSJsuqHSbkDJq1VMw3hd1XBdmyWjqbLa40=; b=X/076dMeo7an9glBANjYaZtGbaMwe5X6XgStyQVVPGeD/npW1LpSe7Af5+UtP3I5H/ XrJnrDsUDOJM2ZAEGQJSHUA5jIrW+Kcom+NSCQNQ0MTXlqu9fy6WQlCpyFSXXEYq+2bh Yfr9SaZ1iHZT7L6QYwosJFvmPHX3wZf+Vt6aOLcX2IRxldEu9uMqYmp0Yg/e7b/aaaop ogPwCsXB6F+Ecn+X23UPxlk/yDbpEQ19GHNU8BwfCzR8/z+S0FSxvtQC8wEngrqvQDi7 Uk+sEgBhX2RBt71xymJ9h5T+2WBlhnAtkgE7m7nGAfspGe1ohscxVjsq2Deosz3STk3Y QkIg== Received: by 10.43.134.199 with SMTP id id7mr15241860icc.21.1332858016732; Tue, 27 Mar 2012 07:20:16 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.5.205 with SMTP id 13csp18949ibw; Tue, 27 Mar 2012 07:20:15 -0700 (PDT) Received: by 10.180.104.231 with SMTP id gh7mr13727349wib.10.1332858008509; Tue, 27 Mar 2012 07:20:08 -0700 (PDT) Received: from mombin.canonical.com (mombin.canonical.com. [91.189.95.16]) by mx.google.com with ESMTP id a7si19534902wie.4.2012.03.27.07.20.07; Tue, 27 Mar 2012 07:20:08 -0700 (PDT) Received-SPF: neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) client-ip=91.189.95.16; Authentication-Results: mx.google.com; spf=neutral (google.com: 91.189.95.16 is neither permitted nor denied by best guess record for domain of linaro-mm-sig-bounces@lists.linaro.org) smtp.mail=linaro-mm-sig-bounces@lists.linaro.org Received: from localhost ([127.0.0.1] helo=mombin.canonical.com) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SCXFm-0007oK-Eo; Tue, 27 Mar 2012 14:20:06 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by mombin.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1SCWgL-00016T-95 for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 13:43:29 +0000 Received: from euspt2 (mailout1.w1.samsung.com [210.118.77.11]) by mailout1.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTP id <0M1J00BNHQ3IIW@mailout1.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 14:42:56 +0100 (BST) Received: from linux.samsung.com ([106.116.38.10]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M1J00KRZQ4AN9@spt2.w1.samsung.com> for linaro-mm-sig@lists.linaro.org; Tue, 27 Mar 2012 14:43:23 +0100 (BST) Received: from mcdsrvbld02.digital.local (unknown [106.116.37.23]) by linux.samsung.com (Postfix) with ESMTP id F2F50270058; Tue, 27 Mar 2012 15:46:11 +0200 (CEST) Date: Tue, 27 Mar 2012 15:42:46 +0200 From: Marek Szyprowski In-reply-to: <1332855768-32583-1-git-send-email-m.szyprowski@samsung.com> To: linux-kernel@vger.kernel.org Message-id: <1332855768-32583-13-git-send-email-m.szyprowski@samsung.com> MIME-version: 1.0 X-Mailer: git-send-email 1.7.9.1 References: <1332855768-32583-1-git-send-email-m.szyprowski@samsung.com> X-Mailman-Approved-At: Tue, 27 Mar 2012 14:19:41 +0000 Cc: linux-mips@linux-mips.org, Kevin Cernekee , linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Benjamin Herrenschmidt , linux-mm@kvack.org, sparclinux@vger.kernel.org, Guan Xuetao , linux-arch@vger.kernel.org, Stephen Rothwell , Jonathan Corbet , x86@kernel.org, Matt Turner , Dezhong Diao , Fenghua Yu , Arnd Bergmann , microblaze-uclinux@itee.uq.edu.au, linaro-mm-sig@lists.linaro.org, Ivan Kokshaysky , Andrzej Pietrasiewicz , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Richard Henderson , discuss@x86-64.org, Michal Simek , Tony Luck , Richard Kuo , FUJITA Tomonori , Kyungmin Park , Paul Mundt , linux-alpha@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Subject: [Linaro-mm-sig] [PATCHv2 12/14] common: dma-mapping: introduce mmap method X-BeenThere: linaro-mm-sig@lists.linaro.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Unified memory management interest group." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linaro-mm-sig-bounces@lists.linaro.org Errors-To: linaro-mm-sig-bounces@lists.linaro.org X-Gm-Message-State: ALoCoQkSqN8giUtwL20fLh2/Le1I0rb7GzmzNGV+diXidgOQVoG+9m5zoCI/XVy2YNNhRaxTO7Rq Introduce new generic mmap method with attributes argument. This method lets drivers to create a userspace mapping for a DMA buffer in generic, architecture independent way. Signed-off-by: Marek Szyprowski Acked-by: Kyungmin Park Reviewed-by: Arnd Bergmann --- include/linux/dma-mapping.h | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2fc413a..b903a20 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -15,6 +15,9 @@ struct dma_map_ops { void (*free)(struct device *dev, size_t size, void *vaddr, dma_addr_t dma_handle, struct dma_attrs *attrs); + int (*mmap)(struct device *, struct vm_area_struct *, + void *, dma_addr_t, size_t, struct dma_attrs *attrs); + dma_addr_t (*map_page)(struct device *dev, struct page *page, unsigned long offset, size_t size, enum dma_data_direction dir,