From patchwork Thu Mar 14 05:53:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shawn Guo X-Patchwork-Id: 2267531 Return-Path: X-Original-To: patchwork-linux-fbdev@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 D02A9DFB79 for ; Thu, 14 Mar 2013 05:53:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435Ab3CNFxM (ORCPT ); Thu, 14 Mar 2013 01:53:12 -0400 Received: from tx2ehsobe001.messaging.microsoft.com ([65.55.88.11]:35647 "EHLO tx2outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753492Ab3CNFxL (ORCPT ); Thu, 14 Mar 2013 01:53:11 -0400 Received: from mail29-tx2-R.bigfish.com (10.9.14.251) by TX2EHSOBE012.bigfish.com (10.9.40.32) with Microsoft SMTP Server id 14.1.225.23; Thu, 14 Mar 2013 05:53:11 +0000 Received: from mail29-tx2 (localhost [127.0.0.1]) by mail29-tx2-R.bigfish.com (Postfix) with ESMTP id 135972C01B1; Thu, 14 Mar 2013 05:53:11 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h1ee6h1de0h1202h1e76h1d1ah1d2ahzz8275dhz2dh87h2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1155h) X-FB-DOMAIN-IP-MATCH: fail Received: from mail29-tx2 (localhost.localdomain [127.0.0.1]) by mail29-tx2 (MessageSwitch) id 1363240388815658_10690; Thu, 14 Mar 2013 05:53:08 +0000 (UTC) Received: from TX2EHSMHS018.bigfish.com (unknown [10.9.14.249]) by mail29-tx2.bigfish.com (Postfix) with ESMTP id BA361180140; Thu, 14 Mar 2013 05:53:08 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by TX2EHSMHS018.bigfish.com (10.9.99.118) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 14 Mar 2013 05:53:06 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.2.328.11; Thu, 14 Mar 2013 05:53:05 +0000 Received: from S2101-09.ap.freescale.net ([10.192.185.71]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r2E5qurc002272; Wed, 13 Mar 2013 22:53:03 -0700 From: Shawn Guo To: , , CC: Florian Tobias Schandinat , Andrew Morton , Shawn Guo Subject: [PATCH 2/6] video: mxsfb: remove fb_phys/fb_size from platform_data Date: Thu, 14 Mar 2013 13:53:26 +0800 Message-ID: <1363240410-16865-3-git-send-email-shawn.guo@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363240410-16865-1-git-send-email-shawn.guo@linaro.org> References: <1363240410-16865-1-git-send-email-shawn.guo@linaro.org> MIME-Version: 1.0 X-OriginatorOrg: sigmatel.com Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org There is no in-tree users of mxsfb_platform_data fb_phys/fb_size. With CMA support in the kernel, there is no real need for platform to reserve memory and pass address and size into driver via platform_data. So let's remove fb_phys/fb_size from mxsfb_platform_data to ease full device tree adoption. Signed-off-by: Shawn Guo --- drivers/video/mxsfb.c | 39 +++++++-------------------------------- include/linux/mxsfb.h | 9 --------- 2 files changed, 7 insertions(+), 41 deletions(-) diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c index 2c5ab15..776d0d5 100644 --- a/drivers/video/mxsfb.c +++ b/drivers/video/mxsfb.c @@ -168,7 +168,6 @@ struct mxsfb_info { unsigned ld_intf_width; unsigned dotclk_delay; const struct mxsfb_devdata *devdata; - int mapped; }; #define mxsfb_is_v3(host) (host->devdata->ipversion == 3) @@ -685,7 +684,7 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host) struct mxsfb_platform_data *pdata = host->pdev->dev.platform_data; dma_addr_t fb_phys; void *fb_virt; - unsigned fb_size = pdata->fb_size; + unsigned fb_size; fb_info->fbops = &mxsfb_ops; fb_info->flags = FBINFO_FLAG_DEFAULT | FBINFO_READS_FAST; @@ -705,30 +704,12 @@ static int mxsfb_init_fbinfo(struct mxsfb_info *host) host->ld_intf_width = pdata->ld_intf_width; /* Memory allocation for framebuffer */ - if (pdata->fb_phys) { - if (!fb_size) - return -EINVAL; - - fb_phys = pdata->fb_phys; + fb_size = SZ_2M; + fb_virt = alloc_pages_exact(fb_size, GFP_DMA); + if (!fb_virt) + return -ENOMEM; - if (!request_mem_region(fb_phys, fb_size, host->pdev->name)) - return -ENOMEM; - - fb_virt = ioremap(fb_phys, fb_size); - if (!fb_virt) { - release_mem_region(fb_phys, fb_size); - return -ENOMEM; - } - host->mapped = 1; - } else { - if (!fb_size) - fb_size = SZ_2M; /* default */ - fb_virt = alloc_pages_exact(fb_size, GFP_DMA); - if (!fb_virt) - return -ENOMEM; - - fb_phys = virt_to_phys(fb_virt); - } + fb_phys = virt_to_phys(fb_virt); fb_info->fix.smem_start = fb_phys; fb_info->screen_base = fb_virt; @@ -744,13 +725,7 @@ static void mxsfb_free_videomem(struct mxsfb_info *host) { struct fb_info *fb_info = &host->fb_info; - if (host->mapped) { - iounmap(fb_info->screen_base); - release_mem_region(fb_info->fix.smem_start, - fb_info->screen_size); - } else { - free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len); - } + free_pages_exact(fb_info->screen_base, fb_info->fix.smem_len); } static struct platform_device_id mxsfb_devtype[] = { diff --git a/include/linux/mxsfb.h b/include/linux/mxsfb.h index f14943d..93fc34b 100644 --- a/include/linux/mxsfb.h +++ b/include/linux/mxsfb.h @@ -35,15 +35,6 @@ struct mxsfb_platform_data { unsigned dotclk_delay; /* refer manual HW_LCDIF_VDCTRL4 register */ unsigned ld_intf_width; /* refer STMLCDIF_* macros */ - - unsigned fb_size; /* Size of the video memory. If zero a - * default will be used - */ - unsigned long fb_phys; /* physical address for the video memory. If - * zero the framebuffer memory will be dynamically - * allocated. If specified,fb_size must also be specified. - * fb_phys must be unused by Linux. - */ }; #endif /* __LINUX_MXSFB_H */