From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751977Ab2IZXlk (ORCPT ); Wed, 26 Sep 2012 19:41:40 -0400 Received: from www.hansjkoch.de ([178.63.77.200]:50786 "EHLO www.hansjkoch.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750950Ab2IZXli (ORCPT ); Wed, 26 Sep 2012 19:41:38 -0400 Date: Thu, 27 Sep 2012 01:41:31 +0200 From: "Hans J. Koch" To: Damian Hobson-Garcia Cc: hjk@hansjkoch.de, gregkh@linuxfoundation.org, magnus.damm@gmail.com, horms@verge.net.au, linux-kernel@vger.kernel.org, linux-sh@vger.kernel.org, hdk@igel.co.jp Subject: Re: [v2 PATCH 2/2] Add uio_dmem_genirq description to UIO documentation Message-ID: <20120926234131.GC4776@local> References: <1348553352-14334-1-git-send-email-dhobsong@igel.co.jp> <1348553352-14334-3-git-send-email-dhobsong@igel.co.jp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1348553352-14334-3-git-send-email-dhobsong@igel.co.jp> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 25, 2012 at 03:09:12PM +0900, Damian Hobson-Garcia wrote: > 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. > + > + > + > > > > -- > 1.7.5.4 > >