From patchwork Sat Nov 17 13:57:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 1759301 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id F272C3FCAE for ; Sat, 17 Nov 2012 14:01:19 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TZivI-0006gY-Nr; Sat, 17 Nov 2012 13:59:05 +0000 Received: from smtp32.i.mail.ru ([94.100.177.92]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TZitr-0006Bz-3d for linux-arm-kernel@lists.infradead.org; Sat, 17 Nov 2012 13:57:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=sqnVpPQ4bkEUi2coV1m0QihchZjPTpqfJm8flqtD0VA=; b=QUtxOV5ztuuaUl1YaYANjcvfrTxICwZirLcjJO+aQ4Fj6J1R1u0IfbFkzj1ugNUizkmgwQPUPvDU3QHgyqfApKU6rke5HWPNl1N8U6W4AGE5I/Chp9rTe+KowJzRXMfp; Received: from [188.134.40.128] (port=37195 helo=shc.zet) by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1TZitp-0006q5-MW; Sat, 17 Nov 2012 17:57:33 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v3 03/18] ARM: clps711x: Transform clps711x-framebuffer to platform driver and use it Date: Sat, 17 Nov 2012 17:57:09 +0400 Message-Id: <1353160644-22446-4-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1353160644-22446-1-git-send-email-shc_work@mail.ru> References: <1353160644-22446-1-git-send-email-shc_work@mail.ru> X-Spam: Not detected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20121117_085735_731574_41A0036E X-CRM114-Status: GOOD ( 15.95 ) X-Spam-Score: -2.0 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (shc_work[at]mail.ru) -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Cc: Olof Johansson , Russell King , Alexander Shiyan , Arnd Bergmann X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org clps711x-framebuffer driver needs to be updated and this is a first step to make driver better. With this patch we are convert clps711x-framebuffer to platform device and load this driver from board code. Signed-off-by: Alexander Shiyan --- arch/arm/mach-clps711x/autcpu12.c | 1 + arch/arm/mach-clps711x/edb7211.c | 1 + arch/arm/mach-clps711x/p720t.c | 6 ++++++ drivers/video/clps711xfb.c | 21 +++++++++++++++------ 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/arch/arm/mach-clps711x/autcpu12.c b/arch/arm/mach-clps711x/autcpu12.c index d9b7f94..c20043b 100644 --- a/arch/arm/mach-clps711x/autcpu12.c +++ b/arch/arm/mach-clps711x/autcpu12.c @@ -61,6 +61,7 @@ static struct platform_device autcpu12_nvram_pdev __initdata = { static void __init autcpu12_init(void) { + platform_device_register_simple("video-clps711x", 0, NULL, 0); platform_device_register_simple("cs89x0", 0, autcpu12_cs8900_resource, ARRAY_SIZE(autcpu12_cs8900_resource)); platform_device_register(&autcpu12_nvram_pdev); diff --git a/arch/arm/mach-clps711x/edb7211.c b/arch/arm/mach-clps711x/edb7211.c index 7add9ad..59dec3b 100644 --- a/arch/arm/mach-clps711x/edb7211.c +++ b/arch/arm/mach-clps711x/edb7211.c @@ -83,6 +83,7 @@ fixup_edb7211(struct tag *tags, char **cmdline, struct meminfo *mi) static void __init edb7211_init(void) { + platform_device_register_simple("video-clps711x", 0, NULL, 0); platform_device_register_simple("cs89x0", 0, edb7211_cs8900_resource, ARRAY_SIZE(edb7211_cs8900_resource)); } diff --git a/arch/arm/mach-clps711x/p720t.c b/arch/arm/mach-clps711x/p720t.c index 8fe33b3..d95cb8a 100644 --- a/arch/arm/mach-clps711x/p720t.c +++ b/arch/arm/mach-clps711x/p720t.c @@ -119,6 +119,11 @@ static struct gpio_led_platform_data p720t_gpio_led_pdata __initdata = { .num_leds = ARRAY_SIZE(p720t_gpio_leds), }; +static void __init p720t_init(void) +{ + platform_device_register_simple("video-clps711x", 0, NULL, 0); +} + static void __init p720t_init_late(void) { platform_device_register_data(&platform_bus, "leds-gpio", 0, @@ -134,6 +139,7 @@ MACHINE_START(P720T, "ARM-Prospector720T") .init_early = p720t_init_early, .init_irq = clps711x_init_irq, .timer = &clps711x_timer, + .init_machine = p720t_init, .init_late = p720t_init_late, .restart = clps711x_restart, MACHINE_END diff --git a/drivers/video/clps711xfb.c b/drivers/video/clps711xfb.c index f994c8b..2ccbb9b 100644 --- a/drivers/video/clps711xfb.c +++ b/drivers/video/clps711xfb.c @@ -270,7 +270,7 @@ static const struct file_operations backlight_proc_fops = { .write = backlight_proc_write, }; -static void __init clps711x_guess_lcd_params(struct fb_info *info) +static void __devinit clps711x_guess_lcd_params(struct fb_info *info) { unsigned int lcdcon, syscon, size; unsigned long phys_base = PAGE_OFFSET; @@ -358,7 +358,7 @@ static void __init clps711x_guess_lcd_params(struct fb_info *info) info->fix.type = FB_TYPE_PACKED_PIXELS; } -int __init clps711xfb_init(void) +static int __devinit clps711x_fb_probe(struct platform_device *pdev) { int err = -ENOMEM; @@ -410,7 +410,7 @@ int __init clps711xfb_init(void) out: return err; } -static void __exit clps711xfb_exit(void) +static int __devexit clps711x_fb_remove(struct platform_device *pdev) { unregister_framebuffer(cfb); kfree(cfb); @@ -422,11 +422,20 @@ static void __exit clps711xfb_exit(void) PLD_LCDEN = 0; PLD_PWR &= ~(PLD_S4_ON|PLD_S3_ON|PLD_S2_ON|PLD_S1_ON); } + + return 0; } -module_init(clps711xfb_init); -module_exit(clps711xfb_exit); +static struct platform_driver clps711x_fb_driver = { + .driver = { + .name = "video-clps711x", + .owner = THIS_MODULE, + }, + .probe = clps711x_fb_probe, + .remove = __devexit_p(clps711x_fb_remove), +}; +module_platform_driver(clps711x_fb_driver); MODULE_AUTHOR("Russell King "); -MODULE_DESCRIPTION("CLPS711x framebuffer driver"); +MODULE_DESCRIPTION("CLPS711X framebuffer driver"); MODULE_LICENSE("GPL");