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
08e31686
Commit
08e31686
authored
Jul 22, 2007
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull thinkpad into release branch
parents
d6da5ce8
f432255e
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
854 additions
and
159 deletions
+854
-159
Documentation/thinkpad-acpi.txt
Documentation/thinkpad-acpi.txt
+276
-77
drivers/misc/Kconfig
drivers/misc/Kconfig
+14
-0
drivers/misc/thinkpad_acpi.c
drivers/misc/thinkpad_acpi.c
+526
-76
drivers/misc/thinkpad_acpi.h
drivers/misc/thinkpad_acpi.h
+36
-6
include/linux/pci_ids.h
include/linux/pci_ids.h
+2
-0
No files found.
Documentation/thinkpad-acpi.txt
View file @
08e31686
This diff is collapsed.
Click to expand it.
drivers/misc/Kconfig
View file @
08e31686
...
...
@@ -150,6 +150,7 @@ config THINKPAD_ACPI
depends on X86 && ACPI
select BACKLIGHT_CLASS_DEVICE
select HWMON
select NVRAM
---help---
This is a driver for the IBM and Lenovo ThinkPad laptops. It adds
support for Fn-Fx key combinations, Bluetooth control, video
...
...
@@ -196,4 +197,17 @@ config THINKPAD_ACPI_BAY
If you are not sure, say Y here.
config THINKPAD_ACPI_INPUT_ENABLED
bool "Enable input layer support by default"
depends on THINKPAD_ACPI
default y
---help---
Enables hot key handling over the input layer by default. If unset,
the driver does not enable any hot key handling by default, and also
starts up with a mostly empty keymap.
If you are not sure, say Y here. Say N to retain the deprecated
behavior of ibm-acpi, and thinkpad-acpi for kernels up to 2.6.21.
endif # MISC_DEVICES
drivers/misc/thinkpad_acpi.c
View file @
08e31686
This diff is collapsed.
Click to expand it.
drivers/misc/thinkpad_acpi.h
View file @
08e31686
...
...
@@ -32,6 +32,7 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/nvram.h>
#include <linux/proc_fs.h>
#include <linux/sysfs.h>
#include <linux/backlight.h>
...
...
@@ -39,6 +40,7 @@
#include <linux/platform_device.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/input.h>
#include <asm/uaccess.h>
#include <linux/dmi.h>
...
...
@@ -48,6 +50,7 @@
#include <acpi/acpi_drivers.h>
#include <acpi/acnamesp.h>
#include <linux/pci_ids.h>
/****************************************************************************
* Main driver
...
...
@@ -78,6 +81,11 @@
#define TP_CMOS_BRIGHTNESS_UP 4
#define TP_CMOS_BRIGHTNESS_DOWN 5
/* ThinkPad CMOS NVRAM constants */
#define TP_NVRAM_ADDR_BRIGHTNESS 0x5e
#define TP_NVRAM_MASK_LEVEL_BRIGHTNESS 0x07
#define TP_NVRAM_POS_LEVEL_BRIGHTNESS 0
#define onoff(status,bit) ((status) & (1 << (bit)) ? "on" : "off")
#define enabled(status,bit) ((status) & (1 << (bit)) ? "enabled" : "disabled")
#define strlencmp(a,b) (strncmp((a), (b), strlen(b)))
...
...
@@ -98,9 +106,13 @@ static const char *str_supported(int is_supported);
#define vdbg_printk(a_dbg_level, format, arg...)
#endif
/* Input IDs */
#define TPACPI_HKEY_INPUT_VENDOR PCI_VENDOR_ID_IBM
#define TPACPI_HKEY_INPUT_PRODUCT 0x5054
/* "TP" */
#define TPACPI_HKEY_INPUT_VERSION 0x4101
/* ACPI HIDs */
#define IBM_HKEY_HID "IBM0068"
#define IBM_PCI_HID "PNP0A03"
/* ACPI helpers */
static
int
__must_check
acpi_evalf
(
acpi_handle
handle
,
...
...
@@ -161,6 +173,7 @@ static int parse_strtoul(const char *buf, unsigned long max,
static
struct
platform_device
*
tpacpi_pdev
;
static
struct
class_device
*
tpacpi_hwmon
;
static
struct
platform_driver
tpacpi_pdriver
;
static
struct
input_dev
*
tpacpi_inputdev
;
static
int
tpacpi_create_driver_attributes
(
struct
device_driver
*
drv
);
static
void
tpacpi_remove_driver_attributes
(
struct
device_driver
*
drv
);
...
...
@@ -168,9 +181,7 @@ static void tpacpi_remove_driver_attributes(struct device_driver *drv);
static
int
experimental
;
static
u32
dbg_level
;
static
int
force_load
;
static
char
*
ibm_thinkpad_ec_found
;
static
char
*
check_dmi_for_ec
(
void
);
static
int
thinkpad_acpi_module_init
(
void
);
static
void
thinkpad_acpi_module_exit
(
void
);
...
...
@@ -197,6 +208,7 @@ struct ibm_struct {
int
(
*
read
)
(
char
*
);
int
(
*
write
)
(
char
*
);
void
(
*
exit
)
(
void
);
void
(
*
resume
)
(
void
);
struct
list_head
all_drivers
;
...
...
@@ -228,12 +240,29 @@ static struct {
u16
bluetooth
:
1
;
u16
hotkey
:
1
;
u16
hotkey_mask
:
1
;
u16
hotkey_wlsw
:
1
;
u16
light
:
1
;
u16
light_status
:
1
;
u16
wan
:
1
;
u16
fan_ctrl_status_undef
:
1
;
u16
input_device_registered
:
1
;
}
tp_features
;
struct
thinkpad_id_data
{
unsigned
int
vendor
;
/* ThinkPad vendor:
* PCI_VENDOR_ID_IBM/PCI_VENDOR_ID_LENOVO */
char
*
bios_version_str
;
/* Something like 1ZET51WW (1.03z) */
char
*
ec_version_str
;
/* Something like 1ZHT51WW-1.04a */
u16
bios_model
;
/* Big Endian, TP-1Y = 0x5931, 0 = unknown */
u16
ec_model
;
char
*
model_str
;
};
static
struct
thinkpad_id_data
thinkpad_id
;
static
struct
list_head
tpacpi_all_drivers
;
static
struct
ibm_init_struct
ibms_init
[];
...
...
@@ -300,6 +329,7 @@ static int bluetooth_write(char *buf);
static
struct
backlight_device
*
ibm_backlight_device
;
static
int
brightness_offset
=
0x31
;
static
int
brightness_mode
;
static
int
brightness_init
(
struct
ibm_init_struct
*
iibm
);
static
void
brightness_exit
(
void
);
...
...
@@ -415,14 +445,14 @@ static int fan_write_cmd_watchdog(const char *cmd, int *rc);
*/
static
int
hotkey_orig_status
;
static
int
hotkey_orig_mask
;
static
u32
hotkey_orig_mask
;
static
struct
mutex
hotkey_mutex
;
static
int
hotkey_init
(
struct
ibm_init_struct
*
iibm
);
static
void
hotkey_exit
(
void
);
static
int
hotkey_get
(
int
*
status
,
int
*
mask
);
static
int
hotkey_set
(
int
status
,
int
mask
);
static
int
hotkey_get
(
int
*
status
,
u32
*
mask
);
static
int
hotkey_set
(
int
status
,
u32
mask
);
static
void
hotkey_notify
(
struct
ibm_struct
*
ibm
,
u32
event
);
static
int
hotkey_read
(
char
*
p
);
static
int
hotkey_write
(
char
*
buf
);
...
...
include/linux/pci_ids.h
View file @
08e31686
...
...
@@ -2040,6 +2040,8 @@
#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
#define PCI_VENDOR_ID_LENOVO 0x17aa
#define PCI_VENDOR_ID_ARECA 0x17d3
#define PCI_DEVICE_ID_ARECA_1110 0x1110
#define PCI_DEVICE_ID_ARECA_1120 0x1120
...
...
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