From patchwork Wed Apr 23 17:28:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Griffin X-Patchwork-Id: 28925 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1C254203AC for ; Wed, 23 Apr 2014 17:29:08 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id lg15sf4624728vcb.11 for ; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=yELFrS+XW4K/5wci3kW2tJCj/YsVA8RBKZwPB0DdAfs=; b=KcsY0iVxlArIuQ3fkqeHxs9Jm6JyYgDaqqP5xttLov/EawRDlix0YnEGCoKPxKw5zT Ex9yj8golVwRy5GUHsX0nG8IMoXs/3MY4BvOWiETjKivVnIqkotVUyPxF9EmSiyJ1Yw3 29D4sBY6JcMELxkLqAFbX8Pzh5KT4kD1NHVqSoEgNe3jWOuPthAoP4JLc7ZoK4JqZFmF 1lSEycQNLOaAcuJEpjrQzqc/69S4lURxHvjctn+n4mHvpGNftjewn/4OV0mEWXVTtOv9 kpJI3Mlhi1R7HMUP+JUFIocd94upxYjWpsKqVM62u7bgu5BNpgYRWYdZbDE9xxa07W5N cZiQ== X-Gm-Message-State: ALoCoQkRTu6tZCGJe8kUMbPBh2X2fAoEt0TqUncMTvycAW+vWw/ozPGK9Ye3Zrhpjg3eO18iMBZM X-Received: by 10.236.142.212 with SMTP id i60mr21731144yhj.39.1398274147908; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.93.131 with SMTP id d3ls772566qge.52.gmail; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) X-Received: by 10.58.1.5 with SMTP id 5mr46598994vei.8.1398274147755; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id e9si308279vct.34.2014.04.23.10.29.07 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 10:29:07 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id id10so1513640vcb.26 for ; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) X-Received: by 10.58.216.163 with SMTP id or3mr15563vec.80.1398274147658; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.221.72 with SMTP id ib8csp120714vcb; Wed, 23 Apr 2014 10:29:07 -0700 (PDT) X-Received: by 10.180.19.167 with SMTP id g7mr2791843wie.46.1398274146776; Wed, 23 Apr 2014 10:29:06 -0700 (PDT) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx.google.com with ESMTPS id ed13si1743806wic.105.2014.04.23.10.29.06 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 10:29:06 -0700 (PDT) Received-SPF: none (google.com: peter.griffin@linaro.org does not designate permitted sender hosts) client-ip=74.125.82.182; Received: by mail-we0-f182.google.com with SMTP id q59so1153219wes.41 for ; Wed, 23 Apr 2014 10:29:06 -0700 (PDT) X-Received: by 10.194.176.226 with SMTP id cl2mr3392242wjc.55.1398274146057; Wed, 23 Apr 2014 10:29:06 -0700 (PDT) Received: from localhost.localdomain (cpc14-aztw22-2-0-cust189.18-1.cable.virginm.net. [82.45.1.190]) by mx.google.com with ESMTPSA id go20sm2372382wjc.18.2014.04.23.10.29.05 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 23 Apr 2014 10:29:05 -0700 (PDT) From: Peter Griffin To: peter.griffin@linaro.org Cc: patches@linaro.org, linaro-kernel@lists.linaro.org Subject: [PATCH 13/13] video: omap: allow building on !MMU Date: Wed, 23 Apr 2014 18:28:47 +0100 Message-Id: <1398274127-2106-13-git-send-email-peter.griffin@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1398274127-2106-1-git-send-email-peter.griffin@linaro.org> References: <1398274127-2106-1-git-send-email-peter.griffin@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.griffin@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Arnd Bergmann The omap lcdc driver has an elaborate mmap_kern function to map the frame buffer into kernel address space as write-combined. This uses functions that are only available on MMU-enabled builds. It does seem equivalent to ioremap_wc though, so we should be able to just use that instead. Signed-off-by: Arnd Bergmann Signed-off-by: Peter Griffin Cc: Jean-Christophe Plagniol-Villard Cc: Tomi Valkeinen Cc: linux-fbdev@vger.kernel.org Cc: linux-omap@vger.kernel.org --- drivers/video/fbdev/omap/lcdc.c | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/video/fbdev/omap/lcdc.c b/drivers/video/fbdev/omap/lcdc.c index b52f625..40e8200 100644 --- a/drivers/video/fbdev/omap/lcdc.c +++ b/drivers/video/fbdev/omap/lcdc.c @@ -613,29 +613,11 @@ static void lcdc_dma_handler(u16 status, void *data) static int mmap_kern(void) { - struct vm_struct *kvma; - struct vm_area_struct vma; - pgprot_t pgprot; - unsigned long vaddr; - - kvma = get_vm_area(lcdc.vram_size, VM_IOREMAP); - if (kvma == NULL) { - dev_err(lcdc.fbdev->dev, "can't get kernel vm area\n"); + void __iomem *vaddr; + + vaddr = ioremap_wc(lcdc.vram_phys, lcdc.vram_size); + if (!vaddr) return -ENOMEM; - } - vma.vm_mm = &init_mm; - - vaddr = (unsigned long)kvma->addr; - vma.vm_start = vaddr; - vma.vm_end = vaddr + lcdc.vram_size; - - pgprot = pgprot_writecombine(pgprot_kernel); - if (io_remap_pfn_range(&vma, vaddr, - lcdc.vram_phys >> PAGE_SHIFT, - lcdc.vram_size, pgprot) < 0) { - dev_err(lcdc.fbdev->dev, "kernel mmap for FB memory failed\n"); - return -EAGAIN; - } lcdc.vram_virt = (void *)vaddr; @@ -644,7 +626,7 @@ static int mmap_kern(void) static void unmap_kern(void) { - vunmap(lcdc.vram_virt); + iounmap(lcdc.vram_virt); } static int alloc_palette_ram(void)