From patchwork Tue Aug 25 05:11:52 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Woithe X-Patchwork-Id: 43697 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 n7P5ILoX009999 for ; Tue, 25 Aug 2009 05:18:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbZHYFSB (ORCPT ); Tue, 25 Aug 2009 01:18:01 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754429AbZHYFSB (ORCPT ); Tue, 25 Aug 2009 01:18:01 -0400 Received: from adelphi.physics.adelaide.edu.au ([129.127.102.1]:56791 "EHLO adelphi.physics.adelaide.edu.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754001AbZHYFSA (ORCPT ); Tue, 25 Aug 2009 01:18:00 -0400 Received: from turbo.physics.adelaide.edu.au (IDENT:0@turbo [129.127.102.108]) by adelphi.physics.adelaide.edu.au (8.13.7/8.13.7/UofA-Physics-1.0) with ESMTP id n7P5BrtQ005343; Tue, 25 Aug 2009 14:41:53 +0930 Received: from turbo.physics.adelaide.edu.au (IDENT:7157@localhost [127.0.0.1]) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4) with ESMTP id n7P5BqHG006904; Tue, 25 Aug 2009 14:41:52 +0930 Received: (from jwoithe@localhost) by turbo.physics.adelaide.edu.au (8.13.4/8.13.4/Submit) id n7P5BqSY006903; Tue, 25 Aug 2009 14:41:52 +0930 From: Jonathan Woithe Message-Id: <200908250511.n7P5BqSY006903@turbo.physics.adelaide.edu.au> Subject: [PATCH] fujitsu-laptop: support led-class as module To: linux-acpi@vger.kernel.org, lenb@kernel.org Date: Tue, 25 Aug 2009 14:41:52 +0930 (CST) Cc: jwoithe@physics.adelaide.edu.au (Jonathan Woithe) X-Mailer: ELM [version 2.5 PL6] MIME-Version: 1.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Hi Len Please consider slipping this in to 2.6.31-rc since it's a fairly trivial bug fix to ensure that fujitsu-laptop uses the LEDS class even when the LEDS class been compiled as a module. If that's not possible or viewed as inappropriate then let's go for 2.6.32. Thanks jonathan From: Stephen Gildea Support fujitsu::logolamp with led-class built as a module instead of being compiled in. Signed-off-by: Stephen Gildea Acked-by: Jonathan Woithe --- A friend pointed out to me that fujitsu-laptop LED support doesn't work with CONFIG_LEDS_CLASS=m. We require CONFIG_LEDS_CLASS=y. He noticed this because his distro ships led-class as a module, not compiled in as my kernels are built. It appears this straightforward patch against 2.6.31-rc7 fixes the problem. < Stephen -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 218b9a1..4c8897a 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c @@ -66,7 +66,7 @@ #include #include #include -#ifdef CONFIG_LEDS_CLASS +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) #include #endif @@ -96,7 +96,7 @@ /* FUNC interface - responses */ #define UNSUPPORTED_CMD 0x80000000 -#ifdef CONFIG_LEDS_CLASS +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) /* FUNC interface - LED control */ #define FUNC_LED_OFF 0x1 #define FUNC_LED_ON 0x30001 @@ -176,7 +176,7 @@ static struct fujitsu_hotkey_t *fujitsu_hotkey; static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event); -#ifdef CONFIG_LEDS_CLASS +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) static enum led_brightness logolamp_get(struct led_classdev *cdev); static void logolamp_set(struct led_classdev *cdev, enum led_brightness brightness); @@ -257,7 +257,7 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2) return out_obj.integer.value; } -#ifdef CONFIG_LEDS_CLASS +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) /* LED class callbacks */ static void logolamp_set(struct led_classdev *cdev, @@ -911,7 +911,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0)); - #ifdef CONFIG_LEDS_CLASS + #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) { result = led_classdev_register(&fujitsu->pf_device->dev, &logolamp_led); @@ -1204,7 +1204,7 @@ fail_acpi: static void __exit fujitsu_cleanup(void) { - #ifdef CONFIG_LEDS_CLASS + #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) if (fujitsu_hotkey->logolamp_registered != 0) led_classdev_unregister(&logolamp_led);