From patchwork Tue May 12 09:57:45 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 23207 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4CA0cbb030397 for ; Tue, 12 May 2009 10:00:38 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753277AbZELKAg (ORCPT ); Tue, 12 May 2009 06:00:36 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752872AbZELKAg (ORCPT ); Tue, 12 May 2009 06:00:36 -0400 Received: from wa-out-1112.google.com ([209.85.146.176]:19861 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753277AbZELKAf (ORCPT ); Tue, 12 May 2009 06:00:35 -0400 Received: by wa-out-1112.google.com with SMTP id j5so1870695wah.21 for ; Tue, 12 May 2009 03:00:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=VjFMLZszF9HXJSB877n+dCuG0kvGreyTteAvFLJi+Ms=; b=GznmPAUsHyC50TSUJnzGcBRBqZfEkjW4pICoMtxfDYhCMJRSceQ7TOJ9QcS7g+0TEy 9COqUmNYfj061aKCFK6qASjX38z8/GPC+7sG+YRsI4Z5EHnONKJ1i4H3NuTRKbZePSr5 tdfHPW5MAhUIeVsG/XfJOOipEDy9g6a/ujGTA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=xhOokqCGD2+0bXDxRTPobT9ZhIB5Ti3LKSDeHxmitge3mb0+fq6M8bAJ13x9tXFnrd 4XSHnxdvnOLmE8pgMexLBpNSQvcYL2M0lnfsQPjTpQNiZN5MlQ0Cj8jKpZB5beY1DwNS UYmIGISMQ9rMDhgVe/4OVlf1JDqphGHV1j9Bk= Received: by 10.114.137.16 with SMTP id k16mr6142827wad.189.1242122436053; Tue, 12 May 2009 03:00:36 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id m28sm7390262waf.2.2009.05.12.03.00.34 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 03:00:35 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, linux-fbdev-devel@lists.sourceforge.net Date: Tue, 12 May 2009 18:57:45 +0900 Message-Id: <20090512095745.25477.87326.sendpatchset@rx1.opensource.se> Subject: [PATCH] video: add sh_mobile_lcdcfb memory resource Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch adds memory resource support to the LCDC driver. With this applied the physical memory range used for framebuffer data will show up in /proc/iomem together with other SuperH Mobile devices. Signed-off-by: Magnus Damm --- drivers/video/sh_mobile_lcdcfb.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0001/drivers/video/sh_mobile_lcdcfb.c +++ work/drivers/video/sh_mobile_lcdcfb.c 2009-05-11 21:14:35.000000000 +0900 @@ -35,6 +35,7 @@ struct sh_mobile_lcdc_chan { struct fb_deferred_io defio; unsigned long frame_end; wait_queue_head_t frame_end_wait; + struct resource memory; }; struct sh_mobile_lcdc_priv { @@ -813,12 +814,26 @@ static int __init sh_mobile_lcdc_probe(s break; } + res = &priv->ch[i].memory; + res->name = "lcdc"; + res->start = priv->ch[i].dma_handle; + res->end = res->start + info->fix.smem_len - 1; + res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; + error = insert_resource(&iomem_resource, res); + if (error) { + dev_err(&pdev->dev, "unable to request resource\n"); + dma_free_coherent(&pdev->dev, info->fix.smem_len, + buf, priv->ch[i].dma_handle); + break; + } + info->pseudo_palette = &priv->ch[i].pseudo_palette; info->flags = FBINFO_FLAG_DEFAULT; error = fb_alloc_cmap(&info->cmap, PALETTE_NR, 0); if (error < 0) { dev_err(&pdev->dev, "unable to allocate cmap\n"); + release_resource(res); dma_free_coherent(&pdev->dev, info->fix.smem_len, buf, priv->ch[i].dma_handle); break; @@ -887,6 +902,7 @@ static int sh_mobile_lcdc_remove(struct if (!info->device) continue; + release_resource(&priv->ch[i].memory); dma_free_coherent(&pdev->dev, info->fix.smem_len, info->screen_base, priv->ch[i].dma_handle); fb_dealloc_cmap(&info->cmap);