* [GIT PULL] ibm-acpi updates
@ 2007-02-22 20:55 Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 1/2] ACPI: ibm-acpi: fix initial status of backlight device Henrique de Moraes Holschuh
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-22 20:55 UTC (permalink / raw)
To: lenb; +Cc: linux-acpi, ibm-acpi-devel
Len,
Please pull from git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
branch for-upstream/acpi-test
to receive the following patches:
ACPI: ibm-acpi: make ibm-acpi bay support optional
ACPI: ibm-acpi: fix initial status of backlight device
The branch is based on 2.6.21-rc1.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ACPI: ibm-acpi: fix initial status of backlight device
2007-02-22 20:55 [GIT PULL] ibm-acpi updates Henrique de Moraes Holschuh
@ 2007-02-22 23:11 ` Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 2/2] ACPI: ibm-acpi: make ibm-acpi bay support optional Henrique de Moraes Holschuh
2007-02-23 6:29 ` [GIT PULL] ibm-acpi updates Len Brown
2 siblings, 0 replies; 6+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-22 23:11 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
The brightness class core does not update the initial status of the
device's brightness at register time. Do it by ourselves.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Acked-by: Richard Purdie <rpurdie@rpsys.net>
---
drivers/acpi/ibm_acpi.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 4cc534e..7c1b418 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -1711,6 +1711,12 @@ static struct backlight_ops ibm_backlight_data = {
static int brightness_init(void)
{
+ int b;
+
+ b = brightness_get(NULL);
+ if (b < 0)
+ return b;
+
ibm_backlight_device = backlight_device_register("ibm", NULL, NULL,
&ibm_backlight_data);
if (IS_ERR(ibm_backlight_device)) {
@@ -1718,7 +1724,9 @@ static int brightness_init(void)
return PTR_ERR(ibm_backlight_device);
}
- ibm_backlight_device->props.max_brightness = 7;
+ ibm_backlight_device->props.max_brightness = 7;
+ ibm_backlight_device->props.brightness = b;
+ backlight_update_status(ibm_backlight_device);
return 0;
}
--
1.4.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ACPI: ibm-acpi: make ibm-acpi bay support optional
2007-02-22 20:55 [GIT PULL] ibm-acpi updates Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 1/2] ACPI: ibm-acpi: fix initial status of backlight device Henrique de Moraes Holschuh
@ 2007-02-22 23:11 ` Henrique de Moraes Holschuh
2007-02-23 6:29 ` [GIT PULL] ibm-acpi updates Len Brown
2 siblings, 0 replies; 6+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-22 23:11 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Henrique de Moraes Holschuh
Make ibm-acpi bay support optional at kernel compile time.
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
---
drivers/acpi/Kconfig | 11 +++++++++++
drivers/acpi/ibm_acpi.c | 12 ++++++++++++
2 files changed, 23 insertions(+), 0 deletions(-)
diff --git a/drivers/acpi/Kconfig b/drivers/acpi/Kconfig
index e942ffe..ee3dcd1 100644
--- a/drivers/acpi/Kconfig
+++ b/drivers/acpi/Kconfig
@@ -242,6 +242,17 @@ config ACPI_IBM_DOCK
If you are not sure, say N here.
+config ACPI_IBM_BAY
+ bool "Legacy Removable Bay Support"
+ depends on ACPI_IBM
+ default y
+ ---help---
+ Allows the ibm_acpi driver to handle removable bays. It will allow
+ disabling the device in the bay, and also generate notifications when
+ the bay lever is ejected or inserted.
+
+ If you are not sure, say Y here.
+
config ACPI_TOSHIBA
tristate "Toshiba Laptop Extras"
depends on X86
diff --git a/drivers/acpi/ibm_acpi.c b/drivers/acpi/ibm_acpi.c
index 7c1b418..e7309a6 100644
--- a/drivers/acpi/ibm_acpi.c
+++ b/drivers/acpi/ibm_acpi.c
@@ -157,6 +157,7 @@ IBM_HANDLE(dock, root, "\\_SB.GDCK", /* X30, X31, X40 */
"\\_SB.PCI.ISA.SLCE", /* 570 */
); /* A21e,G4x,R30,R31,R32,R40,R40e,R50e */
#endif
+#ifdef CONFIG_ACPI_IBM_BAY
IBM_HANDLE(bay, root, "\\_SB.PCI.IDE.SECN.MAST", /* 570 */
"\\_SB.PCI0.IDE0.IDES.IDSM", /* 600e/x, 770e, 770x */
"\\_SB.PCI0.SATA.SCND.MSTR", /* T60, X60, Z60 */
@@ -174,6 +175,7 @@ IBM_HANDLE(bay2, root, "\\_SB.PCI0.IDE0.PRIM.SLAV", /* A3x, R32 */
IBM_HANDLE(bay2_ej, bay2, "_EJ3", /* 600e/x, 770e, A3x */
"_EJ0", /* 770x */
); /* all others */
+#endif /* CONFIG_ACPI_IBM_BAY */
/* don't list other alternatives as we install a notify handler on the 570 */
IBM_HANDLE(pci, root, "\\_SB.PCI"); /* 570 */
@@ -1044,6 +1046,7 @@ static int light_write(char *buf)
return 0;
}
+#if defined(CONFIG_ACPI_IBM_DOCK) || defined(CONFIG_ACPI_IBM_BAY)
static int _sta(acpi_handle handle)
{
int status;
@@ -1053,6 +1056,7 @@ static int _sta(acpi_handle handle)
return status;
}
+#endif
#ifdef CONFIG_ACPI_IBM_DOCK
#define dock_docked() (_sta(dock_handle) & 1)
@@ -1119,6 +1123,7 @@ static void dock_notify(struct ibm_struct *ibm, u32 event)
}
#endif
+#ifdef CONFIG_ACPI_IBM_BAY
static int bay_status_supported;
static int bay_status2_supported;
static int bay_eject_supported;
@@ -1194,6 +1199,7 @@ static void bay_notify(struct ibm_struct *ibm, u32 event)
{
acpi_bus_generate_event(ibm->device, event, 0);
}
+#endif /* CONFIG_ACPI_IBM_BAY */
static int cmos_read(char *p)
{
@@ -2361,6 +2367,7 @@ static struct ibm_struct ibms[] = {
.type = ACPI_SYSTEM_NOTIFY,
},
#endif
+#ifdef CONFIG_ACPI_IBM_BAY
{
.name = "bay",
.init = bay_init,
@@ -2370,6 +2377,7 @@ static struct ibm_struct ibms[] = {
.handle = &bay_handle,
.type = ACPI_SYSTEM_NOTIFY,
},
+#endif /* CONFIG_ACPI_IBM_BAY */
{
.name = "cmos",
.read = cmos_read,
@@ -2655,7 +2663,9 @@ IBM_PARAM(light);
#ifdef CONFIG_ACPI_IBM_DOCK
IBM_PARAM(dock);
#endif
+#ifdef CONFIG_ACPI_IBM_BAY
IBM_PARAM(bay);
+#endif /* CONFIG_ACPI_IBM_BAY */
IBM_PARAM(cmos);
IBM_PARAM(led);
IBM_PARAM(beep);
@@ -2731,12 +2741,14 @@ static int __init acpi_ibm_init(void)
IBM_HANDLE_INIT(dock);
#endif
IBM_HANDLE_INIT(pci);
+#ifdef CONFIG_ACPI_IBM_BAY
IBM_HANDLE_INIT(bay);
if (bay_handle)
IBM_HANDLE_INIT(bay_ej);
IBM_HANDLE_INIT(bay2);
if (bay2_handle)
IBM_HANDLE_INIT(bay2_ej);
+#endif /* CONFIG_ACPI_IBM_BAY */
IBM_HANDLE_INIT(beep);
IBM_HANDLE_INIT(ecrd);
IBM_HANDLE_INIT(ecwr);
--
1.4.4.4
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [GIT PULL] ibm-acpi updates
2007-02-22 20:55 [GIT PULL] ibm-acpi updates Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 1/2] ACPI: ibm-acpi: fix initial status of backlight device Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 2/2] ACPI: ibm-acpi: make ibm-acpi bay support optional Henrique de Moraes Holschuh
@ 2007-02-23 6:29 ` Len Brown
2007-02-23 11:08 ` Henrique de Moraes Holschuh
2 siblings, 1 reply; 6+ messages in thread
From: Len Brown @ 2007-02-23 6:29 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: linux-acpi, ibm-acpi-devel, Kristen Carlson Accardi
On Thursday 22 February 2007 15:55, Henrique de Moraes Holschuh wrote:
> Len,
>
> Please pull from git://repo.or.cz/linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git
> branch for-upstream/acpi-test
>
> to receive the following patches:
>
> ACPI: ibm-acpi: make ibm-acpi bay support optional
> ACPI: ibm-acpi: fix initial status of backlight device
>
> The branch is based on 2.6.21-rc1.
>
----------------------------- drivers/acpi/Kconfig -----------------------------
index e942ffe..ee3dcd1 100644
@@ -242,6 +242,17 @@ config ACPI_IBM_DOCK
If you are not sure, say N here.
+config ACPI_IBM_BAY
+ bool "Legacy Removable Bay Support"
+ depends on ACPI_IBM
+ default y
+ ---help---
+ Allows the ibm_acpi driver to handle removable bays. It will allow
+ disabling the device in the bay, and also generate notifications when
+ the bay lever is ejected or inserted.
+
+ If you are not sure, say Y here.
+
Why is the default Y?
thanks,
-Len
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] ibm-acpi updates
2007-02-23 6:29 ` [GIT PULL] ibm-acpi updates Len Brown
@ 2007-02-23 11:08 ` Henrique de Moraes Holschuh
2007-02-24 4:13 ` Len Brown
0 siblings, 1 reply; 6+ messages in thread
From: Henrique de Moraes Holschuh @ 2007-02-23 11:08 UTC (permalink / raw)
To: Len Brown; +Cc: linux-acpi, ibm-acpi-devel, Kristen Carlson Accardi
On Fri, 23 Feb 2007, Len Brown wrote:
> +config ACPI_IBM_BAY
> + bool "Legacy Removable Bay Support"
> + depends on ACPI_IBM
> + default y
> + ---help---
> + Allows the ibm_acpi driver to handle removable bays. It will allow
> + disabling the device in the bay, and also generate notifications when
> + the bay lever is ejected or inserted.
> +
> + If you are not sure, say Y here.
> +
>
> Why is the default Y?
ACPI_BAY is still experimental, and breaks completely on ThinkPads if
whatever is in the bay is not a disk (e.g. if it is a battery), at least
during boot.
Also, some thinkpads benefit from *optional* extra intelligence on bay
handling during STR (which is not in ibm-acpi yet). E.g. a T43 can save a
few watts if you power off whatever is in the bay right before STR, *as long
as it is not a battery*.
This is just an interim patch to let people easily disable ibm-acpi bay
support. Another patch making it default to N and depend on !ACPI_BAY can
be added later, but since I did not have a time window to work on ACPI_BAY
+ ibm-acpi interaction yet, I fear it is a little early for that.
--
"One disk to rule them all, One disk to find them. One disk to bring
them all and in the darkness grind them. In the Land of Redmond
where the shadows lie." -- The Silicon Valley Tarot
Henrique Holschuh
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [GIT PULL] ibm-acpi updates
2007-02-23 11:08 ` Henrique de Moraes Holschuh
@ 2007-02-24 4:13 ` Len Brown
0 siblings, 0 replies; 6+ messages in thread
From: Len Brown @ 2007-02-24 4:13 UTC (permalink / raw)
To: Henrique de Moraes Holschuh
Cc: linux-acpi, ibm-acpi-devel, Kristen Carlson Accardi
On Friday 23 February 2007 06:08, Henrique de Moraes Holschuh wrote:
> On Fri, 23 Feb 2007, Len Brown wrote:
> > +config ACPI_IBM_BAY
> > + bool "Legacy Removable Bay Support"
> > + depends on ACPI_IBM
> > + default y
> > + ---help---
> > + Allows the ibm_acpi driver to handle removable bays. It will allow
> > + disabling the device in the bay, and also generate notifications when
> > + the bay lever is ejected or inserted.
> > +
> > + If you are not sure, say Y here.
> > +
> >
> > Why is the default Y?
>
> ACPI_BAY is still experimental, and breaks completely on ThinkPads if
> whatever is in the bay is not a disk (e.g. if it is a battery), at least
> during boot.
>
> Also, some thinkpads benefit from *optional* extra intelligence on bay
> handling during STR (which is not in ibm-acpi yet). E.g. a T43 can save a
> few watts if you power off whatever is in the bay right before STR, *as long
> as it is not a battery*.
>
> This is just an interim patch to let people easily disable ibm-acpi bay
> support. Another patch making it default to N and depend on !ACPI_BAY can
> be added later, but since I did not have a time window to work on ACPI_BAY
> + ibm-acpi interaction yet, I fear it is a little early for that.
Thanks for the clarification, Henrique.
-Len
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-02-24 4:21 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-22 20:55 [GIT PULL] ibm-acpi updates Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 1/2] ACPI: ibm-acpi: fix initial status of backlight device Henrique de Moraes Holschuh
2007-02-22 23:11 ` [PATCH 2/2] ACPI: ibm-acpi: make ibm-acpi bay support optional Henrique de Moraes Holschuh
2007-02-23 6:29 ` [GIT PULL] ibm-acpi updates Len Brown
2007-02-23 11:08 ` Henrique de Moraes Holschuh
2007-02-24 4:13 ` Len Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).