From patchwork Mon Oct 8 01:46:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Walmsley X-Patchwork-Id: 1563401 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 0B88D3FD9C for ; Mon, 8 Oct 2012 01:48:42 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TL2Qj-0001mr-Bx; Mon, 08 Oct 2012 01:46:49 +0000 Received: from utopia.booyaka.com ([74.50.51.50]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TL2Qf-0001mO-I0 for linux-arm-kernel@lists.infradead.org; Mon, 08 Oct 2012 01:46:46 +0000 Received: (qmail 27598 invoked by uid 1019); 8 Oct 2012 01:46:44 -0000 Date: Mon, 8 Oct 2012 01:46:44 +0000 (UTC) From: Paul Walmsley To: linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH] ARM: OMAP: move old debug-devices.c and debug-leds.c to be OMAP2+ only for now Message-ID: User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: tony@atomide.com, grinberg@compulab.co.il 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: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Commit 801475ccb2b2c1928b22aec4b9e5285d9e347602 ("ARM: OMAP: move debug_card_init() function") results in the following new sparse[1] warning: arch/arm/plat-omap/debug-devices.c:71:12: warning: symbol 'debug_card_init' was not declared. Should it be static? Normally this could be fixed by including the appropriate header file in plat-omap/debug-devices.c, but the header file now exists only in mach-omap2/, so this would require a "sideways include" and is thus impractical. It turns out that only code in mach-omap2/ currently uses the debug-devices.c and debug-leds.c files, so move them there. In the long term, these devices should be created by DT, and the code should be moved into drivers/ somewhere. While doing this migration, improve the Kconfig help text and fix some checkpatch/CodingStyle issues. ... 1. https://sparse.wiki.kernel.org/index.php/Main_Page Signed-off-by: Paul Walmsley Cc: Igor Grinberg Cc: Tony Lindgren --- arch/arm/mach-omap2/Kconfig | 13 +++++++++++++ arch/arm/mach-omap2/Makefile | 6 ++++++ arch/arm/{plat-omap => mach-omap2}/debug-devices.c | 7 +++++-- arch/arm/{plat-omap => mach-omap2}/debug-leds.c | 7 ++----- arch/arm/plat-omap/Kconfig | 9 --------- arch/arm/plat-omap/Makefile | 2 -- 6 files changed, 26 insertions(+), 18 deletions(-) rename arch/arm/{plat-omap => mach-omap2}/debug-devices.c (93%) rename arch/arm/{plat-omap => mach-omap2}/debug-leds.c (96%) diff --git a/arch/arm/mach-omap2/Kconfig b/arch/arm/mach-omap2/Kconfig index a6219ea..3ba2d5f 100644 --- a/arch/arm/mach-omap2/Kconfig +++ b/arch/arm/mach-omap2/Kconfig @@ -370,6 +370,19 @@ config MACH_OMAP4_PANDA select OMAP_PACKAGE_CBS select REGULATOR_FIXED_VOLTAGE if REGULATOR +config OMAP_DEBUG_DEVICES + bool + help + Partial support for some peripherals on some debug daughtercards + that can be attached to some older TI reference boards. + +config OMAP_DEBUG_LEDS + def_bool y if NEW_LEDS + depends on OMAP_DEBUG_DEVICES + help + Enables the use of some debugging LEDs that are present on the + debug daughtercards on some older TI reference boards. + config OMAP3_EMU bool "OMAP3 debugging peripherals" depends on ARCH_OMAP3 diff --git a/arch/arm/mach-omap2/Makefile b/arch/arm/mach-omap2/Makefile index fe40d9e..12fc983 100644 --- a/arch/arm/mach-omap2/Makefile +++ b/arch/arm/mach-omap2/Makefile @@ -280,3 +280,9 @@ emac-$(CONFIG_TI_DAVINCI_EMAC) := am35xx-emac.o obj-y += $(emac-m) $(emac-y) obj-y += common-board-devices.o twl-common.o + + +# Debug devices available on some TI board daughtercards -- optional + +obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o +obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o diff --git a/arch/arm/plat-omap/debug-devices.c b/arch/arm/mach-omap2/debug-devices.c similarity index 93% rename from arch/arm/plat-omap/debug-devices.c rename to arch/arm/mach-omap2/debug-devices.c index c7a4c09..00407af1 100644 --- a/arch/arm/plat-omap/debug-devices.c +++ b/arch/arm/mach-omap2/debug-devices.c @@ -17,7 +17,10 @@ #include -/* Many OMAP development platforms reuse the same "debug board"; these +#include "debug-devices.h" + +/* + * Many OMAP development platforms reuse the same "debug board"; these * platforms include H2, H3, H4, and Perseus2. */ @@ -80,7 +83,7 @@ int __init debug_card_init(u32 addr, unsigned gpio) status = gpio_request(gpio, "SMC91x irq"); if (status < 0) { - printk(KERN_ERR "GPIO%d unavailable for smc91x IRQ\n", gpio); + pr_err("GPIO%d unavailable for smc91x IRQ\n", gpio); return status; } gpio_direction_input(gpio); diff --git a/arch/arm/plat-omap/debug-leds.c b/arch/arm/mach-omap2/debug-leds.c similarity index 96% rename from arch/arm/plat-omap/debug-leds.c rename to arch/arm/mach-omap2/debug-leds.c index ea29bbe..c12350b 100644 --- a/arch/arm/plat-omap/debug-leds.c +++ b/arch/arm/mach-omap2/debug-leds.c @@ -146,11 +146,8 @@ static struct platform_driver led_driver = { static int __init fpga_init(void) { - if (machine_is_omap_h4() - || machine_is_omap_h3() - || machine_is_omap_h2() - || machine_is_omap_perseus2() - ) + if (machine_is_omap_h4() || machine_is_omap_h3() || + machine_is_omap_h2() || machine_is_omap_perseus2()) return platform_driver_register(&led_driver); return 0; } diff --git a/arch/arm/plat-omap/Kconfig b/arch/arm/plat-omap/Kconfig index ca83a76..4ae003f 100644 --- a/arch/arm/plat-omap/Kconfig +++ b/arch/arm/plat-omap/Kconfig @@ -36,15 +36,6 @@ endchoice comment "OMAP Feature Selections" -config OMAP_DEBUG_DEVICES - bool - help - For debug cards on TI reference boards. - -config OMAP_DEBUG_LEDS - def_bool y if NEW_LEDS - depends on OMAP_DEBUG_DEVICES - config POWER_AVS_OMAP bool "AVS(Adaptive Voltage Scaling) support for OMAP IP versions 1&2" depends on POWER_AVS && (ARCH_OMAP3 || ARCH_OMAP4) && PM diff --git a/arch/arm/plat-omap/Makefile b/arch/arm/plat-omap/Makefile index dacaee0..f8fc0f9 100644 --- a/arch/arm/plat-omap/Makefile +++ b/arch/arm/plat-omap/Makefile @@ -12,8 +12,6 @@ obj- := obj-$(CONFIG_ARCH_OMAP2PLUS) += omap_device.o obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o -obj-$(CONFIG_OMAP_DEBUG_DEVICES) += debug-devices.o -obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o i2c-omap-$(CONFIG_I2C_OMAP) := i2c.o obj-y += $(i2c-omap-m) $(i2c-omap-y)