From patchwork Tue Sep 25 06:09:12 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damian Hobson-Garcia X-Patchwork-Id: 1501961 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id C76BADF28C for ; Tue, 25 Sep 2012 06:10:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753073Ab2IYGJv (ORCPT ); Tue, 25 Sep 2012 02:09:51 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:44402 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753092Ab2IYGJc (ORCPT ); Tue, 25 Sep 2012 02:09:32 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so8490554pbb.19 for ; Mon, 24 Sep 2012 23:09:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=JqU5o9EOcjqydsYbk9OTpQLVEz/WqN7To5QCZS1GSAQ=; b=kEcgtxYc4bt/HYkIbc1cG0HrlYA+onrYylozoIv0eOPotpwp7mD22PX9BGL4rbst5f gyUXZn8lepTsaCRTFAjRnLsRBSJPm9JOdLynSazkMCYQhTxuH7CNDa7CFfjMfg3+ydb9 BJ4jErGI5NyHGcRWLKgRGq77WoeQlA5tPVs+rPoK8WqFmiKmMZeMIzWfA18x0nk3l3aA LlRXf7Mqh9lijX6Un74WlXCqZu8thbPY0jbN65UHslpqi6DDtYmeVLISXG4r38P6/WP4 1m0EDNa+RucwgvqxdGJ6PyZHYJskiP4Elff/8yY+9hQiuH9W+ztBIlS3UsNQkfx1tqtK 0kEQ== Received: by 10.68.226.167 with SMTP id rt7mr42588185pbc.146.1348553371872; Mon, 24 Sep 2012 23:09:31 -0700 (PDT) Received: from localhost.localdomain ([219.106.231.132]) by mx.google.com with ESMTPS id bj7sm9964803pab.24.2012.09.24.23.09.29 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 24 Sep 2012 23:09:30 -0700 (PDT) From: Damian Hobson-Garcia To: hjk@hansjkoch.de, gregkh@linuxfoundation.org, magnus.damm@gmail.com, horms@verge.net.au Cc: linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, hdk@igel.co.jp, Damian Hobson-Garcia Subject: [v2 PATCH 2/2] Add uio_dmem_genirq description to UIO documentation Date: Tue, 25 Sep 2012 15:09:12 +0900 Message-Id: <1348553352-14334-3-git-send-email-dhobsong@igel.co.jp> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1348553352-14334-1-git-send-email-dhobsong@igel.co.jp> References: <1348553352-14334-1-git-send-email-dhobsong@igel.co.jp> X-Gm-Message-State: ALoCoQn24ZpJVHb9coLVnBEmVKDEjAIUxeQoLu43WVAVvnN3aWqrv3Yae5ifq06OUSVdQvbLYXfL Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org Signed-off-by: Damian Hobson-Garcia Signed-off-by: "Hans J. Koch" --- Documentation/DocBook/uio-howto.tmpl | 56 ++++++++++++++++++++++++++++++++++ 1 files changed, 56 insertions(+), 0 deletions(-) diff --git a/Documentation/DocBook/uio-howto.tmpl b/Documentation/DocBook/uio-howto.tmpl index ac3d001..db08c1a 100644 --- a/Documentation/DocBook/uio-howto.tmpl +++ b/Documentation/DocBook/uio-howto.tmpl @@ -719,6 +719,62 @@ framework to set up sysfs files for this region. Simply leave it alone. + +Using uio_dmem_genirq for platform devices + + In addition to statically allocated memory ranges, they may also be + a desire to use dynamically allocated regions in a user space driver. + In particular, being able to access memory made available through the + dma-mapping API, may be particularly useful. The + uio_dmem_genirq driver provides a way to accomplish + this. + + + This driver is used in a similar manner to the + "uio_pdrv_genirq" driver with respect to interrupt + configuration and handling. + + + Set the .name element of + struct platform_device to + "uio_dmem_genirq" to use this driver. + + + When using this driver, fill in the .platform_data + element of struct platform_device, which is of type + struct uio_dmem_genirq_pdata and which contains the + following elements: + + + struct uio_info uioinfo: The same + structure used as the uio_pdrv_genirq platform + data + unsigned int *dynamic_region_sizes: + Pointer to list of sizes of dynamic memory regions to be mapped into + user space. + + unsigned int num_dynamic_regions: + Number of elements in dynamic_region_sizes array. + + + + The dynamic regions defined in the platform data will be appended to + the mem[] array after the platform device + resources, which implies that the total number of static and dynamic + memory regions cannot exceed MAX_UIO_MAPS. + + + The dynamic memory regions will be allocated when the UIO device file, + /dev/uioX is opened. + Simiar to static memory resources, the memory region information for + dynamic regions is then visible via sysfs at + /sys/class/uio/uioX/maps/mapY/*. + The dynmaic memory regions will be freed when the UIO device file is + closed. When no processes are holding the device file open, the address + returned to userspace is DMA_ERROR_CODE. + + +