* [PATCH] fujitsu-laptop: support led-class as module
@ 2009-08-25 5:11 Jonathan Woithe
2009-08-25 11:12 ` Alan Jenkins
2009-08-27 22:53 ` Len Brown
0 siblings, 2 replies; 5+ messages in thread
From: Jonathan Woithe @ 2009-08-25 5:11 UTC (permalink / raw)
To: linux-acpi, lenb; +Cc: Jonathan Woithe
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 <stepheng+linux@gildea.com>
Support fujitsu::logolamp with led-class built as a module instead of
being compiled in.
Signed-off-by: Stephen Gildea <stepheng+linux@gildea.com>
Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
---
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
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 <linux/kfifo.h>
#include <linux/video_output.h>
#include <linux/platform_device.h>
-#ifdef CONFIG_LEDS_CLASS
+#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
#include <linux/leds.h>
#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);
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] fujitsu-laptop: support led-class as module
2009-08-25 5:11 [PATCH] fujitsu-laptop: support led-class as module Jonathan Woithe
@ 2009-08-25 11:12 ` Alan Jenkins
2009-08-26 1:38 ` Jonathan Woithe
2009-08-27 22:53 ` Len Brown
1 sibling, 1 reply; 5+ messages in thread
From: Alan Jenkins @ 2009-08-25 11:12 UTC (permalink / raw)
To: Jonathan Woithe; +Cc: linux-acpi, lenb
On 8/25/09, Jonathan Woithe <jwoithe@physics.adelaide.edu.au> wrote:
> 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 <stepheng+linux@gildea.com>
>
> Support fujitsu::logolamp with led-class built as a module instead of
> being compiled in.
>
> Signed-off-by: Stephen Gildea <stepheng+linux@gildea.com>
> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
>
> ---
> 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
>
>
> 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 <linux/kfifo.h>
> #include <linux/video_output.h>
> #include <linux/platform_device.h>
> -#ifdef CONFIG_LEDS_CLASS
> +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> #include <linux/leds.h>
> #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);
Don't you need to exclude
CONFIG_LEDS_CLASS=m
CONFIG_FUJITSU_LAPTOP=y
I think the Kconfig-fu is "depends on LEDS_CLASS || LEDS_CLASS=n".
Regards
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] fujitsu-laptop: support led-class as module
2009-08-25 11:12 ` Alan Jenkins
@ 2009-08-26 1:38 ` Jonathan Woithe
2009-08-26 8:23 ` Alan Jenkins
0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Woithe @ 2009-08-26 1:38 UTC (permalink / raw)
To: Alan Jenkins; +Cc: Jonathan Woithe, linux-acpi, lenb
Hi
> > 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.
> > :
>
> Don't you need to exclude
>
> CONFIG_LEDS_CLASS=m
> CONFIG_FUJITSU_LAPTOP=y
Hmm, good point. Admittedly this would be a rare case since most
distributors would ship with both CONFIG_LEDS_CLASS and
CONFIG_FUJITSU_LAPTOP set to "m" - a situation which the proposed patch
at least makes workable.
> I think the Kconfig-fu is "depends on LEDS_CLASS || LEDS_CLASS=n".
So, basically something like this should do the trick:
signed-off-by: Alan Jenkins <sourcejedi.lkml@googlemail.com>
signed-off-by: Joathan Woithe <jwoithe@physics.adelaide.edu.au>
--- a/drivers/platform/x86/Kconfig 2009-08-26 11:03:20.000000000 +0930
+++ b/drivers/platform/x86/Kconfig 2009-08-26 11:04:28.000000000 +0930
@@ -82,6 +82,7 @@
depends on ACPI
depends on INPUT
depends on BACKLIGHT_CLASS_DEVICE
+ depends on LEDS_CLASS || LEDS_CLASS=n
---help---
This is a driver for laptops built by Fujitsu:
Regards
jonathan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fujitsu-laptop: support led-class as module
2009-08-26 1:38 ` Jonathan Woithe
@ 2009-08-26 8:23 ` Alan Jenkins
0 siblings, 0 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-08-26 8:23 UTC (permalink / raw)
To: Jonathan Woithe; +Cc: alan-jenkins, linux-acpi, lenb
On 8/26/09, Jonathan Woithe <jwoithe@physics.adelaide.edu.au> wrote:
> Hi
>
>> > 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.
>> > :
>>
>> Don't you need to exclude
>>
>> CONFIG_LEDS_CLASS=m
>> CONFIG_FUJITSU_LAPTOP=y
>
> Hmm, good point. Admittedly this would be a rare case since most
> distributors would ship with both CONFIG_LEDS_CLASS and
> CONFIG_FUJITSU_LAPTOP set to "m" - a situation which the proposed patch
> at least makes workable.
>
>> I think the Kconfig-fu is "depends on LEDS_CLASS || LEDS_CLASS=n".
>
> So, basically something like this should do the trick:
>
> signed-off-by: Alan Jenkins <sourcejedi.lkml@googlemail.com>
> signed-off-by: Joathan Woithe <jwoithe@physics.adelaide.edu.au>
>
> --- a/drivers/platform/x86/Kconfig 2009-08-26 11:03:20.000000000 +0930
> +++ b/drivers/platform/x86/Kconfig 2009-08-26 11:04:28.000000000 +0930
> @@ -82,6 +82,7 @@
> depends on ACPI
> depends on INPUT
> depends on BACKLIGHT_CLASS_DEVICE
> + depends on LEDS_CLASS || LEDS_CLASS=n
> ---help---
> This is a driver for laptops built by Fujitsu:
>
> Regards
> jonathan
Yeah. It's a really random scenario, but people do make randconfig
for testing and it's expected to work.
I'd prefer you used my other address
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Thanks
Alan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fujitsu-laptop: support led-class as module
2009-08-25 5:11 [PATCH] fujitsu-laptop: support led-class as module Jonathan Woithe
2009-08-25 11:12 ` Alan Jenkins
@ 2009-08-27 22:53 ` Len Brown
1 sibling, 0 replies; 5+ messages in thread
From: Len Brown @ 2009-08-27 22:53 UTC (permalink / raw)
To: Jonathan Woithe; +Cc: linux-acpi
On Tue, 25 Aug 2009, Jonathan Woithe wrote:
> 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 <stepheng+linux@gildea.com>
Note that a From-override works only if it is the 1st line of the body.
> Support fujitsu::logolamp with led-class built as a module instead of
> being compiled in.
>
> Signed-off-by: Stephen Gildea <stepheng+linux@gildea.com>
> Acked-by: Jonathan Woithe <jwoithe@physics.adelaide.edu.au>
>
> ---
Note that everything above this ---
gets put into the check-in commant
and evertying below (until the patch) is thrown away.
(unless i manually edit like i did this time, but would
rather not have to do)
applied.
thanks
-Len Brown, Intel Open Source Technology Center
> 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
>
>
> 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 <linux/kfifo.h>
> #include <linux/video_output.h>
> #include <linux/platform_device.h>
> -#ifdef CONFIG_LEDS_CLASS
> +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
> #include <linux/leds.h>
> #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);
>
>
> --
> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-08-27 22:53 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-25 5:11 [PATCH] fujitsu-laptop: support led-class as module Jonathan Woithe
2009-08-25 11:12 ` Alan Jenkins
2009-08-26 1:38 ` Jonathan Woithe
2009-08-26 8:23 ` Alan Jenkins
2009-08-27 22:53 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox