public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
@ 2009-05-13 14:10 Tobias Müller
  2009-05-13 22:14 ` Andrew Morton
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Müller @ 2009-05-13 14:10 UTC (permalink / raw)
  To: linux-kernel; +Cc: Tobias Müller

From: Tobias Mueller <Tobias_Mueller@twam.info>

Added initialisation of GPIO ports for compatibility with boards with Award
BIOS (e.g. ALIX.3D3).
Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>
---
diff --git a/drivers/leds/leds-alix2.c b/drivers/leds/leds-alix2.c
index ddbd773..bda9403 100644
--- a/drivers/leds/leds-alix2.c
+++ b/drivers/leds/leds-alix2.c
@@ -14,7 +14,7 @@

 static int force = 0;
 module_param(force, bool, 0444);
-MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs");
+MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");

 struct alix_led {
 	struct led_classdev cdev;
@@ -155,6 +155,11 @@ static int __init alix_led_init(void)
 		goto out;
 	}

+	/* enable output on GPIO for LED 1,2,3 */
+	outl(1 << 6, 0x6104);
+	outl(1 << 9, 0x6184);
+	outl(1 << 11, 0x6184);
+
 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
 	if (!IS_ERR(pdev)) {
 		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-13 14:10 [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS Tobias Müller
@ 2009-05-13 22:14 ` Andrew Morton
  2009-05-14  9:08   ` Tobias Müller
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Morton @ 2009-05-13 22:14 UTC (permalink / raw)
  To: Tobias_Mueller; +Cc: linux-kernel, Richard Purdie, Constantin Baranov

On Wed, 13 May 2009 16:10:27 +0200
Tobias M__ller <Tobias_Mueller@twam.info> wrote:

> From: Tobias Mueller <Tobias_Mueller@twam.info>
> 
> Added initialisation of GPIO ports for compatibility with boards with Award
> BIOS (e.g. ALIX.3D3).
> Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>
> ---
> diff --git a/drivers/leds/leds-alix2.c b/drivers/leds/leds-alix2.c
> index ddbd773..bda9403 100644
> --- a/drivers/leds/leds-alix2.c
> +++ b/drivers/leds/leds-alix2.c
> @@ -14,7 +14,7 @@
> 
>  static int force = 0;
>  module_param(force, bool, 0444);
> -MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs");
> +MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");
> 
>  struct alix_led {
>  	struct led_classdev cdev;
> @@ -155,6 +155,11 @@ static int __init alix_led_init(void)
>  		goto out;
>  	}
> 
> +	/* enable output on GPIO for LED 1,2,3 */
> +	outl(1 << 6, 0x6104);
> +	outl(1 << 9, 0x6184);
> +	outl(1 << 11, 0x6184);
> +
>  	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
>  	if (!IS_ERR(pdev)) {
>  		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);

Will this cause problems on boards which are _not_ running that BIOS?

IOW, is this change backward-compatible?

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-13 22:14 ` Andrew Morton
@ 2009-05-14  9:08   ` Tobias Müller
  2009-05-14 20:09     ` Constantin Baranov
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Müller @ 2009-05-14  9:08 UTC (permalink / raw)
  To: Andrew Morton
  Cc: linux-kernel, Richard Purdie, Constantin Baranov,
	Tobias Müller

2009/5/14 Andrew Morton <akpm@linux-foundation.org>:
> Will this cause problems on boards which are _not_ running that BIOS?
No. These initialisations is already done there by BIOS, but setting
the registers twice doesn't matter. It's just configurating these pins
as an output.

> IOW, is this change backward-compatible?
Yes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-14  9:08   ` Tobias Müller
@ 2009-05-14 20:09     ` Constantin Baranov
  2009-05-14 20:23       ` Tobias Müller
  0 siblings, 1 reply; 9+ messages in thread
From: Constantin Baranov @ 2009-05-14 20:09 UTC (permalink / raw)
  To: Tobias_Mueller; +Cc: Andrew Morton, linux-kernel, Richard Purdie

Do these boards support DMI? In that case, I suggest to write another
function, say alix_award_present(). It shall first check DMI and then
initialize GPIOs.

On Thu, 14 May 2009 11:08:45 +0200 Tobias Müller <Tobias_Mueller@twam.info> wrote:
> 2009/5/14 Andrew Morton <akpm@linux-foundation.org>:
> > Will this cause problems on boards which are _not_ running that BIOS?
> No. These initialisations is already done there by BIOS, but setting
> the registers twice doesn't matter. It's just configurating these pins
> as an output.
> 
> > IOW, is this change backward-compatible?
> Yes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-14 20:09     ` Constantin Baranov
@ 2009-05-14 20:23       ` Tobias Müller
  2009-05-14 21:32         ` Constantin Baranov
  0 siblings, 1 reply; 9+ messages in thread
From: Tobias Müller @ 2009-05-14 20:23 UTC (permalink / raw)
  To: Constantin Baranov; +Cc: Andrew Morton, linux-kernel, Richard Purdie

2009/5/14 Constantin Baranov <const@mimas.ru>:
> Do these boards support DMI? In that case, I suggest to write another
> function, say alix_award_present(). It shall first check DMI and then

Unfortunately, they don't.

I already searched the BIOS for characteristical strings, but it
seems to be there very basic version of Award BIOS. f It had a
characteric string or something like that then I had adjustet
alix_present(), because at the moment the force=1 parameter
is needed on boards with Award BIOS.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-14 20:23       ` Tobias Müller
@ 2009-05-14 21:32         ` Constantin Baranov
  2009-05-16  9:52           ` Tobias Müller
  0 siblings, 1 reply; 9+ messages in thread
From: Constantin Baranov @ 2009-05-14 21:32 UTC (permalink / raw)
  To: Tobias_Mueller; +Cc: Andrew Morton, linux-kernel, Richard Purdie

On Thu, 14 May 2009 22:23:51 +0200 Tobias Müller <Tobias_Mueller@twam.info> wrote:
>> Do these boards support DMI? In that case, I suggest to write another
> Unfortunately, they don't.
> I already searched the BIOS for characteristical strings, but it
> seems to be there very basic version of Award BIOS. f It had a

OK, 'double' initialization seems good.
I will test it on my ALIX.2c3 later.

> alix_present(), because at the moment the force=1 parameter
> is needed on boards with Award BIOS.

It should be stated in the Kconfig help message that the 'force' is
required for boards with Award BIOS.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-14 21:32         ` Constantin Baranov
@ 2009-05-16  9:52           ` Tobias Müller
  2009-05-16 10:11             ` [PATCH v3 001/001] " Tobias Müller
  2009-05-16 15:21             ` Constantin Baranov
  0 siblings, 2 replies; 9+ messages in thread
From: Tobias Müller @ 2009-05-16  9:52 UTC (permalink / raw)
  To: Constantin Baranov; +Cc: Andrew Morton, linux-kernel, Richard Purdie

2009/5/14 Constantin Baranov <const@mimas.ru>:
> OK, 'double' initialization seems good.
> I will test it on my ALIX.2c3 later.
Did you get some results>

> It should be stated in the Kconfig help message that the 'force' is
> required for boards with Award BIOS.
I added this.

From: Tobias Mueller <Tobias_Mueller@twam.info>

Added initialisation of GPIO ports for compatibility with boards with Award
BIOS (e.g. ALIX.3D3).
Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>
---
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 7427136..ecf1b9c 100644
--- a/linux-2.6.29.3-org/drivers/leds/Kconfig
+++ b/linux-2.6.29.3/drivers/leds/Kconfig
@@ -68,6 +68,7 @@ config LEDS_ALIX2
 	depends on LEDS_CLASS && X86 && EXPERIMENTAL
 	help
 	  This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs.
+	  You have to set leds.alix2.force=1 for boards with Award BIOS.

 config LEDS_H1940
 	tristate "LED Support for iPAQ H1940 device"
diff --git a/drivers/leds/leds-alix2.c b/drivers/leds/leds-alix2.c
index ddbd773..731d4ee 100644
--- a/linux-2.6.29.3-org/drivers/leds/leds-alix2.c
+++ b/linux-2.6.29.3/drivers/leds/leds-alix2.c
@@ -14,7 +14,7 @@

 static int force = 0;
 module_param(force, bool, 0444);
-MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs");
+MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");

 struct alix_led {
 	struct led_classdev cdev;
@@ -155,6 +155,11 @@ static int __init alix_led_init(void)
 		goto out;
 	}

+	/* enable output on GPIO for LED 1,2,3 */
+	outl(1 << 6, 0x6104);
+	outl(1 << 9, 0x6184);
+	outl(1 << 11, 0x6184);
+
 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
 	if (!IS_ERR(pdev)) {
 		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH v3 001/001] [PATCH 001/001] leds: alix-leds2 fixed for Award  BIOS
  2009-05-16  9:52           ` Tobias Müller
@ 2009-05-16 10:11             ` Tobias Müller
  2009-05-16 15:21             ` Constantin Baranov
  1 sibling, 0 replies; 9+ messages in thread
From: Tobias Müller @ 2009-05-16 10:11 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Constantin Baranov, Richard Purdie

From: Tobias Mueller <Tobias_Mueller@twam.info>

Added initialisation of GPIO ports for compatibility with boards with Award
BIOS (e.g. ALIX.3D3).
Signed-off-by: Tobias Mueller <Tobias_Mueller@twam.info>
---
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig
index 9b60b6b..37e9118 100644
--- a/drivers/leds/Kconfig
+++ b/drivers/leds/Kconfig
@@ -75,6 +75,7 @@ config LEDS_ALIX2
 	depends on LEDS_CLASS && X86 && EXPERIMENTAL
 	help
 	  This option enables support for the PCEngines ALIX.2 and ALIX.3 LEDs.
+	  You have to set leds-alix2.force=1 for boards with Award BIOS.

 config LEDS_H1940
 	tristate "LED Support for iPAQ H1940 device"
diff --git a/drivers/leds/leds-alix2.c b/drivers/leds/leds-alix2.c
index ddbd773..731d4ee 100644
--- a/drivers/leds/leds-alix2.c
+++ b/drivers/leds/leds-alix2.c
@@ -14,7 +14,7 @@

 static int force = 0;
 module_param(force, bool, 0444);
-MODULE_PARM_DESC(force, "Assume system has ALIX.2 style LEDs");
+MODULE_PARM_DESC(force, "Assume system has ALIX.2/ALIX.3 style LEDs");

 struct alix_led {
 	struct led_classdev cdev;
@@ -155,6 +155,11 @@ static int __init alix_led_init(void)
 		goto out;
 	}

+	/* enable output on GPIO for LED 1,2,3 */
+	outl(1 << 6, 0x6104);
+	outl(1 << 9, 0x6184);
+	outl(1 << 11, 0x6184);
+
 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
 	if (!IS_ERR(pdev)) {
 		ret = platform_driver_probe(&alix_led_driver, alix_led_probe);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS
  2009-05-16  9:52           ` Tobias Müller
  2009-05-16 10:11             ` [PATCH v3 001/001] " Tobias Müller
@ 2009-05-16 15:21             ` Constantin Baranov
  1 sibling, 0 replies; 9+ messages in thread
From: Constantin Baranov @ 2009-05-16 15:21 UTC (permalink / raw)
  To: Tobias_Mueller; +Cc: Andrew Morton, linux-kernel, Richard Purdie

On Sat, 16 May 2009 11:52:35 +0200 Tobias Müller <Tobias_Mueller@twam.info> wrote:
> 2009/5/14 Constantin Baranov <const@mimas.ru>:
> > OK, 'double' initialization seems good.
> > I will test it on my ALIX.2c3 later.
> Did you get some results>
Yes, I have not found any effect of those three outls on ALIX.2c3.
Thus I consider the patch to be safe.

Reviewed-by: Constantin Baranov <const@mimas.ru>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-05-16 15:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 14:10 [PATCH 001/001] leds: alix-leds2 fixed for Award BIOS Tobias Müller
2009-05-13 22:14 ` Andrew Morton
2009-05-14  9:08   ` Tobias Müller
2009-05-14 20:09     ` Constantin Baranov
2009-05-14 20:23       ` Tobias Müller
2009-05-14 21:32         ` Constantin Baranov
2009-05-16  9:52           ` Tobias Müller
2009-05-16 10:11             ` [PATCH v3 001/001] " Tobias Müller
2009-05-16 15:21             ` Constantin Baranov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox