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
437cb0db
Commit
437cb0db
authored
May 29, 2011
by
Matthew Garrett
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'x86-platform-next' into x86-platform
parents
139f37f5
987dfbaa
Changes
35
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
35 changed files
with
1393 additions
and
1192 deletions
+1393
-1192
Documentation/laptops/acer-wmi.txt
Documentation/laptops/acer-wmi.txt
+0
-184
MAINTAINERS
MAINTAINERS
+3
-8
drivers/platform/x86/Kconfig
drivers/platform/x86/Kconfig
+10
-1
drivers/platform/x86/Makefile
drivers/platform/x86/Makefile
+2
-1
drivers/platform/x86/acer-wmi.c
drivers/platform/x86/acer-wmi.c
+159
-25
drivers/platform/x86/acerhdf.c
drivers/platform/x86/acerhdf.c
+1
-3
drivers/platform/x86/asus-laptop.c
drivers/platform/x86/asus-laptop.c
+17
-17
drivers/platform/x86/asus-wmi.c
drivers/platform/x86/asus-wmi.c
+11
-11
drivers/platform/x86/asus_acpi.c
drivers/platform/x86/asus_acpi.c
+32
-45
drivers/platform/x86/compal-laptop.c
drivers/platform/x86/compal-laptop.c
+9
-13
drivers/platform/x86/dell-laptop.c
drivers/platform/x86/dell-laptop.c
+6
-6
drivers/platform/x86/dell-wmi-aio.c
drivers/platform/x86/dell-wmi-aio.c
+2
-1
drivers/platform/x86/dell-wmi.c
drivers/platform/x86/dell-wmi.c
+8
-9
drivers/platform/x86/eeepc-laptop.c
drivers/platform/x86/eeepc-laptop.c
+11
-10
drivers/platform/x86/eeepc-wmi.c
drivers/platform/x86/eeepc-wmi.c
+7
-7
drivers/platform/x86/fujitsu-laptop.c
drivers/platform/x86/fujitsu-laptop.c
+19
-20
drivers/platform/x86/hdaps.c
drivers/platform/x86/hdaps.c
+10
-9
drivers/platform/x86/hp-wmi.c
drivers/platform/x86/hp-wmi.c
+17
-26
drivers/platform/x86/ibm_rtl.c
drivers/platform/x86/ibm_rtl.c
+13
-10
drivers/platform/x86/ideapad-laptop.c
drivers/platform/x86/ideapad-laptop.c
+2
-0
drivers/platform/x86/intel_menlow.c
drivers/platform/x86/intel_menlow.c
+3
-2
drivers/platform/x86/intel_mid_powerbtn.c
drivers/platform/x86/intel_mid_powerbtn.c
+30
-42
drivers/platform/x86/intel_mid_thermal.c
drivers/platform/x86/intel_mid_thermal.c
+301
-306
drivers/platform/x86/intel_oaktrail.c
drivers/platform/x86/intel_oaktrail.c
+396
-0
drivers/platform/x86/intel_pmic_gpio.c
drivers/platform/x86/intel_pmic_gpio.c
+7
-7
drivers/platform/x86/msi-laptop.c
drivers/platform/x86/msi-laptop.c
+5
-6
drivers/platform/x86/msi-wmi.c
drivers/platform/x86/msi-wmi.c
+20
-25
drivers/platform/x86/sony-laptop.c
drivers/platform/x86/sony-laptop.c
+49
-57
drivers/platform/x86/tc1100-wmi.c
drivers/platform/x86/tc1100-wmi.c
+3
-4
drivers/platform/x86/thinkpad_acpi.c
drivers/platform/x86/thinkpad_acpi.c
+197
-293
drivers/platform/x86/topstar-laptop.c
drivers/platform/x86/topstar-laptop.c
+1
-1
drivers/platform/x86/toshiba_acpi.c
drivers/platform/x86/toshiba_acpi.c
+28
-31
drivers/platform/x86/toshiba_bluetooth.c
drivers/platform/x86/toshiba_bluetooth.c
+6
-5
drivers/platform/x86/wmi.c
drivers/platform/x86/wmi.c
+5
-5
drivers/platform/x86/xo15-ebook.c
drivers/platform/x86/xo15-ebook.c
+3
-2
No files found.
Documentation/laptops/acer-wmi.txt
deleted
100644 → 0
View file @
139f37f5
Acer Laptop WMI Extras Driver
http://code.google.com/p/aceracpi
Version 0.3
4th April 2009
Copyright 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk>
acer-wmi is a driver to allow you to control various parts of your Acer laptop
hardware under Linux which are exposed via ACPI-WMI.
This driver completely replaces the old out-of-tree acer_acpi, which I am
currently maintaining for bug fixes only on pre-2.6.25 kernels. All development
work is now focused solely on acer-wmi.
Disclaimer
**********
Acer and Wistron have provided nothing towards the development acer_acpi or
acer-wmi. All information we have has been through the efforts of the developers
and the users to discover as much as possible about the hardware.
As such, I do warn that this could break your hardware - this is extremely
unlikely of course, but please bear this in mind.
Background
**********
acer-wmi is derived from acer_acpi, originally developed by Mark
Smith in 2005, then taken over by Carlos Corbacho in 2007, in order to activate
the wireless LAN card under a 64-bit version of Linux, as acerhk[1] (the
previous solution to the problem) relied on making 32 bit BIOS calls which are
not possible in kernel space from a 64 bit OS.
[1] acerhk: http://www.cakey.de/acerhk/
Supported Hardware
******************
NOTE: The Acer Aspire One is not supported hardware. It cannot work with
acer-wmi until Acer fix their ACPI-WMI implementation on them, so has been
blacklisted until that happens.
Please see the website for the current list of known working hardware:
http://code.google.com/p/aceracpi/wiki/SupportedHardware
If your laptop is not listed, or listed as unknown, and works with acer-wmi,
please contact me with a copy of the DSDT.
If your Acer laptop doesn't work with acer-wmi, I would also like to see the
DSDT.
To send me the DSDT, as root/sudo:
cat /sys/firmware/acpi/tables/DSDT > dsdt
And send me the resulting 'dsdt' file.
Usage
*****
On Acer laptops, acer-wmi should already be autoloaded based on DMI matching.
For non-Acer laptops, until WMI based autoloading support is added, you will
need to manually load acer-wmi.
acer-wmi creates /sys/devices/platform/acer-wmi, and fills it with various
files whose usage is detailed below, which enables you to control some of the
following (varies between models):
* the wireless LAN card radio
* inbuilt Bluetooth adapter
* inbuilt 3G card
* mail LED of your laptop
* brightness of the LCD panel
Wireless
********
With regards to wireless, all acer-wmi does is enable the radio on the card. It
is not responsible for the wireless LED - once the radio is enabled, this is
down to the wireless driver for your card. So the behaviour of the wireless LED,
once you enable the radio, will depend on your hardware and driver combination.
e.g. With the BCM4318 on the Acer Aspire 5020 series:
ndiswrapper: Light blinks on when transmitting
b43: Solid light, blinks off when transmitting
Wireless radio control is unconditionally enabled - all Acer laptops that support
acer-wmi come with built-in wireless. However, should you feel so inclined to
ever wish to remove the card, or swap it out at some point, please get in touch
with me, as we may well be able to gain some data on wireless card detection.
The wireless radio is exposed through rfkill.
Bluetooth
*********
For bluetooth, this is an internal USB dongle, so once enabled, you will get
a USB device connection event, and a new USB device appears. When you disable
bluetooth, you get the reverse - a USB device disconnect event, followed by the
device disappearing again.
Bluetooth is autodetected by acer-wmi, so if you do not have a bluetooth module
installed in your laptop, this file won't exist (please be aware that it is
quite common for Acer not to fit bluetooth to their laptops - so just because
you have a bluetooth button on the laptop, doesn't mean that bluetooth is
installed).
For the adventurously minded - if you want to buy an internal bluetooth
module off the internet that is compatible with your laptop and fit it, then
it will work just fine with acer-wmi.
Bluetooth is exposed through rfkill.
3G
**
3G is currently not autodetected, so the 'threeg' file is always created under
sysfs. So far, no-one in possession of an Acer laptop with 3G built-in appears to
have tried Linux, or reported back, so we don't have any information on this.
If you have an Acer laptop that does have a 3G card in, please contact me so we
can properly detect these, and find out a bit more about them.
To read the status of the 3G card (0=off, 1=on):
cat /sys/devices/platform/acer-wmi/threeg
To enable the 3G card:
echo 1 > /sys/devices/platform/acer-wmi/threeg
To disable the 3G card:
echo 0 > /sys/devices/platform/acer-wmi/threeg
To set the state of the 3G card when loading acer-wmi, pass:
threeg=X (where X is 0 or 1)
Mail LED
********
This can be found in most older Acer laptops supported by acer-wmi, and many
newer ones - it is built into the 'mail' button, and blinks when active.
On newer (WMID) laptops though, we have no way of detecting the mail LED. If
your laptop identifies itself in dmesg as a WMID model, then please try loading
acer_acpi with:
force_series=2490
This will use a known alternative method of reading/ writing the mail LED. If
it works, please report back to me with the DMI data from your laptop so this
can be added to acer-wmi.
The LED is exposed through the LED subsystem, and can be found in:
/sys/devices/platform/acer-wmi/leds/acer-wmi::mail/
The mail LED is autodetected, so if you don't have one, the LED device won't
be registered.
Backlight
*********
The backlight brightness control is available on all acer-wmi supported
hardware. The maximum brightness level is usually 15, but on some newer laptops
it's 10 (this is again autodetected).
The backlight is exposed through the backlight subsystem, and can be found in:
/sys/devices/platform/acer-wmi/backlight/acer-wmi/
Credits
*******
Olaf Tauber, who did the real hard work when he developed acerhk
http://www.cakey.de/acerhk/
All the authors of laptop ACPI modules in the kernel, whose work
was an inspiration in the early days of acer_acpi
Mathieu Segaud, who solved the problem with having to modprobe the driver
twice in acer_acpi 0.2.
Jim Ramsay, who added support for the WMID interface
Mark Smith, who started the original acer_acpi
And the many people who have used both acer_acpi and acer-wmi.
MAINTAINERS
View file @
437cb0db
...
@@ -223,10 +223,8 @@ S: Maintained
...
@@ -223,10 +223,8 @@ S: Maintained
F: drivers/platform/x86/acerhdf.c
F: drivers/platform/x86/acerhdf.c
ACER WMI LAPTOP EXTRAS
ACER WMI LAPTOP EXTRAS
M: Carlos Corbacho <carlos@strangeworlds.co.uk>
M: Joey Lee <jlee@novell.com>
L: aceracpi@googlegroups.com (subscribers-only)
L: platform-driver-x86@vger.kernel.org
L: platform-driver-x86@vger.kernel.org
W: http://code.google.com/p/aceracpi
S: Maintained
S: Maintained
F: drivers/platform/x86/acer-wmi.c
F: drivers/platform/x86/acer-wmi.c
...
@@ -271,10 +269,8 @@ S: Supported
...
@@ -271,10 +269,8 @@ S: Supported
F: drivers/acpi/video.c
F: drivers/acpi/video.c
ACPI WMI DRIVER
ACPI WMI DRIVER
M: Carlos Corbacho <carlos@strangeworlds.co.uk>
L: platform-driver-x86@vger.kernel.org
L: platform-driver-x86@vger.kernel.org
W: http://www.lesswatts.org/projects/acpi/
S: Orphan
S: Maintained
F: drivers/platform/x86/wmi.c
F: drivers/platform/x86/wmi.c
AD1889 ALSA SOUND DRIVER
AD1889 ALSA SOUND DRIVER
...
@@ -3033,9 +3029,8 @@ S: Maintained
...
@@ -3033,9 +3029,8 @@ S: Maintained
F: drivers/net/wireless/hostap/
F: drivers/net/wireless/hostap/
HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
M: Carlos Corbacho <carlos@strangeworlds.co.uk>
L: platform-driver-x86@vger.kernel.org
L: platform-driver-x86@vger.kernel.org
S: O
dd Fixes
S: O
rphan
F: drivers/platform/x86/tc1100-wmi.c
F: drivers/platform/x86/tc1100-wmi.c
HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
...
...
drivers/platform/x86/Kconfig
View file @
437cb0db
...
@@ -39,7 +39,7 @@ config ACER_WMI
...
@@ -39,7 +39,7 @@ config ACER_WMI
config ACERHDF
config ACERHDF
tristate "Acer Aspire One temperature and fan driver"
tristate "Acer Aspire One temperature and fan driver"
depends on THERMAL &&
THERMAL_HWMON &&
ACPI
depends on THERMAL && ACPI
---help---
---help---
This is a driver for Acer Aspire One netbooks. It allows to access
This is a driver for Acer Aspire One netbooks. It allows to access
the temperature sensor and to control the fan.
the temperature sensor and to control the fan.
...
@@ -760,4 +760,13 @@ config MXM_WMI
...
@@ -760,4 +760,13 @@ config MXM_WMI
MXM is a standard for laptop graphics cards, the WMI interface
MXM is a standard for laptop graphics cards, the WMI interface
is required for switchable nvidia graphics machines
is required for switchable nvidia graphics machines
config INTEL_OAKTRAIL
tristate "Intel Oaktrail Platform Extras"
depends on ACPI
depends on RFKILL && BACKLIGHT_CLASS_DEVICE && ACPI
---help---
Intel Oaktrail platform need this driver to provide interfaces to
enable/disable the Camera, WiFi, BT etc. devices. If in doubt, say Y
here; it will only load on supported platforms.
endif # X86_PLATFORM_DEVICES
endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile
View file @
437cb0db
...
@@ -41,5 +41,6 @@ obj-$(CONFIG_XO1_RFKILL) += xo1-rfkill.o
...
@@ -41,5 +41,6 @@ obj-$(CONFIG_XO1_RFKILL) += xo1-rfkill.o
obj-$(CONFIG_XO15_EBOOK)
+=
xo15-ebook.o
obj-$(CONFIG_XO15_EBOOK)
+=
xo15-ebook.o
obj-$(CONFIG_IBM_RTL)
+=
ibm_rtl.o
obj-$(CONFIG_IBM_RTL)
+=
ibm_rtl.o
obj-$(CONFIG_SAMSUNG_LAPTOP)
+=
samsung-laptop.o
obj-$(CONFIG_SAMSUNG_LAPTOP)
+=
samsung-laptop.o
obj-$(CONFIG_INTEL_MFLD_THERMAL)
+=
intel_mid_thermal.o
obj-$(CONFIG_MXM_WMI)
+=
mxm-wmi.o
obj-$(CONFIG_MXM_WMI)
+=
mxm-wmi.o
obj-$(CONFIG_INTEL_MID_POWER_BUTTON)
+=
intel_mid_powerbtn.o
obj-$(CONFIG_INTEL_OAKTRAIL)
+=
intel_oaktrail.o
drivers/platform/x86/acer-wmi.c
View file @
437cb0db
...
@@ -98,13 +98,26 @@ enum acer_wmi_event_ids {
...
@@ -98,13 +98,26 @@ enum acer_wmi_event_ids {
static
const
struct
key_entry
acer_wmi_keymap
[]
=
{
static
const
struct
key_entry
acer_wmi_keymap
[]
=
{
{
KE_KEY
,
0x01
,
{
KEY_WLAN
}
},
/* WiFi */
{
KE_KEY
,
0x01
,
{
KEY_WLAN
}
},
/* WiFi */
{
KE_KEY
,
0x03
,
{
KEY_WLAN
}
},
/* WiFi */
{
KE_KEY
,
0x12
,
{
KEY_BLUETOOTH
}
},
/* BT */
{
KE_KEY
,
0x12
,
{
KEY_BLUETOOTH
}
},
/* BT */
{
KE_KEY
,
0x21
,
{
KEY_PROG1
}
},
/* Backup */
{
KE_KEY
,
0x21
,
{
KEY_PROG1
}
},
/* Backup */
{
KE_KEY
,
0x22
,
{
KEY_PROG2
}
},
/* Arcade */
{
KE_KEY
,
0x22
,
{
KEY_PROG2
}
},
/* Arcade */
{
KE_KEY
,
0x23
,
{
KEY_PROG3
}
},
/* P_Key */
{
KE_KEY
,
0x23
,
{
KEY_PROG3
}
},
/* P_Key */
{
KE_KEY
,
0x24
,
{
KEY_PROG4
}
},
/* Social networking_Key */
{
KE_KEY
,
0x24
,
{
KEY_PROG4
}
},
/* Social networking_Key */
{
KE_IGNORE
,
0x41
,
{
KEY_MUTE
}
},
{
KE_IGNORE
,
0x42
,
{
KEY_PREVIOUSSONG
}
},
{
KE_IGNORE
,
0x43
,
{
KEY_NEXTSONG
}
},
{
KE_IGNORE
,
0x44
,
{
KEY_PLAYPAUSE
}
},
{
KE_IGNORE
,
0x45
,
{
KEY_STOP
}
},
{
KE_IGNORE
,
0x48
,
{
KEY_VOLUMEUP
}
},
{
KE_IGNORE
,
0x49
,
{
KEY_VOLUMEDOWN
}
},
{
KE_IGNORE
,
0x61
,
{
KEY_SWITCHVIDEOMODE
}
},
{
KE_IGNORE
,
0x62
,
{
KEY_BRIGHTNESSUP
}
},
{
KE_IGNORE
,
0x63
,
{
KEY_BRIGHTNESSDOWN
}
},
{
KE_KEY
,
0x64
,
{
KEY_SWITCHVIDEOMODE
}
},
/* Display Switch */
{
KE_KEY
,
0x64
,
{
KEY_SWITCHVIDEOMODE
}
},
/* Display Switch */
{
KE_IGNORE
,
0x81
,
{
KEY_SLEEP
}
},
{
KE_KEY
,
0x82
,
{
KEY_TOUCHPAD_TOGGLE
}
},
/* Touch Pad On/Off */
{
KE_KEY
,
0x82
,
{
KEY_TOUCHPAD_TOGGLE
}
},
/* Touch Pad On/Off */
{
KE_IGNORE
,
0x83
,
{
KEY_TOUCHPAD_TOGGLE
}
},
{
KE_END
,
0
}
{
KE_END
,
0
}
};
};
...
@@ -122,6 +135,7 @@ struct event_return_value {
...
@@ -122,6 +135,7 @@ struct event_return_value {
*/
*/
#define ACER_WMID3_GDS_WIRELESS (1<<0)
/* WiFi */
#define ACER_WMID3_GDS_WIRELESS (1<<0)
/* WiFi */
#define ACER_WMID3_GDS_THREEG (1<<6)
/* 3G */
#define ACER_WMID3_GDS_THREEG (1<<6)
/* 3G */
#define ACER_WMID3_GDS_WIMAX (1<<7)
/* WiMAX */
#define ACER_WMID3_GDS_BLUETOOTH (1<<11)
/* BT */
#define ACER_WMID3_GDS_BLUETOOTH (1<<11)
/* BT */
struct
lm_input_params
{
struct
lm_input_params
{
...
@@ -737,8 +751,11 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
...
@@ -737,8 +751,11 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out)
obj
=
(
union
acpi_object
*
)
result
.
pointer
;
obj
=
(
union
acpi_object
*
)
result
.
pointer
;
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
obj
->
buffer
.
length
==
sizeof
(
u32
))
{
(
obj
->
buffer
.
length
==
sizeof
(
u32
)
||
obj
->
buffer
.
length
==
sizeof
(
u64
)))
{
tmp
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
tmp
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
}
else
if
(
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
tmp
=
(
u32
)
obj
->
integer
.
value
;
}
else
{
}
else
{
tmp
=
0
;
tmp
=
0
;
}
}
...
@@ -866,8 +883,11 @@ static acpi_status WMID_set_capabilities(void)
...
@@ -866,8 +883,11 @@ static acpi_status WMID_set_capabilities(void)
obj
=
(
union
acpi_object
*
)
out
.
pointer
;
obj
=
(
union
acpi_object
*
)
out
.
pointer
;
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
obj
->
buffer
.
length
==
sizeof
(
u32
))
{
(
obj
->
buffer
.
length
==
sizeof
(
u32
)
||
obj
->
buffer
.
length
==
sizeof
(
u64
)))
{
devices
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
devices
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
}
else
if
(
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
devices
=
(
u32
)
obj
->
integer
.
value
;
}
else
{
}
else
{
kfree
(
out
.
pointer
);
kfree
(
out
.
pointer
);
return
AE_ERROR
;
return
AE_ERROR
;
...
@@ -876,6 +896,7 @@ static acpi_status WMID_set_capabilities(void)
...
@@ -876,6 +896,7 @@ static acpi_status WMID_set_capabilities(void)
dmi_walk
(
type_aa_dmi_decode
,
NULL
);
dmi_walk
(
type_aa_dmi_decode
,
NULL
);
if
(
!
has_type_aa
)
{
if
(
!
has_type_aa
)
{
interface
->
capability
|=
ACER_CAP_WIRELESS
;
interface
->
capability
|=
ACER_CAP_WIRELESS
;
if
(
devices
&
0x40
)
interface
->
capability
|=
ACER_CAP_THREEG
;
interface
->
capability
|=
ACER_CAP_THREEG
;
if
(
devices
&
0x10
)
if
(
devices
&
0x10
)
interface
->
capability
|=
ACER_CAP_BLUETOOTH
;
interface
->
capability
|=
ACER_CAP_BLUETOOTH
;
...
@@ -961,9 +982,11 @@ static void __init acer_commandline_init(void)
...
@@ -961,9 +982,11 @@ static void __init acer_commandline_init(void)
* These will all fail silently if the value given is invalid, or the
* These will all fail silently if the value given is invalid, or the
* capability isn't available on the given interface
* capability isn't available on the given interface
*/
*/
if
(
mailled
>=
0
)
set_u32
(
mailled
,
ACER_CAP_MAILLED
);
set_u32
(
mailled
,
ACER_CAP_MAILLED
);
if
(
!
has_type_aa
)
if
(
!
has_type_aa
&&
threeg
>=
0
)
set_u32
(
threeg
,
ACER_CAP_THREEG
);
set_u32
(
threeg
,
ACER_CAP_THREEG
);
if
(
brightness
>=
0
)
set_u32
(
brightness
,
ACER_CAP_BRIGHTNESS
);
set_u32
(
brightness
,
ACER_CAP_BRIGHTNESS
);
}
}
...
@@ -1081,7 +1104,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
...
@@ -1081,7 +1104,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
return
AE_ERROR
;
return
AE_ERROR
;
}
}
if
(
obj
->
buffer
.
length
!=
8
)
{
if
(
obj
->
buffer
.
length
!=
8
)
{
pr_warn
ing
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
pr_warn
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
kfree
(
obj
);
kfree
(
obj
);
return
AE_ERROR
;
return
AE_ERROR
;
}
}
...
@@ -1090,8 +1113,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
...
@@ -1090,8 +1113,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device)
kfree
(
obj
);
kfree
(
obj
);
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
pr_warn
ing
(
"Get Device Status failed: "
pr_warn
(
"Get Device Status failed: 0x%x - 0x%x
\n
"
,
"0x%x - 0x%x
\n
"
,
return_value
.
error_code
,
return_value
.
error_code
,
return_value
.
ec_return_value
);
return_value
.
ec_return_value
);
else
else
*
value
=
!!
(
return_value
.
devices
&
device
);
*
value
=
!!
(
return_value
.
devices
&
device
);
...
@@ -1124,6 +1147,114 @@ static acpi_status get_device_status(u32 *value, u32 cap)
...
@@ -1124,6 +1147,114 @@ static acpi_status get_device_status(u32 *value, u32 cap)
}
}
}
}
static
acpi_status
wmid3_set_device_status
(
u32
value
,
u16
device
)
{
struct
wmid3_gds_return_value
return_value
;
acpi_status
status
;
union
acpi_object
*
obj
;
u16
devices
;
struct
wmid3_gds_input_param
params
=
{
.
function_num
=
0x1
,
.
hotkey_number
=
0x01
,
.
devices
=
ACER_WMID3_GDS_WIRELESS
&
ACER_WMID3_GDS_THREEG
&
ACER_WMID3_GDS_WIMAX
&
ACER_WMID3_GDS_BLUETOOTH
,
};
struct
acpi_buffer
input
=
{
sizeof
(
struct
wmid3_gds_input_param
),
&
params
};
struct
acpi_buffer
output
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
struct
acpi_buffer
output2
=
{
ACPI_ALLOCATE_BUFFER
,
NULL
};
status
=
wmi_evaluate_method
(
WMID_GUID3
,
0
,
0x2
,
&
input
,
&
output
);
if
(
ACPI_FAILURE
(
status
))
return
status
;
obj
=
output
.
pointer
;
if
(
!
obj
)
return
AE_ERROR
;
else
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
kfree
(
obj
);
return
AE_ERROR
;
}
if
(
obj
->
buffer
.
length
!=
8
)
{
pr_warning
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
kfree
(
obj
);
return
AE_ERROR
;
}
return_value
=
*
((
struct
wmid3_gds_return_value
*
)
obj
->
buffer
.
pointer
);
kfree
(
obj
);
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
{
pr_warning
(
"Get Current Device Status failed: "
"0x%x - 0x%x
\n
"
,
return_value
.
error_code
,
return_value
.
ec_return_value
);
return
status
;
}
devices
=
return_value
.
devices
;
params
.
function_num
=
0x2
;
params
.
hotkey_number
=
0x01
;
params
.
devices
=
(
value
)
?
(
devices
|
device
)
:
(
devices
&
~
device
);
status
=
wmi_evaluate_method
(
WMID_GUID3
,
0
,
0x1
,
&
input
,
&
output2
);
if
(
ACPI_FAILURE
(
status
))
return
status
;
obj
=
output2
.
pointer
;
if
(
!
obj
)
return
AE_ERROR
;
else
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
kfree
(
obj
);
return
AE_ERROR
;
}
if
(
obj
->
buffer
.
length
!=
4
)
{
pr_warning
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
kfree
(
obj
);
return
AE_ERROR
;
}
return_value
=
*
((
struct
wmid3_gds_return_value
*
)
obj
->
buffer
.
pointer
);
kfree
(
obj
);
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
pr_warning
(
"Set Device Status failed: "
"0x%x - 0x%x
\n
"
,
return_value
.
error_code
,
return_value
.
ec_return_value
);
return
status
;
}
static
acpi_status
set_device_status
(
u32
value
,
u32
cap
)
{
if
(
wmi_has_guid
(
WMID_GUID3
))
{
u16
device
;
switch
(
cap
)
{
case
ACER_CAP_WIRELESS
:
device
=
ACER_WMID3_GDS_WIRELESS
;
break
;
case
ACER_CAP_BLUETOOTH
:
device
=
ACER_WMID3_GDS_BLUETOOTH
;
break
;
case
ACER_CAP_THREEG
:
device
=
ACER_WMID3_GDS_THREEG
;
break
;
default:
return
AE_ERROR
;
}
return
wmid3_set_device_status
(
value
,
device
);
}
else
{
return
set_u32
(
value
,
cap
);
}
}
/*
/*
* Rfkill devices
* Rfkill devices
*/
*/
...
@@ -1160,7 +1291,7 @@ static int acer_rfkill_set(void *data, bool blocked)
...
@@ -1160,7 +1291,7 @@ static int acer_rfkill_set(void *data, bool blocked)
u32
cap
=
(
unsigned
long
)
data
;
u32
cap
=
(
unsigned
long
)
data
;
if
(
rfkill_inited
)
{
if
(
rfkill_inited
)
{
status
=
set_
u32
(
!
blocked
,
cap
);
status
=
set_
device_status
(
!
blocked
,
cap
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -1317,7 +1448,7 @@ static void acer_wmi_notify(u32 value, void *context)
...
@@ -1317,7 +1448,7 @@ static void acer_wmi_notify(u32 value, void *context)
status
=
wmi_get_event_data
(
value
,
&
response
);
status
=
wmi_get_event_data
(
value
,
&
response
);
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
pr_warn
ing
(
"bad event status 0x%x
\n
"
,
status
);
pr_warn
(
"bad event status 0x%x
\n
"
,
status
);
return
;
return
;
}
}
...
@@ -1326,12 +1457,12 @@ static void acer_wmi_notify(u32 value, void *context)
...
@@ -1326,12 +1457,12 @@ static void acer_wmi_notify(u32 value, void *context)
if
(
!
obj
)
if
(
!
obj
)
return
;
return
;
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
pr_warn
ing
(
"Unknown response received %d
\n
"
,
obj
->
type
);
pr_warn
(
"Unknown response received %d
\n
"
,
obj
->
type
);
kfree
(
obj
);
kfree
(
obj
);
return
;
return
;
}
}
if
(
obj
->
buffer
.
length
!=
8
)
{
if
(
obj
->
buffer
.
length
!=
8
)
{
pr_warn
ing
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
pr_warn
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
kfree
(
obj
);
kfree
(
obj
);
return
;
return
;
}
}
...
@@ -1343,7 +1474,7 @@ static void acer_wmi_notify(u32 value, void *context)
...
@@ -1343,7 +1474,7 @@ static void acer_wmi_notify(u32 value, void *context)
case
WMID_HOTKEY_EVENT
:
case
WMID_HOTKEY_EVENT
:
if
(
return_value
.
device_state
)
{
if
(
return_value
.
device_state
)
{
u16
device_state
=
return_value
.
device_state
;
u16
device_state
=
return_value
.
device_state
;
pr_debug
(
"de
ivces states
: 0x%x
\n
"
,
device_state
);
pr_debug
(
"de
vice state
: 0x%x
\n
"
,
device_state
);
if
(
has_cap
(
ACER_CAP_WIRELESS
))
if
(
has_cap
(
ACER_CAP_WIRELESS
))
rfkill_set_sw_state
(
wireless_rfkill
,
rfkill_set_sw_state
(
wireless_rfkill
,
!
(
device_state
&
ACER_WMID3_GDS_WIRELESS
));
!
(
device_state
&
ACER_WMID3_GDS_WIRELESS
));
...
@@ -1356,11 +1487,11 @@ static void acer_wmi_notify(u32 value, void *context)
...
@@ -1356,11 +1487,11 @@ static void acer_wmi_notify(u32 value, void *context)
}
}
if
(
!
sparse_keymap_report_event
(
acer_wmi_input_dev
,
if
(
!
sparse_keymap_report_event
(
acer_wmi_input_dev
,
return_value
.
key_num
,
1
,
true
))
return_value
.
key_num
,
1
,
true
))
pr_warn
ing
(
"Unknown key number - 0x%x
\n
"
,
pr_warn
(
"Unknown key number - 0x%x
\n
"
,
return_value
.
key_num
);
return_value
.
key_num
);
break
;
break
;
default:
default:
pr_warn
ing
(
"Unknown function number - %d - %d
\n
"
,
pr_warn
(
"Unknown function number - %d - %d
\n
"
,
return_value
.
function
,
return_value
.
key_num
);
return_value
.
function
,
return_value
.
key_num
);
break
;
break
;
}
}
...
@@ -1389,7 +1520,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
...
@@ -1389,7 +1520,7 @@ wmid3_set_lm_mode(struct lm_input_params *params,
return
AE_ERROR
;
return
AE_ERROR
;
}
}
if
(
obj
->
buffer
.
length
!=
4
)
{
if
(
obj
->
buffer
.
length
!=
4
)
{
pr_warn
ing
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
pr_warn
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
kfree
(
obj
);
kfree
(
obj
);
return
AE_ERROR
;
return
AE_ERROR
;
}
}
...
@@ -1414,11 +1545,11 @@ static int acer_wmi_enable_ec_raw(void)
...
@@ -1414,11 +1545,11 @@ static int acer_wmi_enable_ec_raw(void)
status
=
wmid3_set_lm_mode
(
&
params
,
&
return_value
);
status
=
wmid3_set_lm_mode
(
&
params
,
&
return_value
);
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
pr_warn
ing
(
"Enabling EC raw mode failed: "
pr_warn
(
"Enabling EC raw mode failed: 0x%x - 0x%x
\n
"
,
"0x%x - 0x%x
\n
"
,
return_value
.
error_code
,
return_value
.
error_code
,
return_value
.
ec_return_value
);
return_value
.
ec_return_value
);
else
else
pr_info
(
"Enabled EC raw mode"
);
pr_info
(
"Enabled EC raw mode
\n
"
);
return
status
;
return
status
;
}
}
...
@@ -1437,8 +1568,8 @@ static int acer_wmi_enable_lm(void)
...
@@ -1437,8 +1568,8 @@ static int acer_wmi_enable_lm(void)
status
=
wmid3_set_lm_mode
(
&
params
,
&
return_value
);
status
=
wmid3_set_lm_mode
(
&
params
,
&
return_value
);
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
if
(
return_value
.
error_code
||
return_value
.
ec_return_value
)
pr_warn
ing
(
"Enabling Launch Manager failed: "
pr_warn
(
"Enabling Launch Manager failed: 0x%x - 0x%x
\n
"
,
"0x%x - 0x%x
\n
"
,
return_value
.
error_code
,
return_value
.
error_code
,
return_value
.
ec_return_value
);
return_value
.
ec_return_value
);
return
status
;
return
status
;
...
@@ -1506,8 +1637,11 @@ static u32 get_wmid_devices(void)
...
@@ -1506,8 +1637,11 @@ static u32 get_wmid_devices(void)
obj
=
(
union
acpi_object
*
)
out
.
pointer
;
obj
=
(
union
acpi_object
*
)
out
.
pointer
;
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_BUFFER
&&
obj
->
buffer
.
length
==
sizeof
(
u32
))
{
(
obj
->
buffer
.
length
==
sizeof
(
u32
)
||
obj
->
buffer
.
length
==
sizeof
(
u64
)))
{
devices
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
devices
=
*
((
u32
*
)
obj
->
buffer
.
pointer
);
}
else
if
(
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
devices
=
(
u32
)
obj
->
integer
.
value
;
}
}
kfree
(
out
.
pointer
);
kfree
(
out
.
pointer
);
...
...
drivers/platform/x86/acerhdf.c
View file @
437cb0db
...
@@ -35,10 +35,8 @@
...
@@ -35,10 +35,8 @@
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/fs.h>
#include <linux/dmi.h>
#include <linux/dmi.h>
#include <acpi/acpi_drivers.h>
#include <linux/acpi.h>
#include <linux/sched.h>
#include <linux/thermal.h>
#include <linux/thermal.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
...
...
drivers/platform/x86/asus-laptop.c
View file @
437cb0db
...
@@ -318,7 +318,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method,
...
@@ -318,7 +318,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method,
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
if
(
ret
)
if
(
ret
)
pr_warn
ing
(
"Error finding %s
\n
"
,
method
);
pr_warn
(
"Error finding %s
\n
"
,
method
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
0
;
return
0
;
...
@@ -383,7 +383,7 @@ static int asus_kled_lvl(struct asus_laptop *asus)
...
@@ -383,7 +383,7 @@ static int asus_kled_lvl(struct asus_laptop *asus)
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_KBD_LIGHT_GET
,
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_KBD_LIGHT_GET
,
&
params
,
&
kblv
);
&
params
,
&
kblv
);
if
(
ACPI_FAILURE
(
rv
))
{
if
(
ACPI_FAILURE
(
rv
))
{
pr_warn
ing
(
"Error reading kled level
\n
"
);
pr_warn
(
"Error reading kled level
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
kblv
;
return
kblv
;
...
@@ -397,7 +397,7 @@ static int asus_kled_set(struct asus_laptop *asus, int kblv)
...
@@ -397,7 +397,7 @@ static int asus_kled_set(struct asus_laptop *asus, int kblv)
kblv
=
0
;
kblv
=
0
;
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_KBD_LIGHT_SET
,
kblv
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_KBD_LIGHT_SET
,
kblv
))
{
pr_warn
ing
(
"Keyboard LED display write failed
\n
"
);
pr_warn
(
"Keyboard LED display write failed
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
0
;
return
0
;
...
@@ -531,7 +531,7 @@ static int asus_read_brightness(struct backlight_device *bd)
...
@@ -531,7 +531,7 @@ static int asus_read_brightness(struct backlight_device *bd)
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_BRIGHTNESS_GET
,
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_BRIGHTNESS_GET
,
NULL
,
&
value
);
NULL
,
&
value
);
if
(
ACPI_FAILURE
(
rv
))
if
(
ACPI_FAILURE
(
rv
))
pr_warn
ing
(
"Error reading brightness
\n
"
);
pr_warn
(
"Error reading brightness
\n
"
);
return
value
;
return
value
;
}
}
...
@@ -541,7 +541,7 @@ static int asus_set_brightness(struct backlight_device *bd, int value)
...
@@ -541,7 +541,7 @@ static int asus_set_brightness(struct backlight_device *bd, int value)
struct
asus_laptop
*
asus
=
bl_get_data
(
bd
);
struct
asus_laptop
*
asus
=
bl_get_data
(
bd
);
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_BRIGHTNESS_SET
,
value
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_BRIGHTNESS_SET
,
value
))
{
pr_warn
ing
(
"Error changing brightness
\n
"
);
pr_warn
(
"Error changing brightness
\n
"
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
...
@@ -730,7 +730,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
...
@@ -730,7 +730,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr,
rv
=
parse_arg
(
buf
,
count
,
&
value
);
rv
=
parse_arg
(
buf
,
count
,
&
value
);
if
(
rv
>
0
)
{
if
(
rv
>
0
)
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_LEDD
,
value
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_LEDD
,
value
))
{
pr_warn
ing
(
"LED display write failed
\n
"
);
pr_warn
(
"LED display write failed
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
asus
->
ledd_status
=
(
u32
)
value
;
asus
->
ledd_status
=
(
u32
)
value
;
...
@@ -752,7 +752,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
...
@@ -752,7 +752,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_WL_STATUS
,
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_WL_STATUS
,
NULL
,
&
status
);
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
{
if
(
ACPI_FAILURE
(
rv
))
{
pr_warn
ing
(
"Error reading Wireless status
\n
"
);
pr_warn
(
"Error reading Wireless status
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
!!
(
status
&
mask
);
return
!!
(
status
&
mask
);
...
@@ -764,7 +764,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
...
@@ -764,7 +764,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask)
static
int
asus_wlan_set
(
struct
asus_laptop
*
asus
,
int
status
)
static
int
asus_wlan_set
(
struct
asus_laptop
*
asus
,
int
status
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WLAN
,
!!
status
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WLAN
,
!!
status
))
{
pr_warn
ing
(
"Error setting wlan status to %d
"
,
status
);
pr_warn
(
"Error setting wlan status to %d
\n
"
,
status
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
...
@@ -792,7 +792,7 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
...
@@ -792,7 +792,7 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr,
static
int
asus_bluetooth_set
(
struct
asus_laptop
*
asus
,
int
status
)
static
int
asus_bluetooth_set
(
struct
asus_laptop
*
asus
,
int
status
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_BLUETOOTH
,
!!
status
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_BLUETOOTH
,
!!
status
))
{
pr_warn
ing
(
"Error setting bluetooth status to %d
"
,
status
);
pr_warn
(
"Error setting bluetooth status to %d
\n
"
,
status
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
...
@@ -821,7 +821,7 @@ static ssize_t store_bluetooth(struct device *dev,
...
@@ -821,7 +821,7 @@ static ssize_t store_bluetooth(struct device *dev,
static
int
asus_wimax_set
(
struct
asus_laptop
*
asus
,
int
status
)
static
int
asus_wimax_set
(
struct
asus_laptop
*
asus
,
int
status
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WIMAX
,
!!
status
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WIMAX
,
!!
status
))
{
pr_warn
ing
(
"Error setting wimax status to %d
"
,
status
);
pr_warn
(
"Error setting wimax status to %d
\n
"
,
status
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
...
@@ -850,7 +850,7 @@ static ssize_t store_wimax(struct device *dev,
...
@@ -850,7 +850,7 @@ static ssize_t store_wimax(struct device *dev,
static
int
asus_wwan_set
(
struct
asus_laptop
*
asus
,
int
status
)
static
int
asus_wwan_set
(
struct
asus_laptop
*
asus
,
int
status
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WWAN
,
!!
status
))
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_WWAN
,
!!
status
))
{
pr_warn
ing
(
"Error setting wwan status to %d
"
,
status
);
pr_warn
(
"Error setting wwan status to %d
\n
"
,
status
);
return
-
EIO
;
return
-
EIO
;
}
}
return
0
;
return
0
;
...
@@ -880,7 +880,7 @@ static void asus_set_display(struct asus_laptop *asus, int value)
...
@@ -880,7 +880,7 @@ static void asus_set_display(struct asus_laptop *asus, int value)
{
{
/* no sanity check needed for now */
/* no sanity check needed for now */
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_SWITCH_DISPLAY
,
value
))
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_SWITCH_DISPLAY
,
value
))
pr_warn
ing
(
"Error setting display
\n
"
);
pr_warn
(
"Error setting display
\n
"
);
return
;
return
;
}
}
...
@@ -909,7 +909,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
...
@@ -909,7 +909,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr,
static
void
asus_als_switch
(
struct
asus_laptop
*
asus
,
int
value
)
static
void
asus_als_switch
(
struct
asus_laptop
*
asus
,
int
value
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_ALS_CONTROL
,
value
))
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_ALS_CONTROL
,
value
))
pr_warn
ing
(
"Error setting light sensor switch
\n
"
);
pr_warn
(
"Error setting light sensor switch
\n
"
);
asus
->
light_switch
=
value
;
asus
->
light_switch
=
value
;
}
}
...
@@ -937,7 +937,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
...
@@ -937,7 +937,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr,
static
void
asus_als_level
(
struct
asus_laptop
*
asus
,
int
value
)
static
void
asus_als_level
(
struct
asus_laptop
*
asus
,
int
value
)
{
{
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_ALS_LEVEL
,
value
))
if
(
write_acpi_int
(
asus
->
handle
,
METHOD_ALS_LEVEL
,
value
))
pr_warn
ing
(
"Error setting light sensor level
\n
"
);
pr_warn
(
"Error setting light sensor level
\n
"
);
asus
->
light_level
=
value
;
asus
->
light_level
=
value
;
}
}
...
@@ -976,7 +976,7 @@ static int asus_gps_status(struct asus_laptop *asus)
...
@@ -976,7 +976,7 @@ static int asus_gps_status(struct asus_laptop *asus)
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_GPS_STATUS
,
rv
=
acpi_evaluate_integer
(
asus
->
handle
,
METHOD_GPS_STATUS
,
NULL
,
&
status
);
NULL
,
&
status
);
if
(
ACPI_FAILURE
(
rv
))
{
if
(
ACPI_FAILURE
(
rv
))
{
pr_warn
ing
(
"Error reading GPS status
\n
"
);
pr_warn
(
"Error reading GPS status
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
!!
status
;
return
!!
status
;
...
@@ -1284,7 +1284,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
...
@@ -1284,7 +1284,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
*/
*/
status
=
acpi_get_table
(
ACPI_SIG_DSDT
,
1
,
&
asus
->
dsdt_info
);
status
=
acpi_get_table
(
ACPI_SIG_DSDT
,
1
,
&
asus
->
dsdt_info
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr_warn
ing
(
"Couldn't get the DSDT table header
\n
"
);
pr_warn
(
"Couldn't get the DSDT table header
\n
"
);
/* We have to write 0 on init this far for all ASUS models */
/* We have to write 0 on init this far for all ASUS models */
if
(
write_acpi_int_ret
(
asus
->
handle
,
"INIT"
,
0
,
&
buffer
))
{
if
(
write_acpi_int_ret
(
asus
->
handle
,
"INIT"
,
0
,
&
buffer
))
{
...
@@ -1296,7 +1296,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
...
@@ -1296,7 +1296,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus)
status
=
status
=
acpi_evaluate_integer
(
asus
->
handle
,
"BSTS"
,
NULL
,
&
bsts_result
);
acpi_evaluate_integer
(
asus
->
handle
,
"BSTS"
,
NULL
,
&
bsts_result
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr_warn
ing
(
"Error calling BSTS
\n
"
);
pr_warn
(
"Error calling BSTS
\n
"
);
else
if
(
bsts_result
)
else
if
(
bsts_result
)
pr_notice
(
"BSTS called, 0x%02x returned
\n
"
,
pr_notice
(
"BSTS called, 0x%02x returned
\n
"
,
(
uint
)
bsts_result
);
(
uint
)
bsts_result
);
...
...
drivers/platform/x86/asus-wmi.c
View file @
437cb0db
...
@@ -425,7 +425,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
...
@@ -425,7 +425,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
if
(
asus
->
hotplug_slot
)
{
if
(
asus
->
hotplug_slot
)
{
bus
=
pci_find_bus
(
0
,
1
);
bus
=
pci_find_bus
(
0
,
1
);
if
(
!
bus
)
{
if
(
!
bus
)
{
pr_warn
ing
(
"Unable to find PCI bus 1?
\n
"
);
pr_warn
(
"Unable to find PCI bus 1?
\n
"
);
goto
out_unlock
;
goto
out_unlock
;
}
}
...
@@ -436,11 +436,11 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
...
@@ -436,11 +436,11 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus)
absent
=
(
l
==
0xffffffff
);
absent
=
(
l
==
0xffffffff
);
if
(
blocked
!=
absent
)
{
if
(
blocked
!=
absent
)
{
pr_warn
ing
(
"BIOS says wireless lan is %s, "
pr_warn
(
"BIOS says wireless lan is %s, "
"but the pci device is %s
\n
"
,
"but the pci device is %s
\n
"
,
blocked
?
"blocked"
:
"unblocked"
,
blocked
?
"blocked"
:
"unblocked"
,
absent
?
"absent"
:
"present"
);
absent
?
"absent"
:
"present"
);
pr_warn
ing
(
"skipped wireless hotplug as probably "
pr_warn
(
"skipped wireless hotplug as probably "
"inappropriate for this model
\n
"
);
"inappropriate for this model
\n
"
);
goto
out_unlock
;
goto
out_unlock
;
}
}
...
@@ -500,7 +500,7 @@ static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node)
...
@@ -500,7 +500,7 @@ static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node)
ACPI_SYSTEM_NOTIFY
,
ACPI_SYSTEM_NOTIFY
,
asus_rfkill_notify
,
asus
);
asus_rfkill_notify
,
asus
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr_warn
ing
(
"Failed to register notify on %s
\n
"
,
node
);
pr_warn
(
"Failed to register notify on %s
\n
"
,
node
);
}
else
}
else
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -1223,7 +1223,7 @@ static int asus_wmi_sysfs_init(struct platform_device *device)
...
@@ -1223,7 +1223,7 @@ static int asus_wmi_sysfs_init(struct platform_device *device)
/*
/*
* Platform device
* Platform device
*/
*/
static
int
__init
asus_wmi_platform_init
(
struct
asus_wmi
*
asus
)
static
int
asus_wmi_platform_init
(
struct
asus_wmi
*
asus
)
{
{
int
rv
;
int
rv
;
...
@@ -1583,12 +1583,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
...
@@ -1583,12 +1583,12 @@ static int asus_wmi_probe(struct platform_device *pdev)
int
ret
;
int
ret
;
if
(
!
wmi_has_guid
(
ASUS_WMI_MGMT_GUID
))
{
if
(
!
wmi_has_guid
(
ASUS_WMI_MGMT_GUID
))
{
pr_warn
ing
(
"Management GUID not found
\n
"
);
pr_warn
(
"Management GUID not found
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
wdrv
->
event_guid
&&
!
wmi_has_guid
(
wdrv
->
event_guid
))
{
if
(
wdrv
->
event_guid
&&
!
wmi_has_guid
(
wdrv
->
event_guid
))
{
pr_warn
ing
(
"Event GUID not found
\n
"
);
pr_warn
(
"Event GUID not found
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
...
drivers/platform/x86/asus_acpi.c
View file @
437cb0db
...
@@ -30,6 +30,8 @@
...
@@ -30,6 +30,8 @@
*
*
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
...
@@ -581,8 +583,7 @@ static int read_led(const char *ledname, int ledmask)
...
@@ -581,8 +583,7 @@ static int read_led(const char *ledname, int ledmask)
if
(
read_acpi_int
(
NULL
,
ledname
,
&
led_status
))
if
(
read_acpi_int
(
NULL
,
ledname
,
&
led_status
))
return
led_status
;
return
led_status
;
else
else
printk
(
KERN_WARNING
"Asus ACPI: Error reading LED "
pr_warn
(
"Error reading LED status
\n
"
);
"status
\n
"
);
}
}
return
(
hotk
->
status
&
ledmask
)
?
1
:
0
;
return
(
hotk
->
status
&
ledmask
)
?
1
:
0
;
}
}
...
@@ -621,8 +622,7 @@ write_led(const char __user *buffer, unsigned long count,
...
@@ -621,8 +622,7 @@ write_led(const char __user *buffer, unsigned long count,
led_out
=
!
led_out
;
led_out
=
!
led_out
;
if
(
!
write_acpi_int
(
hotk
->
handle
,
ledname
,
led_out
,
NULL
))
if
(
!
write_acpi_int
(
hotk
->
handle
,
ledname
,
led_out
,
NULL
))
printk
(
KERN_WARNING
"Asus ACPI: LED (%s) write failed
\n
"
,
pr_warn
(
"LED (%s) write failed
\n
"
,
ledname
);
ledname
);
return
rv
;
return
rv
;
}
}
...
@@ -679,8 +679,7 @@ static ssize_t ledd_proc_write(struct file *file, const char __user *buffer,
...
@@ -679,8 +679,7 @@ static ssize_t ledd_proc_write(struct file *file, const char __user *buffer,
if
(
rv
>
0
)
{
if
(
rv
>
0
)
{
if
(
!
write_acpi_int
if
(
!
write_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
mt_ledd
,
value
,
NULL
))
(
hotk
->
handle
,
hotk
->
methods
->
mt_ledd
,
value
,
NULL
))
printk
(
KERN_WARNING
pr_warn
(
"LED display write failed
\n
"
);
"Asus ACPI: LED display write failed
\n
"
);
else
else
hotk
->
ledd_status
=
(
u32
)
value
;
hotk
->
ledd_status
=
(
u32
)
value
;
}
}
...
@@ -838,8 +837,7 @@ static int get_lcd_state(void)
...
@@ -838,8 +837,7 @@ static int get_lcd_state(void)
}
else
{
}
else
{
/* We don't have to check anything if we are here */
/* We don't have to check anything if we are here */
if
(
!
read_acpi_int
(
NULL
,
hotk
->
methods
->
lcd_status
,
&
lcd
))
if
(
!
read_acpi_int
(
NULL
,
hotk
->
methods
->
lcd_status
,
&
lcd
))
printk
(
KERN_WARNING
pr_warn
(
"Error reading LCD status
\n
"
);
"Asus ACPI: Error reading LCD status
\n
"
);
if
(
hotk
->
model
==
L2D
)
if
(
hotk
->
model
==
L2D
)
lcd
=
~
lcd
;
lcd
=
~
lcd
;
...
@@ -871,7 +869,7 @@ static int set_lcd_state(int value)
...
@@ -871,7 +869,7 @@ static int set_lcd_state(int value)
the exact behaviour is simulated here */
the exact behaviour is simulated here */
}
}
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr
intk
(
KERN_WARNING
"Asus ACPI:
Error switching LCD
\n
"
);
pr
_warn
(
"
Error switching LCD
\n
"
);
}
}
return
0
;
return
0
;
...
@@ -915,13 +913,11 @@ static int read_brightness(struct backlight_device *bd)
...
@@ -915,13 +913,11 @@ static int read_brightness(struct backlight_device *bd)
if
(
hotk
->
methods
->
brightness_get
)
{
/* SPLV/GPLV laptop */
if
(
hotk
->
methods
->
brightness_get
)
{
/* SPLV/GPLV laptop */
if
(
!
read_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
brightness_get
,
if
(
!
read_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
brightness_get
,
&
value
))
&
value
))
printk
(
KERN_WARNING
pr_warn
(
"Error reading brightness
\n
"
);
"Asus ACPI: Error reading brightness
\n
"
);
}
else
if
(
hotk
->
methods
->
brightness_status
)
{
/* For D1 for example */
}
else
if
(
hotk
->
methods
->
brightness_status
)
{
/* For D1 for example */
if
(
!
read_acpi_int
(
NULL
,
hotk
->
methods
->
brightness_status
,
if
(
!
read_acpi_int
(
NULL
,
hotk
->
methods
->
brightness_status
,
&
value
))
&
value
))
printk
(
KERN_WARNING
pr_warn
(
"Error reading brightness
\n
"
);
"Asus ACPI: Error reading brightness
\n
"
);
}
else
/* No GPLV method */
}
else
/* No GPLV method */
value
=
hotk
->
brightness
;
value
=
hotk
->
brightness
;
return
value
;
return
value
;
...
@@ -939,8 +935,7 @@ static int set_brightness(int value)
...
@@ -939,8 +935,7 @@ static int set_brightness(int value)
if
(
hotk
->
methods
->
brightness_set
)
{
if
(
hotk
->
methods
->
brightness_set
)
{
if
(
!
write_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
brightness_set
,
if
(
!
write_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
brightness_set
,
value
,
NULL
))
{
value
,
NULL
))
{
printk
(
KERN_WARNING
pr_warn
(
"Error changing brightness
\n
"
);
"Asus ACPI: Error changing brightness
\n
"
);
ret
=
-
EIO
;
ret
=
-
EIO
;
}
}
goto
out
;
goto
out
;
...
@@ -955,8 +950,7 @@ static int set_brightness(int value)
...
@@ -955,8 +950,7 @@ static int set_brightness(int value)
NULL
,
NULL
);
NULL
,
NULL
);
(
value
>
0
)
?
value
--
:
value
++
;
(
value
>
0
)
?
value
--
:
value
++
;
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
printk
(
KERN_WARNING
pr_warn
(
"Error changing brightness
\n
"
);
"Asus ACPI: Error changing brightness
\n
"
);
ret
=
-
EIO
;
ret
=
-
EIO
;
}
}
}
}
...
@@ -1008,7 +1002,7 @@ static void set_display(int value)
...
@@ -1008,7 +1002,7 @@ static void set_display(int value)
/* no sanity check needed for now */
/* no sanity check needed for now */
if
(
!
write_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
display_set
,
if
(
!
write_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
display_set
,
value
,
NULL
))
value
,
NULL
))
pr
intk
(
KERN_WARNING
"Asus ACPI:
Error setting display
\n
"
);
pr
_warn
(
"
Error setting display
\n
"
);
return
;
return
;
}
}
...
@@ -1021,8 +1015,7 @@ static int disp_proc_show(struct seq_file *m, void *v)
...
@@ -1021,8 +1015,7 @@ static int disp_proc_show(struct seq_file *m, void *v)
int
value
=
0
;
int
value
=
0
;
if
(
!
read_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
display_get
,
&
value
))
if
(
!
read_acpi_int
(
hotk
->
handle
,
hotk
->
methods
->
display_get
,
&
value
))
printk
(
KERN_WARNING
pr_warn
(
"Error reading display status
\n
"
);
"Asus ACPI: Error reading display status
\n
"
);
value
&=
0x07
;
/* needed for some models, shouldn't hurt others */
value
&=
0x07
;
/* needed for some models, shouldn't hurt others */
seq_printf
(
m
,
"%d
\n
"
,
value
);
seq_printf
(
m
,
"%d
\n
"
,
value
);
return
0
;
return
0
;
...
@@ -1068,7 +1061,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
...
@@ -1068,7 +1061,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode,
proc
=
proc_create_data
(
name
,
mode
,
acpi_device_dir
(
device
),
proc
=
proc_create_data
(
name
,
mode
,
acpi_device_dir
(
device
),
proc_fops
,
acpi_driver_data
(
device
));
proc_fops
,
acpi_driver_data
(
device
));
if
(
!
proc
)
{
if
(
!
proc
)
{
pr
intk
(
KERN_WARNING
" Unable to create %s fs entry
\n
"
,
name
);
pr
_warn
(
" Unable to create %s fs entry
\n
"
,
name
);
return
-
1
;
return
-
1
;
}
}
proc
->
uid
=
asus_uid
;
proc
->
uid
=
asus_uid
;
...
@@ -1085,7 +1078,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
...
@@ -1085,7 +1078,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
mode
=
S_IFREG
|
S_IRUGO
|
S_IWUSR
|
S_IWGRP
;
mode
=
S_IFREG
|
S_IRUGO
|
S_IWUSR
|
S_IWGRP
;
}
else
{
}
else
{
mode
=
S_IFREG
|
S_IRUSR
|
S_IRGRP
|
S_IWUSR
|
S_IWGRP
;
mode
=
S_IFREG
|
S_IRUSR
|
S_IRGRP
|
S_IWUSR
|
S_IWGRP
;
pr
intk
(
KERN_WARNING
" asus_uid and asus_gid parameters are "
pr
_warn
(
" asus_uid and asus_gid parameters are "
"deprecated, use chown and chmod instead!
\n
"
);
"deprecated, use chown and chmod instead!
\n
"
);
}
}
...
@@ -1099,8 +1092,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
...
@@ -1099,8 +1092,7 @@ static int asus_hotk_add_fs(struct acpi_device *device)
proc
->
uid
=
asus_uid
;
proc
->
uid
=
asus_uid
;
proc
->
gid
=
asus_gid
;
proc
->
gid
=
asus_gid
;
}
else
{
}
else
{
printk
(
KERN_WARNING
" Unable to create "
PROC_INFO
pr_warn
(
" Unable to create "
PROC_INFO
" fs entry
\n
"
);
" fs entry
\n
"
);
}
}
if
(
hotk
->
methods
->
mt_wled
)
{
if
(
hotk
->
methods
->
mt_wled
)
{
...
@@ -1283,20 +1275,19 @@ static int asus_hotk_get_info(void)
...
@@ -1283,20 +1275,19 @@ static int asus_hotk_get_info(void)
*/
*/
status
=
acpi_get_table
(
ACPI_SIG_DSDT
,
1
,
&
asus_info
);
status
=
acpi_get_table
(
ACPI_SIG_DSDT
,
1
,
&
asus_info
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr
intk
(
KERN_WARNING
" Couldn't get the DSDT table header
\n
"
);
pr
_warn
(
" Couldn't get the DSDT table header
\n
"
);
/* We have to write 0 on init this far for all ASUS models */
/* We have to write 0 on init this far for all ASUS models */
if
(
!
write_acpi_int
(
hotk
->
handle
,
"INIT"
,
0
,
&
buffer
))
{
if
(
!
write_acpi_int
(
hotk
->
handle
,
"INIT"
,
0
,
&
buffer
))
{
pr
intk
(
KERN_ERR
" Hotkey initialization failed
\n
"
);
pr
_err
(
" Hotkey initialization failed
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
/* This needs to be called for some laptops to init properly */
/* This needs to be called for some laptops to init properly */
if
(
!
read_acpi_int
(
hotk
->
handle
,
"BSTS"
,
&
bsts_result
))
if
(
!
read_acpi_int
(
hotk
->
handle
,
"BSTS"
,
&
bsts_result
))
pr
intk
(
KERN_WARNING
" Error calling BSTS
\n
"
);
pr
_warn
(
" Error calling BSTS
\n
"
);
else
if
(
bsts_result
)
else
if
(
bsts_result
)
printk
(
KERN_NOTICE
" BSTS called, 0x%02x returned
\n
"
,
pr_notice
(
" BSTS called, 0x%02x returned
\n
"
,
bsts_result
);
bsts_result
);
/*
/*
* Try to match the object returned by INIT to the specific model.
* Try to match the object returned by INIT to the specific model.
...
@@ -1324,23 +1315,21 @@ static int asus_hotk_get_info(void)
...
@@ -1324,23 +1315,21 @@ static int asus_hotk_get_info(void)
if
(
asus_info
&&
if
(
asus_info
&&
strncmp
(
asus_info
->
oem_table_id
,
"ODEM"
,
4
)
==
0
)
{
strncmp
(
asus_info
->
oem_table_id
,
"ODEM"
,
4
)
==
0
)
{
hotk
->
model
=
P30
;
hotk
->
model
=
P30
;
printk
(
KERN_NOTICE
pr_notice
(
" Samsung P30 detected, supported
\n
"
);
" Samsung P30 detected, supported
\n
"
);
hotk
->
methods
=
&
model_conf
[
hotk
->
model
];
hotk
->
methods
=
&
model_conf
[
hotk
->
model
];
kfree
(
model
);
kfree
(
model
);
return
0
;
return
0
;
}
else
{
}
else
{
hotk
->
model
=
M2E
;
hotk
->
model
=
M2E
;
printk
(
KERN_NOTICE
" unsupported model %s, trying "
pr_notice
(
" unsupported model %s, trying default values
\n
"
,
"default values
\n
"
,
string
);
string
);
printk
(
KERN_NOTICE
pr_notice
(
" send /proc/acpi/dsdt to the developers
\n
"
);
" send /proc/acpi/dsdt to the developers
\n
"
);
kfree
(
model
);
kfree
(
model
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
}
}
hotk
->
methods
=
&
model_conf
[
hotk
->
model
];
hotk
->
methods
=
&
model_conf
[
hotk
->
model
];
pr
intk
(
KERN_NOTICE
" %s model detected, supported
\n
"
,
string
);
pr
_notice
(
" %s model detected, supported
\n
"
,
string
);
/* Sort of per-model blacklist */
/* Sort of per-model blacklist */
if
(
strncmp
(
string
,
"L2B"
,
3
)
==
0
)
if
(
strncmp
(
string
,
"L2B"
,
3
)
==
0
)
...
@@ -1385,7 +1374,7 @@ static int asus_hotk_check(void)
...
@@ -1385,7 +1374,7 @@ static int asus_hotk_check(void)
if
(
hotk
->
device
->
status
.
present
)
{
if
(
hotk
->
device
->
status
.
present
)
{
result
=
asus_hotk_get_info
();
result
=
asus_hotk_get_info
();
}
else
{
}
else
{
pr
intk
(
KERN_ERR
" Hotkey device not present, aborting
\n
"
);
pr
_err
(
" Hotkey device not present, aborting
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -1399,8 +1388,7 @@ static int asus_hotk_add(struct acpi_device *device)
...
@@ -1399,8 +1388,7 @@ static int asus_hotk_add(struct acpi_device *device)
acpi_status
status
=
AE_OK
;
acpi_status
status
=
AE_OK
;
int
result
;
int
result
;
printk
(
KERN_NOTICE
"Asus Laptop ACPI Extras version %s
\n
"
,
pr_notice
(
"Asus Laptop ACPI Extras version %s
\n
"
,
ASUS_ACPI_VERSION
);
ASUS_ACPI_VERSION
);
hotk
=
kzalloc
(
sizeof
(
struct
asus_hotk
),
GFP_KERNEL
);
hotk
=
kzalloc
(
sizeof
(
struct
asus_hotk
),
GFP_KERNEL
);
if
(
!
hotk
)
if
(
!
hotk
)
...
@@ -1428,15 +1416,14 @@ static int asus_hotk_add(struct acpi_device *device)
...
@@ -1428,15 +1416,14 @@ static int asus_hotk_add(struct acpi_device *device)
acpi_evaluate_object
(
NULL
,
hotk
->
methods
->
brightness_down
,
acpi_evaluate_object
(
NULL
,
hotk
->
methods
->
brightness_down
,
NULL
,
NULL
);
NULL
,
NULL
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr
intk
(
KERN_WARNING
" Error changing brightness
\n
"
);
pr
_warn
(
" Error changing brightness
\n
"
);
else
{
else
{
status
=
status
=
acpi_evaluate_object
(
NULL
,
acpi_evaluate_object
(
NULL
,
hotk
->
methods
->
brightness_up
,
hotk
->
methods
->
brightness_up
,
NULL
,
NULL
);
NULL
,
NULL
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
printk
(
KERN_WARNING
" Strange, error changing"
pr_warn
(
" Strange, error changing brightness
\n
"
);
" brightness
\n
"
);
}
}
}
}
...
@@ -1488,7 +1475,7 @@ static int __init asus_acpi_init(void)
...
@@ -1488,7 +1475,7 @@ static int __init asus_acpi_init(void)
asus_proc_dir
=
proc_mkdir
(
PROC_ASUS
,
acpi_root_dir
);
asus_proc_dir
=
proc_mkdir
(
PROC_ASUS
,
acpi_root_dir
);
if
(
!
asus_proc_dir
)
{
if
(
!
asus_proc_dir
)
{
pr
intk
(
KERN_ERR
"Asus ACPI:
Unable to create /proc entry
\n
"
);
pr
_err
(
"
Unable to create /proc entry
\n
"
);
acpi_bus_unregister_driver
(
&
asus_hotk_driver
);
acpi_bus_unregister_driver
(
&
asus_hotk_driver
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -1513,7 +1500,7 @@ static int __init asus_acpi_init(void)
...
@@ -1513,7 +1500,7 @@ static int __init asus_acpi_init(void)
&
asus_backlight_data
,
&
asus_backlight_data
,
&
props
);
&
props
);
if
(
IS_ERR
(
asus_backlight_device
))
{
if
(
IS_ERR
(
asus_backlight_device
))
{
pr
intk
(
KERN_ERR
"Could not register asus backlight device
\n
"
);
pr
_err
(
"Could not register asus backlight device
\n
"
);
asus_backlight_device
=
NULL
;
asus_backlight_device
=
NULL
;
asus_acpi_exit
();
asus_acpi_exit
();
return
-
ENODEV
;
return
-
ENODEV
;
...
...
drivers/platform/x86/compal-laptop.c
View file @
437cb0db
...
@@ -68,6 +68,8 @@
...
@@ -68,6 +68,8 @@
* only enabled on a JHL90 board until it is verified that they work on the
* only enabled on a JHL90 board until it is verified that they work on the
* other boards too. See the extra_features variable. */
* other boards too. See the extra_features variable. */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -760,16 +762,14 @@ static struct rfkill *bt_rfkill;
...
@@ -760,16 +762,14 @@ static struct rfkill *bt_rfkill;
static
int
dmi_check_cb
(
const
struct
dmi_system_id
*
id
)
static
int
dmi_check_cb
(
const
struct
dmi_system_id
*
id
)
{
{
printk
(
KERN_INFO
DRIVER_NAME
": Identified laptop model '%s'
\n
"
,
pr_info
(
"Identified laptop model '%s'
\n
"
,
id
->
ident
);
id
->
ident
);
extra_features
=
false
;
extra_features
=
false
;
return
1
;
return
1
;
}
}
static
int
dmi_check_cb_extra
(
const
struct
dmi_system_id
*
id
)
static
int
dmi_check_cb_extra
(
const
struct
dmi_system_id
*
id
)
{
{
printk
(
KERN_INFO
DRIVER_NAME
": Identified laptop model '%s', "
pr_info
(
"Identified laptop model '%s', enabling extra features
\n
"
,
"enabling extra features
\n
"
,
id
->
ident
);
id
->
ident
);
extra_features
=
true
;
extra_features
=
true
;
return
1
;
return
1
;
...
@@ -956,14 +956,12 @@ static int __init compal_init(void)
...
@@ -956,14 +956,12 @@ static int __init compal_init(void)
int
ret
;
int
ret
;
if
(
acpi_disabled
)
{
if
(
acpi_disabled
)
{
printk
(
KERN_ERR
DRIVER_NAME
": ACPI needs to be enabled for "
pr_err
(
"ACPI needs to be enabled for this driver to work!
\n
"
);
"this driver to work!
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
if
(
!
force
&&
!
dmi_check_system
(
compal_dmi_table
))
{
if
(
!
force
&&
!
dmi_check_system
(
compal_dmi_table
))
{
printk
(
KERN_ERR
DRIVER_NAME
": Motherboard not recognized (You "
pr_err
(
"Motherboard not recognized (You could try the module's force-parameter)
\n
"
);
"could try the module's force-parameter)"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -998,8 +996,7 @@ static int __init compal_init(void)
...
@@ -998,8 +996,7 @@ static int __init compal_init(void)
if
(
ret
)
if
(
ret
)
goto
err_rfkill
;
goto
err_rfkill
;
printk
(
KERN_INFO
DRIVER_NAME
": Driver "
DRIVER_VERSION
pr_info
(
"Driver "
DRIVER_VERSION
" successfully loaded
\n
"
);
" successfully loaded
\n
"
);
return
0
;
return
0
;
err_rfkill:
err_rfkill:
...
@@ -1064,7 +1061,7 @@ static void __exit compal_cleanup(void)
...
@@ -1064,7 +1061,7 @@ static void __exit compal_cleanup(void)
rfkill_destroy
(
wifi_rfkill
);
rfkill_destroy
(
wifi_rfkill
);
rfkill_destroy
(
bt_rfkill
);
rfkill_destroy
(
bt_rfkill
);
pr
intk
(
KERN_INFO
DRIVER_NAME
":
Driver unloaded
\n
"
);
pr
_info
(
"
Driver unloaded
\n
"
);
}
}
static
int
__devexit
compal_remove
(
struct
platform_device
*
pdev
)
static
int
__devexit
compal_remove
(
struct
platform_device
*
pdev
)
...
@@ -1074,8 +1071,7 @@ static int __devexit compal_remove(struct platform_device *pdev)
...
@@ -1074,8 +1071,7 @@ static int __devexit compal_remove(struct platform_device *pdev)
if
(
!
extra_features
)
if
(
!
extra_features
)
return
0
;
return
0
;
printk
(
KERN_INFO
DRIVER_NAME
": Unloading: resetting fan control "
pr_info
(
"Unloading: resetting fan control to motherboard
\n
"
);
"to motherboard
\n
"
);
pwm_disable_control
();
pwm_disable_control
();
data
=
platform_get_drvdata
(
pdev
);
data
=
platform_get_drvdata
(
pdev
);
...
...
drivers/platform/x86/dell-laptop.c
View file @
437cb0db
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
* published by the Free Software Foundation.
* published by the Free Software Foundation.
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -434,8 +436,7 @@ static int __init dell_setup_rfkill(void)
...
@@ -434,8 +436,7 @@ static int __init dell_setup_rfkill(void)
int
ret
;
int
ret
;
if
(
dmi_check_system
(
dell_blacklist
))
{
if
(
dmi_check_system
(
dell_blacklist
))
{
printk
(
KERN_INFO
"dell-laptop: Blacklisted hardware detected - "
pr_info
(
"Blacklisted hardware detected - not enabling rfkill
\n
"
);
"not enabling rfkill
\n
"
);
return
0
;
return
0
;
}
}
...
@@ -606,7 +607,7 @@ static int __init dell_init(void)
...
@@ -606,7 +607,7 @@ static int __init dell_init(void)
dmi_walk
(
find_tokens
,
NULL
);
dmi_walk
(
find_tokens
,
NULL
);
if
(
!
da_tokens
)
{
if
(
!
da_tokens
)
{
pr
intk
(
KERN_INFO
"dell-laptop:
Unable to find dmi tokens
\n
"
);
pr
_info
(
"
Unable to find dmi tokens
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -636,14 +637,13 @@ static int __init dell_init(void)
...
@@ -636,14 +637,13 @@ static int __init dell_init(void)
ret
=
dell_setup_rfkill
();
ret
=
dell_setup_rfkill
();
if
(
ret
)
{
if
(
ret
)
{
pr
intk
(
KERN_WARNING
"dell-laptop:
Unable to setup rfkill
\n
"
);
pr
_warn
(
"
Unable to setup rfkill
\n
"
);
goto
fail_rfkill
;
goto
fail_rfkill
;
}
}
ret
=
i8042_install_filter
(
dell_laptop_i8042_filter
);
ret
=
i8042_install_filter
(
dell_laptop_i8042_filter
);
if
(
ret
)
{
if
(
ret
)
{
printk
(
KERN_WARNING
pr_warn
(
"Unable to install key filter
\n
"
);
"dell-laptop: Unable to install key filter
\n
"
);
goto
fail_filter
;
goto
fail_filter
;
}
}
...
...
drivers/platform/x86/dell-wmi-aio.c
View file @
437cb0db
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
* along with this program; if not, write to the Free Software
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
...
@@ -138,7 +139,7 @@ static int __init dell_wmi_aio_init(void)
...
@@ -138,7 +139,7 @@ static int __init dell_wmi_aio_init(void)
guid
=
dell_wmi_aio_find
();
guid
=
dell_wmi_aio_find
();
if
(
!
guid
)
{
if
(
!
guid
)
{
pr_warn
ing
(
"No known WMI GUID found
\n
"
);
pr_warn
(
"No known WMI GUID found
\n
"
);
return
-
ENXIO
;
return
-
ENXIO
;
}
}
...
...
drivers/platform/x86/dell-wmi.c
View file @
437cb0db
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -141,7 +143,7 @@ static void dell_wmi_notify(u32 value, void *context)
...
@@ -141,7 +143,7 @@ static void dell_wmi_notify(u32 value, void *context)
status
=
wmi_get_event_data
(
value
,
&
response
);
status
=
wmi_get_event_data
(
value
,
&
response
);
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
pr
intk
(
KERN_INFO
"dell-wmi:
bad event status 0x%x
\n
"
,
status
);
pr
_info
(
"
bad event status 0x%x
\n
"
,
status
);
return
;
return
;
}
}
...
@@ -153,8 +155,8 @@ static void dell_wmi_notify(u32 value, void *context)
...
@@ -153,8 +155,8 @@ static void dell_wmi_notify(u32 value, void *context)
u16
*
buffer_entry
=
(
u16
*
)
obj
->
buffer
.
pointer
;
u16
*
buffer_entry
=
(
u16
*
)
obj
->
buffer
.
pointer
;
if
(
dell_new_hk_type
&&
(
buffer_entry
[
1
]
!=
0x10
))
{
if
(
dell_new_hk_type
&&
(
buffer_entry
[
1
]
!=
0x10
))
{
pr
intk
(
KERN_INFO
"dell-wmi: Received unknown WMI event"
pr
_info
(
"Received unknown WMI event (0x%x)
\n
"
,
" (0x%x)
\n
"
,
buffer_entry
[
1
]);
buffer_entry
[
1
]);
kfree
(
obj
);
kfree
(
obj
);
return
;
return
;
}
}
...
@@ -167,8 +169,7 @@ static void dell_wmi_notify(u32 value, void *context)
...
@@ -167,8 +169,7 @@ static void dell_wmi_notify(u32 value, void *context)
key
=
sparse_keymap_entry_from_scancode
(
dell_wmi_input_dev
,
key
=
sparse_keymap_entry_from_scancode
(
dell_wmi_input_dev
,
reported_key
);
reported_key
);
if
(
!
key
)
{
if
(
!
key
)
{
printk
(
KERN_INFO
"dell-wmi: Unknown key %x pressed
\n
"
,
pr_info
(
"Unknown key %x pressed
\n
"
,
reported_key
);
reported_key
);
}
else
if
((
key
->
keycode
==
KEY_BRIGHTNESSUP
||
}
else
if
((
key
->
keycode
==
KEY_BRIGHTNESSUP
||
key
->
keycode
==
KEY_BRIGHTNESSDOWN
)
&&
acpi_video
)
{
key
->
keycode
==
KEY_BRIGHTNESSDOWN
)
&&
acpi_video
)
{
/* Don't report brightness notifications that will also
/* Don't report brightness notifications that will also
...
@@ -275,7 +276,7 @@ static int __init dell_wmi_init(void)
...
@@ -275,7 +276,7 @@ static int __init dell_wmi_init(void)
acpi_status
status
;
acpi_status
status
;
if
(
!
wmi_has_guid
(
DELL_EVENT_GUID
))
{
if
(
!
wmi_has_guid
(
DELL_EVENT_GUID
))
{
pr
intk
(
KERN_WARNING
"dell-wmi:
No known WMI GUID found
\n
"
);
pr
_warn
(
"
No known WMI GUID found
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -290,9 +291,7 @@ static int __init dell_wmi_init(void)
...
@@ -290,9 +291,7 @@ static int __init dell_wmi_init(void)
dell_wmi_notify
,
NULL
);
dell_wmi_notify
,
NULL
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
dell_wmi_input_destroy
();
dell_wmi_input_destroy
();
printk
(
KERN_ERR
pr_err
(
"Unable to register notify handler - %d
\n
"
,
status
);
"dell-wmi: Unable to register notify handler - %d
\n
"
,
status
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
...
drivers/platform/x86/eeepc-laptop.c
View file @
437cb0db
...
@@ -228,7 +228,7 @@ static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value)
...
@@ -228,7 +228,7 @@ static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value)
return
-
ENODEV
;
return
-
ENODEV
;
if
(
write_acpi_int
(
eeepc
->
handle
,
method
,
value
))
if
(
write_acpi_int
(
eeepc
->
handle
,
method
,
value
))
pr_warn
ing
(
"Error writing %s
\n
"
,
method
);
pr_warn
(
"Error writing %s
\n
"
,
method
);
return
0
;
return
0
;
}
}
...
@@ -243,7 +243,7 @@ static int get_acpi(struct eeepc_laptop *eeepc, int cm)
...
@@ -243,7 +243,7 @@ static int get_acpi(struct eeepc_laptop *eeepc, int cm)
return
-
ENODEV
;
return
-
ENODEV
;
if
(
read_acpi_int
(
eeepc
->
handle
,
method
,
&
value
))
if
(
read_acpi_int
(
eeepc
->
handle
,
method
,
&
value
))
pr_warn
ing
(
"Error reading %s
\n
"
,
method
);
pr_warn
(
"Error reading %s
\n
"
,
method
);
return
value
;
return
value
;
}
}
...
@@ -261,7 +261,7 @@ static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm,
...
@@ -261,7 +261,7 @@ static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm,
status
=
acpi_get_handle
(
eeepc
->
handle
,
(
char
*
)
method
,
status
=
acpi_get_handle
(
eeepc
->
handle
,
(
char
*
)
method
,
handle
);
handle
);
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
pr_warn
ing
(
"Error finding %s
\n
"
,
method
);
pr_warn
(
"Error finding %s
\n
"
,
method
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
return
0
;
return
0
;
...
@@ -417,7 +417,7 @@ static ssize_t store_cpufv_disabled(struct device *dev,
...
@@ -417,7 +417,7 @@ static ssize_t store_cpufv_disabled(struct device *dev,
switch
(
value
)
{
switch
(
value
)
{
case
0
:
case
0
:
if
(
eeepc
->
cpufv_disabled
)
if
(
eeepc
->
cpufv_disabled
)
pr_warn
ing
(
"cpufv enabled (not officially supported "
pr_warn
(
"cpufv enabled (not officially supported "
"on this model)
\n
"
);
"on this model)
\n
"
);
eeepc
->
cpufv_disabled
=
false
;
eeepc
->
cpufv_disabled
=
false
;
return
rv
;
return
rv
;
...
@@ -609,7 +609,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
...
@@ -609,7 +609,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
bus
=
port
->
subordinate
;
bus
=
port
->
subordinate
;
if
(
!
bus
)
{
if
(
!
bus
)
{
pr_warn
ing
(
"Unable to find PCI bus
?
\n
"
);
pr_warn
(
"Unable to find PCI bus 1
?
\n
"
);
goto
out_unlock
;
goto
out_unlock
;
}
}
...
@@ -621,11 +621,11 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
...
@@ -621,11 +621,11 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
absent
=
(
l
==
0xffffffff
);
absent
=
(
l
==
0xffffffff
);
if
(
blocked
!=
absent
)
{
if
(
blocked
!=
absent
)
{
pr_warn
ing
(
"BIOS says wireless lan is %s, "
pr_warn
(
"BIOS says wireless lan is %s, "
"but the pci device is %s
\n
"
,
"but the pci device is %s
\n
"
,
blocked
?
"blocked"
:
"unblocked"
,
blocked
?
"blocked"
:
"unblocked"
,
absent
?
"absent"
:
"present"
);
absent
?
"absent"
:
"present"
);
pr_warn
ing
(
"skipped wireless hotplug as probably "
pr_warn
(
"skipped wireless hotplug as probably "
"inappropriate for this model
\n
"
);
"inappropriate for this model
\n
"
);
goto
out_unlock
;
goto
out_unlock
;
}
}
...
@@ -691,7 +691,8 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
...
@@ -691,7 +691,8 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
eeepc_rfkill_notify
,
eeepc_rfkill_notify
,
eeepc
);
eeepc
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
pr_warning
(
"Failed to register notify on %s
\n
"
,
node
);
pr_warn
(
"Failed to register notify on %s
\n
"
,
node
);
/*
/*
* Refresh pci hotplug in case the rfkill state was
* Refresh pci hotplug in case the rfkill state was
* changed during setup.
* changed during setup.
...
...
drivers/platform/x86/eeepc-wmi.c
View file @
437cb0db
...
@@ -84,7 +84,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
...
@@ -84,7 +84,7 @@ static const struct key_entry eeepc_wmi_keymap[] = {
static
acpi_status
eeepc_wmi_parse_device
(
acpi_handle
handle
,
u32
level
,
static
acpi_status
eeepc_wmi_parse_device
(
acpi_handle
handle
,
u32
level
,
void
*
context
,
void
**
retval
)
void
*
context
,
void
**
retval
)
{
{
pr_warn
ing
(
"Found legacy ATKD device (%s)
"
,
EEEPC_ACPI_HID
);
pr_warn
(
"Found legacy ATKD device (%s)
\n
"
,
EEEPC_ACPI_HID
);
*
(
bool
*
)
context
=
true
;
*
(
bool
*
)
context
=
true
;
return
AE_CTRL_TERMINATE
;
return
AE_CTRL_TERMINATE
;
}
}
...
@@ -105,12 +105,12 @@ static int eeepc_wmi_check_atkd(void)
...
@@ -105,12 +105,12 @@ static int eeepc_wmi_check_atkd(void)
static
int
eeepc_wmi_probe
(
struct
platform_device
*
pdev
)
static
int
eeepc_wmi_probe
(
struct
platform_device
*
pdev
)
{
{
if
(
eeepc_wmi_check_atkd
())
{
if
(
eeepc_wmi_check_atkd
())
{
pr_warn
ing
(
"WMI device present, but legacy ATKD device is also "
pr_warn
(
"WMI device present, but legacy ATKD device is also "
"present and enabled.
"
);
"present and enabled
\n
"
);
pr_warn
ing
(
"You probably booted with acpi_osi=
\"
Linux
\"
or "
pr_warn
(
"You probably booted with acpi_osi=
\"
Linux
\"
or "
"acpi_osi=
\"
!Windows 2009
\"
"
);
"acpi_osi=
\"
!Windows 2009
\"\n
"
);
pr_warn
ing
(
"Can't load eeepc-wmi, use default acpi_osi "
pr_warn
(
"Can't load eeepc-wmi, use default acpi_osi "
"(preferred) or eeepc-laptop
"
);
"(preferred) or eeepc-laptop
\n
"
);
return
-
EBUSY
;
return
-
EBUSY
;
}
}
return
0
;
return
0
;
...
...
drivers/platform/x86/fujitsu-laptop.c
View file @
437cb0db
...
@@ -56,6 +56,8 @@
...
@@ -56,6 +56,8 @@
*
*
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -585,8 +587,7 @@ static struct platform_driver fujitsupf_driver = {
...
@@ -585,8 +587,7 @@ static struct platform_driver fujitsupf_driver = {
static
void
dmi_check_cb_common
(
const
struct
dmi_system_id
*
id
)
static
void
dmi_check_cb_common
(
const
struct
dmi_system_id
*
id
)
{
{
acpi_handle
handle
;
acpi_handle
handle
;
printk
(
KERN_INFO
"fujitsu-laptop: Identified laptop model '%s'.
\n
"
,
pr_info
(
"Identified laptop model '%s'
\n
"
,
id
->
ident
);
id
->
ident
);
if
(
use_alt_lcd_levels
==
-
1
)
{
if
(
use_alt_lcd_levels
==
-
1
)
{
if
(
ACPI_SUCCESS
(
acpi_get_handle
(
NULL
,
if
(
ACPI_SUCCESS
(
acpi_get_handle
(
NULL
,
"
\\
_SB.PCI0.LPCB.FJEX.SBL2"
,
&
handle
)))
"
\\
_SB.PCI0.LPCB.FJEX.SBL2"
,
&
handle
)))
...
@@ -691,11 +692,11 @@ static int acpi_fujitsu_add(struct acpi_device *device)
...
@@ -691,11 +692,11 @@ static int acpi_fujitsu_add(struct acpi_device *device)
result
=
acpi_bus_update_power
(
fujitsu
->
acpi_handle
,
&
state
);
result
=
acpi_bus_update_power
(
fujitsu
->
acpi_handle
,
&
state
);
if
(
result
)
{
if
(
result
)
{
pr
intk
(
KERN_ERR
"Error reading power state
\n
"
);
pr
_err
(
"Error reading power state
\n
"
);
goto
err_unregister_input_dev
;
goto
err_unregister_input_dev
;
}
}
pr
intk
(
KERN_INFO
"ACPI: %s [%s] (%s)
\n
"
,
pr
_info
(
"ACPI: %s [%s] (%s)
\n
"
,
acpi_device_name
(
device
),
acpi_device_bid
(
device
),
acpi_device_name
(
device
),
acpi_device_bid
(
device
),
!
device
->
power
.
state
?
"on"
:
"off"
);
!
device
->
power
.
state
?
"on"
:
"off"
);
...
@@ -707,7 +708,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
...
@@ -707,7 +708,7 @@ static int acpi_fujitsu_add(struct acpi_device *device)
if
(
ACPI_FAILURE
if
(
ACPI_FAILURE
(
acpi_evaluate_object
(
acpi_evaluate_object
(
device
->
handle
,
METHOD_NAME__INI
,
NULL
,
NULL
)))
(
device
->
handle
,
METHOD_NAME__INI
,
NULL
,
NULL
)))
pr
intk
(
KERN_ERR
"_INI Method failed
\n
"
);
pr
_err
(
"_INI Method failed
\n
"
);
}
}
/* do config (detect defaults) */
/* do config (detect defaults) */
...
@@ -827,7 +828,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -827,7 +828,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
error
=
kfifo_alloc
(
&
fujitsu_hotkey
->
fifo
,
RINGBUFFERSIZE
*
sizeof
(
int
),
error
=
kfifo_alloc
(
&
fujitsu_hotkey
->
fifo
,
RINGBUFFERSIZE
*
sizeof
(
int
),
GFP_KERNEL
);
GFP_KERNEL
);
if
(
error
)
{
if
(
error
)
{
pr
intk
(
KERN_ERR
"kfifo_alloc failed
\n
"
);
pr
_err
(
"kfifo_alloc failed
\n
"
);
goto
err_stop
;
goto
err_stop
;
}
}
...
@@ -859,11 +860,11 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -859,11 +860,11 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
result
=
acpi_bus_update_power
(
fujitsu_hotkey
->
acpi_handle
,
&
state
);
result
=
acpi_bus_update_power
(
fujitsu_hotkey
->
acpi_handle
,
&
state
);
if
(
result
)
{
if
(
result
)
{
pr
intk
(
KERN_ERR
"Error reading power state
\n
"
);
pr
_err
(
"Error reading power state
\n
"
);
goto
err_unregister_input_dev
;
goto
err_unregister_input_dev
;
}
}
pr
intk
(
KERN_INFO
"ACPI: %s [%s] (%s)
\n
"
,
pr
_info
(
"ACPI: %s [%s] (%s)
\n
"
,
acpi_device_name
(
device
),
acpi_device_bid
(
device
),
acpi_device_name
(
device
),
acpi_device_bid
(
device
),
!
device
->
power
.
state
?
"on"
:
"off"
);
!
device
->
power
.
state
?
"on"
:
"off"
);
...
@@ -875,7 +876,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -875,7 +876,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if
(
ACPI_FAILURE
if
(
ACPI_FAILURE
(
acpi_evaluate_object
(
acpi_evaluate_object
(
device
->
handle
,
METHOD_NAME__INI
,
NULL
,
NULL
)))
(
device
->
handle
,
METHOD_NAME__INI
,
NULL
,
NULL
)))
pr
intk
(
KERN_ERR
"_INI Method failed
\n
"
);
pr
_err
(
"_INI Method failed
\n
"
);
}
}
i
=
0
;
i
=
0
;
...
@@ -897,8 +898,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -897,8 +898,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
call_fext_func
(
FUNC_RFKILL
,
0x4
,
0x0
,
0x0
);
call_fext_func
(
FUNC_RFKILL
,
0x4
,
0x0
,
0x0
);
/* Suspect this is a keymap of the application panel, print it */
/* Suspect this is a keymap of the application panel, print it */
printk
(
KERN_INFO
"fujitsu-laptop: BTNI: [0x%x]
\n
"
,
pr_info
(
"BTNI: [0x%x]
\n
"
,
call_fext_func
(
FUNC_BUTTONS
,
0x0
,
0x0
,
0x0
));
call_fext_func
(
FUNC_BUTTONS
,
0x0
,
0x0
,
0x0
));
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
if
(
call_fext_func
(
FUNC_LEDS
,
0x0
,
0x0
,
0x0
)
&
LOGOLAMP_POWERON
)
{
if
(
call_fext_func
(
FUNC_LEDS
,
0x0
,
0x0
,
0x0
)
&
LOGOLAMP_POWERON
)
{
...
@@ -907,8 +907,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -907,8 +907,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if
(
result
==
0
)
{
if
(
result
==
0
)
{
fujitsu_hotkey
->
logolamp_registered
=
1
;
fujitsu_hotkey
->
logolamp_registered
=
1
;
}
else
{
}
else
{
pr
intk
(
KERN_ERR
"fujitsu-laptop: Could not register "
pr
_err
(
"Could not register LED handler for logo lamp, error %i
\n
"
,
"LED handler for logo lamp, error %i
\n
"
,
result
);
result
);
}
}
}
}
...
@@ -919,8 +919,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
...
@@ -919,8 +919,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device)
if
(
result
==
0
)
{
if
(
result
==
0
)
{
fujitsu_hotkey
->
kblamps_registered
=
1
;
fujitsu_hotkey
->
kblamps_registered
=
1
;
}
else
{
}
else
{
pr
intk
(
KERN_ERR
"fujitsu-laptop: Could not register "
pr
_err
(
"Could not register LED handler for keyboard lamps, error %i
\n
"
,
"LED handler for keyboard lamps, error %i
\n
"
,
result
);
result
);
}
}
}
}
#endif
#endif
...
@@ -1169,8 +1169,7 @@ static int __init fujitsu_init(void)
...
@@ -1169,8 +1169,7 @@ static int __init fujitsu_init(void)
fujitsu
->
bl_device
->
props
.
power
=
0
;
fujitsu
->
bl_device
->
props
.
power
=
0
;
}
}
printk
(
KERN_INFO
"fujitsu-laptop: driver "
FUJITSU_DRIVER_VERSION
pr_info
(
"driver "
FUJITSU_DRIVER_VERSION
" successfully loaded
\n
"
);
" successfully loaded.
\n
"
);
return
0
;
return
0
;
...
@@ -1216,7 +1215,7 @@ static void __exit fujitsu_cleanup(void)
...
@@ -1216,7 +1215,7 @@ static void __exit fujitsu_cleanup(void)
kfree
(
fujitsu
);
kfree
(
fujitsu
);
pr
intk
(
KERN_INFO
"fujitsu-laptop: driver unloaded.
\n
"
);
pr
_info
(
"driver unloaded
\n
"
);
}
}
module_init
(
fujitsu_init
);
module_init
(
fujitsu_init
);
...
...
drivers/platform/x86/hdaps.c
View file @
437cb0db
...
@@ -26,6 +26,8 @@
...
@@ -26,6 +26,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/input-polldev.h>
#include <linux/input-polldev.h>
...
@@ -238,7 +240,7 @@ static int hdaps_device_init(void)
...
@@ -238,7 +240,7 @@ static int hdaps_device_init(void)
__check_latch
(
0x1611
,
0x01
))
__check_latch
(
0x1611
,
0x01
))
goto
out
;
goto
out
;
printk
(
KERN_DEBUG
"hdaps: initial latch check good (0x%02x)
.
\n
"
,
printk
(
KERN_DEBUG
"hdaps: initial latch check good (0x%02x)
\n
"
,
__get_latch
(
0x1611
));
__get_latch
(
0x1611
));
outb
(
0x17
,
0x1610
);
outb
(
0x17
,
0x1610
);
...
@@ -299,7 +301,7 @@ static int hdaps_probe(struct platform_device *dev)
...
@@ -299,7 +301,7 @@ static int hdaps_probe(struct platform_device *dev)
if
(
ret
)
if
(
ret
)
return
ret
;
return
ret
;
pr
intk
(
KERN_INFO
"hdaps: device successfully initialized.
\n
"
);
pr
_info
(
"device successfully initialized
\n
"
);
return
0
;
return
0
;
}
}
...
@@ -480,7 +482,7 @@ static struct attribute_group hdaps_attribute_group = {
...
@@ -480,7 +482,7 @@ static struct attribute_group hdaps_attribute_group = {
/* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
/* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
static
int
__init
hdaps_dmi_match
(
const
struct
dmi_system_id
*
id
)
static
int
__init
hdaps_dmi_match
(
const
struct
dmi_system_id
*
id
)
{
{
pr
intk
(
KERN_INFO
"hdaps: %s detected.
\n
"
,
id
->
ident
);
pr
_info
(
"%s detected
\n
"
,
id
->
ident
);
return
1
;
return
1
;
}
}
...
@@ -488,8 +490,7 @@ static int __init hdaps_dmi_match(const struct dmi_system_id *id)
...
@@ -488,8 +490,7 @@ static int __init hdaps_dmi_match(const struct dmi_system_id *id)
static
int
__init
hdaps_dmi_match_invert
(
const
struct
dmi_system_id
*
id
)
static
int
__init
hdaps_dmi_match_invert
(
const
struct
dmi_system_id
*
id
)
{
{
hdaps_invert
=
(
unsigned
long
)
id
->
driver_data
;
hdaps_invert
=
(
unsigned
long
)
id
->
driver_data
;
printk
(
KERN_INFO
"hdaps: inverting axis (%u) readings.
\n
"
,
pr_info
(
"inverting axis (%u) readings
\n
"
,
hdaps_invert
);
hdaps_invert
);
return
hdaps_dmi_match
(
id
);
return
hdaps_dmi_match
(
id
);
}
}
...
@@ -543,7 +544,7 @@ static int __init hdaps_init(void)
...
@@ -543,7 +544,7 @@ static int __init hdaps_init(void)
int
ret
;
int
ret
;
if
(
!
dmi_check_system
(
hdaps_whitelist
))
{
if
(
!
dmi_check_system
(
hdaps_whitelist
))
{
pr
intk
(
KERN_WARNING
"hdaps:
supported laptop not found!
\n
"
);
pr
_warn
(
"
supported laptop not found!
\n
"
);
ret
=
-
ENODEV
;
ret
=
-
ENODEV
;
goto
out
;
goto
out
;
}
}
...
@@ -595,7 +596,7 @@ static int __init hdaps_init(void)
...
@@ -595,7 +596,7 @@ static int __init hdaps_init(void)
if
(
ret
)
if
(
ret
)
goto
out_idev
;
goto
out_idev
;
pr
intk
(
KERN_INFO
"hdaps: driver successfully loaded.
\n
"
);
pr
_info
(
"driver successfully loaded
\n
"
);
return
0
;
return
0
;
out_idev:
out_idev:
...
@@ -609,7 +610,7 @@ static int __init hdaps_init(void)
...
@@ -609,7 +610,7 @@ static int __init hdaps_init(void)
out_region:
out_region:
release_region
(
HDAPS_LOW_PORT
,
HDAPS_NR_PORTS
);
release_region
(
HDAPS_LOW_PORT
,
HDAPS_NR_PORTS
);
out:
out:
pr
intk
(
KERN_WARNING
"hdaps:
driver init failed (ret=%d)!
\n
"
,
ret
);
pr
_warn
(
"
driver init failed (ret=%d)!
\n
"
,
ret
);
return
ret
;
return
ret
;
}
}
...
@@ -622,7 +623,7 @@ static void __exit hdaps_exit(void)
...
@@ -622,7 +623,7 @@ static void __exit hdaps_exit(void)
platform_driver_unregister
(
&
hdaps_driver
);
platform_driver_unregister
(
&
hdaps_driver
);
release_region
(
HDAPS_LOW_PORT
,
HDAPS_NR_PORTS
);
release_region
(
HDAPS_LOW_PORT
,
HDAPS_NR_PORTS
);
pr
intk
(
KERN_INFO
"hdaps: driver unloaded.
\n
"
);
pr
_info
(
"driver unloaded
\n
"
);
}
}
module_init
(
hdaps_init
);
module_init
(
hdaps_init
);
...
...
drivers/platform/x86/hp-wmi.c
View file @
437cb0db
...
@@ -24,6 +24,8 @@
...
@@ -24,6 +24,8 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
...
@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4");
#define HPWMI_HOTKEY_QUERY 0xc
#define HPWMI_HOTKEY_QUERY 0xc
#define HPWMI_WIRELESS2_QUERY 0x1b
#define HPWMI_WIRELESS2_QUERY 0x1b
#define PREFIX "HP WMI: "
#define UNIMP "Unimplemented "
enum
hp_wmi_radio
{
enum
hp_wmi_radio
{
HPWMI_WIFI
=
0
,
HPWMI_WIFI
=
0
,
HPWMI_BLUETOOTH
=
1
,
HPWMI_BLUETOOTH
=
1
,
...
@@ -228,8 +227,7 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
...
@@ -228,8 +227,7 @@ static int hp_wmi_perform_query(int query, int write, void *buffer,
if
(
bios_return
->
return_code
)
{
if
(
bios_return
->
return_code
)
{
if
(
bios_return
->
return_code
!=
HPWMI_RET_UNKNOWN_CMDTYPE
)
if
(
bios_return
->
return_code
!=
HPWMI_RET_UNKNOWN_CMDTYPE
)
printk
(
KERN_WARNING
PREFIX
"query 0x%x returned "
pr_warn
(
"query 0x%x returned error 0x%x
\n
"
,
"error 0x%x
\n
"
,
query
,
bios_return
->
return_code
);
query
,
bios_return
->
return_code
);
kfree
(
obj
);
kfree
(
obj
);
return
bios_return
->
return_code
;
return
bios_return
->
return_code
;
...
@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void)
...
@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void)
if
(
num
>=
state
.
count
||
if
(
num
>=
state
.
count
||
devstate
->
rfkill_id
!=
rfkill2
[
i
].
id
)
{
devstate
->
rfkill_id
!=
rfkill2
[
i
].
id
)
{
printk
(
KERN_WARNING
PREFIX
"power configuration of "
pr_warn
(
"power configuration of the wireless devices unexpectedly changed
\n
"
);
"the wireless devices unexpectedly changed
\n
"
);
continue
;
continue
;
}
}
...
@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context)
...
@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context)
status
=
wmi_get_event_data
(
value
,
&
response
);
status
=
wmi_get_event_data
(
value
,
&
response
);
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
pr
intk
(
KERN_INFO
PREFIX
"bad event status 0x%x
\n
"
,
status
);
pr
_info
(
"bad event status 0x%x
\n
"
,
status
);
return
;
return
;
}
}
...
@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context)
...
@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context)
if
(
!
obj
)
if
(
!
obj
)
return
;
return
;
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
if
(
obj
->
type
!=
ACPI_TYPE_BUFFER
)
{
printk
(
KERN_INFO
"hp-wmi: Unknown response received %d
\n
"
,
pr_info
(
"Unknown response received %d
\n
"
,
obj
->
type
);
obj
->
type
);
kfree
(
obj
);
kfree
(
obj
);
return
;
return
;
}
}
...
@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context)
...
@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context)
event_id
=
*
location
;
event_id
=
*
location
;
event_data
=
*
(
location
+
2
);
event_data
=
*
(
location
+
2
);
}
else
{
}
else
{
printk
(
KERN_INFO
"hp-wmi: Unknown buffer length %d
\n
"
,
pr_info
(
"Unknown buffer length %d
\n
"
,
obj
->
buffer
.
length
);
obj
->
buffer
.
length
);
kfree
(
obj
);
kfree
(
obj
);
return
;
return
;
}
}
...
@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context)
...
@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context)
if
(
!
sparse_keymap_report_event
(
hp_wmi_input_dev
,
if
(
!
sparse_keymap_report_event
(
hp_wmi_input_dev
,
key_code
,
1
,
true
))
key_code
,
1
,
true
))
printk
(
KERN_INFO
PREFIX
"Unknown key code - 0x%x
\n
"
,
pr_info
(
"Unknown key code - 0x%x
\n
"
,
key_code
);
key_code
);
break
;
break
;
case
HPWMI_WIRELESS
:
case
HPWMI_WIRELESS
:
if
(
rfkill2_count
)
{
if
(
rfkill2_count
)
{
...
@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context)
...
@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context)
hp_wmi_get_hw_state
(
HPWMI_WWAN
));
hp_wmi_get_hw_state
(
HPWMI_WWAN
));
break
;
break
;
case
HPWMI_CPU_BATTERY_THROTTLE
:
case
HPWMI_CPU_BATTERY_THROTTLE
:
printk
(
KERN_INFO
PREFIX
UNIMP
"CPU throttle because of 3 Cell"
pr_info
(
"Unimplemented CPU throttle because of 3 Cell battery event detected
\n
"
);
" battery event detected
\n
"
);
break
;
break
;
case
HPWMI_LOCK_SWITCH
:
case
HPWMI_LOCK_SWITCH
:
break
;
break
;
default:
default:
printk
(
KERN_INFO
PREFIX
"Unknown event_id - %d - 0x%x
\n
"
,
pr_info
(
"Unknown event_id - %d - 0x%x
\n
"
,
event_id
,
event_data
);
event_id
,
event_data
);
break
;
break
;
}
}
}
}
...
@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
...
@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
return
err
;
return
err
;
if
(
state
.
count
>
HPWMI_MAX_RFKILL2_DEVICES
)
{
if
(
state
.
count
>
HPWMI_MAX_RFKILL2_DEVICES
)
{
pr
intk
(
KERN_WARNING
PREFIX
"unable to parse 0x1b query output
\n
"
);
pr
_warn
(
"unable to parse 0x1b query output
\n
"
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
...
@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
...
@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
name
=
"hp-wwan"
;
name
=
"hp-wwan"
;
break
;
break
;
default:
default:
pr
intk
(
KERN_WARNING
PREFIX
"unknown device type 0x%x
\n
"
,
pr
_warn
(
"unknown device type 0x%x
\n
"
,
state
.
device
[
i
].
radio_type
);
state
.
device
[
i
].
radio_type
);
continue
;
continue
;
}
}
if
(
!
state
.
device
[
i
].
vendor_id
)
{
if
(
!
state
.
device
[
i
].
vendor_id
)
{
pr
intk
(
KERN_WARNING
PREFIX
"zero device %d while %d "
pr
_warn
(
"zero device %d while %d reported
\n
"
,
"reported
\n
"
,
i
,
state
.
count
);
i
,
state
.
count
);
continue
;
continue
;
}
}
...
@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
...
@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device)
IS_HWBLOCKED
(
state
.
device
[
i
].
power
));
IS_HWBLOCKED
(
state
.
device
[
i
].
power
));
if
(
!
(
state
.
device
[
i
].
power
&
HPWMI_POWER_BIOS
))
if
(
!
(
state
.
device
[
i
].
power
&
HPWMI_POWER_BIOS
))
printk
(
KERN_INFO
PREFIX
"device %s blocked by BIOS
\n
"
,
pr_info
(
"device %s blocked by BIOS
\n
"
,
name
);
name
);
err
=
rfkill_register
(
rfkill
);
err
=
rfkill_register
(
rfkill
);
if
(
err
)
{
if
(
err
)
{
...
...
drivers/platform/x86/ibm_rtl.c
View file @
437cb0db
...
@@ -22,6 +22,8 @@
...
@@ -22,6 +22,8 @@
*
*
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/delay.h>
#include <linux/module.h>
#include <linux/module.h>
...
@@ -69,9 +71,10 @@ struct ibm_rtl_table {
...
@@ -69,9 +71,10 @@ struct ibm_rtl_table {
#define RTL_SIGNATURE 0x0000005f4c54525fULL
#define RTL_SIGNATURE 0x0000005f4c54525fULL
#define RTL_MASK 0x000000ffffffffffULL
#define RTL_MASK 0x000000ffffffffffULL
#define RTL_DEBUG(A, ...) do { \
#define RTL_DEBUG(fmt, ...) \
do { \
if (debug) \
if (debug) \
pr_info(
"ibm-rtl: " A, ##__VA_ARGS__ );
\
pr_info(
fmt, ##__VA_ARGS__);
\
} while (0)
} while (0)
static
DEFINE_MUTEX
(
rtl_lock
);
static
DEFINE_MUTEX
(
rtl_lock
);
...
@@ -114,7 +117,7 @@ static int ibm_rtl_write(u8 value)
...
@@ -114,7 +117,7 @@ static int ibm_rtl_write(u8 value)
int
ret
=
0
,
count
=
0
;
int
ret
=
0
,
count
=
0
;
static
u32
cmd_port_val
;
static
u32
cmd_port_val
;
RTL_DEBUG
(
"%s(%d)
\n
"
,
__
FUNCTION
__
,
value
);
RTL_DEBUG
(
"%s(%d)
\n
"
,
__
func
__
,
value
);
value
=
value
==
1
?
RTL_CMD_ENTER_PRTM
:
RTL_CMD_EXIT_PRTM
;
value
=
value
==
1
?
RTL_CMD_ENTER_PRTM
:
RTL_CMD_EXIT_PRTM
;
...
@@ -144,7 +147,7 @@ static int ibm_rtl_write(u8 value)
...
@@ -144,7 +147,7 @@ static int ibm_rtl_write(u8 value)
while
(
ioread8
(
&
rtl_table
->
command
))
{
while
(
ioread8
(
&
rtl_table
->
command
))
{
msleep
(
10
);
msleep
(
10
);
if
(
count
++
>
500
)
{
if
(
count
++
>
500
)
{
pr_err
(
"
ibm-rtl:
Hardware not responding to "
pr_err
(
"Hardware not responding to "
"mode switch request
\n
"
);
"mode switch request
\n
"
);
ret
=
-
EIO
;
ret
=
-
EIO
;
break
;
break
;
...
@@ -250,7 +253,7 @@ static int __init ibm_rtl_init(void) {
...
@@ -250,7 +253,7 @@ static int __init ibm_rtl_init(void) {
int
ret
=
-
ENODEV
,
i
;
int
ret
=
-
ENODEV
,
i
;
if
(
force
)
if
(
force
)
pr_warn
ing
(
"ibm-rtl:
module loaded by force
\n
"
);
pr_warn
(
"
module loaded by force
\n
"
);
/* first ensure that we are running on IBM HW */
/* first ensure that we are running on IBM HW */
else
if
(
efi_enabled
||
!
dmi_check_system
(
ibm_rtl_dmi_table
))
else
if
(
efi_enabled
||
!
dmi_check_system
(
ibm_rtl_dmi_table
))
return
-
ENODEV
;
return
-
ENODEV
;
...
@@ -288,7 +291,7 @@ static int __init ibm_rtl_init(void) {
...
@@ -288,7 +291,7 @@ static int __init ibm_rtl_init(void) {
if
((
readq
(
&
tmp
->
signature
)
&
RTL_MASK
)
==
RTL_SIGNATURE
)
{
if
((
readq
(
&
tmp
->
signature
)
&
RTL_MASK
)
==
RTL_SIGNATURE
)
{
phys_addr_t
addr
;
phys_addr_t
addr
;
unsigned
int
plen
;
unsigned
int
plen
;
RTL_DEBUG
(
"found RTL_SIGNATURE at %
#llx
\n
"
,
(
u64
)
tmp
);
RTL_DEBUG
(
"found RTL_SIGNATURE at %
p
\n
"
,
tmp
);
rtl_table
=
tmp
;
rtl_table
=
tmp
;
/* The address, value, width and offset are platform
/* The address, value, width and offset are platform
* dependent and found in the ibm_rtl_table */
* dependent and found in the ibm_rtl_table */
...
@@ -300,7 +303,7 @@ static int __init ibm_rtl_init(void) {
...
@@ -300,7 +303,7 @@ static int __init ibm_rtl_init(void) {
RTL_DEBUG
(
"addr = %#llx
\n
"
,
(
unsigned
long
long
)
addr
);
RTL_DEBUG
(
"addr = %#llx
\n
"
,
(
unsigned
long
long
)
addr
);
plen
=
rtl_cmd_width
/
sizeof
(
char
);
plen
=
rtl_cmd_width
/
sizeof
(
char
);
rtl_cmd_addr
=
rtl_port_map
(
addr
,
plen
);
rtl_cmd_addr
=
rtl_port_map
(
addr
,
plen
);
RTL_DEBUG
(
"rtl_cmd_addr = %
#llx
\n
"
,
(
u64
)
rtl_cmd_addr
);
RTL_DEBUG
(
"rtl_cmd_addr = %
p
\n
"
,
rtl_cmd_addr
);
if
(
!
rtl_cmd_addr
)
{
if
(
!
rtl_cmd_addr
)
{
ret
=
-
ENOMEM
;
ret
=
-
ENOMEM
;
break
;
break
;
...
...
drivers/platform/x86/ideapad-laptop.c
View file @
437cb0db
...
@@ -20,6 +20,8 @@
...
@@ -20,6 +20,8 @@
* 02110-1301, USA.
* 02110-1301, USA.
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
...
drivers/platform/x86/intel_menlow.c
View file @
437cb0db
...
@@ -27,6 +27,8 @@
...
@@ -27,6 +27,8 @@
* to get/set bandwidth.
* to get/set bandwidth.
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -135,8 +137,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
...
@@ -135,8 +137,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
acpi_evaluate_integer
(
handle
,
MEMORY_SET_BANDWIDTH
,
&
arg_list
,
acpi_evaluate_integer
(
handle
,
MEMORY_SET_BANDWIDTH
,
&
arg_list
,
&
temp
);
&
temp
);
printk
(
KERN_INFO
pr_info
(
"Bandwidth value was %ld: status is %d
\n
"
,
state
,
status
);
"Bandwidth value was %ld: status is %d
\n
"
,
state
,
status
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
return
-
EFAULT
;
return
-
EFAULT
;
...
...
drivers/platform/x86/intel_mid_powerbtn.c
View file @
437cb0db
...
@@ -23,58 +23,48 @@
...
@@ -23,58 +23,48 @@
#include <linux/slab.h>
#include <linux/slab.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/input.h>
#include <linux/input.h>
#include <asm/intel_scu_ipc.h>
#include <asm/intel_scu_ipc.h>
#define DRIVER_NAME "msic_power_btn"
#define DRIVER_NAME "msic_power_btn"
#define MSIC_IRQ_STAT 0x02
#define MSIC_IRQ_PB (1 << 0)
#define MSIC_PB_CONFIG 0x3e
#define MSIC_PB_STATUS 0x3f
#define MSIC_PB_STATUS 0x3f
#define MSIC_PB_LEVEL (1 << 3)
/* 1 - release, 0 - press */
#define MSIC_PB_LEVEL (1 << 3)
/* 1 - release, 0 - press */
struct
mfld_pb_priv
{
struct
input_dev
*
input
;
unsigned
int
irq
;
};
static
irqreturn_t
mfld_pb_isr
(
int
irq
,
void
*
dev_id
)
static
irqreturn_t
mfld_pb_isr
(
int
irq
,
void
*
dev_id
)
{
{
struct
mfld_pb_priv
*
priv
=
dev_id
;
struct
input_dev
*
input
=
dev_id
;
int
ret
;
int
ret
;
u8
pbstat
;
u8
pbstat
;
ret
=
intel_scu_ipc_ioread8
(
MSIC_PB_STATUS
,
&
pbstat
);
ret
=
intel_scu_ipc_ioread8
(
MSIC_PB_STATUS
,
&
pbstat
);
if
(
ret
<
0
)
if
(
ret
<
0
)
{
return
IRQ_HANDLED
;
dev_err
(
input
->
dev
.
parent
,
"Read error %d while reading"
" MSIC_PB_STATUS
\n
"
,
ret
);
input_event
(
priv
->
input
,
EV_KEY
,
KEY_POWER
,
!
(
pbstat
&
MSIC_PB_LEVEL
));
}
else
{
input_sync
(
priv
->
input
);
input_event
(
input
,
EV_KEY
,
KEY_POWER
,
!
(
pbstat
&
MSIC_PB_LEVEL
));
input_sync
(
input
);
}
return
IRQ_HANDLED
;
return
IRQ_HANDLED
;
}
}
static
int
__devinit
mfld_pb_probe
(
struct
platform_device
*
pdev
)
static
int
__devinit
mfld_pb_probe
(
struct
platform_device
*
pdev
)
{
{
struct
mfld_pb_priv
*
priv
;
struct
input_dev
*
input
;
struct
input_dev
*
input
;
int
irq
;
int
irq
=
platform_get_irq
(
pdev
,
0
)
;
int
error
;
int
error
;
irq
=
platform_get_irq
(
pdev
,
0
);
if
(
irq
<
0
)
if
(
irq
<
0
)
return
-
EINVAL
;
return
-
EINVAL
;
priv
=
kzalloc
(
sizeof
(
struct
mfld_pb_priv
),
GFP_KERNEL
);
input
=
input_allocate_device
();
input
=
input_allocate_device
();
if
(
!
priv
||
!
input
)
{
if
(
!
input
)
{
error
=
-
ENOMEM
;
dev_err
(
&
pdev
->
dev
,
"Input device allocation error
\n
"
)
;
goto
err_free_mem
;
return
-
ENOMEM
;
}
}
priv
->
input
=
input
;
priv
->
irq
=
irq
;
input
->
name
=
pdev
->
name
;
input
->
name
=
pdev
->
name
;
input
->
phys
=
"power-button/input0"
;
input
->
phys
=
"power-button/input0"
;
input
->
id
.
bustype
=
BUS_HOST
;
input
->
id
.
bustype
=
BUS_HOST
;
...
@@ -82,42 +72,40 @@ static int __devinit mfld_pb_probe(struct platform_device *pdev)
...
@@ -82,42 +72,40 @@ static int __devinit mfld_pb_probe(struct platform_device *pdev)
input_set_capability
(
input
,
EV_KEY
,
KEY_POWER
);
input_set_capability
(
input
,
EV_KEY
,
KEY_POWER
);
error
=
request_threaded_irq
(
priv
->
irq
,
NULL
,
mfld_pb_isr
,
error
=
request_threaded_irq
(
irq
,
NULL
,
mfld_pb_isr
,
0
,
0
,
DRIVER_NAME
,
priv
);
DRIVER_NAME
,
input
);
if
(
error
)
{
if
(
error
)
{
dev_err
(
&
pdev
->
dev
,
dev_err
(
&
pdev
->
dev
,
"Unable to request irq %d for mfld power"
"unable to request irq %d for mfld power button
\n
"
,
"button
\n
"
,
irq
);
irq
);
goto
err_free_input
;
goto
err_free_mem
;
}
}
error
=
input_register_device
(
input
);
error
=
input_register_device
(
input
);
if
(
error
)
{
if
(
error
)
{
dev_err
(
&
pdev
->
dev
,
dev_err
(
&
pdev
->
dev
,
"Unable to register input dev, error "
"unable to register input dev, error
%d
\n
"
,
error
);
"
%d
\n
"
,
error
);
goto
err_free_irq
;
goto
err_free_irq
;
}
}
platform_set_drvdata
(
pdev
,
priv
);
platform_set_drvdata
(
pdev
,
input
);
return
0
;
return
0
;
err_free_irq:
err_free_irq:
free_irq
(
priv
->
irq
,
priv
);
free_irq
(
irq
,
input
);
err_free_
mem
:
err_free_
input
:
input_free_device
(
input
);
input_free_device
(
input
);
kfree
(
priv
);
return
error
;
return
error
;
}
}
static
int
__devexit
mfld_pb_remove
(
struct
platform_device
*
pdev
)
static
int
__devexit
mfld_pb_remove
(
struct
platform_device
*
pdev
)
{
{
struct
mfld_pb_priv
*
priv
=
platform_get_drvdata
(
pdev
);
struct
input_dev
*
input
=
platform_get_drvdata
(
pdev
);
int
irq
=
platform_get_irq
(
pdev
,
0
);
free_irq
(
priv
->
irq
,
priv
);
input_unregister_device
(
priv
->
input
);
kfree
(
priv
);
free_irq
(
irq
,
input
);
input_unregister_device
(
input
);
platform_set_drvdata
(
pdev
,
NULL
);
platform_set_drvdata
(
pdev
,
NULL
);
return
0
;
return
0
;
}
}
...
...
drivers/platform/x86/intel_mid_thermal.c
View file @
437cb0db
...
@@ -51,7 +51,8 @@
...
@@ -51,7 +51,8 @@
#define MSIC_STOPBIT_MASK 16
#define MSIC_STOPBIT_MASK 16
#define MSIC_ADCTHERM_MASK 4
#define MSIC_ADCTHERM_MASK 4
#define ADC_CHANLS_MAX 15
/* Number of ADC channels */
/* Number of ADC channels */
#define ADC_CHANLS_MAX 15
#define ADC_LOOP_MAX (ADC_CHANLS_MAX - MSIC_THERMAL_SENSORS)
#define ADC_LOOP_MAX (ADC_CHANLS_MAX - MSIC_THERMAL_SENSORS)
/* ADC channel code values */
/* ADC channel code values */
...
@@ -245,7 +246,6 @@ static int configure_adc(int val)
...
@@ -245,7 +246,6 @@ static int configure_adc(int val)
/* Just stop the ADC */
/* Just stop the ADC */
data
&=
(
~
MSIC_ADC_START
);
data
&=
(
~
MSIC_ADC_START
);
}
}
return
intel_scu_ipc_iowrite8
(
MSIC_THERM_ADC1CNTL1
,
data
);
return
intel_scu_ipc_iowrite8
(
MSIC_THERM_ADC1CNTL1
,
data
);
}
}
...
@@ -275,7 +275,7 @@ static int set_up_therm_channel(u16 base_addr)
...
@@ -275,7 +275,7 @@ static int set_up_therm_channel(u16 base_addr)
return
ret
;
return
ret
;
/* Since this is the last channel, set the stop bit
/* Since this is the last channel, set the stop bit
to 1 by ORing the DIE_SENSOR_CODE with 0x10 */
*
to 1 by ORing the DIE_SENSOR_CODE with 0x10 */
ret
=
intel_scu_ipc_iowrite8
(
base_addr
+
3
,
ret
=
intel_scu_ipc_iowrite8
(
base_addr
+
3
,
(
MSIC_DIE_SENSOR_CODE
|
0x10
));
(
MSIC_DIE_SENSOR_CODE
|
0x10
));
if
(
ret
)
if
(
ret
)
...
@@ -462,7 +462,6 @@ static struct thermal_zone_device_ops tzd_ops = {
...
@@ -462,7 +462,6 @@ static struct thermal_zone_device_ops tzd_ops = {
.
get_temp
=
read_curr_temp
,
.
get_temp
=
read_curr_temp
,
};
};
/**
/**
* mid_thermal_probe - mfld thermal initialize
* mid_thermal_probe - mfld thermal initialize
* @pdev: platform device structure
* @pdev: platform device structure
...
@@ -495,8 +494,7 @@ static int mid_thermal_probe(struct platform_device *pdev)
...
@@ -495,8 +494,7 @@ static int mid_thermal_probe(struct platform_device *pdev)
/* Register each sensor with the generic thermal framework*/
/* Register each sensor with the generic thermal framework*/
for
(
i
=
0
;
i
<
MSIC_THERMAL_SENSORS
;
i
++
)
{
for
(
i
=
0
;
i
<
MSIC_THERMAL_SENSORS
;
i
++
)
{
pinfo
->
tzd
[
i
]
=
thermal_zone_device_register
(
name
[
i
],
pinfo
->
tzd
[
i
]
=
thermal_zone_device_register
(
name
[
i
],
0
,
initialize_sensor
(
i
),
0
,
initialize_sensor
(
i
),
&
tzd_ops
,
0
,
0
,
0
,
0
);
&
tzd_ops
,
0
,
0
,
0
,
0
);
if
(
IS_ERR
(
pinfo
->
tzd
[
i
]))
if
(
IS_ERR
(
pinfo
->
tzd
[
i
]))
goto
reg_fail
;
goto
reg_fail
;
}
}
...
@@ -529,16 +527,13 @@ static int mid_thermal_remove(struct platform_device *pdev)
...
@@ -529,16 +527,13 @@ static int mid_thermal_remove(struct platform_device *pdev)
for
(
i
=
0
;
i
<
MSIC_THERMAL_SENSORS
;
i
++
)
for
(
i
=
0
;
i
<
MSIC_THERMAL_SENSORS
;
i
++
)
thermal_zone_device_unregister
(
pinfo
->
tzd
[
i
]);
thermal_zone_device_unregister
(
pinfo
->
tzd
[
i
]);
kfree
(
pinfo
);
platform_set_drvdata
(
pdev
,
NULL
);
platform_set_drvdata
(
pdev
,
NULL
);
/* Stop the ADC */
/* Stop the ADC */
return
configure_adc
(
0
);
return
configure_adc
(
0
);
}
}
/*********************************************************************
* Driver initialisation and finalization
*********************************************************************/
#define DRIVER_NAME "msic_sensor"
#define DRIVER_NAME "msic_sensor"
static
const
struct
platform_device_id
therm_id_table
[]
=
{
static
const
struct
platform_device_id
therm_id_table
[]
=
{
...
...
drivers/platform/x86/intel_oaktrail.c
0 → 100644
View file @
437cb0db
/*
* intel_oaktrail.c - Intel OakTrail Platform support.
*
* Copyright (C) 2010-2011 Intel Corporation
* Author: Yin Kangkai (kangkai.yin@intel.com)
*
* based on Compal driver, Copyright (C) 2008 Cezary Jackiewicz
* <cezary.jackiewicz (at) gmail.com>, based on MSI driver
* Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* This driver does below things:
* 1. registers itself in the Linux backlight control in
* /sys/class/backlight/intel_oaktrail/
*
* 2. registers in the rfkill subsystem here: /sys/class/rfkill/rfkillX/
* for these components: wifi, bluetooth, wwan (3g), gps
*
* This driver might work on other products based on Oaktrail. If you
* want to try it you can pass force=1 as argument to the module which
* will force it to load even when the DMI data doesn't identify the
* product as compatible.
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/acpi.h>
#include <linux/fb.h>
#include <linux/mutex.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/backlight.h>
#include <linux/platform_device.h>
#include <linux/dmi.h>
#include <linux/rfkill.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#define DRIVER_NAME "intel_oaktrail"
#define DRIVER_VERSION "0.4ac1"
/*
* This is the devices status address in EC space, and the control bits
* definition:
*
* (1 << 0): Camera enable/disable, RW.
* (1 << 1): Bluetooth enable/disable, RW.
* (1 << 2): GPS enable/disable, RW.
* (1 << 3): WiFi enable/disable, RW.
* (1 << 4): WWAN (3G) enable/disalbe, RW.
* (1 << 5): Touchscreen enable/disable, Read Only.
*/
#define OT_EC_DEVICE_STATE_ADDRESS 0xD6
#define OT_EC_CAMERA_MASK (1 << 0)
#define OT_EC_BT_MASK (1 << 1)
#define OT_EC_GPS_MASK (1 << 2)
#define OT_EC_WIFI_MASK (1 << 3)
#define OT_EC_WWAN_MASK (1 << 4)
#define OT_EC_TS_MASK (1 << 5)
/*
* This is the address in EC space and commands used to control LCD backlight:
*
* Two steps needed to change the LCD backlight:
* 1. write the backlight percentage into OT_EC_BL_BRIGHTNESS_ADDRESS;
* 2. write OT_EC_BL_CONTROL_ON_DATA into OT_EC_BL_CONTROL_ADDRESS.
*
* To read the LCD back light, just read out the value from
* OT_EC_BL_BRIGHTNESS_ADDRESS.
*
* LCD backlight brightness range: 0 - 100 (OT_EC_BL_BRIGHTNESS_MAX)
*/
#define OT_EC_BL_BRIGHTNESS_ADDRESS 0x44
#define OT_EC_BL_BRIGHTNESS_MAX 100
#define OT_EC_BL_CONTROL_ADDRESS 0x3A
#define OT_EC_BL_CONTROL_ON_DATA 0x1A
static
int
force
;
module_param
(
force
,
bool
,
0
);
MODULE_PARM_DESC
(
force
,
"Force driver load, ignore DMI data"
);
static
struct
platform_device
*
oaktrail_device
;
static
struct
backlight_device
*
oaktrail_bl_device
;
static
struct
rfkill
*
bt_rfkill
;
static
struct
rfkill
*
gps_rfkill
;
static
struct
rfkill
*
wifi_rfkill
;
static
struct
rfkill
*
wwan_rfkill
;
/* rfkill */
static
int
oaktrail_rfkill_set
(
void
*
data
,
bool
blocked
)
{
u8
value
;
u8
result
;
unsigned
long
radio
=
(
unsigned
long
)
data
;
ec_read
(
OT_EC_DEVICE_STATE_ADDRESS
,
&
result
);
if
(
!
blocked
)
value
=
(
u8
)
(
result
|
radio
);
else
value
=
(
u8
)
(
result
&
~
radio
);
ec_write
(
OT_EC_DEVICE_STATE_ADDRESS
,
value
);
return
0
;
}
static
const
struct
rfkill_ops
oaktrail_rfkill_ops
=
{
.
set_block
=
oaktrail_rfkill_set
,
};
static
struct
rfkill
*
oaktrail_rfkill_new
(
char
*
name
,
enum
rfkill_type
type
,
unsigned
long
mask
)
{
struct
rfkill
*
rfkill_dev
;
u8
value
;
int
err
;
rfkill_dev
=
rfkill_alloc
(
name
,
&
oaktrail_device
->
dev
,
type
,
&
oaktrail_rfkill_ops
,
(
void
*
)
mask
);
if
(
!
rfkill_dev
)
return
ERR_PTR
(
-
ENOMEM
);
ec_read
(
OT_EC_DEVICE_STATE_ADDRESS
,
&
value
);
rfkill_init_sw_state
(
rfkill_dev
,
(
value
&
mask
)
!=
1
);
err
=
rfkill_register
(
rfkill_dev
);
if
(
err
)
{
rfkill_destroy
(
rfkill_dev
);
return
ERR_PTR
(
err
);
}
return
rfkill_dev
;
}
static
inline
void
__oaktrail_rfkill_cleanup
(
struct
rfkill
*
rf
)
{
if
(
rf
)
{
rfkill_unregister
(
rf
);
rfkill_destroy
(
rf
);
}
}
static
void
oaktrail_rfkill_cleanup
(
void
)
{
__oaktrail_rfkill_cleanup
(
wifi_rfkill
);
__oaktrail_rfkill_cleanup
(
bt_rfkill
);
__oaktrail_rfkill_cleanup
(
gps_rfkill
);
__oaktrail_rfkill_cleanup
(
wwan_rfkill
);
}
static
int
oaktrail_rfkill_init
(
void
)
{
int
ret
;
wifi_rfkill
=
oaktrail_rfkill_new
(
"oaktrail-wifi"
,
RFKILL_TYPE_WLAN
,
OT_EC_WIFI_MASK
);
if
(
IS_ERR
(
wifi_rfkill
))
{
ret
=
PTR_ERR
(
wifi_rfkill
);
wifi_rfkill
=
NULL
;
goto
cleanup
;
}
bt_rfkill
=
oaktrail_rfkill_new
(
"oaktrail-bluetooth"
,
RFKILL_TYPE_BLUETOOTH
,
OT_EC_BT_MASK
);
if
(
IS_ERR
(
bt_rfkill
))
{
ret
=
PTR_ERR
(
bt_rfkill
);
bt_rfkill
=
NULL
;
goto
cleanup
;
}
gps_rfkill
=
oaktrail_rfkill_new
(
"oaktrail-gps"
,
RFKILL_TYPE_GPS
,
OT_EC_GPS_MASK
);
if
(
IS_ERR
(
gps_rfkill
))
{
ret
=
PTR_ERR
(
gps_rfkill
);
gps_rfkill
=
NULL
;
goto
cleanup
;
}
wwan_rfkill
=
oaktrail_rfkill_new
(
"oaktrail-wwan"
,
RFKILL_TYPE_WWAN
,
OT_EC_WWAN_MASK
);
if
(
IS_ERR
(
wwan_rfkill
))
{
ret
=
PTR_ERR
(
wwan_rfkill
);
wwan_rfkill
=
NULL
;
goto
cleanup
;
}
return
0
;
cleanup:
oaktrail_rfkill_cleanup
();
return
ret
;
}
/* backlight */
static
int
get_backlight_brightness
(
struct
backlight_device
*
b
)
{
u8
value
;
ec_read
(
OT_EC_BL_BRIGHTNESS_ADDRESS
,
&
value
);
return
value
;
}
static
int
set_backlight_brightness
(
struct
backlight_device
*
b
)
{
u8
percent
=
(
u8
)
b
->
props
.
brightness
;
if
(
percent
<
0
||
percent
>
OT_EC_BL_BRIGHTNESS_MAX
)
return
-
EINVAL
;
ec_write
(
OT_EC_BL_BRIGHTNESS_ADDRESS
,
percent
);
ec_write
(
OT_EC_BL_CONTROL_ADDRESS
,
OT_EC_BL_CONTROL_ON_DATA
);
return
0
;
}
static
const
struct
backlight_ops
oaktrail_bl_ops
=
{
.
get_brightness
=
get_backlight_brightness
,
.
update_status
=
set_backlight_brightness
,
};
static
int
oaktrail_backlight_init
(
void
)
{
struct
backlight_device
*
bd
;
struct
backlight_properties
props
;
memset
(
&
props
,
0
,
sizeof
(
struct
backlight_properties
));
props
.
max_brightness
=
OT_EC_BL_BRIGHTNESS_MAX
;
bd
=
backlight_device_register
(
DRIVER_NAME
,
&
oaktrail_device
->
dev
,
NULL
,
&
oaktrail_bl_ops
,
&
props
);
if
(
IS_ERR
(
bd
))
{
oaktrail_bl_device
=
NULL
;
pr_warning
(
"Unable to register backlight device
\n
"
);
return
PTR_ERR
(
bd
);
}
oaktrail_bl_device
=
bd
;
bd
->
props
.
brightness
=
get_backlight_brightness
(
bd
);
bd
->
props
.
power
=
FB_BLANK_UNBLANK
;
backlight_update_status
(
bd
);
return
0
;
}
static
void
oaktrail_backlight_exit
(
void
)
{
if
(
oaktrail_bl_device
)
backlight_device_unregister
(
oaktrail_bl_device
);
}
static
int
__devinit
oaktrail_probe
(
struct
platform_device
*
pdev
)
{
return
0
;
}
static
int
__devexit
oaktrail_remove
(
struct
platform_device
*
pdev
)
{
return
0
;
}
static
struct
platform_driver
oaktrail_driver
=
{
.
driver
=
{
.
name
=
DRIVER_NAME
,
.
owner
=
THIS_MODULE
,
},
.
probe
=
oaktrail_probe
,
.
remove
=
__devexit_p
(
oaktrail_remove
)
};
static
int
dmi_check_cb
(
const
struct
dmi_system_id
*
id
)
{
pr_info
(
"Identified model '%s'
\n
"
,
id
->
ident
);
return
0
;
}
static
struct
dmi_system_id
__initdata
oaktrail_dmi_table
[]
=
{
{
.
ident
=
"OakTrail platform"
,
.
matches
=
{
DMI_MATCH
(
DMI_PRODUCT_NAME
,
"OakTrail platform"
),
},
.
callback
=
dmi_check_cb
},
{
}
};
static
int
__init
oaktrail_init
(
void
)
{
int
ret
;
if
(
acpi_disabled
)
{
pr_err
(
"ACPI needs to be enabled for this driver to work!
\n
"
);
return
-
ENODEV
;
}
if
(
!
force
&&
!
dmi_check_system
(
oaktrail_dmi_table
))
{
pr_err
(
"Platform not recognized (You could try the module's force-parameter)"
);
return
-
ENODEV
;
}
ret
=
platform_driver_register
(
&
oaktrail_driver
);
if
(
ret
)
{
pr_warning
(
"Unable to register platform driver
\n
"
);
goto
err_driver_reg
;
}
oaktrail_device
=
platform_device_alloc
(
DRIVER_NAME
,
-
1
);
if
(
!
oaktrail_device
)
{
pr_warning
(
"Unable to allocate platform device
\n
"
);
ret
=
-
ENOMEM
;
goto
err_device_alloc
;
}
ret
=
platform_device_add
(
oaktrail_device
);
if
(
ret
)
{
pr_warning
(
"Unable to add platform device
\n
"
);
goto
err_device_add
;
}
if
(
!
acpi_video_backlight_support
())
{
ret
=
oaktrail_backlight_init
();
if
(
ret
)
goto
err_backlight
;
}
else
pr_info
(
"Backlight controlled by ACPI video driver
\n
"
);
ret
=
oaktrail_rfkill_init
();
if
(
ret
)
{
pr_warning
(
"Setup rfkill failed
\n
"
);
goto
err_rfkill
;
}
pr_info
(
"Driver "
DRIVER_VERSION
" successfully loaded
\n
"
);
return
0
;
err_rfkill:
oaktrail_backlight_exit
();
err_backlight:
platform_device_del
(
oaktrail_device
);
err_device_add:
platform_device_put
(
oaktrail_device
);
err_device_alloc:
platform_driver_unregister
(
&
oaktrail_driver
);
err_driver_reg:
return
ret
;
}
static
void
__exit
oaktrail_cleanup
(
void
)
{
oaktrail_backlight_exit
();
oaktrail_rfkill_cleanup
();
platform_device_unregister
(
oaktrail_device
);
platform_driver_unregister
(
&
oaktrail_driver
);
pr_info
(
"Driver unloaded
\n
"
);
}
module_init
(
oaktrail_init
);
module_exit
(
oaktrail_cleanup
);
MODULE_AUTHOR
(
"Yin Kangkai (kangkai.yin@intel.com)"
);
MODULE_DESCRIPTION
(
"Intel Oaktrail Platform ACPI Extras"
);
MODULE_VERSION
(
DRIVER_VERSION
);
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"dmi:*:svnIntelCorporation:pnOakTrailplatform:*"
);
drivers/platform/x86/intel_pmic_gpio.c
View file @
437cb0db
...
@@ -19,6 +19,8 @@
...
@@ -19,6 +19,8 @@
* Moorestown platform PMIC chip
* Moorestown platform PMIC chip
*/
*/
#define pr_fmt(fmt) "%s: " fmt, __func__
#include <linux/module.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/interrupt.h>
#include <linux/interrupt.h>
...
@@ -90,8 +92,7 @@ static void pmic_program_irqtype(int gpio, int type)
...
@@ -90,8 +92,7 @@ static void pmic_program_irqtype(int gpio, int type)
static
int
pmic_gpio_direction_input
(
struct
gpio_chip
*
chip
,
unsigned
offset
)
static
int
pmic_gpio_direction_input
(
struct
gpio_chip
*
chip
,
unsigned
offset
)
{
{
if
(
offset
>
8
)
{
if
(
offset
>
8
)
{
printk
(
KERN_ERR
pr_err
(
"only pin 0-7 support input
\n
"
);
"%s: only pin 0-7 support input
\n
"
,
__func__
);
return
-
1
;
/* we only have 8 GPIO can use as input */
return
-
1
;
/* we only have 8 GPIO can use as input */
}
}
return
intel_scu_ipc_update_register
(
GPIO0
+
offset
,
return
intel_scu_ipc_update_register
(
GPIO0
+
offset
,
...
@@ -116,8 +117,7 @@ static int pmic_gpio_direction_output(struct gpio_chip *chip,
...
@@ -116,8 +117,7 @@ static int pmic_gpio_direction_output(struct gpio_chip *chip,
value
?
1
<<
(
offset
-
16
)
:
0
,
value
?
1
<<
(
offset
-
16
)
:
0
,
1
<<
(
offset
-
16
));
1
<<
(
offset
-
16
));
else
{
else
{
printk
(
KERN_ERR
pr_err
(
"invalid PMIC GPIO pin %d!
\n
"
,
offset
);
"%s: invalid PMIC GPIO pin %d!
\n
"
,
__func__
,
offset
);
WARN_ON
(
1
);
WARN_ON
(
1
);
}
}
...
@@ -260,7 +260,7 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
...
@@ -260,7 +260,7 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
/* setting up SRAM mapping for GPIOINT register */
/* setting up SRAM mapping for GPIOINT register */
pg
->
gpiointr
=
ioremap_nocache
(
pdata
->
gpiointr
,
8
);
pg
->
gpiointr
=
ioremap_nocache
(
pdata
->
gpiointr
,
8
);
if
(
!
pg
->
gpiointr
)
{
if
(
!
pg
->
gpiointr
)
{
pr
intk
(
KERN_ERR
"%s: Can not map GPIOINT.
\n
"
,
__func__
);
pr
_err
(
"Can not map GPIOINT
\n
"
);
retval
=
-
EINVAL
;
retval
=
-
EINVAL
;
goto
err2
;
goto
err2
;
}
}
...
@@ -281,13 +281,13 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
...
@@ -281,13 +281,13 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev)
pg
->
chip
.
dev
=
dev
;
pg
->
chip
.
dev
=
dev
;
retval
=
gpiochip_add
(
&
pg
->
chip
);
retval
=
gpiochip_add
(
&
pg
->
chip
);
if
(
retval
)
{
if
(
retval
)
{
pr
intk
(
KERN_ERR
"%s: Can not add pmic gpio chip.
\n
"
,
__func__
);
pr
_err
(
"Can not add pmic gpio chip
\n
"
);
goto
err
;
goto
err
;
}
}
retval
=
request_irq
(
pg
->
irq
,
pmic_irq_handler
,
0
,
"pmic"
,
pg
);
retval
=
request_irq
(
pg
->
irq
,
pmic_irq_handler
,
0
,
"pmic"
,
pg
);
if
(
retval
)
{
if
(
retval
)
{
pr
intk
(
KERN_WARNING
"pmic:
Interrupt request failed
\n
"
);
pr
_warn
(
"
Interrupt request failed
\n
"
);
goto
err
;
goto
err
;
}
}
...
...
drivers/platform/x86/msi-laptop.c
View file @
437cb0db
...
@@ -447,7 +447,7 @@ static struct platform_device *msipf_device;
...
@@ -447,7 +447,7 @@ static struct platform_device *msipf_device;
static
int
dmi_check_cb
(
const
struct
dmi_system_id
*
id
)
static
int
dmi_check_cb
(
const
struct
dmi_system_id
*
id
)
{
{
pr_info
(
"Identified laptop model '%s'
.
\n
"
,
id
->
ident
);
pr_info
(
"Identified laptop model '%s'
\n
"
,
id
->
ident
);
return
1
;
return
1
;
}
}
...
@@ -800,7 +800,7 @@ static void msi_laptop_input_destroy(void)
...
@@ -800,7 +800,7 @@ static void msi_laptop_input_destroy(void)
input_unregister_device
(
msi_laptop_input_dev
);
input_unregister_device
(
msi_laptop_input_dev
);
}
}
static
int
load_scm_model_init
(
struct
platform_device
*
sdev
)
static
int
__init
load_scm_model_init
(
struct
platform_device
*
sdev
)
{
{
u8
data
;
u8
data
;
int
result
;
int
result
;
...
@@ -875,8 +875,7 @@ static int __init msi_init(void)
...
@@ -875,8 +875,7 @@ static int __init msi_init(void)
/* Register backlight stuff */
/* Register backlight stuff */
if
(
acpi_video_backlight_support
())
{
if
(
acpi_video_backlight_support
())
{
pr_info
(
"Brightness ignored, must be controlled "
pr_info
(
"Brightness ignored, must be controlled by ACPI video driver
\n
"
);
"by ACPI video driver
\n
"
);
}
else
{
}
else
{
struct
backlight_properties
props
;
struct
backlight_properties
props
;
memset
(
&
props
,
0
,
sizeof
(
struct
backlight_properties
));
memset
(
&
props
,
0
,
sizeof
(
struct
backlight_properties
));
...
@@ -930,7 +929,7 @@ static int __init msi_init(void)
...
@@ -930,7 +929,7 @@ static int __init msi_init(void)
if
(
auto_brightness
!=
2
)
if
(
auto_brightness
!=
2
)
set_auto_brightness
(
auto_brightness
);
set_auto_brightness
(
auto_brightness
);
pr_info
(
"driver "
MSI_DRIVER_VERSION
" successfully loaded.
\n
"
);
pr_info
(
"driver "
MSI_DRIVER_VERSION
" successfully loaded
\n
"
);
return
0
;
return
0
;
...
@@ -978,7 +977,7 @@ static void __exit msi_cleanup(void)
...
@@ -978,7 +977,7 @@ static void __exit msi_cleanup(void)
if
(
auto_brightness
!=
2
)
if
(
auto_brightness
!=
2
)
set_auto_brightness
(
1
);
set_auto_brightness
(
1
);
pr_info
(
"driver unloaded
.
\n
"
);
pr_info
(
"driver unloaded
\n
"
);
}
}
module_init
(
msi_init
);
module_init
(
msi_init
);
...
...
drivers/platform/x86/msi-wmi.c
View file @
437cb0db
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/input.h>
#include <linux/input.h>
...
@@ -36,13 +37,10 @@ MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45");
...
@@ -36,13 +37,10 @@ MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45");
MODULE_ALIAS
(
"wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
);
MODULE_ALIAS
(
"wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
);
#define DRV_NAME "msi-wmi"
#define DRV_NAME "msi-wmi"
#define DRV_PFX DRV_NAME ": "
#define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45"
#define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45"
#define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
#define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
#define dprintk(msg...) pr_debug(DRV_PFX msg)
#define SCANCODE_BASE 0xD0
#define SCANCODE_BASE 0xD0
#define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE
#define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE
#define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1)
#define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1)
...
@@ -78,7 +76,7 @@ static int msi_wmi_query_block(int instance, int *ret)
...
@@ -78,7 +76,7 @@ static int msi_wmi_query_block(int instance, int *ret)
if
(
!
obj
||
obj
->
type
!=
ACPI_TYPE_INTEGER
)
{
if
(
!
obj
||
obj
->
type
!=
ACPI_TYPE_INTEGER
)
{
if
(
obj
)
{
if
(
obj
)
{
pr
intk
(
KERN_ERR
DRV_PFX
"query block returned object "
pr
_err
(
"query block returned object "
"type: %d - buffer length:%d
\n
"
,
obj
->
type
,
"type: %d - buffer length:%d
\n
"
,
obj
->
type
,
obj
->
type
==
ACPI_TYPE_BUFFER
?
obj
->
type
==
ACPI_TYPE_BUFFER
?
obj
->
buffer
.
length
:
0
);
obj
->
buffer
.
length
:
0
);
...
@@ -97,7 +95,7 @@ static int msi_wmi_set_block(int instance, int value)
...
@@ -97,7 +95,7 @@ static int msi_wmi_set_block(int instance, int value)
struct
acpi_buffer
input
=
{
sizeof
(
int
),
&
value
};
struct
acpi_buffer
input
=
{
sizeof
(
int
),
&
value
};
dprintk
(
"Going to set block of instance: %d - value: %d
\n
"
,
pr_debug
(
"Going to set block of instance: %d - value: %d
\n
"
,
instance
,
value
);
instance
,
value
);
status
=
wmi_set_block
(
MSIWMI_BIOS_GUID
,
instance
,
&
input
);
status
=
wmi_set_block
(
MSIWMI_BIOS_GUID
,
instance
,
&
input
);
...
@@ -112,20 +110,19 @@ static int bl_get(struct backlight_device *bd)
...
@@ -112,20 +110,19 @@ static int bl_get(struct backlight_device *bd)
/* Instance 1 is "get backlight", cmp with DSDT */
/* Instance 1 is "get backlight", cmp with DSDT */
err
=
msi_wmi_query_block
(
1
,
&
ret
);
err
=
msi_wmi_query_block
(
1
,
&
ret
);
if
(
err
)
{
if
(
err
)
{
pr
intk
(
KERN_ERR
DRV_PFX
"Could not query backlight: %d
\n
"
,
err
);
pr
_err
(
"Could not query backlight: %d
\n
"
,
err
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
dprintk
(
"Get: Query block returned: %d
\n
"
,
ret
);
pr_debug
(
"Get: Query block returned: %d
\n
"
,
ret
);
for
(
level
=
0
;
level
<
ARRAY_SIZE
(
backlight_map
);
level
++
)
{
for
(
level
=
0
;
level
<
ARRAY_SIZE
(
backlight_map
);
level
++
)
{
if
(
backlight_map
[
level
]
==
ret
)
{
if
(
backlight_map
[
level
]
==
ret
)
{
dprintk
(
"Current backlight level: 0x%X - index: %d
\n
"
,
pr_debug
(
"Current backlight level: 0x%X - index: %d
\n
"
,
backlight_map
[
level
],
level
);
backlight_map
[
level
],
level
);
break
;
break
;
}
}
}
}
if
(
level
==
ARRAY_SIZE
(
backlight_map
))
{
if
(
level
==
ARRAY_SIZE
(
backlight_map
))
{
printk
(
KERN_ERR
DRV_PFX
"get: Invalid brightness value: 0x%X
\n
"
,
pr_err
(
"get: Invalid brightness value: 0x%X
\n
"
,
ret
);
ret
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
return
level
;
return
level
;
...
@@ -156,7 +153,7 @@ static void msi_wmi_notify(u32 value, void *context)
...
@@ -156,7 +153,7 @@ static void msi_wmi_notify(u32 value, void *context)
status
=
wmi_get_event_data
(
value
,
&
response
);
status
=
wmi_get_event_data
(
value
,
&
response
);
if
(
status
!=
AE_OK
)
{
if
(
status
!=
AE_OK
)
{
pr
intk
(
KERN_INFO
DRV_PFX
"bad event status 0x%x
\n
"
,
status
);
pr
_info
(
"bad event status 0x%x
\n
"
,
status
);
return
;
return
;
}
}
...
@@ -164,7 +161,7 @@ static void msi_wmi_notify(u32 value, void *context)
...
@@ -164,7 +161,7 @@ static void msi_wmi_notify(u32 value, void *context)
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
if
(
obj
&&
obj
->
type
==
ACPI_TYPE_INTEGER
)
{
int
eventcode
=
obj
->
integer
.
value
;
int
eventcode
=
obj
->
integer
.
value
;
dprintk
(
"Eventcode: 0x%x
\n
"
,
eventcode
);
pr_debug
(
"Eventcode: 0x%x
\n
"
,
eventcode
);
key
=
sparse_keymap_entry_from_scancode
(
msi_wmi_input_dev
,
key
=
sparse_keymap_entry_from_scancode
(
msi_wmi_input_dev
,
eventcode
);
eventcode
);
if
(
key
)
{
if
(
key
)
{
...
@@ -175,7 +172,7 @@ static void msi_wmi_notify(u32 value, void *context)
...
@@ -175,7 +172,7 @@ static void msi_wmi_notify(u32 value, void *context)
/* Ignore event if the same event happened in a 50 ms
/* Ignore event if the same event happened in a 50 ms
timeframe -> Key press may result in 10-20 GPEs */
timeframe -> Key press may result in 10-20 GPEs */
if
(
ktime_to_us
(
diff
)
<
1000
*
50
)
{
if
(
ktime_to_us
(
diff
)
<
1000
*
50
)
{
dprintk
(
"Suppressed key event 0x%X - "
pr_debug
(
"Suppressed key event 0x%X - "
"Last press was %lld us ago
\n
"
,
"Last press was %lld us ago
\n
"
,
key
->
code
,
ktime_to_us
(
diff
));
key
->
code
,
ktime_to_us
(
diff
));
return
;
return
;
...
@@ -187,17 +184,16 @@ static void msi_wmi_notify(u32 value, void *context)
...
@@ -187,17 +184,16 @@ static void msi_wmi_notify(u32 value, void *context)
(
!
acpi_video_backlight_support
()
||
(
!
acpi_video_backlight_support
()
||
(
key
->
code
!=
MSI_WMI_BRIGHTNESSUP
&&
(
key
->
code
!=
MSI_WMI_BRIGHTNESSUP
&&
key
->
code
!=
MSI_WMI_BRIGHTNESSDOWN
)))
{
key
->
code
!=
MSI_WMI_BRIGHTNESSDOWN
)))
{
dprintk
(
"Send key: 0x%X - "
pr_debug
(
"Send key: 0x%X - "
"Input layer keycode: %d
\n
"
,
key
->
code
,
"Input layer keycode: %d
\n
"
,
key
->
keycode
);
key
->
code
,
key
->
keycode
);
sparse_keymap_report_entry
(
msi_wmi_input_dev
,
sparse_keymap_report_entry
(
msi_wmi_input_dev
,
key
,
1
,
true
);
key
,
1
,
true
);
}
}
}
else
}
else
printk
(
KERN_INFO
"Unknown key pressed - %x
\n
"
,
pr_info
(
"Unknown key pressed - %x
\n
"
,
eventcode
);
eventcode
);
}
else
}
else
pr
intk
(
KERN_INFO
DRV_PFX
"Unknown event received
\n
"
);
pr
_info
(
"Unknown event received
\n
"
);
kfree
(
response
.
pointer
);
kfree
(
response
.
pointer
);
}
}
...
@@ -238,8 +234,7 @@ static int __init msi_wmi_init(void)
...
@@ -238,8 +234,7 @@ static int __init msi_wmi_init(void)
int
err
;
int
err
;
if
(
!
wmi_has_guid
(
MSIWMI_EVENT_GUID
))
{
if
(
!
wmi_has_guid
(
MSIWMI_EVENT_GUID
))
{
printk
(
KERN_ERR
pr_err
(
"This machine doesn't have MSI-hotkeys through WMI
\n
"
);
"This machine doesn't have MSI-hotkeys through WMI
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
err
=
wmi_install_notify_handler
(
MSIWMI_EVENT_GUID
,
err
=
wmi_install_notify_handler
(
MSIWMI_EVENT_GUID
,
...
@@ -270,7 +265,7 @@ static int __init msi_wmi_init(void)
...
@@ -270,7 +265,7 @@ static int __init msi_wmi_init(void)
backlight
->
props
.
brightness
=
err
;
backlight
->
props
.
brightness
=
err
;
}
}
dprintk
(
"Event handler installed
\n
"
);
pr_debug
(
"Event handler installed
\n
"
);
return
0
;
return
0
;
...
...
drivers/platform/x86/sony-laptop.c
View file @
437cb0db
This diff is collapsed.
Click to expand it.
drivers/platform/x86/tc1100-wmi.c
View file @
437cb0db
...
@@ -25,6 +25,8 @@
...
@@ -25,6 +25,8 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/slab.h>
...
@@ -40,9 +42,6 @@
...
@@ -40,9 +42,6 @@
#define TC1100_INSTANCE_WIRELESS 1
#define TC1100_INSTANCE_WIRELESS 1
#define TC1100_INSTANCE_JOGDIAL 2
#define TC1100_INSTANCE_JOGDIAL 2
#define TC1100_LOGPREFIX "tc1100-wmi: "
#define TC1100_INFO KERN_INFO TC1100_LOGPREFIX
MODULE_AUTHOR
(
"Jamey Hicks, Carlos Corbacho"
);
MODULE_AUTHOR
(
"Jamey Hicks, Carlos Corbacho"
);
MODULE_DESCRIPTION
(
"HP Compaq TC1100 Tablet WMI Extras"
);
MODULE_DESCRIPTION
(
"HP Compaq TC1100 Tablet WMI Extras"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
...
@@ -264,7 +263,7 @@ static int __init tc1100_init(void)
...
@@ -264,7 +263,7 @@ static int __init tc1100_init(void)
if
(
error
)
if
(
error
)
goto
err_device_del
;
goto
err_device_del
;
pr
intk
(
TC1100_INFO
"HP Compaq TC1100 Tablet WMI Extras loaded
\n
"
);
pr
_info
(
"HP Compaq TC1100 Tablet WMI Extras loaded
\n
"
);
return
0
;
return
0
;
err_device_del:
err_device_del:
...
...
drivers/platform/x86/thinkpad_acpi.c
View file @
437cb0db
This diff is collapsed.
Click to expand it.
drivers/platform/x86/topstar-laptop.c
View file @
437cb0db
...
@@ -194,7 +194,7 @@ static int __init topstar_laptop_init(void)
...
@@ -194,7 +194,7 @@ static int __init topstar_laptop_init(void)
if
(
ret
<
0
)
if
(
ret
<
0
)
return
ret
;
return
ret
;
pr
intk
(
KERN_INFO
"Topstar Laptop
ACPI extras driver loaded
\n
"
);
pr
_info
(
"
ACPI extras driver loaded
\n
"
);
return
0
;
return
0
;
}
}
...
...
drivers/platform/x86/toshiba_acpi.c
View file @
437cb0db
...
@@ -35,6 +35,8 @@
...
@@ -35,6 +35,8 @@
*
*
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define TOSHIBA_ACPI_VERSION "0.19"
#define TOSHIBA_ACPI_VERSION "0.19"
#define PROC_INTERFACE_VERSION 1
#define PROC_INTERFACE_VERSION 1
...
@@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte");
...
@@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte");
MODULE_DESCRIPTION
(
"Toshiba Laptop ACPI Extras Driver"
);
MODULE_DESCRIPTION
(
"Toshiba Laptop ACPI Extras Driver"
);
MODULE_LICENSE
(
"GPL"
);
MODULE_LICENSE
(
"GPL"
);
#define MY_LOGPREFIX "toshiba_acpi: "
#define MY_ERR KERN_ERR MY_LOGPREFIX
#define MY_NOTICE KERN_NOTICE MY_LOGPREFIX
#define MY_INFO KERN_INFO MY_LOGPREFIX
/* Toshiba ACPI method paths */
/* Toshiba ACPI method paths */
#define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM"
#define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM"
#define TOSH_INTERFACE_1 "\\_SB_.VALD"
#define TOSH_INTERFACE_1 "\\_SB_.VALD"
...
@@ -301,7 +298,7 @@ static int toshiba_illumination_available(void)
...
@@ -301,7 +298,7 @@ static int toshiba_illumination_available(void)
in
[
0
]
=
0xf100
;
in
[
0
]
=
0xf100
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Illumination device not available
\n
"
);
pr
_info
(
"Illumination device not available
\n
"
);
return
0
;
return
0
;
}
}
in
[
0
]
=
0xf400
;
in
[
0
]
=
0xf400
;
...
@@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
...
@@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in
[
0
]
=
0xf100
;
in
[
0
]
=
0xf100
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Illumination device not available
\n
"
);
pr
_info
(
"Illumination device not available
\n
"
);
return
;
return
;
}
}
...
@@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
...
@@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in
[
2
]
=
1
;
in
[
2
]
=
1
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"ACPI call for illumination failed.
\n
"
);
pr
_info
(
"ACPI call for illumination failed
\n
"
);
return
;
return
;
}
}
}
else
{
}
else
{
...
@@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
...
@@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev,
in
[
2
]
=
0
;
in
[
2
]
=
0
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"ACPI call for illumination failed.
\n
"
);
pr
_info
(
"ACPI call for illumination failed.
\n
"
);
return
;
return
;
}
}
}
}
...
@@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
...
@@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
in
[
0
]
=
0xf100
;
in
[
0
]
=
0xf100
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Illumination device not available
\n
"
);
pr
_info
(
"Illumination device not available
\n
"
);
return
LED_OFF
;
return
LED_OFF
;
}
}
...
@@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
...
@@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev)
in
[
1
]
=
0x14e
;
in
[
1
]
=
0x14e
;
status
=
hci_raw
(
in
,
out
);
status
=
hci_raw
(
in
,
out
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"ACPI call for illumination failed.
\n
"
);
pr
_info
(
"ACPI call for illumination failed.
\n
"
);
return
LED_OFF
;
return
LED_OFF
;
}
}
...
@@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v)
...
@@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v)
seq_printf
(
m
,
"brightness_levels: %d
\n
"
,
seq_printf
(
m
,
"brightness_levels: %d
\n
"
,
HCI_LCD_BRIGHTNESS_LEVELS
);
HCI_LCD_BRIGHTNESS_LEVELS
);
}
else
{
}
else
{
pr
intk
(
MY_ERR
"Error reading LCD brightness
\n
"
);
pr
_err
(
"Error reading LCD brightness
\n
"
);
}
}
return
0
;
return
0
;
...
@@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v)
...
@@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v)
seq_printf
(
m
,
"crt_out: %d
\n
"
,
is_crt
);
seq_printf
(
m
,
"crt_out: %d
\n
"
,
is_crt
);
seq_printf
(
m
,
"tv_out: %d
\n
"
,
is_tv
);
seq_printf
(
m
,
"tv_out: %d
\n
"
,
is_tv
);
}
else
{
}
else
{
pr
intk
(
MY_ERR
"Error reading video out status
\n
"
);
pr
_err
(
"Error reading video out status
\n
"
);
}
}
return
0
;
return
0
;
...
@@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v)
...
@@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v)
seq_printf
(
m
,
"running: %d
\n
"
,
(
value
>
0
));
seq_printf
(
m
,
"running: %d
\n
"
,
(
value
>
0
));
seq_printf
(
m
,
"force_on: %d
\n
"
,
force_fan
);
seq_printf
(
m
,
"force_on: %d
\n
"
,
force_fan
);
}
else
{
}
else
{
pr
intk
(
MY_ERR
"Error reading fan status
\n
"
);
pr
_err
(
"Error reading fan status
\n
"
);
}
}
return
0
;
return
0
;
...
@@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v)
...
@@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v)
* some machines where system events sporadically
* some machines where system events sporadically
* become disabled. */
* become disabled. */
hci_write1
(
HCI_SYSTEM_EVENT
,
1
,
&
hci_result
);
hci_write1
(
HCI_SYSTEM_EVENT
,
1
,
&
hci_result
);
pr
intk
(
MY_NOTICE
"Re-enabled hotkeys
\n
"
);
pr
_notice
(
"Re-enabled hotkeys
\n
"
);
}
else
{
}
else
{
pr
intk
(
MY_ERR
"Error reading hotkey status
\n
"
);
pr
_err
(
"Error reading hotkey status
\n
"
);
goto
end
;
goto
end
;
}
}
}
}
...
@@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
...
@@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
if
(
!
sparse_keymap_report_event
(
toshiba_acpi
.
hotkey_dev
,
if
(
!
sparse_keymap_report_event
(
toshiba_acpi
.
hotkey_dev
,
value
,
1
,
true
))
{
value
,
1
,
true
))
{
pr
intk
(
MY_INFO
"Unknown key %x
\n
"
,
pr
_info
(
"Unknown key %x
\n
"
,
value
);
value
);
}
}
}
else
if
(
hci_result
==
HCI_NOT_SUPPORTED
)
{
}
else
if
(
hci_result
==
HCI_NOT_SUPPORTED
)
{
...
@@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
...
@@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context)
* some machines where system events sporadically
* some machines where system events sporadically
* become disabled. */
* become disabled. */
hci_write1
(
HCI_SYSTEM_EVENT
,
1
,
&
hci_result
);
hci_write1
(
HCI_SYSTEM_EVENT
,
1
,
&
hci_result
);
pr
intk
(
MY_NOTICE
"Re-enabled hotkeys
\n
"
);
pr
_notice
(
"Re-enabled hotkeys
\n
"
);
}
}
}
while
(
hci_result
!=
HCI_EMPTY
);
}
while
(
hci_result
!=
HCI_EMPTY
);
}
}
...
@@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
...
@@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
status
=
acpi_get_handle
(
NULL
,
device
,
&
toshiba_acpi
.
handle
);
status
=
acpi_get_handle
(
NULL
,
device
,
&
toshiba_acpi
.
handle
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Unable to get notification device
\n
"
);
pr
_info
(
"Unable to get notification device
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
toshiba_acpi
.
hotkey_dev
=
input_allocate_device
();
toshiba_acpi
.
hotkey_dev
=
input_allocate_device
();
if
(
!
toshiba_acpi
.
hotkey_dev
)
{
if
(
!
toshiba_acpi
.
hotkey_dev
)
{
pr
intk
(
MY_INFO
"Unable to register input device
\n
"
);
pr
_info
(
"Unable to register input device
\n
"
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
...
@@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
...
@@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device)
status
=
acpi_install_notify_handler
(
toshiba_acpi
.
handle
,
status
=
acpi_install_notify_handler
(
toshiba_acpi
.
handle
,
ACPI_DEVICE_NOTIFY
,
toshiba_acpi_notify
,
NULL
);
ACPI_DEVICE_NOTIFY
,
toshiba_acpi_notify
,
NULL
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Unable to install hotkey notification
\n
"
);
pr
_info
(
"Unable to install hotkey notification
\n
"
);
error
=
-
ENODEV
;
error
=
-
ENODEV
;
goto
err_free_keymap
;
goto
err_free_keymap
;
}
}
status
=
acpi_evaluate_object
(
toshiba_acpi
.
handle
,
"ENAB"
,
NULL
,
NULL
);
status
=
acpi_evaluate_object
(
toshiba_acpi
.
handle
,
"ENAB"
,
NULL
,
NULL
);
if
(
ACPI_FAILURE
(
status
))
{
if
(
ACPI_FAILURE
(
status
))
{
pr
intk
(
MY_INFO
"Unable to enable hotkeys
\n
"
);
pr
_info
(
"Unable to enable hotkeys
\n
"
);
error
=
-
ENODEV
;
error
=
-
ENODEV
;
goto
err_remove_notify
;
goto
err_remove_notify
;
}
}
error
=
input_register_device
(
toshiba_acpi
.
hotkey_dev
);
error
=
input_register_device
(
toshiba_acpi
.
hotkey_dev
);
if
(
error
)
{
if
(
error
)
{
pr
intk
(
MY_INFO
"Unable to register input device
\n
"
);
pr
_info
(
"Unable to register input device
\n
"
);
goto
err_remove_notify
;
goto
err_remove_notify
;
}
}
...
@@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void)
...
@@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void)
if
(
is_valid_acpi_path
(
TOSH_INTERFACE_1
GHCI_METHOD
))
{
if
(
is_valid_acpi_path
(
TOSH_INTERFACE_1
GHCI_METHOD
))
{
method_hci
=
TOSH_INTERFACE_1
GHCI_METHOD
;
method_hci
=
TOSH_INTERFACE_1
GHCI_METHOD
;
if
(
toshiba_acpi_setup_keyboard
(
TOSH_INTERFACE_1
))
if
(
toshiba_acpi_setup_keyboard
(
TOSH_INTERFACE_1
))
pr
intk
(
MY_INFO
"Unable to activate hotkeys
\n
"
);
pr
_info
(
"Unable to activate hotkeys
\n
"
);
}
else
if
(
is_valid_acpi_path
(
TOSH_INTERFACE_2
GHCI_METHOD
))
{
}
else
if
(
is_valid_acpi_path
(
TOSH_INTERFACE_2
GHCI_METHOD
))
{
method_hci
=
TOSH_INTERFACE_2
GHCI_METHOD
;
method_hci
=
TOSH_INTERFACE_2
GHCI_METHOD
;
if
(
toshiba_acpi_setup_keyboard
(
TOSH_INTERFACE_2
))
if
(
toshiba_acpi_setup_keyboard
(
TOSH_INTERFACE_2
))
pr
intk
(
MY_INFO
"Unable to activate hotkeys
\n
"
);
pr
_info
(
"Unable to activate hotkeys
\n
"
);
}
else
}
else
return
-
ENODEV
;
return
-
ENODEV
;
pr
intk
(
MY_INFO
"Toshiba Laptop ACPI Extras version %s
\n
"
,
pr
_info
(
"Toshiba Laptop ACPI Extras version %s
\n
"
,
TOSHIBA_ACPI_VERSION
);
TOSHIBA_ACPI_VERSION
);
pr
intk
(
MY_INFO
" HCI method: %s
\n
"
,
method_hci
);
pr
_info
(
" HCI method: %s
\n
"
,
method_hci
);
mutex_init
(
&
toshiba_acpi
.
mutex
);
mutex_init
(
&
toshiba_acpi
.
mutex
);
...
@@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void)
...
@@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void)
-
1
,
NULL
,
0
);
-
1
,
NULL
,
0
);
if
(
IS_ERR
(
toshiba_acpi
.
p_dev
))
{
if
(
IS_ERR
(
toshiba_acpi
.
p_dev
))
{
ret
=
PTR_ERR
(
toshiba_acpi
.
p_dev
);
ret
=
PTR_ERR
(
toshiba_acpi
.
p_dev
);
pr
intk
(
MY_ERR
"unable to register platform device
\n
"
);
pr
_err
(
"unable to register platform device
\n
"
);
toshiba_acpi
.
p_dev
=
NULL
;
toshiba_acpi
.
p_dev
=
NULL
;
toshiba_acpi_exit
();
toshiba_acpi_exit
();
return
ret
;
return
ret
;
...
@@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void)
...
@@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void)
if
(
IS_ERR
(
toshiba_backlight_device
))
{
if
(
IS_ERR
(
toshiba_backlight_device
))
{
ret
=
PTR_ERR
(
toshiba_backlight_device
);
ret
=
PTR_ERR
(
toshiba_backlight_device
);
pr
intk
(
KERN_ERR
"Could not register toshiba backlight device
\n
"
);
pr
_err
(
"Could not register toshiba backlight device
\n
"
);
toshiba_backlight_device
=
NULL
;
toshiba_backlight_device
=
NULL
;
toshiba_acpi_exit
();
toshiba_acpi_exit
();
return
ret
;
return
ret
;
...
@@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void)
...
@@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void)
&
toshiba_rfk_ops
,
&
toshiba_rfk_ops
,
&
toshiba_acpi
);
&
toshiba_acpi
);
if
(
!
toshiba_acpi
.
bt_rfk
)
{
if
(
!
toshiba_acpi
.
bt_rfk
)
{
pr
intk
(
MY_ERR
"unable to allocate rfkill device
\n
"
);
pr
_err
(
"unable to allocate rfkill device
\n
"
);
toshiba_acpi_exit
();
toshiba_acpi_exit
();
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
ret
=
rfkill_register
(
toshiba_acpi
.
bt_rfk
);
ret
=
rfkill_register
(
toshiba_acpi
.
bt_rfk
);
if
(
ret
)
{
if
(
ret
)
{
pr
intk
(
MY_ERR
"unable to register rfkill device
\n
"
);
pr
_err
(
"unable to register rfkill device
\n
"
);
rfkill_destroy
(
toshiba_acpi
.
bt_rfk
);
rfkill_destroy
(
toshiba_acpi
.
bt_rfk
);
toshiba_acpi_exit
();
toshiba_acpi_exit
();
return
ret
;
return
ret
;
...
...
drivers/platform/x86/toshiba_bluetooth.c
View file @
437cb0db
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
* delivered.
* delivered.
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -70,14 +72,13 @@ static int toshiba_bluetooth_enable(acpi_handle handle)
...
@@ -70,14 +72,13 @@ static int toshiba_bluetooth_enable(acpi_handle handle)
if
(
!
(
result
&
0x01
))
if
(
!
(
result
&
0x01
))
return
0
;
return
0
;
pr
intk
(
KERN_INFO
"toshiba_bluetooth:
Re-enabling Toshiba Bluetooth
\n
"
);
pr
_info
(
"
Re-enabling Toshiba Bluetooth
\n
"
);
res1
=
acpi_evaluate_object
(
handle
,
"AUSB"
,
NULL
,
NULL
);
res1
=
acpi_evaluate_object
(
handle
,
"AUSB"
,
NULL
,
NULL
);
res2
=
acpi_evaluate_object
(
handle
,
"BTPO"
,
NULL
,
NULL
);
res2
=
acpi_evaluate_object
(
handle
,
"BTPO"
,
NULL
,
NULL
);
if
(
!
ACPI_FAILURE
(
res1
)
||
!
ACPI_FAILURE
(
res2
))
if
(
!
ACPI_FAILURE
(
res1
)
||
!
ACPI_FAILURE
(
res2
))
return
0
;
return
0
;
printk
(
KERN_WARNING
"toshiba_bluetooth: Failed to re-enable "
pr_warn
(
"Failed to re-enable Toshiba Bluetooth
\n
"
);
"Toshiba Bluetooth
\n
"
);
return
-
ENODEV
;
return
-
ENODEV
;
}
}
...
@@ -107,7 +108,7 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device)
...
@@ -107,7 +108,7 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device)
&
bt_present
);
&
bt_present
);
if
(
!
ACPI_FAILURE
(
status
)
&&
bt_present
)
{
if
(
!
ACPI_FAILURE
(
status
)
&&
bt_present
)
{
pr
intk
(
KERN_INFO
"Detected Toshiba ACPI Bluetooth device - "
pr
_info
(
"Detected Toshiba ACPI Bluetooth device - "
"installing RFKill handler
\n
"
);
"installing RFKill handler
\n
"
);
result
=
toshiba_bluetooth_enable
(
device
->
handle
);
result
=
toshiba_bluetooth_enable
(
device
->
handle
);
}
}
...
...
drivers/platform/x86/wmi.c
View file @
437cb0db
...
@@ -486,16 +486,16 @@ static void wmi_dump_wdg(const struct guid_block *g)
...
@@ -486,16 +486,16 @@ static void wmi_dump_wdg(const struct guid_block *g)
pr_info
(
"
\t
notify_id: %02X
\n
"
,
g
->
notify_id
);
pr_info
(
"
\t
notify_id: %02X
\n
"
,
g
->
notify_id
);
pr_info
(
"
\t
reserved: %02X
\n
"
,
g
->
reserved
);
pr_info
(
"
\t
reserved: %02X
\n
"
,
g
->
reserved
);
pr_info
(
"
\t
instance_count: %d
\n
"
,
g
->
instance_count
);
pr_info
(
"
\t
instance_count: %d
\n
"
,
g
->
instance_count
);
pr_info
(
"
\t
flags: %#x
"
,
g
->
flags
);
pr_info
(
"
\t
flags: %#x"
,
g
->
flags
);
if
(
g
->
flags
)
{
if
(
g
->
flags
)
{
if
(
g
->
flags
&
ACPI_WMI_EXPENSIVE
)
if
(
g
->
flags
&
ACPI_WMI_EXPENSIVE
)
pr_cont
(
"
ACPI_WMI_EXPENSIVE
"
);
pr_cont
(
"
ACPI_WMI_EXPENSIVE
"
);
if
(
g
->
flags
&
ACPI_WMI_METHOD
)
if
(
g
->
flags
&
ACPI_WMI_METHOD
)
pr_cont
(
"
ACPI_WMI_METHOD
"
);
pr_cont
(
"
ACPI_WMI_METHOD
"
);
if
(
g
->
flags
&
ACPI_WMI_STRING
)
if
(
g
->
flags
&
ACPI_WMI_STRING
)
pr_cont
(
"
ACPI_WMI_STRING
"
);
pr_cont
(
"
ACPI_WMI_STRING
"
);
if
(
g
->
flags
&
ACPI_WMI_EVENT
)
if
(
g
->
flags
&
ACPI_WMI_EVENT
)
pr_cont
(
"
ACPI_WMI_EVENT
"
);
pr_cont
(
"
ACPI_WMI_EVENT
"
);
}
}
pr_cont
(
"
\n
"
);
pr_cont
(
"
\n
"
);
...
...
drivers/platform/x86/xo15-ebook.c
View file @
437cb0db
...
@@ -11,6 +11,8 @@
...
@@ -11,6 +11,8 @@
* your option) any later version.
* your option) any later version.
*/
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -20,7 +22,6 @@
...
@@ -20,7 +22,6 @@
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_drivers.h>
#define MODULE_NAME "xo15-ebook"
#define MODULE_NAME "xo15-ebook"
#define PREFIX MODULE_NAME ": "
#define XO15_EBOOK_CLASS MODULE_NAME
#define XO15_EBOOK_CLASS MODULE_NAME
#define XO15_EBOOK_TYPE_UNKNOWN 0x00
#define XO15_EBOOK_TYPE_UNKNOWN 0x00
...
@@ -105,7 +106,7 @@ static int ebook_switch_add(struct acpi_device *device)
...
@@ -105,7 +106,7 @@ static int ebook_switch_add(struct acpi_device *device)
class
=
acpi_device_class
(
device
);
class
=
acpi_device_class
(
device
);
if
(
strcmp
(
hid
,
XO15_EBOOK_HID
))
{
if
(
strcmp
(
hid
,
XO15_EBOOK_HID
))
{
pr
intk
(
KERN_ERR
PREFIX
"Unsupported hid [%s]
\n
"
,
hid
);
pr
_err
(
"Unsupported hid [%s]
\n
"
,
hid
);
error
=
-
ENODEV
;
error
=
-
ENODEV
;
goto
err_free_input
;
goto
err_free_input
;
}
}
...
...
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