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
nexedi
linux
Commits
7b806016
Commit
7b806016
authored
Apr 24, 2009
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'thinkpad-acpi' into release
parents
60cd8adc
b57f7e7b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
46 additions
and
39 deletions
+46
-39
Documentation/laptops/thinkpad-acpi.txt
Documentation/laptops/thinkpad-acpi.txt
+2
-2
drivers/platform/x86/thinkpad_acpi.c
drivers/platform/x86/thinkpad_acpi.c
+44
-37
No files found.
Documentation/laptops/thinkpad-acpi.txt
View file @
7b806016
ThinkPad ACPI Extras Driver
Version 0.2
2
November 23rd, 2008
Version 0.2
3
April 10th, 2009
Borislav Deianov <borislav@users.sf.net>
Henrique de Moraes Holschuh <hmh@hmh.eng.br>
...
...
drivers/platform/x86/thinkpad_acpi.c
View file @
7b806016
...
...
@@ -21,7 +21,7 @@
* 02110-1301, USA.
*/
#define TPACPI_VERSION "0.2
2
"
#define TPACPI_VERSION "0.2
3
"
#define TPACPI_SYSFS_VERSION 0x020300
/*
...
...
@@ -303,11 +303,17 @@ static u32 dbg_level;
static
struct
workqueue_struct
*
tpacpi_wq
;
enum
led_status_t
{
TPACPI_LED_OFF
=
0
,
TPACPI_LED_ON
,
TPACPI_LED_BLINK
,
};
/* Special LED class that can defer work */
struct
tpacpi_led_classdev
{
struct
led_classdev
led_classdev
;
struct
work_struct
work
;
enum
led_
brightness
new_brightness
;
enum
led_
status_t
new_state
;
unsigned
int
led
;
};
...
...
@@ -2946,12 +2952,18 @@ static int hotkey_read(char *p)
return
len
;
}
static
void
hotkey_enabledisable_warn
(
void
)
static
void
hotkey_enabledisable_warn
(
bool
enable
)
{
tpacpi_log_usertask
(
"procfs hotkey enable/disable"
);
WARN
(
1
,
TPACPI_WARN
"hotkey enable/disable functionality has been "
"removed from the driver. Hotkeys are always enabled.
\n
"
);
if
(
!
WARN
((
tpacpi_lifecycle
==
TPACPI_LIFE_RUNNING
||
!
enable
),
TPACPI_WARN
"hotkey enable/disable functionality has been "
"removed from the driver. Hotkeys are always "
"enabled
\n
"
))
printk
(
TPACPI_ERR
"Please remove the hotkey=enable module "
"parameter, it is deprecated. Hotkeys are always "
"enabled
\n
"
);
}
static
int
hotkey_write
(
char
*
buf
)
...
...
@@ -2971,9 +2983,9 @@ static int hotkey_write(char *buf)
res
=
0
;
while
((
cmd
=
next_cmd
(
&
buf
)))
{
if
(
strlencmp
(
cmd
,
"enable"
)
==
0
)
{
hotkey_enabledisable_warn
();
hotkey_enabledisable_warn
(
1
);
}
else
if
(
strlencmp
(
cmd
,
"disable"
)
==
0
)
{
hotkey_enabledisable_warn
();
hotkey_enabledisable_warn
(
0
);
res
=
-
EPERM
;
}
else
if
(
strlencmp
(
cmd
,
"reset"
)
==
0
)
{
mask
=
hotkey_orig_mask
;
...
...
@@ -4207,7 +4219,7 @@ static void light_set_status_worker(struct work_struct *work)
container_of
(
work
,
struct
tpacpi_led_classdev
,
work
);
if
(
likely
(
tpacpi_lifecycle
==
TPACPI_LIFE_RUNNING
))
light_set_status
((
data
->
new_
brightness
!=
LED_OFF
));
light_set_status
((
data
->
new_
state
!=
TPACPI_
LED_OFF
));
}
static
void
light_sysfs_set
(
struct
led_classdev
*
led_cdev
,
...
...
@@ -4217,7 +4229,8 @@ static void light_sysfs_set(struct led_classdev *led_cdev,
container_of
(
led_cdev
,
struct
tpacpi_led_classdev
,
led_classdev
);
data
->
new_brightness
=
brightness
;
data
->
new_state
=
(
brightness
!=
LED_OFF
)
?
TPACPI_LED_ON
:
TPACPI_LED_OFF
;
queue_work
(
tpacpi_wq
,
&
data
->
work
);
}
...
...
@@ -4724,12 +4737,6 @@ enum { /* For TPACPI_LED_OLD */
TPACPI_LED_EC_HLMS
=
0x0e
,
/* EC reg to select led to command */
};
enum
led_status_t
{
TPACPI_LED_OFF
=
0
,
TPACPI_LED_ON
,
TPACPI_LED_BLINK
,
};
static
enum
led_access_mode
led_supported
;
TPACPI_HANDLE
(
led
,
ec
,
"SLED"
,
/* 570 */
...
...
@@ -4841,23 +4848,13 @@ static int led_set_status(const unsigned int led,
return
rc
;
}
static
void
led_sysfs_set_status
(
unsigned
int
led
,
enum
led_brightness
brightness
)
{
led_set_status
(
led
,
(
brightness
==
LED_OFF
)
?
TPACPI_LED_OFF
:
(
tpacpi_led_state_cache
[
led
]
==
TPACPI_LED_BLINK
)
?
TPACPI_LED_BLINK
:
TPACPI_LED_ON
);
}
static
void
led_set_status_worker
(
struct
work_struct
*
work
)
{
struct
tpacpi_led_classdev
*
data
=
container_of
(
work
,
struct
tpacpi_led_classdev
,
work
);
if
(
likely
(
tpacpi_lifecycle
==
TPACPI_LIFE_RUNNING
))
led_s
ysfs_set_status
(
data
->
led
,
data
->
new_brightness
);
led_s
et_status
(
data
->
led
,
data
->
new_state
);
}
static
void
led_sysfs_set
(
struct
led_classdev
*
led_cdev
,
...
...
@@ -4866,7 +4863,13 @@ static void led_sysfs_set(struct led_classdev *led_cdev,
struct
tpacpi_led_classdev
*
data
=
container_of
(
led_cdev
,
struct
tpacpi_led_classdev
,
led_classdev
);
data
->
new_brightness
=
brightness
;
if
(
brightness
==
LED_OFF
)
data
->
new_state
=
TPACPI_LED_OFF
;
else
if
(
tpacpi_led_state_cache
[
data
->
led
]
!=
TPACPI_LED_BLINK
)
data
->
new_state
=
TPACPI_LED_ON
;
else
data
->
new_state
=
TPACPI_LED_BLINK
;
queue_work
(
tpacpi_wq
,
&
data
->
work
);
}
...
...
@@ -4884,7 +4887,7 @@ static int led_sysfs_blink_set(struct led_classdev *led_cdev,
}
else
if
((
*
delay_on
!=
500
)
||
(
*
delay_off
!=
500
))
return
-
EINVAL
;
data
->
new_
brightness
=
TPACPI_LED_BLINK
;
data
->
new_
state
=
TPACPI_LED_BLINK
;
queue_work
(
tpacpi_wq
,
&
data
->
work
);
return
0
;
...
...
@@ -7857,6 +7860,15 @@ static int __init thinkpad_acpi_module_init(void)
MODULE_ALIAS
(
TPACPI_DRVR_SHORTNAME
);
/*
* This will autoload the driver in almost every ThinkPad
* in widespread use.
*
* Only _VERY_ old models, like the 240, 240x and 570 lack
* the HKEY event interface.
*/
MODULE_DEVICE_TABLE
(
acpi
,
ibm_htk_device_ids
);
/*
* DMI matching for module autoloading
*
...
...
@@ -7869,18 +7881,13 @@ MODULE_ALIAS(TPACPI_DRVR_SHORTNAME);
#define IBM_BIOS_MODULE_ALIAS(__type) \
MODULE_ALIAS("dmi:bvnIBM:bvr" __type "ET??WW*")
/* Non-ancient thinkpads */
MODULE_ALIAS
(
"dmi:bvnIBM:*:svnIBM:*:pvrThinkPad*:rvnIBM:*"
);
MODULE_ALIAS
(
"dmi:bvnLENOVO:*:svnLENOVO:*:pvrThinkPad*:rvnLENOVO:*"
);
/* Ancient thinkpad BIOSes have to be identified by
* BIOS type or model number, and there are far less
* BIOS types than model numbers... */
IBM_BIOS_MODULE_ALIAS
(
"I[BDHIMNOTWVYZ]"
);
IBM_BIOS_MODULE_ALIAS
(
"1[0368A-GIKM-PST]"
);
IBM_BIOS_MODULE_ALIAS
(
"K[UX-Z]"
);
IBM_BIOS_MODULE_ALIAS
(
"I[MU]"
);
/* 570, 570e */
MODULE_AUTHOR
(
"Borislav Deianov, Henrique de Moraes Holschuh"
);
MODULE_AUTHOR
(
"Borislav Deianov <borislav@users.sf.net>"
);
MODULE_AUTHOR
(
"Henrique de Moraes Holschuh <hmh@hmh.eng.br>"
);
MODULE_DESCRIPTION
(
TPACPI_DESC
);
MODULE_VERSION
(
TPACPI_VERSION
);
MODULE_LICENSE
(
"GPL"
);
...
...
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