Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
634d6b5f
Commit
634d6b5f
authored
Nov 08, 2004
by
Len Brown
Committed by
Len Brown
Nov 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[ACPI] ibm ACPI 0.8 by Chris Wright and Borislav Deianov
Signed-off-by:
Len Brown
<
len.brown@intel.com
>
parent
51b3e81b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
37 deletions
+31
-37
Documentation/ibm-acpi.txt
Documentation/ibm-acpi.txt
+2
-2
drivers/acpi/ibm_acpi.c
drivers/acpi/ibm_acpi.c
+29
-35
No files found.
Documentation/ibm-acpi.txt
View file @
634d6b5f
IBM ThinkPad ACPI Extras Driver
Version 0.
7
23 Octo
ber 2004
Version 0.
8
8 Novem
ber 2004
Borislav Deianov <borislav@users.sf.net>
http://ibm-acpi.sf.net/
...
...
drivers/acpi/ibm_acpi.c
View file @
634d6b5f
...
...
@@ -43,9 +43,11 @@
* 2004-10-19 0.6 use acpi_bus_register_driver() to claim HKEY device
* 2004-10-23 0.7 fix module loading on A21e, A22p, T20, T21, X20
* fix LED control on A21e
* 2004-11-08 0.8 fix init error case, don't return from a macro
* thanks to Chris Wright <chrisw@osdl.org>
*/
#define IBM_VERSION "0.
7
"
#define IBM_VERSION "0.
8
"
#include <linux/kernel.h>
#include <linux/module.h>
...
...
@@ -1130,25 +1132,19 @@ static int ibm_handle_init(char *name,
return
0
;
}
*
handle
=
NULL
;
if
(
required
)
{
printk
(
IBM_ERR
"%s object not found
\n
"
,
name
);
return
-
1
;
}
*
handle
=
NULL
;
return
0
;
}
#define IBM_HANDLE_INIT_REQ(object) do { \
if (ibm_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, sizeof(object##_paths)/sizeof(char *), 1) < 0)\
return -ENODEV; \
} while (0)
#define IBM_HANDLE_INIT(object) \
ibm_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, sizeof(object##_paths)/sizeof(char *), 0)
#define IBM_HANDLE_INIT(object, required) \
ibm_handle_init(#object, &object##_handle, *object##_parent, \
object##_paths, sizeof(object##_paths)/sizeof(char*), required)
static
void
ibm_param
(
char
*
feature
,
char
*
cmd
)
...
...
@@ -1184,6 +1180,27 @@ static int __init acpi_ibm_init(void)
if
(
acpi_disabled
)
return
-
ENODEV
;
/* these handles are required */
if
(
IBM_HANDLE_INIT
(
ec
,
1
)
<
0
||
IBM_HANDLE_INIT
(
hkey
,
1
)
<
0
||
IBM_HANDLE_INIT
(
vid
,
1
)
<
0
||
IBM_HANDLE_INIT
(
beep
,
1
)
<
0
)
return
-
ENODEV
;
/* these handles have alternatives */
IBM_HANDLE_INIT
(
lght
,
0
);
if
(
IBM_HANDLE_INIT
(
cmos
,
!
lght_handle
)
<
0
)
return
-
ENODEV
;
IBM_HANDLE_INIT
(
sysl
,
0
);
if
(
IBM_HANDLE_INIT
(
led
,
!
sysl_handle
)
<
0
)
return
-
ENODEV
;
/* these handles are not required */
IBM_HANDLE_INIT
(
dock
,
0
);
IBM_HANDLE_INIT
(
bay
,
0
);
IBM_HANDLE_INIT
(
bayej
,
0
);
IBM_HANDLE_INIT
(
bled
,
0
);
proc_dir
=
proc_mkdir
(
IBM_DIR
,
acpi_root_dir
);
if
(
!
proc_dir
)
{
printk
(
IBM_ERR
"unable to create proc dir %s"
,
IBM_DIR
);
...
...
@@ -1191,29 +1208,6 @@ static int __init acpi_ibm_init(void)
}
proc_dir
->
owner
=
THIS_MODULE
;
IBM_HANDLE_INIT_REQ
(
ec
);
IBM_HANDLE_INIT_REQ
(
hkey
);
IBM_HANDLE_INIT_REQ
(
vid
);
IBM_HANDLE_INIT
(
cmos
);
IBM_HANDLE_INIT
(
lght
);
IBM_HANDLE_INIT
(
dock
);
IBM_HANDLE_INIT
(
bay
);
IBM_HANDLE_INIT
(
bayej
);
IBM_HANDLE_INIT
(
led
);
IBM_HANDLE_INIT
(
sysl
);
IBM_HANDLE_INIT
(
bled
);
IBM_HANDLE_INIT_REQ
(
beep
);
if
(
!
cmos_handle
&&
!
lght_handle
)
{
printk
(
IBM_ERR
"neither cmos nor lght object found
\n
"
);
return
-
ENODEV
;
}
if
(
!
led_handle
&&
!
sysl_handle
)
{
printk
(
IBM_ERR
"neither led nor sysl object found
\n
"
);
return
-
ENODEV
;
}
for
(
i
=
0
;
i
<
NUM_IBMS
;
i
++
)
{
ret
=
ibm_init
(
&
ibms
[
i
]);
if
(
ret
<
0
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment