History

Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86: (43 commits) acer-wmi: support integer return type from WMI methods msi-laptop: fix section mismatch in reference from the function load_scm_model_init acer-wmi: support to set communication device state by new wmid method acer-wmi: allow 64-bits return buffer from WMI methods acer-wmi: check the existence of internal 3G device when set capability platform/x86:delete two unused variables support wlan hotkey on Acer Travelmate 5735Z platform-x86: intel_mid_thermal: Fix memory leak platform/x86: Fix Makefile for intel_mid_powerbtn platform/x86: Simplify intel_mid_powerbtn acer-wmi: Delete out-of-date documentation acerhdf: Clean up includes acerhdf: Drop pointless dependency on THERMAL_HWMON acer-wmi: Update MAINTAINERS wmi: Orphan ACPI-WMI driver tc1100-wmi: Orphan driver acer-wmi: does not allow negative number set to initial device state platform/oaktrail: ACPI EC Extra driver for Oaktrail thinkpad_acpi: Convert printks to pr_<level> thinkpad_acpi: Correct !CONFIG_THINKPAD_ACPI_VIDEO warning ...

Linus Torvalds committed 15 years ago

Commit 2ba781c2 parents 6345d24 437cb0d35 files · +1393 −1192Browse files

Unified · Split

35 files
  1. Documentation/laptops/acer-wmi.txt +0 −184
  2. MAINTAINERS +3 −8
  3. drivers/platform/x86/Kconfig +10 −1
  4. drivers/platform/x86/Makefile +2 −1
  5. drivers/platform/x86/acer-wmi.c +159 −25
  6. drivers/platform/x86/acerhdf.c +1 −3
  7. drivers/platform/x86/asus-laptop.c +17 −17
  8. drivers/platform/x86/asus-wmi.c +11 −11
  9. drivers/platform/x86/asus_acpi.c +32 −45
  10. drivers/platform/x86/compal-laptop.c +9 −13
  11. drivers/platform/x86/dell-laptop.c +6 −6
  12. drivers/platform/x86/dell-wmi-aio.c +2 −1
  13. drivers/platform/x86/dell-wmi.c +8 −9
  14. drivers/platform/x86/eeepc-laptop.c +11 −10
  15. drivers/platform/x86/eeepc-wmi.c +7 −7
  16. drivers/platform/x86/fujitsu-laptop.c +19 −20
  17. drivers/platform/x86/hdaps.c +10 −9
  18. drivers/platform/x86/hp-wmi.c +17 −26
  19. drivers/platform/x86/ibm_rtl.c +13 −10
  20. drivers/platform/x86/ideapad-laptop.c +2 −0
  21. drivers/platform/x86/intel_menlow.c +3 −2
  22. drivers/platform/x86/intel_mid_powerbtn.c +30 −42
  23. drivers/platform/x86/intel_mid_thermal.c +301 −306
  24. drivers/platform/x86/intel_oaktrail.c +396 −0
  25. drivers/platform/x86/intel_pmic_gpio.c +7 −7
  26. drivers/platform/x86/msi-laptop.c +5 −6
  27. drivers/platform/x86/msi-wmi.c +20 −25
  28. drivers/platform/x86/sony-laptop.c +49 −57
  29. drivers/platform/x86/tc1100-wmi.c +3 −4
  30. drivers/platform/x86/thinkpad_acpi.c +197 −293
  31. drivers/platform/x86/topstar-laptop.c +1 −1
  32. drivers/platform/x86/toshiba_acpi.c +28 −31
  33. drivers/platform/x86/toshiba_bluetooth.c +6 −5
  34. drivers/platform/x86/wmi.c +5 −5
  35. drivers/platform/x86/xo15-ebook.c +3 −2
Documentation/laptops/acer-wmi.txt+0−184
@@ -1,184 +0,0 @@
1−Acer Laptop WMI Extras Driver
2−http://code.google.com/p/aceracpi
3−Version 0.3
4−4th April 2009
5−
6−Copyright 2007-2009 Carlos Corbacho <carlos@strangeworlds.co.uk>
7−
8−acer-wmi is a driver to allow you to control various parts of your Acer laptop
9−hardware under Linux which are exposed via ACPI-WMI.
10−
11−This driver completely replaces the old out-of-tree acer_acpi, which I am
12−currently maintaining for bug fixes only on pre-2.6.25 kernels. All development
13−work is now focused solely on acer-wmi.
14−
15−Disclaimer
16−**********
17−
18−Acer and Wistron have provided nothing towards the development acer_acpi or
19−acer-wmi. All information we have has been through the efforts of the developers
20−and the users to discover as much as possible about the hardware.
21−
22−As such, I do warn that this could break your hardware - this is extremely
23−unlikely of course, but please bear this in mind.
24−
25−Background
26−**********
27−
28−acer-wmi is derived from acer_acpi, originally developed by Mark
29−Smith in 2005, then taken over by Carlos Corbacho in 2007, in order to activate
30−the wireless LAN card under a 64-bit version of Linux, as acerhk[1] (the
31−previous solution to the problem) relied on making 32 bit BIOS calls which are
32−not possible in kernel space from a 64 bit OS.
33−
34−[1] acerhk: http://www.cakey.de/acerhk/
35−
36−Supported Hardware
37−******************
38−
39−NOTE: The Acer Aspire One is not supported hardware. It cannot work with
40−acer-wmi until Acer fix their ACPI-WMI implementation on them, so has been
41−blacklisted until that happens.
42−
43−Please see the website for the current list of known working hardware:
44−
45−http://code.google.com/p/aceracpi/wiki/SupportedHardware
46−
47−If your laptop is not listed, or listed as unknown, and works with acer-wmi,
48−please contact me with a copy of the DSDT.
49−
50−If your Acer laptop doesn't work with acer-wmi, I would also like to see the
51−DSDT.
52−
53−To send me the DSDT, as root/sudo:
54−
55−cat /sys/firmware/acpi/tables/DSDT > dsdt
56−
57−And send me the resulting 'dsdt' file.
58−
59−Usage
60−*****
61−
62−On Acer laptops, acer-wmi should already be autoloaded based on DMI matching.
63−For non-Acer laptops, until WMI based autoloading support is added, you will
64−need to manually load acer-wmi.
65−
66−acer-wmi creates /sys/devices/platform/acer-wmi, and fills it with various
67−files whose usage is detailed below, which enables you to control some of the
68−following (varies between models):
69−
70−* the wireless LAN card radio
71−* inbuilt Bluetooth adapter
72−* inbuilt 3G card
73−* mail LED of your laptop
74−* brightness of the LCD panel
75−
76−Wireless
77−********
78−
79−With regards to wireless, all acer-wmi does is enable the radio on the card. It
80−is not responsible for the wireless LED - once the radio is enabled, this is
81−down to the wireless driver for your card. So the behaviour of the wireless LED,
82−once you enable the radio, will depend on your hardware and driver combination.
83−
84−e.g. With the BCM4318 on the Acer Aspire 5020 series:
85−
86−ndiswrapper: Light blinks on when transmitting
87−b43: Solid light, blinks off when transmitting
88−
89−Wireless radio control is unconditionally enabled - all Acer laptops that support
90−acer-wmi come with built-in wireless. However, should you feel so inclined to
91−ever wish to remove the card, or swap it out at some point, please get in touch
92−with me, as we may well be able to gain some data on wireless card detection.
93−
94−The wireless radio is exposed through rfkill.
95−
96−Bluetooth
97−*********
98−
99−For bluetooth, this is an internal USB dongle, so once enabled, you will get
100−a USB device connection event, and a new USB device appears. When you disable
101−bluetooth, you get the reverse - a USB device disconnect event, followed by the
102−device disappearing again.
103−
104−Bluetooth is autodetected by acer-wmi, so if you do not have a bluetooth module
105−installed in your laptop, this file won't exist (please be aware that it is
106−quite common for Acer not to fit bluetooth to their laptops - so just because
107−you have a bluetooth button on the laptop, doesn't mean that bluetooth is
108−installed).
109−
110−For the adventurously minded - if you want to buy an internal bluetooth
111−module off the internet that is compatible with your laptop and fit it, then
112−it will work just fine with acer-wmi.
113−
114−Bluetooth is exposed through rfkill.
115−
116−3G
117−**
118−
119−3G is currently not autodetected, so the 'threeg' file is always created under
120−sysfs. So far, no-one in possession of an Acer laptop with 3G built-in appears to
121−have tried Linux, or reported back, so we don't have any information on this.
122−
123−If you have an Acer laptop that does have a 3G card in, please contact me so we
124−can properly detect these, and find out a bit more about them.
125−
126−To read the status of the 3G card (0=off, 1=on):
127−cat /sys/devices/platform/acer-wmi/threeg
128−
129−To enable the 3G card:
130−echo 1 > /sys/devices/platform/acer-wmi/threeg
131−
132−To disable the 3G card:
133−echo 0 > /sys/devices/platform/acer-wmi/threeg
134−
135−To set the state of the 3G card when loading acer-wmi, pass:
136−threeg=X (where X is 0 or 1)
137−
138−Mail LED
139−********
140−
141−This can be found in most older Acer laptops supported by acer-wmi, and many
142−newer ones - it is built into the 'mail' button, and blinks when active.
143−
144−On newer (WMID) laptops though, we have no way of detecting the mail LED. If
145−your laptop identifies itself in dmesg as a WMID model, then please try loading
146−acer_acpi with:
147−
148−force_series=2490
149−
150−This will use a known alternative method of reading/ writing the mail LED. If
151−it works, please report back to me with the DMI data from your laptop so this
152−can be added to acer-wmi.
153−
154−The LED is exposed through the LED subsystem, and can be found in:
155−
156−/sys/devices/platform/acer-wmi/leds/acer-wmi::mail/
157−
158−The mail LED is autodetected, so if you don't have one, the LED device won't
159−be registered.
160−
161−Backlight
162−*********
163−
164−The backlight brightness control is available on all acer-wmi supported
165−hardware. The maximum brightness level is usually 15, but on some newer laptops
166−it's 10 (this is again autodetected).
167−
168−The backlight is exposed through the backlight subsystem, and can be found in:
169−
170−/sys/devices/platform/acer-wmi/backlight/acer-wmi/
171−
172−Credits
173−*******
174−
175−Olaf Tauber, who did the real hard work when he developed acerhk
176−http://www.cakey.de/acerhk/
177−All the authors of laptop ACPI modules in the kernel, whose work
178−was an inspiration in the early days of acer_acpi
179−Mathieu Segaud, who solved the problem with having to modprobe the driver
180−twice in acer_acpi 0.2.
181−Jim Ramsay, who added support for the WMID interface
182−Mark Smith, who started the original acer_acpi
183−
184−And the many people who have used both acer_acpi and acer-wmi.
MAINTAINERS+3−8
@@ -223,10 +223,8 @@ S: Maintained · 222 unmodified lines
223223 F: drivers/platform/x86/acerhdf.c
224224
225225 ACER WMI LAPTOP EXTRAS
226−M: Carlos Corbacho <carlos@strangeworlds.co.uk>
227−L: aceracpi@googlegroups.com (subscribers-only)
226+M: Joey Lee <jlee@novell.com>
228227 L: platform-driver-x86@vger.kernel.org
229−W: http://code.google.com/p/aceracpi
230228 S: Maintained
231229 F: drivers/platform/x86/acer-wmi.c
232230
@@ -271,10 +269,8 @@ S: Supported · 38 unmodified lines
271269 F: drivers/acpi/video.c
272270
273271 ACPI WMI DRIVER
274−M: Carlos Corbacho <carlos@strangeworlds.co.uk>
275272 L: platform-driver-x86@vger.kernel.org
276−W: http://www.lesswatts.org/projects/acpi/
277−S: Maintained
273+S: Orphan
278274 F: drivers/platform/x86/wmi.c
279275
280276 AD1889 ALSA SOUND DRIVER
@@ -3033,9 +3029,8 @@ S: Maintained · 2752 unmodified lines
30333029 F: drivers/net/wireless/hostap/
30343030
30353031 HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER
3036−M: Carlos Corbacho <carlos@strangeworlds.co.uk>
30373032 L: platform-driver-x86@vger.kernel.org
3038−S: Odd Fixes
3033+S: Orphan
30393034 F: drivers/platform/x86/tc1100-wmi.c
30403035
30413036 HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
drivers/platform/x86/Kconfig+10−1
@@ -39,7 +39,7 @@ config ACER_WMI · 38 unmodified lines
3939
4040 config ACERHDF
4141 tristate "Acer Aspire One temperature and fan driver"
42− depends on THERMAL && THERMAL_HWMON && ACPI
42+ depends on THERMAL && ACPI
4343 ---help---
4444 This is a driver for Acer Aspire One netbooks. It allows to access
4545 the temperature sensor and to control the fan.
@@ -760,4 +760,13 @@ config MXM_WMI · 714 unmodified lines
760760 MXM is a standard for laptop graphics cards, the WMI interface
761761 is required for switchable nvidia graphics machines
762762
763+config INTEL_OAKTRAIL
764+ tristate "Intel Oaktrail Platform Extras"
765+ depends on ACPI
766+ depends on RFKILL && BACKLIGHT_CLASS_DEVICE && ACPI
767+ ---help---
768+ Intel Oaktrail platform need this driver to provide interfaces to
769+ enable/disable the Camera, WiFi, BT etc. devices. If in doubt, say Y
770+ here; it will only load on supported platforms.
771+
763772 endif # X86_PLATFORM_DEVICES
drivers/platform/x86/Makefile+2−1
@@ -41,5 +41,6 @@ obj-$(CONFIG_XO1_RFKILL) += xo1-rfkill.o · 40 unmodified lines
4141 obj-$(CONFIG_XO15_EBOOK) += xo15-ebook.o
4242 obj-$(CONFIG_IBM_RTL) += ibm_rtl.o
4343 obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o
44−obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o
4544 obj-$(CONFIG_MXM_WMI) += mxm-wmi.o
45+obj-$(CONFIG_INTEL_MID_POWER_BUTTON) += intel_mid_powerbtn.o
46+obj-$(CONFIG_INTEL_OAKTRAIL) += intel_oaktrail.o
drivers/platform/x86/acer-wmi.c+159−25
@@ -98,13 +98,26 @@ enum acer_wmi_event_ids { · 97 unmodified lines
9898
9999 static const struct key_entry acer_wmi_keymap[] = {
100100 {KE_KEY, 0x01, {KEY_WLAN} }, /* WiFi */
101+ {KE_KEY, 0x03, {KEY_WLAN} }, /* WiFi */
101102 {KE_KEY, 0x12, {KEY_BLUETOOTH} }, /* BT */
102103 {KE_KEY, 0x21, {KEY_PROG1} }, /* Backup */
103104 {KE_KEY, 0x22, {KEY_PROG2} }, /* Arcade */
104105 {KE_KEY, 0x23, {KEY_PROG3} }, /* P_Key */
105106 {KE_KEY, 0x24, {KEY_PROG4} }, /* Social networking_Key */
107+ {KE_IGNORE, 0x41, {KEY_MUTE} },
108+ {KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
109+ {KE_IGNORE, 0x43, {KEY_NEXTSONG} },
110+ {KE_IGNORE, 0x44, {KEY_PLAYPAUSE} },
111+ {KE_IGNORE, 0x45, {KEY_STOP} },
112+ {KE_IGNORE, 0x48, {KEY_VOLUMEUP} },
113+ {KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} },
114+ {KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} },
115+ {KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} },
116+ {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} },
106117 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
118+ {KE_IGNORE, 0x81, {KEY_SLEEP} },
107119 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad On/Off */
120+ {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} },
108121 {KE_END, 0}
109122 };
110123
@@ -122,6 +135,7 @@ struct event_return_value { · 11 unmodified lines
122135 */
123136 #define ACER_WMID3_GDS_WIRELESS (1<<0) /* WiFi */
124137 #define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */
138+#define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */
125139 #define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */
126140
127141 struct lm_input_params {
@@ -737,8 +751,11 @@ WMI_execute_u32(u32 method_id, u32 in, u32 *out) · 609 unmodified lines
737751
738752 obj = (union acpi_object *) result.pointer;
739753 if (obj && obj->type == ACPI_TYPE_BUFFER &&
740− obj->buffer.length == sizeof(u32)) {
754+ (obj->buffer.length == sizeof(u32) ||
755+ obj->buffer.length == sizeof(u64))) {
741756 tmp = *((u32 *) obj->buffer.pointer);
757+ } else if (obj->type == ACPI_TYPE_INTEGER) {
758+ tmp = (u32) obj->integer.value;
742759 } else {
743760 tmp = 0;
744761 }
@@ -866,8 +883,11 @@ static acpi_status WMID_set_capabilities(void) · 121 unmodified lines
866883
867884 obj = (union acpi_object *) out.pointer;
868885 if (obj && obj->type == ACPI_TYPE_BUFFER &&
869− obj->buffer.length == sizeof(u32)) {
886+ (obj->buffer.length == sizeof(u32) ||
887+ obj->buffer.length == sizeof(u64))) {
870888 devices = *((u32 *) obj->buffer.pointer);
889+ } else if (obj->type == ACPI_TYPE_INTEGER) {
890+ devices = (u32) obj->integer.value;
871891 } else {
872892 kfree(out.pointer);
873893 return AE_ERROR;
@@ -876,7 +896,8 @@ static acpi_status WMID_set_capabilities(void) · 2 unmodified lines
876896 dmi_walk(type_aa_dmi_decode, NULL);
877897 if (!has_type_aa) {
878898 interface->capability |= ACER_CAP_WIRELESS;
879− interface->capability |= ACER_CAP_THREEG;
899+ if (devices & 0x40)
900+ interface->capability |= ACER_CAP_THREEG;
880901 if (devices & 0x10)
881902 interface->capability |= ACER_CAP_BLUETOOTH;
882903 }
@@ -961,10 +982,12 @@ static void __init acer_commandline_init(void) · 78 unmodified lines
961982 * These will all fail silently if the value given is invalid, or the
962983 * capability isn't available on the given interface
963984 */
964− set_u32(mailled, ACER_CAP_MAILLED);
965− if (!has_type_aa)
985+ if (mailled >= 0)
986+ set_u32(mailled, ACER_CAP_MAILLED);
987+ if (!has_type_aa && threeg >= 0)
966988 set_u32(threeg, ACER_CAP_THREEG);
967− set_u32(brightness, ACER_CAP_BRIGHTNESS);
989+ if (brightness >= 0)
990+ set_u32(brightness, ACER_CAP_BRIGHTNESS);
968991 }
969992
970993 /*
@@ -1081,7 +1104,7 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device) · 110 unmodified lines
10811104 return AE_ERROR;
10821105 }
10831106 if (obj->buffer.length != 8) {
1084− pr_warning("Unknown buffer length %d\n", obj->buffer.length);
1107+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
10851108 kfree(obj);
10861109 return AE_ERROR;
10871110 }
@@ -1090,8 +1113,8 @@ static acpi_status wmid3_get_device_status(u32 *value, u16 device) · 2 unmodified lines
10901113 kfree(obj);
10911114
10921115 if (return_value.error_code || return_value.ec_return_value)
1093− pr_warning("Get Device Status failed: "
1094− "0x%x - 0x%x\n", return_value.error_code,
1116+ pr_warn("Get Device Status failed: 0x%x - 0x%x\n",
1117+ return_value.error_code,
10951118 return_value.ec_return_value);
10961119 else
10971120 *value = !!(return_value.devices & device);
@@ -1124,6 +1147,114 @@ static acpi_status get_device_status(u32 *value, u32 cap) · 26 unmodified lines
11241147 }
11251148 }
11261149
1150+static acpi_status wmid3_set_device_status(u32 value, u16 device)
1151+{
1152+ struct wmid3_gds_return_value return_value;
1153+ acpi_status status;
1154+ union acpi_object *obj;
1155+ u16 devices;
1156+ struct wmid3_gds_input_param params = {
1157+ .function_num = 0x1,
1158+ .hotkey_number = 0x01,
1159+ .devices = ACER_WMID3_GDS_WIRELESS &
1160+ ACER_WMID3_GDS_THREEG &
1161+ ACER_WMID3_GDS_WIMAX &
1162+ ACER_WMID3_GDS_BLUETOOTH,
1163+ };
1164+ struct acpi_buffer input = {
1165+ sizeof(struct wmid3_gds_input_param),
1166+ &params
1167+ };
1168+ struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL };
1169+ struct acpi_buffer output2 = { ACPI_ALLOCATE_BUFFER, NULL };
1170+
1171+ status = wmi_evaluate_method(WMID_GUID3, 0, 0x2, &input, &output);
1172+ if (ACPI_FAILURE(status))
1173+ return status;
1174+
1175+ obj = output.pointer;
1176+
1177+ if (!obj)
1178+ return AE_ERROR;
1179+ else if (obj->type != ACPI_TYPE_BUFFER) {
1180+ kfree(obj);
1181+ return AE_ERROR;
1182+ }
1183+ if (obj->buffer.length != 8) {
1184+ pr_warning("Unknown buffer length %d\n", obj->buffer.length);
1185+ kfree(obj);
1186+ return AE_ERROR;
1187+ }
1188+
1189+ return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer);
1190+ kfree(obj);
1191+
1192+ if (return_value.error_code || return_value.ec_return_value) {
1193+ pr_warning("Get Current Device Status failed: "
1194+ "0x%x - 0x%x\n", return_value.error_code,
1195+ return_value.ec_return_value);
1196+ return status;
1197+ }
1198+
1199+ devices = return_value.devices;
1200+ params.function_num = 0x2;
1201+ params.hotkey_number = 0x01;
1202+ params.devices = (value) ? (devices | device) : (devices & ~device);
1203+
1204+ status = wmi_evaluate_method(WMID_GUID3, 0, 0x1, &input, &output2);
1205+ if (ACPI_FAILURE(status))
1206+ return status;
1207+
1208+ obj = output2.pointer;
1209+
1210+ if (!obj)
1211+ return AE_ERROR;
1212+ else if (obj->type != ACPI_TYPE_BUFFER) {
1213+ kfree(obj);
1214+ return AE_ERROR;
1215+ }
1216+ if (obj->buffer.length != 4) {
1217+ pr_warning("Unknown buffer length %d\n", obj->buffer.length);
1218+ kfree(obj);
1219+ return AE_ERROR;
1220+ }
1221+
1222+ return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer);
1223+ kfree(obj);
1224+
1225+ if (return_value.error_code || return_value.ec_return_value)
1226+ pr_warning("Set Device Status failed: "
1227+ "0x%x - 0x%x\n", return_value.error_code,
1228+ return_value.ec_return_value);
1229+
1230+ return status;
1231+}
1232+
1233+static acpi_status set_device_status(u32 value, u32 cap)
1234+{
1235+ if (wmi_has_guid(WMID_GUID3)) {
1236+ u16 device;
1237+
1238+ switch (cap) {
1239+ case ACER_CAP_WIRELESS:
1240+ device = ACER_WMID3_GDS_WIRELESS;
1241+ break;
1242+ case ACER_CAP_BLUETOOTH:
1243+ device = ACER_WMID3_GDS_BLUETOOTH;
1244+ break;
1245+ case ACER_CAP_THREEG:
1246+ device = ACER_WMID3_GDS_THREEG;
1247+ break;
1248+ default:
1249+ return AE_ERROR;
1250+ }
1251+ return wmid3_set_device_status(value, device);
1252+
1253+ } else {
1254+ return set_u32(value, cap);
1255+ }
1256+}
1257+
11271258 /*
11281259 * Rfkill devices
11291260 */
@@ -1160,7 +1291,7 @@ static int acer_rfkill_set(void *data, bool blocked) · 30 unmodified lines
11601291 u32 cap = (unsigned long)data;
11611292
11621293 if (rfkill_inited) {
1163− status = set_u32(!blocked, cap);
1294+ status = set_device_status(!blocked, cap);
11641295 if (ACPI_FAILURE(status))
11651296 return -ENODEV;
11661297 }
@@ -1317,7 +1448,7 @@ static void acer_wmi_notify(u32 value, void *context) · 150 unmodified lines
13171448
13181449 status = wmi_get_event_data(value, &response);
13191450 if (status != AE_OK) {
1320− pr_warning("bad event status 0x%x\n", status);
1451+ pr_warn("bad event status 0x%x\n", status);
13211452 return;
13221453 }
13231454
@@ -1326,12 +1457,12 @@ static void acer_wmi_notify(u32 value, void *context) · 2 unmodified lines
13261457 if (!obj)
13271458 return;
13281459 if (obj->type != ACPI_TYPE_BUFFER) {
1329− pr_warning("Unknown response received %d\n", obj->type);
1460+ pr_warn("Unknown response received %d\n", obj->type);
13301461 kfree(obj);
13311462 return;
13321463 }
13331464 if (obj->buffer.length != 8) {
1334− pr_warning("Unknown buffer length %d\n", obj->buffer.length);
1465+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
13351466 kfree(obj);
13361467 return;
13371468 }
@@ -1343,7 +1474,7 @@ static void acer_wmi_notify(u32 value, void *context) · 5 unmodified lines
13431474 case WMID_HOTKEY_EVENT:
13441475 if (return_value.device_state) {
13451476 u16 device_state = return_value.device_state;
1346− pr_debug("deivces states: 0x%x\n", device_state);
1477+ pr_debug("device state: 0x%x\n", device_state);
13471478 if (has_cap(ACER_CAP_WIRELESS))
13481479 rfkill_set_sw_state(wireless_rfkill,
13491480 !(device_state & ACER_WMID3_GDS_WIRELESS));
@@ -1356,11 +1487,11 @@ static void acer_wmi_notify(u32 value, void *context) · 6 unmodified lines
13561487 }
13571488 if (!sparse_keymap_report_event(acer_wmi_input_dev,
13581489 return_value.key_num, 1, true))
1359− pr_warning("Unknown key number - 0x%x\n",
1490+ pr_warn("Unknown key number - 0x%x\n",
13601491 return_value.key_num);
13611492 break;
13621493 default:
1363− pr_warning("Unknown function number - %d - %d\n",
1494+ pr_warn("Unknown function number - %d - %d\n",
13641495 return_value.function, return_value.key_num);
13651496 break;
13661497 }
@@ -1389,7 +1520,7 @@ wmid3_set_lm_mode(struct lm_input_params *params, · 22 unmodified lines
13891520 return AE_ERROR;
13901521 }
13911522 if (obj->buffer.length != 4) {
1392− pr_warning("Unknown buffer length %d\n", obj->buffer.length);
1523+ pr_warn("Unknown buffer length %d\n", obj->buffer.length);
13931524 kfree(obj);
13941525 return AE_ERROR;
13951526 }
@@ -1414,11 +1545,11 @@ static int acer_wmi_enable_ec_raw(void) · 18 unmodified lines
14141545 status = wmid3_set_lm_mode(&params, &return_value);
14151546
14161547 if (return_value.error_code || return_value.ec_return_value)
1417− pr_warning("Enabling EC raw mode failed: "
1418− "0x%x - 0x%x\n", return_value.error_code,
1419− return_value.ec_return_value);
1548+ pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n",
1549+ return_value.error_code,
1550+ return_value.ec_return_value);
14201551 else
1421− pr_info("Enabled EC raw mode");
1552+ pr_info("Enabled EC raw mode\n");
14221553
14231554 return status;
14241555 }
@@ -1437,9 +1568,9 @@ static int acer_wmi_enable_lm(void) · 12 unmodified lines
14371568 status = wmid3_set_lm_mode(&params, &return_value);
14381569
14391570 if (return_value.error_code || return_value.ec_return_value)
1440− pr_warning("Enabling Launch Manager failed: "
1441− "0x%x - 0x%x\n", return_value.error_code,
1442− return_value.ec_return_value);
1571+ pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n",
1572+ return_value.error_code,
1573+ return_value.ec_return_value);
14431574
14441575 return status;
14451576 }
@@ -1506,8 +1637,11 @@ static u32 get_wmid_devices(void) · 60 unmodified lines
15061637
15071638 obj = (union acpi_object *) out.pointer;
15081639 if (obj && obj->type == ACPI_TYPE_BUFFER &&
1509− obj->buffer.length == sizeof(u32)) {
1640+ (obj->buffer.length == sizeof(u32) ||
1641+ obj->buffer.length == sizeof(u64))) {
15101642 devices = *((u32 *) obj->buffer.pointer);
1643+ } else if (obj->type == ACPI_TYPE_INTEGER) {
1644+ devices = (u32) obj->integer.value;
15111645 }
15121646
15131647 kfree(out.pointer);
drivers/platform/x86/acerhdf.c+1−3
@@ -35,10 +35,8 @@ · 34 unmodified lines
3535
3636 #include <linux/kernel.h>
3737 #include <linux/module.h>
38−#include <linux/fs.h>
3938 #include <linux/dmi.h>
40−#include <acpi/acpi_drivers.h>
41−#include <linux/sched.h>
39+#include <linux/acpi.h>
4240 #include <linux/thermal.h>
4341 #include <linux/platform_device.h>
4442
drivers/platform/x86/asus-laptop.c+17−17
@@ -318,7 +318,7 @@ static int acpi_check_handle(acpi_handle handle, const char *method, · 317 unmodified lines
318318
319319 if (status != AE_OK) {
320320 if (ret)
321− pr_warning("Error finding %s\n", method);
321+ pr_warn("Error finding %s\n", method);
322322 return -ENODEV;
323323 }
324324 return 0;
@@ -383,7 +383,7 @@ static int asus_kled_lvl(struct asus_laptop *asus) · 58 unmodified lines
383383 rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET,
384384 &params, &kblv);
385385 if (ACPI_FAILURE(rv)) {
386− pr_warning("Error reading kled level\n");
386+ pr_warn("Error reading kled level\n");
387387 return -ENODEV;
388388 }
389389 return kblv;
@@ -397,7 +397,7 @@ static int asus_kled_set(struct asus_laptop *asus, int kblv) · 7 unmodified lines
397397 kblv = 0;
398398
399399 if (write_acpi_int(asus->handle, METHOD_KBD_LIGHT_SET, kblv)) {
400− pr_warning("Keyboard LED display write failed\n");
400+ pr_warn("Keyboard LED display write failed\n");
401401 return -EINVAL;
402402 }
403403 return 0;
@@ -531,7 +531,7 @@ static int asus_read_brightness(struct backlight_device *bd) · 127 unmodified lines
531531 rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET,
532532 NULL, &value);
533533 if (ACPI_FAILURE(rv))
534− pr_warning("Error reading brightness\n");
534+ pr_warn("Error reading brightness\n");
535535
536536 return value;
537537 }
@@ -541,7 +541,7 @@ static int asus_set_brightness(struct backlight_device *bd, int value) · 3 unmodified lines
541541 struct asus_laptop *asus = bl_get_data(bd);
542542
543543 if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) {
544− pr_warning("Error changing brightness\n");
544+ pr_warn("Error changing brightness\n");
545545 return -EIO;
546546 }
547547 return 0;
@@ -730,7 +730,7 @@ static ssize_t store_ledd(struct device *dev, struct device_attribute *attr, · 182 unmodified lines
730730 rv = parse_arg(buf, count, &value);
731731 if (rv > 0) {
732732 if (write_acpi_int(asus->handle, METHOD_LEDD, value)) {
733− pr_warning("LED display write failed\n");
733+ pr_warn("LED display write failed\n");
734734 return -ENODEV;
735735 }
736736 asus->ledd_status = (u32) value;
@@ -752,7 +752,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask) · 15 unmodified lines
752752 rv = acpi_evaluate_integer(asus->handle, METHOD_WL_STATUS,
753753 NULL, &status);
754754 if (ACPI_FAILURE(rv)) {
755− pr_warning("Error reading Wireless status\n");
755+ pr_warn("Error reading Wireless status\n");
756756 return -EINVAL;
757757 }
758758 return !!(status & mask);
@@ -764,7 +764,7 @@ static int asus_wireless_status(struct asus_laptop *asus, int mask) · 5 unmodified lines
764764 static int asus_wlan_set(struct asus_laptop *asus, int status)
765765 {
766766 if (write_acpi_int(asus->handle, METHOD_WLAN, !!status)) {
767− pr_warning("Error setting wlan status to %d", status);
767+ pr_warn("Error setting wlan status to %d\n", status);
768768 return -EIO;
769769 }
770770 return 0;
@@ -792,7 +792,7 @@ static ssize_t store_wlan(struct device *dev, struct device_attribute *attr, · 21 unmodified lines
792792 static int asus_bluetooth_set(struct asus_laptop *asus, int status)
793793 {
794794 if (write_acpi_int(asus->handle, METHOD_BLUETOOTH, !!status)) {
795− pr_warning("Error setting bluetooth status to %d", status);
795+ pr_warn("Error setting bluetooth status to %d\n", status);
796796 return -EIO;
797797 }
798798 return 0;
@@ -821,7 +821,7 @@ static ssize_t store_bluetooth(struct device *dev, · 22 unmodified lines
821821 static int asus_wimax_set(struct asus_laptop *asus, int status)
822822 {
823823 if (write_acpi_int(asus->handle, METHOD_WIMAX, !!status)) {
824− pr_warning("Error setting wimax status to %d", status);
824+ pr_warn("Error setting wimax status to %d\n", status);
825825 return -EIO;
826826 }
827827 return 0;
@@ -850,7 +850,7 @@ static ssize_t store_wimax(struct device *dev, · 22 unmodified lines
850850 static int asus_wwan_set(struct asus_laptop *asus, int status)
851851 {
852852 if (write_acpi_int(asus->handle, METHOD_WWAN, !!status)) {
853− pr_warning("Error setting wwan status to %d", status);
853+ pr_warn("Error setting wwan status to %d\n", status);
854854 return -EIO;
855855 }
856856 return 0;
@@ -880,7 +880,7 @@ static void asus_set_display(struct asus_laptop *asus, int value) · 23 unmodified lines
880880 {
881881 /* no sanity check needed for now */
882882 if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value))
883− pr_warning("Error setting display\n");
883+ pr_warn("Error setting display\n");
884884 return;
885885 }
886886
@@ -909,7 +909,7 @@ static ssize_t store_disp(struct device *dev, struct device_attribute *attr, · 22 unmodified lines
909909 static void asus_als_switch(struct asus_laptop *asus, int value)
910910 {
911911 if (write_acpi_int(asus->handle, METHOD_ALS_CONTROL, value))
912− pr_warning("Error setting light sensor switch\n");
912+ pr_warn("Error setting light sensor switch\n");
913913 asus->light_switch = value;
914914 }
915915
@@ -937,7 +937,7 @@ static ssize_t store_lssw(struct device *dev, struct device_attribute *attr, · 21 unmodified lines
937937 static void asus_als_level(struct asus_laptop *asus, int value)
938938 {
939939 if (write_acpi_int(asus->handle, METHOD_ALS_LEVEL, value))
940− pr_warning("Error setting light sensor level\n");
940+ pr_warn("Error setting light sensor level\n");
941941 asus->light_level = value;
942942 }
943943
@@ -976,7 +976,7 @@ static int asus_gps_status(struct asus_laptop *asus) · 32 unmodified lines
976976 rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS,
977977 NULL, &status);
978978 if (ACPI_FAILURE(rv)) {
979− pr_warning("Error reading GPS status\n");
979+ pr_warn("Error reading GPS status\n");
980980 return -ENODEV;
981981 }
982982 return !!status;
@@ -1284,7 +1284,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus) · 301 unmodified lines
12841284 */
12851285 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus->dsdt_info);
12861286 if (ACPI_FAILURE(status))
1287− pr_warning("Couldn't get the DSDT table header\n");
1287+ pr_warn("Couldn't get the DSDT table header\n");
12881288
12891289 /* We have to write 0 on init this far for all ASUS models */
12901290 if (write_acpi_int_ret(asus->handle, "INIT", 0, &buffer)) {
@@ -1296,7 +1296,7 @@ static int asus_laptop_get_info(struct asus_laptop *asus) · 5 unmodified lines
12961296 status =
12971297 acpi_evaluate_integer(asus->handle, "BSTS", NULL, &bsts_result);
12981298 if (ACPI_FAILURE(status))
1299− pr_warning("Error calling BSTS\n");
1299+ pr_warn("Error calling BSTS\n");
13001300 else if (bsts_result)
13011301 pr_notice("BSTS called, 0x%02x returned\n",
13021302 (uint) bsts_result);
drivers/platform/x86/asus-wmi.c+11−11
@@ -425,7 +425,7 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus) · 424 unmodified lines
425425 if (asus->hotplug_slot) {
426426 bus = pci_find_bus(0, 1);
427427 if (!bus) {
428− pr_warning("Unable to find PCI bus 1?\n");
428+ pr_warn("Unable to find PCI bus 1?\n");
429429 goto out_unlock;
430430 }
431431
@@ -436,12 +436,12 @@ static void asus_rfkill_hotplug(struct asus_wmi *asus) · 4 unmodified lines
436436 absent = (l == 0xffffffff);
437437
438438 if (blocked != absent) {
439− pr_warning("BIOS says wireless lan is %s, "
440− "but the pci device is %s\n",
441− blocked ? "blocked" : "unblocked",
442− absent ? "absent" : "present");
443− pr_warning("skipped wireless hotplug as probably "
444− "inappropriate for this model\n");
439+ pr_warn("BIOS says wireless lan is %s, "
440+ "but the pci device is %s\n",
441+ blocked ? "blocked" : "unblocked",
442+ absent ? "absent" : "present");
443+ pr_warn("skipped wireless hotplug as probably "
444+ "inappropriate for this model\n");
445445 goto out_unlock;
446446 }
447447
@@ -500,7 +500,7 @@ static int asus_register_rfkill_notifier(struct asus_wmi *asus, char *node) · 52 unmodified lines
500500 ACPI_SYSTEM_NOTIFY,
501501 asus_rfkill_notify, asus);
502502 if (ACPI_FAILURE(status))
503− pr_warning("Failed to register notify on %s\n", node);
503+ pr_warn("Failed to register notify on %s\n", node);
504504 } else
505505 return -ENODEV;
506506
@@ -1223,7 +1223,7 @@ static int asus_wmi_sysfs_init(struct platform_device *device) · 716 unmodified lines
12231223 /*
12241224 * Platform device
12251225 */
1226−static int __init asus_wmi_platform_init(struct asus_wmi *asus)
1226+static int asus_wmi_platform_init(struct asus_wmi *asus)
12271227 {
12281228 int rv;
12291229
@@ -1583,12 +1583,12 @@ static int asus_wmi_probe(struct platform_device *pdev) · 353 unmodified lines
15831583 int ret;
15841584
15851585 if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) {
1586− pr_warning("Management GUID not found\n");
1586+ pr_warn("Management GUID not found\n");
15871587 return -ENODEV;
15881588 }
15891589
15901590 if (wdrv->event_guid && !wmi_has_guid(wdrv->event_guid)) {
1591− pr_warning("Event GUID not found\n");
1591+ pr_warn("Event GUID not found\n");
15921592 return -ENODEV;
15931593 }
15941594
drivers/platform/x86/asus_acpi.c+32−45
@@ -30,6 +30,8 @@ · 29 unmodified lines
3030 *
3131 */
3232
33+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
34+
3335 #include <linux/kernel.h>
3436 #include <linux/module.h>
3537 #include <linux/slab.h>
@@ -581,8 +583,7 @@ static int read_led(const char *ledname, int ledmask) · 545 unmodified lines
581583 if (read_acpi_int(NULL, ledname, &led_status))
582584 return led_status;
583585 else
584− printk(KERN_WARNING "Asus ACPI: Error reading LED "
585− "status\n");
586+ pr_warn("Error reading LED status\n");
586587 }
587588 return (hotk->status & ledmask) ? 1 : 0;
588589 }
@@ -621,8 +622,7 @@ write_led(const char __user *buffer, unsigned long count, · 32 unmodified lines
621622 led_out = !led_out;
622623
623624 if (!write_acpi_int(hotk->handle, ledname, led_out, NULL))
624− printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n",
625− ledname);
625+ pr_warn("LED (%s) write failed\n", ledname);
626626
627627 return rv;
628628 }
@@ -679,8 +679,7 @@ static ssize_t ledd_proc_write(struct file *file, const char __user *buffer, · 50 unmodified lines
679679 if (rv > 0) {
680680 if (!write_acpi_int
681681 (hotk->handle, hotk->methods->mt_ledd, value, NULL))
682− printk(KERN_WARNING
683− "Asus ACPI: LED display write failed\n");
682+ pr_warn("LED display write failed\n");
684683 else
685684 hotk->ledd_status = (u32) value;
686685 }
@@ -838,8 +837,7 @@ static int get_lcd_state(void) · 151 unmodified lines
838837 } else {
839838 /* We don't have to check anything if we are here */
840839 if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd))
841− printk(KERN_WARNING
842− "Asus ACPI: Error reading LCD status\n");
840+ pr_warn("Error reading LCD status\n");
843841
844842 if (hotk->model == L2D)
845843 lcd = ~lcd;
@@ -871,7 +869,7 @@ static int set_lcd_state(int value) · 25 unmodified lines
871869 the exact behaviour is simulated here */
872870 }
873871 if (ACPI_FAILURE(status))
874− printk(KERN_WARNING "Asus ACPI: Error switching LCD\n");
872+ pr_warn("Error switching LCD\n");
875873 }
876874 return 0;
877875
@@ -915,13 +913,11 @@ static int read_brightness(struct backlight_device *bd) · 37 unmodified lines
915913 if (hotk->methods->brightness_get) { /* SPLV/GPLV laptop */
916914 if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get,
917915 &value))
918− printk(KERN_WARNING
919− "Asus ACPI: Error reading brightness\n");
916+ pr_warn("Error reading brightness\n");
920917 } else if (hotk->methods->brightness_status) { /* For D1 for example */
921918 if (!read_acpi_int(NULL, hotk->methods->brightness_status,
922919 &value))
923− printk(KERN_WARNING
924− "Asus ACPI: Error reading brightness\n");
920+ pr_warn("Error reading brightness\n");
925921 } else /* No GPLV method */
926922 value = hotk->brightness;
927923 return value;
@@ -939,8 +935,7 @@ static int set_brightness(int value) · 11 unmodified lines
939935 if (hotk->methods->brightness_set) {
940936 if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set,
941937 value, NULL)) {
942− printk(KERN_WARNING
943− "Asus ACPI: Error changing brightness\n");
938+ pr_warn("Error changing brightness\n");
944939 ret = -EIO;
945940 }
946941 goto out;
@@ -955,8 +950,7 @@ static int set_brightness(int value) · 8 unmodified lines
955950 NULL, NULL);
956951 (value > 0) ? value-- : value++;
957952 if (ACPI_FAILURE(status)) {
958− printk(KERN_WARNING
959− "Asus ACPI: Error changing brightness\n");
953+ pr_warn("Error changing brightness\n");
960954 ret = -EIO;
961955 }
962956 }
@@ -1008,7 +1002,7 @@ static void set_display(int value) · 45 unmodified lines
10081002 /* no sanity check needed for now */
10091003 if (!write_acpi_int(hotk->handle, hotk->methods->display_set,
10101004 value, NULL))
1011− printk(KERN_WARNING "Asus ACPI: Error setting display\n");
1005+ pr_warn("Error setting display\n");
10121006 return;
10131007 }
10141008
@@ -1021,8 +1015,7 @@ static int disp_proc_show(struct seq_file *m, void *v) · 6 unmodified lines
10211015 int value = 0;
10221016
10231017 if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value))
1024− printk(KERN_WARNING
1025− "Asus ACPI: Error reading display status\n");
1018+ pr_warn("Error reading display status\n");
10261019 value &= 0x07; /* needed for some models, shouldn't hurt others */
10271020 seq_printf(m, "%d\n", value);
10281021 return 0;
@@ -1068,7 +1061,7 @@ asus_proc_add(char *name, const struct file_operations *proc_fops, mode_t mode, · 39 unmodified lines
10681061 proc = proc_create_data(name, mode, acpi_device_dir(device),
10691062 proc_fops, acpi_driver_data(device));
10701063 if (!proc) {
1071− printk(KERN_WARNING " Unable to create %s fs entry\n", name);
1064+ pr_warn(" Unable to create %s fs entry\n", name);
10721065 return -1;
10731066 }
10741067 proc->uid = asus_uid;
@@ -1085,8 +1078,8 @@ static int asus_hotk_add_fs(struct acpi_device *device) · 10 unmodified lines
10851078 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP;
10861079 } else {
10871080 mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP;
1088− printk(KERN_WARNING " asus_uid and asus_gid parameters are "
1089− "deprecated, use chown and chmod instead!\n");
1081+ pr_warn(" asus_uid and asus_gid parameters are "
1082+ "deprecated, use chown and chmod instead!\n");
10901083 }
10911084
10921085 acpi_device_dir(device) = asus_proc_dir;
@@ -1099,8 +1092,7 @@ static int asus_hotk_add_fs(struct acpi_device *device) · 6 unmodified lines
10991092 proc->uid = asus_uid;
11001093 proc->gid = asus_gid;
11011094 } else {
1102− printk(KERN_WARNING " Unable to create " PROC_INFO
1103− " fs entry\n");
1095+ pr_warn(" Unable to create " PROC_INFO " fs entry\n");
11041096 }
11051097
11061098 if (hotk->methods->mt_wled) {
@@ -1283,20 +1275,19 @@ static int asus_hotk_get_info(void) · 176 unmodified lines
12831275 */
12841276 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info);
12851277 if (ACPI_FAILURE(status))
1286− printk(KERN_WARNING " Couldn't get the DSDT table header\n");
1278+ pr_warn(" Couldn't get the DSDT table header\n");
12871279
12881280 /* We have to write 0 on init this far for all ASUS models */
12891281 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) {
1290− printk(KERN_ERR " Hotkey initialization failed\n");
1282+ pr_err(" Hotkey initialization failed\n");
12911283 return -ENODEV;
12921284 }
12931285
12941286 /* This needs to be called for some laptops to init properly */
12951287 if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result))
1296− printk(KERN_WARNING " Error calling BSTS\n");
1288+ pr_warn(" Error calling BSTS\n");
12971289 else if (bsts_result)
1298− printk(KERN_NOTICE " BSTS called, 0x%02x returned\n",
1299− bsts_result);
1290+ pr_notice(" BSTS called, 0x%02x returned\n", bsts_result);
13001291
13011292 /*
13021293 * Try to match the object returned by INIT to the specific model.
@@ -1324,23 +1315,21 @@ static int asus_hotk_get_info(void) · 21 unmodified lines
13241315 if (asus_info &&
13251316 strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) {
13261317 hotk->model = P30;
1327− printk(KERN_NOTICE
1328− " Samsung P30 detected, supported\n");
1318+ pr_notice(" Samsung P30 detected, supported\n");
13291319 hotk->methods = &model_conf[hotk->model];
13301320 kfree(model);
13311321 return 0;
13321322 } else {
13331323 hotk->model = M2E;
1334− printk(KERN_NOTICE " unsupported model %s, trying "
1335− "default values\n", string);
1336− printk(KERN_NOTICE
1337− " send /proc/acpi/dsdt to the developers\n");
1324+ pr_notice(" unsupported model %s, trying default values\n",
1325+ string);
1326+ pr_notice(" send /proc/acpi/dsdt to the developers\n");
13381327 kfree(model);
13391328 return -ENODEV;
13401329 }
13411330 }
13421331 hotk->methods = &model_conf[hotk->model];
1343− printk(KERN_NOTICE " %s model detected, supported\n", string);
1332+ pr_notice(" %s model detected, supported\n", string);
13441333
13451334 /* Sort of per-model blacklist */
13461335 if (strncmp(string, "L2B", 3) == 0)
@@ -1385,7 +1374,7 @@ static int asus_hotk_check(void) · 38 unmodified lines
13851374 if (hotk->device->status.present) {
13861375 result = asus_hotk_get_info();
13871376 } else {
1388− printk(KERN_ERR " Hotkey device not present, aborting\n");
1377+ pr_err(" Hotkey device not present, aborting\n");
13891378 return -EINVAL;
13901379 }
13911380
@@ -1399,8 +1388,7 @@ static int asus_hotk_add(struct acpi_device *device) · 7 unmodified lines
13991388 acpi_status status = AE_OK;
14001389 int result;
14011390
1402− printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n",
1403− ASUS_ACPI_VERSION);
1391+ pr_notice("Asus Laptop ACPI Extras version %s\n", ASUS_ACPI_VERSION);
14041392
14051393 hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL);
14061394 if (!hotk)
@@ -1428,15 +1416,14 @@ static int asus_hotk_add(struct acpi_device *device) · 21 unmodified lines
14281416 acpi_evaluate_object(NULL, hotk->methods->brightness_down,
14291417 NULL, NULL);
14301418 if (ACPI_FAILURE(status))
1431− printk(KERN_WARNING " Error changing brightness\n");
1419+ pr_warn(" Error changing brightness\n");
14321420 else {
14331421 status =
14341422 acpi_evaluate_object(NULL,
14351423 hotk->methods->brightness_up,
14361424 NULL, NULL);
14371425 if (ACPI_FAILURE(status))
1438− printk(KERN_WARNING " Strange, error changing"
1439− " brightness\n");
1426+ pr_warn(" Strange, error changing brightness\n");
14401427 }
14411428 }
14421429
@@ -1488,7 +1475,7 @@ static int __init asus_acpi_init(void) · 45 unmodified lines
14881475
14891476 asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir);
14901477 if (!asus_proc_dir) {
1491− printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n");
1478+ pr_err("Unable to create /proc entry\n");
14921479 acpi_bus_unregister_driver(&asus_hotk_driver);
14931480 return -ENODEV;
14941481 }
@@ -1513,7 +1500,7 @@ static int __init asus_acpi_init(void) · 18 unmodified lines
15131500 &asus_backlight_data,
15141501 &props);
15151502 if (IS_ERR(asus_backlight_device)) {
1516− printk(KERN_ERR "Could not register asus backlight device\n");
1503+ pr_err("Could not register asus backlight device\n");
15171504 asus_backlight_device = NULL;
15181505 asus_acpi_exit();
15191506 return -ENODEV;
drivers/platform/x86/compal-laptop.c+9−13
@@ -68,6 +68,8 @@ · 67 unmodified lines
6868 * only enabled on a JHL90 board until it is verified that they work on the
6969 * other boards too. See the extra_features variable. */
7070
71+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
72+
7173 #include <linux/module.h>
7274 #include <linux/kernel.h>
7375 #include <linux/init.h>
@@ -760,16 +762,14 @@ static struct rfkill *bt_rfkill; · 686 unmodified lines
760762
761763 static int dmi_check_cb(const struct dmi_system_id *id)
762764 {
763− printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s'\n",
764− id->ident);
765+ pr_info("Identified laptop model '%s'\n", id->ident);
765766 extra_features = false;
766767 return 1;
767768 }
768769
769770 static int dmi_check_cb_extra(const struct dmi_system_id *id)
770771 {
771− printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s', "
772− "enabling extra features\n",
772+ pr_info("Identified laptop model '%s', enabling extra features\n",
773773 id->ident);
774774 extra_features = true;
775775 return 1;
@@ -956,14 +956,12 @@ static int __init compal_init(void) · 180 unmodified lines
956956 int ret;
957957
958958 if (acpi_disabled) {
959− printk(KERN_ERR DRIVER_NAME": ACPI needs to be enabled for "
960− "this driver to work!\n");
959+ pr_err("ACPI needs to be enabled for this driver to work!\n");
961960 return -ENODEV;
962961 }
963962
964963 if (!force && !dmi_check_system(compal_dmi_table)) {
965− printk(KERN_ERR DRIVER_NAME": Motherboard not recognized (You "
966− "could try the module's force-parameter)");
964+ pr_err("Motherboard not recognized (You could try the module's force-parameter)\n");
967965 return -ENODEV;
968966 }
969967
@@ -998,8 +996,7 @@ static int __init compal_init(void) · 28 unmodified lines
998996 if (ret)
999997 goto err_rfkill;
1000998
1001− printk(KERN_INFO DRIVER_NAME": Driver "DRIVER_VERSION
1002− " successfully loaded\n");
999+ pr_info("Driver " DRIVER_VERSION " successfully loaded\n");
10031000 return 0;
10041001
10051002 err_rfkill:
@@ -1064,7 +1061,7 @@ static void __exit compal_cleanup(void) · 58 unmodified lines
10641061 rfkill_destroy(wifi_rfkill);
10651062 rfkill_destroy(bt_rfkill);
10661063
1067− printk(KERN_INFO DRIVER_NAME": Driver unloaded\n");
1064+ pr_info("Driver unloaded\n");
10681065 }
10691066
10701067 static int __devexit compal_remove(struct platform_device *pdev)
@@ -1074,8 +1071,7 @@ static int __devexit compal_remove(struct platform_device *pdev) · 3 unmodified lines
10741071 if (!extra_features)
10751072 return 0;
10761073
1077− printk(KERN_INFO DRIVER_NAME": Unloading: resetting fan control "
1078− "to motherboard\n");
1074+ pr_info("Unloading: resetting fan control to motherboard\n");
10791075 pwm_disable_control();
10801076
10811077 data = platform_get_drvdata(pdev);
drivers/platform/x86/dell-laptop.c+6−6
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 * published by the Free Software Foundation.
1212 */
1313
14+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15+
1416 #include <linux/module.h>
1517 #include <linux/kernel.h>
1618 #include <linux/init.h>
@@ -434,8 +436,7 @@ static int __init dell_setup_rfkill(void) · 417 unmodified lines
434436 int ret;
435437
436438 if (dmi_check_system(dell_blacklist)) {
437− printk(KERN_INFO "dell-laptop: Blacklisted hardware detected - "
438− "not enabling rfkill\n");
439+ pr_info("Blacklisted hardware detected - not enabling rfkill\n");
439440 return 0;
440441 }
441442
@@ -606,7 +607,7 @@ static int __init dell_init(void) · 164 unmodified lines
606607 dmi_walk(find_tokens, NULL);
607608
608609 if (!da_tokens) {
609− printk(KERN_INFO "dell-laptop: Unable to find dmi tokens\n");
610+ pr_info("Unable to find dmi tokens\n");
610611 return -ENODEV;
611612 }
612613
@@ -636,14 +637,13 @@ static int __init dell_init(void) · 23 unmodified lines
636637 ret = dell_setup_rfkill();
637638
638639 if (ret) {
639− printk(KERN_WARNING "dell-laptop: Unable to setup rfkill\n");
640+ pr_warn("Unable to setup rfkill\n");
640641 goto fail_rfkill;
641642 }
642643
643644 ret = i8042_install_filter(dell_laptop_i8042_filter);
644645 if (ret) {
645− printk(KERN_WARNING
646− "dell-laptop: Unable to install key filter\n");
646+ pr_warn("Unable to install key filter\n");
647647 goto fail_filter;
648648 }
649649
drivers/platform/x86/dell-wmi-aio.c+2−1
@@ -15,6 +15,7 @@ · 14 unmodified lines
1515 * along with this program; if not, write to the Free Software
1616 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1717 */
18+
1819 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1920
2021 #include <linux/kernel.h>
@@ -138,7 +139,7 @@ static int __init dell_wmi_aio_init(void) · 117 unmodified lines
138139
139140 guid = dell_wmi_aio_find();
140141 if (!guid) {
141− pr_warning("No known WMI GUID found\n");
142+ pr_warn("No known WMI GUID found\n");
142143 return -ENXIO;
143144 }
144145
drivers/platform/x86/dell-wmi.c+8−9
@@ -23,6 +23,8 @@ · 22 unmodified lines
2323 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2424 */
2525
26+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
27+
2628 #include <linux/kernel.h>
2729 #include <linux/module.h>
2830 #include <linux/init.h>
@@ -141,7 +143,7 @@ static void dell_wmi_notify(u32 value, void *context) · 112 unmodified lines
141143
142144 status = wmi_get_event_data(value, &response);
143145 if (status != AE_OK) {
144− printk(KERN_INFO "dell-wmi: bad event status 0x%x\n", status);
146+ pr_info("bad event status 0x%x\n", status);
145147 return;
146148 }
147149
@@ -153,8 +155,8 @@ static void dell_wmi_notify(u32 value, void *context) · 5 unmodified lines
153155 u16 *buffer_entry = (u16 *)obj->buffer.pointer;
154156
155157 if (dell_new_hk_type && (buffer_entry[1] != 0x10)) {
156− printk(KERN_INFO "dell-wmi: Received unknown WMI event"
157− " (0x%x)\n", buffer_entry[1]);
158+ pr_info("Received unknown WMI event (0x%x)\n",
159+ buffer_entry[1]);
158160 kfree(obj);
159161 return;
160162 }
@@ -167,8 +169,7 @@ static void dell_wmi_notify(u32 value, void *context) · 6 unmodified lines
167169 key = sparse_keymap_entry_from_scancode(dell_wmi_input_dev,
168170 reported_key);
169171 if (!key) {
170− printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n",
171− reported_key);
172+ pr_info("Unknown key %x pressed\n", reported_key);
172173 } else if ((key->keycode == KEY_BRIGHTNESSUP ||
173174 key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) {
174175 /* Don't report brightness notifications that will also
@@ -275,7 +276,7 @@ static int __init dell_wmi_init(void) · 100 unmodified lines
275276 acpi_status status;
276277
277278 if (!wmi_has_guid(DELL_EVENT_GUID)) {
278− printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n");
279+ pr_warn("No known WMI GUID found\n");
279280 return -ENODEV;
280281 }
281282
@@ -290,9 +291,7 @@ static int __init dell_wmi_init(void) · 8 unmodified lines
290291 dell_wmi_notify, NULL);
291292 if (ACPI_FAILURE(status)) {
292293 dell_wmi_input_destroy();
293− printk(KERN_ERR
294− "dell-wmi: Unable to register notify handler - %d\n",
295− status);
294+ pr_err("Unable to register notify handler - %d\n", status);
296295 return -ENODEV;
297296 }
298297
drivers/platform/x86/eeepc-laptop.c+11−10
@@ -228,7 +228,7 @@ static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value) · 227 unmodified lines
228228 return -ENODEV;
229229
230230 if (write_acpi_int(eeepc->handle, method, value))
231− pr_warning("Error writing %s\n", method);
231+ pr_warn("Error writing %s\n", method);
232232 return 0;
233233 }
234234
@@ -243,7 +243,7 @@ static int get_acpi(struct eeepc_laptop *eeepc, int cm) · 8 unmodified lines
243243 return -ENODEV;
244244
245245 if (read_acpi_int(eeepc->handle, method, &value))
246− pr_warning("Error reading %s\n", method);
246+ pr_warn("Error reading %s\n", method);
247247 return value;
248248 }
249249
@@ -261,7 +261,7 @@ static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm, · 11 unmodified lines
261261 status = acpi_get_handle(eeepc->handle, (char *)method,
262262 handle);
263263 if (status != AE_OK) {
264− pr_warning("Error finding %s\n", method);
264+ pr_warn("Error finding %s\n", method);
265265 return -ENODEV;
266266 }
267267 return 0;
@@ -417,7 +417,7 @@ static ssize_t store_cpufv_disabled(struct device *dev, · 149 unmodified lines
417417 switch (value) {
418418 case 0:
419419 if (eeepc->cpufv_disabled)
420− pr_warning("cpufv enabled (not officially supported "
420+ pr_warn("cpufv enabled (not officially supported "
421421 "on this model)\n");
422422 eeepc->cpufv_disabled = false;
423423 return rv;
@@ -609,7 +609,7 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) · 185 unmodified lines
609609 bus = port->subordinate;
610610
611611 if (!bus) {
612− pr_warning("Unable to find PCI bus?\n");
612+ pr_warn("Unable to find PCI bus 1?\n");
613613 goto out_unlock;
614614 }
615615
@@ -621,12 +621,12 @@ static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle) · 5 unmodified lines
621621 absent = (l == 0xffffffff);
622622
623623 if (blocked != absent) {
624− pr_warning("BIOS says wireless lan is %s, "
625− "but the pci device is %s\n",
624+ pr_warn("BIOS says wireless lan is %s, "
625+ "but the pci device is %s\n",
626626 blocked ? "blocked" : "unblocked",
627627 absent ? "absent" : "present");
628− pr_warning("skipped wireless hotplug as probably "
629− "inappropriate for this model\n");
628+ pr_warn("skipped wireless hotplug as probably "
629+ "inappropriate for this model\n");
630630 goto out_unlock;
631631 }
632632
@@ -691,7 +691,8 @@ static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc, · 58 unmodified lines
691691 eeepc_rfkill_notify,
692692 eeepc);
693693 if (ACPI_FAILURE(status))
694− pr_warning("Failed to register notify on %s\n", node);
694+ pr_warn("Failed to register notify on %s\n", node);
695+
695696 /*
696697 * Refresh pci hotplug in case the rfkill state was
697698 * changed during setup.
drivers/platform/x86/eeepc-wmi.c+7−7
@@ -84,7 +84,7 @@ static const struct key_entry eeepc_wmi_keymap[] = { · 83 unmodified lines
8484 static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level,
8585 void *context, void **retval)
8686 {
87− pr_warning("Found legacy ATKD device (%s)", EEEPC_ACPI_HID);
87+ pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID);
8888 *(bool *)context = true;
8989 return AE_CTRL_TERMINATE;
9090 }
@@ -105,12 +105,12 @@ static int eeepc_wmi_check_atkd(void) · 14 unmodified lines
105105 static int eeepc_wmi_probe(struct platform_device *pdev)
106106 {
107107 if (eeepc_wmi_check_atkd()) {
108− pr_warning("WMI device present, but legacy ATKD device is also "
109− "present and enabled.");
110− pr_warning("You probably booted with acpi_osi=\"Linux\" or "
111− "acpi_osi=\"!Windows 2009\"");
112− pr_warning("Can't load eeepc-wmi, use default acpi_osi "
113− "(preferred) or eeepc-laptop");
108+ pr_warn("WMI device present, but legacy ATKD device is also "
109+ "present and enabled\n");
110+ pr_warn("You probably booted with acpi_osi=\"Linux\" or "
111+ "acpi_osi=\"!Windows 2009\"\n");
112+ pr_warn("Can't load eeepc-wmi, use default acpi_osi "
113+ "(preferred) or eeepc-laptop\n");
114114 return -EBUSY;
115115 }
116116 return 0;
drivers/platform/x86/fujitsu-laptop.c+19−20
@@ -56,6 +56,8 @@ · 55 unmodified lines
5656 *
5757 */
5858
59+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
60+
5961 #include <linux/module.h>
6062 #include <linux/kernel.h>
6163 #include <linux/init.h>
@@ -585,8 +587,7 @@ static struct platform_driver fujitsupf_driver = { · 523 unmodified lines
585587 static void dmi_check_cb_common(const struct dmi_system_id *id)
586588 {
587589 acpi_handle handle;
588− printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n",
589− id->ident);
590+ pr_info("Identified laptop model '%s'\n", id->ident);
590591 if (use_alt_lcd_levels == -1) {
591592 if (ACPI_SUCCESS(acpi_get_handle(NULL,
592593 "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle)))
@@ -691,11 +692,11 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 98 unmodified lines
691692
692693 result = acpi_bus_update_power(fujitsu->acpi_handle, &state);
693694 if (result) {
694− printk(KERN_ERR "Error reading power state\n");
695+ pr_err("Error reading power state\n");
695696 goto err_unregister_input_dev;
696697 }
697698
698− printk(KERN_INFO "ACPI: %s [%s] (%s)\n",
699+ pr_info("ACPI: %s [%s] (%s)\n",
699700 acpi_device_name(device), acpi_device_bid(device),
700701 !device->power.state ? "on" : "off");
701702
@@ -707,7 +708,7 @@ static int acpi_fujitsu_add(struct acpi_device *device) · 5 unmodified lines
707708 if (ACPI_FAILURE
708709 (acpi_evaluate_object
709710 (device->handle, METHOD_NAME__INI, NULL, NULL)))
710− printk(KERN_ERR "_INI Method failed\n");
711+ pr_err("_INI Method failed\n");
711712 }
712713
713714 /* do config (detect defaults) */
@@ -827,7 +828,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 113 unmodified lines
827828 error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int),
828829 GFP_KERNEL);
829830 if (error) {
830− printk(KERN_ERR "kfifo_alloc failed\n");
831+ pr_err("kfifo_alloc failed\n");
831832 goto err_stop;
832833 }
833834
@@ -859,13 +860,13 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 25 unmodified lines
859860
860861 result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state);
861862 if (result) {
862− printk(KERN_ERR "Error reading power state\n");
863+ pr_err("Error reading power state\n");
863864 goto err_unregister_input_dev;
864865 }
865866
866− printk(KERN_INFO "ACPI: %s [%s] (%s)\n",
867− acpi_device_name(device), acpi_device_bid(device),
868− !device->power.state ? "on" : "off");
867+ pr_info("ACPI: %s [%s] (%s)\n",
868+ acpi_device_name(device), acpi_device_bid(device),
869+ !device->power.state ? "on" : "off");
869870
870871 fujitsu_hotkey->dev = device;
871872
@@ -875,7 +876,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 3 unmodified lines
875876 if (ACPI_FAILURE
876877 (acpi_evaluate_object
877878 (device->handle, METHOD_NAME__INI, NULL, NULL)))
878− printk(KERN_ERR "_INI Method failed\n");
879+ pr_err("_INI Method failed\n");
879880 }
880881
881882 i = 0;
@@ -897,8 +898,7 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 15 unmodified lines
897898 call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0);
898899
899900 /* Suspect this is a keymap of the application panel, print it */
900− printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n",
901− call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
901+ pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0));
902902
903903 #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE)
904904 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) · 2 unmodified lines
907907 if (result == 0) {
908908 fujitsu_hotkey->logolamp_registered = 1;
909909 } else {
910− printk(KERN_ERR "fujitsu-laptop: Could not register "
911− "LED handler for logo lamp, error %i\n", result);
910+ pr_err("Could not register LED handler for logo lamp, error %i\n",
911+ result);
912912 }
913913 }
914914
@@ -919,8 +919,8 @@ static int acpi_fujitsu_hotkey_add(struct acpi_device *device) · 4 unmodified lines
919919 if (result == 0) {
920920 fujitsu_hotkey->kblamps_registered = 1;
921921 } else {
922− printk(KERN_ERR "fujitsu-laptop: Could not register "
923− "LED handler for keyboard lamps, error %i\n", result);
922+ pr_err("Could not register LED handler for keyboard lamps, error %i\n",
923+ result);
924924 }
925925 }
926926 #endif
@@ -1169,8 +1169,7 @@ static int __init fujitsu_init(void) · 242 unmodified lines
11691169 fujitsu->bl_device->props.power = 0;
11701170 }
11711171
1172− printk(KERN_INFO "fujitsu-laptop: driver " FUJITSU_DRIVER_VERSION
1173− " successfully loaded.\n");
1172+ pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n");
11741173
11751174 return 0;
11761175
@@ -1216,7 +1215,7 @@ static void __exit fujitsu_cleanup(void) · 39 unmodified lines
12161215
12171216 kfree(fujitsu);
12181217
1219− printk(KERN_INFO "fujitsu-laptop: driver unloaded.\n");
1218+ pr_info("driver unloaded\n");
12201219 }
12211220
12221221 module_init(fujitsu_init);
drivers/platform/x86/hdaps.c+10−9
@@ -26,6 +26,8 @@ · 25 unmodified lines
2626 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
2727 */
2828
29+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
30+
2931 #include <linux/delay.h>
3032 #include <linux/platform_device.h>
3133 #include <linux/input-polldev.h>
@@ -238,7 +240,7 @@ static int hdaps_device_init(void) · 206 unmodified lines
238240 __check_latch(0x1611, 0x01))
239241 goto out;
240242
241− printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x).\n",
243+ printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x)\n",
242244 __get_latch(0x1611));
243245
244246 outb(0x17, 0x1610);
@@ -299,7 +301,7 @@ static int hdaps_probe(struct platform_device *dev) · 54 unmodified lines
299301 if (ret)
300302 return ret;
301303
302− printk(KERN_INFO "hdaps: device successfully initialized.\n");
304+ pr_info("device successfully initialized\n");
303305 return 0;
304306 }
305307
@@ -480,7 +482,7 @@ static struct attribute_group hdaps_attribute_group = { · 174 unmodified lines
480482 /* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */
481483 static int __init hdaps_dmi_match(const struct dmi_system_id *id)
482484 {
483− printk(KERN_INFO "hdaps: %s detected.\n", id->ident);
485+ pr_info("%s detected\n", id->ident);
484486 return 1;
485487 }
486488
@@ -488,8 +490,7 @@ static int __init hdaps_dmi_match(const struct dmi_system_id *id) · 1 unmodified line
488490 static int __init hdaps_dmi_match_invert(const struct dmi_system_id *id)
489491 {
490492 hdaps_invert = (unsigned long)id->driver_data;
491− printk(KERN_INFO "hdaps: inverting axis (%u) readings.\n",
492− hdaps_invert);
493+ pr_info("inverting axis (%u) readings\n", hdaps_invert);
493494 return hdaps_dmi_match(id);
494495 }
495496
@@ -543,7 +544,7 @@ static int __init hdaps_init(void) · 47 unmodified lines
543544 int ret;
544545
545546 if (!dmi_check_system(hdaps_whitelist)) {
546− printk(KERN_WARNING "hdaps: supported laptop not found!\n");
547+ pr_warn("supported laptop not found!\n");
547548 ret = -ENODEV;
548549 goto out;
549550 }
@@ -595,7 +596,7 @@ static int __init hdaps_init(void) · 45 unmodified lines
595596 if (ret)
596597 goto out_idev;
597598
598− printk(KERN_INFO "hdaps: driver successfully loaded.\n");
599+ pr_info("driver successfully loaded\n");
599600 return 0;
600601
601602 out_idev:
@@ -609,7 +610,7 @@ out_driver: · 7 unmodified lines
609610 out_region:
610611 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
611612 out:
612− printk(KERN_WARNING "hdaps: driver init failed (ret=%d)!\n", ret);
613+ pr_warn("driver init failed (ret=%d)!\n", ret);
613614 return ret;
614615 }
615616
@@ -622,7 +623,7 @@ static void __exit hdaps_exit(void) · 6 unmodified lines
622623 platform_driver_unregister(&hdaps_driver);
623624 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS);
624625
625− printk(KERN_INFO "hdaps: driver unloaded.\n");
626+ pr_info("driver unloaded\n");
626627 }
627628
628629 module_init(hdaps_init);
drivers/platform/x86/hp-wmi.c+17−26
@@ -24,6 +24,8 @@ · 23 unmodified lines
2424 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2525 */
2626
27+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
28+
2729 #include <linux/kernel.h>
2830 #include <linux/module.h>
2931 #include <linux/init.h>
@@ -54,9 +56,6 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); · 24 unmodified lines
5456 #define HPWMI_HOTKEY_QUERY 0xc
5557 #define HPWMI_WIRELESS2_QUERY 0x1b
5658
57−#define PREFIX "HP WMI: "
58−#define UNIMP "Unimplemented "
59−
6059 enum hp_wmi_radio {
6160 HPWMI_WIFI = 0,
6261 HPWMI_BLUETOOTH = 1,
@@ -228,9 +227,8 @@ static int hp_wmi_perform_query(int query, int write, void *buffer, · 165 unmodified lines
228227
229228 if (bios_return->return_code) {
230229 if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE)
231− printk(KERN_WARNING PREFIX "query 0x%x returned "
232− "error 0x%x\n",
233− query, bios_return->return_code);
230+ pr_warn("query 0x%x returned error 0x%x\n",
231+ query, bios_return->return_code);
234232 kfree(obj);
235233 return bios_return->return_code;
236234 }
@@ -384,8 +382,7 @@ static int hp_wmi_rfkill2_refresh(void) · 147 unmodified lines
384382
385383 if (num >= state.count ||
386384 devstate->rfkill_id != rfkill2[i].id) {
387− printk(KERN_WARNING PREFIX "power configuration of "
388− "the wireless devices unexpectedly changed\n");
385+ pr_warn("power configuration of the wireless devices unexpectedly changed\n");
389386 continue;
390387 }
391388
@@ -471,7 +468,7 @@ static void hp_wmi_notify(u32 value, void *context) · 79 unmodified lines
471468
472469 status = wmi_get_event_data(value, &response);
473470 if (status != AE_OK) {
474− printk(KERN_INFO PREFIX "bad event status 0x%x\n", status);
471+ pr_info("bad event status 0x%x\n", status);
475472 return;
476473 }
477474
@@ -480,8 +477,7 @@ static void hp_wmi_notify(u32 value, void *context) · 2 unmodified lines
480477 if (!obj)
481478 return;
482479 if (obj->type != ACPI_TYPE_BUFFER) {
483− printk(KERN_INFO "hp-wmi: Unknown response received %d\n",
484− obj->type);
480+ pr_info("Unknown response received %d\n", obj->type);
485481 kfree(obj);
486482 return;
487483 }
@@ -498,8 +494,7 @@ static void hp_wmi_notify(u32 value, void *context) · 10 unmodified lines
498494 event_id = *location;
499495 event_data = *(location + 2);
500496 } else {
501− printk(KERN_INFO "hp-wmi: Unknown buffer length %d\n",
502− obj->buffer.length);
497+ pr_info("Unknown buffer length %d\n", obj->buffer.length);
503498 kfree(obj);
504499 return;
505500 }
@@ -527,8 +522,7 @@ static void hp_wmi_notify(u32 value, void *context) · 21 unmodified lines
527522
528523 if (!sparse_keymap_report_event(hp_wmi_input_dev,
529524 key_code, 1, true))
530− printk(KERN_INFO PREFIX "Unknown key code - 0x%x\n",
531− key_code);
525+ pr_info("Unknown key code - 0x%x\n", key_code);
532526 break;
533527 case HPWMI_WIRELESS:
534528 if (rfkill2_count) {
@@ -550,14 +544,12 @@ static void hp_wmi_notify(u32 value, void *context) · 15 unmodified lines
550544 hp_wmi_get_hw_state(HPWMI_WWAN));
551545 break;
552546 case HPWMI_CPU_BATTERY_THROTTLE:
553− printk(KERN_INFO PREFIX UNIMP "CPU throttle because of 3 Cell"
554− " battery event detected\n");
547+ pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n");
555548 break;
556549 case HPWMI_LOCK_SWITCH:
557550 break;
558551 default:
559− printk(KERN_INFO PREFIX "Unknown event_id - %d - 0x%x\n",
560− event_id, event_data);
552+ pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data);
561553 break;
562554 }
563555 }
@@ -705,7 +697,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) · 141 unmodified lines
705697 return err;
706698
707699 if (state.count > HPWMI_MAX_RFKILL2_DEVICES) {
708− printk(KERN_WARNING PREFIX "unable to parse 0x1b query output\n");
700+ pr_warn("unable to parse 0x1b query output\n");
709701 return -EINVAL;
710702 }
711703
@@ -727,14 +719,14 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) · 15 unmodified lines
727719 name = "hp-wwan";
728720 break;
729721 default:
730− printk(KERN_WARNING PREFIX "unknown device type 0x%x\n",
731− state.device[i].radio_type);
722+ pr_warn("unknown device type 0x%x\n",
723+ state.device[i].radio_type);
732724 continue;
733725 }
734726
735727 if (!state.device[i].vendor_id) {
736− printk(KERN_WARNING PREFIX "zero device %d while %d "
737− "reported\n", i, state.count);
728+ pr_warn("zero device %d while %d reported\n",
729+ i, state.count);
738730 continue;
739731 }
740732
@@ -755,8 +747,7 @@ static int __devinit hp_wmi_rfkill2_setup(struct platform_device *device) · 14 unmodified lines
755747 IS_HWBLOCKED(state.device[i].power));
756748
757749 if (!(state.device[i].power & HPWMI_POWER_BIOS))
758− printk(KERN_INFO PREFIX "device %s blocked by BIOS\n",
759− name);
750+ pr_info("device %s blocked by BIOS\n", name);
760751
761752 err = rfkill_register(rfkill);
762753 if (err) {
drivers/platform/x86/ibm_rtl.c+13−10
@@ -22,6 +22,8 @@ · 21 unmodified lines
2222 *
2323 */
2424
25+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
26+
2527 #include <linux/kernel.h>
2628 #include <linux/delay.h>
2729 #include <linux/module.h>
@@ -69,9 +71,10 @@ struct ibm_rtl_table { · 41 unmodified lines
6971 #define RTL_SIGNATURE 0x0000005f4c54525fULL
7072 #define RTL_MASK 0x000000ffffffffffULL
7173
72−#define RTL_DEBUG(A, ...) do { \
73− if (debug) \
74− pr_info("ibm-rtl: " A, ##__VA_ARGS__ ); \
74+#define RTL_DEBUG(fmt, ...) \
75+do { \
76+ if (debug) \
77+ pr_info(fmt, ##__VA_ARGS__); \
7578 } while (0)
7679
7780 static DEFINE_MUTEX(rtl_lock);
@@ -114,7 +117,7 @@ static int ibm_rtl_write(u8 value) · 36 unmodified lines
114117 int ret = 0, count = 0;
115118 static u32 cmd_port_val;
116119
117− RTL_DEBUG("%s(%d)\n", __FUNCTION__, value);
120+ RTL_DEBUG("%s(%d)\n", __func__, value);
118121
119122 value = value == 1 ? RTL_CMD_ENTER_PRTM : RTL_CMD_EXIT_PRTM;
120123
@@ -144,8 +147,8 @@ static int ibm_rtl_write(u8 value) · 23 unmodified lines
144147 while (ioread8(&rtl_table->command)) {
145148 msleep(10);
146149 if (count++ > 500) {
147− pr_err("ibm-rtl: Hardware not responding to "
148− "mode switch request\n");
150+ pr_err("Hardware not responding to "
151+ "mode switch request\n");
149152 ret = -EIO;
150153 break;
151154 }
@@ -250,7 +253,7 @@ static int __init ibm_rtl_init(void) { · 98 unmodified lines
250253 int ret = -ENODEV, i;
251254
252255 if (force)
253− pr_warning("ibm-rtl: module loaded by force\n");
256+ pr_warn("module loaded by force\n");
254257 /* first ensure that we are running on IBM HW */
255258 else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table))
256259 return -ENODEV;
@@ -288,19 +291,19 @@ static int __init ibm_rtl_init(void) { · 31 unmodified lines
288291 if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) {
289292 phys_addr_t addr;
290293 unsigned int plen;
291− RTL_DEBUG("found RTL_SIGNATURE at %#llx\n", (u64)tmp);
294+ RTL_DEBUG("found RTL_SIGNATURE at %p\n", tmp);
292295 rtl_table = tmp;
293296 /* The address, value, width and offset are platform
294297 * dependent and found in the ibm_rtl_table */
295298 rtl_cmd_width = ioread8(&rtl_table->cmd_granularity);
296299 rtl_cmd_type = ioread8(&rtl_table->cmd_address_type);
297300 RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n",
298− rtl_cmd_width, rtl_cmd_type);
301+ rtl_cmd_width, rtl_cmd_type);
299302 addr = ioread32(&rtl_table->cmd_port_address);
300303 RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr);
301304 plen = rtl_cmd_width/sizeof(char);
302305 rtl_cmd_addr = rtl_port_map(addr, plen);
303− RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr);
306+ RTL_DEBUG("rtl_cmd_addr = %p\n", rtl_cmd_addr);
304307 if (!rtl_cmd_addr) {
305308 ret = -ENOMEM;
306309 break;
drivers/platform/x86/ideapad-laptop.c+2−0
@@ -20,6 +20,8 @@ · 19 unmodified lines
2020 * 02110-1301, USA.
2121 */
2222
23+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
24+
2325 #include <linux/kernel.h>
2426 #include <linux/module.h>
2527 #include <linux/init.h>
drivers/platform/x86/intel_menlow.c+3−2
@@ -27,6 +27,8 @@ · 26 unmodified lines
2727 * to get/set bandwidth.
2828 */
2929
30+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
31+
3032 #include <linux/kernel.h>
3133 #include <linux/module.h>
3234 #include <linux/init.h>
@@ -135,8 +137,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev, · 102 unmodified lines
135137 acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list,
136138 &temp);
137139
138− printk(KERN_INFO
139− "Bandwidth value was %ld: status is %d\n", state, status);
140+ pr_info("Bandwidth value was %ld: status is %d\n", state, status);
140141 if (ACPI_FAILURE(status))
141142 return -EFAULT;
142143
drivers/platform/x86/intel_mid_powerbtn.c+30−42
@@ -23,58 +23,48 @@ · 22 unmodified lines
2323 #include <linux/slab.h>
2424 #include <linux/platform_device.h>
2525 #include <linux/input.h>
26+
2627 #include <asm/intel_scu_ipc.h>
2728
2829 #define DRIVER_NAME "msic_power_btn"
2930
30−#define MSIC_IRQ_STAT 0x02
31− #define MSIC_IRQ_PB (1 << 0)
32−#define MSIC_PB_CONFIG 0x3e
3331 #define MSIC_PB_STATUS 0x3f
34− #define MSIC_PB_LEVEL (1 << 3) /* 1 - release, 0 - press */
35−
36−struct mfld_pb_priv {
37− struct input_dev *input;
38− unsigned int irq;
39−};
32+#define MSIC_PB_LEVEL (1 << 3) /* 1 - release, 0 - press */
4033
4134 static irqreturn_t mfld_pb_isr(int irq, void *dev_id)
4235 {
43− struct mfld_pb_priv *priv = dev_id;
36+ struct input_dev *input = dev_id;
4437 int ret;
4538 u8 pbstat;
4639
4740 ret = intel_scu_ipc_ioread8(MSIC_PB_STATUS, &pbstat);
48− if (ret < 0)
49− return IRQ_HANDLED;
50−
51− input_event(priv->input, EV_KEY, KEY_POWER, !(pbstat & MSIC_PB_LEVEL));
52− input_sync(priv->input);
41+ if (ret < 0) {
42+ dev_err(input->dev.parent, "Read error %d while reading"
43+ " MSIC_PB_STATUS\n", ret);
44+ } else {
45+ input_event(input, EV_KEY, KEY_POWER,
46+ !(pbstat & MSIC_PB_LEVEL));
47+ input_sync(input);
48+ }
5349
5450 return IRQ_HANDLED;
5551 }
5652
5753 static int __devinit mfld_pb_probe(struct platform_device *pdev)
5854 {
59− struct mfld_pb_priv *priv;
6055 struct input_dev *input;
61− int irq;
56+ int irq = platform_get_irq(pdev, 0);
6257 int error;
6358
64− irq = platform_get_irq(pdev, 0);
6559 if (irq < 0)
6660 return -EINVAL;
6761
68− priv = kzalloc(sizeof(struct mfld_pb_priv), GFP_KERNEL);
6962 input = input_allocate_device();
70− if (!priv || !input) {
71− error = -ENOMEM;
72− goto err_free_mem;
63+ if (!input) {
64+ dev_err(&pdev->dev, "Input device allocation error\n");
65+ return -ENOMEM;
7366 }
7467
75− priv->input = input;
76− priv->irq = irq;
77−
7868 input->name = pdev->name;
7969 input->phys = "power-button/input0";
8070 input->id.bustype = BUS_HOST;
@@ -82,42 +72,40 @@ static int __devinit mfld_pb_probe(struct platform_device *pdev) · 1 unmodified line
8272
8373 input_set_capability(input, EV_KEY, KEY_POWER);
8474
85− error = request_threaded_irq(priv->irq, NULL, mfld_pb_isr,
86− 0, DRIVER_NAME, priv);
75+ error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0,
76+ DRIVER_NAME, input);
8777 if (error) {
88− dev_err(&pdev->dev,
89− "unable to request irq %d for mfld power button\n",
90− irq);
91− goto err_free_mem;
78+ dev_err(&pdev->dev, "Unable to request irq %d for mfld power"
79+ "button\n", irq);
80+ goto err_free_input;
9281 }
9382
9483 error = input_register_device(input);
9584 if (error) {
96− dev_err(&pdev->dev,
97− "unable to register input dev, error %d\n", error);
85+ dev_err(&pdev->dev, "Unable to register input dev, error "
86+ "%d\n", error);
9887 goto err_free_irq;
9988 }
10089
101− platform_set_drvdata(pdev, priv);
90+ platform_set_drvdata(pdev, input);
10291 return 0;
10392
10493 err_free_irq:
105− free_irq(priv->irq, priv);
106−err_free_mem:
94+ free_irq(irq, input);
95+err_free_input:
10796 input_free_device(input);
108− kfree(priv);
10997 return error;
11098 }
11199
112100 static int __devexit mfld_pb_remove(struct platform_device *pdev)
113101 {
114− struct mfld_pb_priv *priv = platform_get_drvdata(pdev);
115−
116− free_irq(priv->irq, priv);
117− input_unregister_device(priv->input);
118− kfree(priv);
102+ struct input_dev *input = platform_get_drvdata(pdev);
103+ int irq = platform_get_irq(pdev, 0);
119104
105+ free_irq(irq, input);
106+ input_unregister_device(input);
120107 platform_set_drvdata(pdev, NULL);
108+
121109 return 0;
122110 }
123111
drivers/platform/x86/intel_mid_thermal.c+301−306
@@ -37,49 +37,50 @@ · 36 unmodified lines
3737 #include <asm/intel_scu_ipc.h>
3838
3939 /* Number of thermal sensors */
40−#define MSIC_THERMAL_SENSORS 4
40+#define MSIC_THERMAL_SENSORS 4
4141
4242 /* ADC1 - thermal registers */
43−#define MSIC_THERM_ADC1CNTL1 0x1C0
44−#define MSIC_ADC_ENBL 0x10
45−#define MSIC_ADC_START 0x08
43+#define MSIC_THERM_ADC1CNTL1 0x1C0
44+#define MSIC_ADC_ENBL 0x10
45+#define MSIC_ADC_START 0x08
4646
47−#define MSIC_THERM_ADC1CNTL3 0x1C2
48−#define MSIC_ADCTHERM_ENBL 0x04
49−#define MSIC_ADCRRDATA_ENBL 0x05
50−#define MSIC_CHANL_MASK_VAL 0x0F
47+#define MSIC_THERM_ADC1CNTL3 0x1C2
48+#define MSIC_ADCTHERM_ENBL 0x04
49+#define MSIC_ADCRRDATA_ENBL 0x05
50+#define MSIC_CHANL_MASK_VAL 0x0F
5151
52−#define MSIC_STOPBIT_MASK 16
53−#define MSIC_ADCTHERM_MASK 4
54−#define ADC_CHANLS_MAX 15 /* Number of ADC channels */
55−#define ADC_LOOP_MAX (ADC_CHANLS_MAX - MSIC_THERMAL_SENSORS)
52+#define MSIC_STOPBIT_MASK 16
53+#define MSIC_ADCTHERM_MASK 4
54+/* Number of ADC channels */
55+#define ADC_CHANLS_MAX 15
56+#define ADC_LOOP_MAX (ADC_CHANLS_MAX - MSIC_THERMAL_SENSORS)
5657
5758 /* ADC channel code values */
58−#define SKIN_SENSOR0_CODE 0x08
59−#define SKIN_SENSOR1_CODE 0x09
60−#define SYS_SENSOR_CODE 0x0A
61−#define MSIC_DIE_SENSOR_CODE 0x03
59+#define SKIN_SENSOR0_CODE 0x08
60+#define SKIN_SENSOR1_CODE 0x09
61+#define SYS_SENSOR_CODE 0x0A
62+#define MSIC_DIE_SENSOR_CODE 0x03
6263
63−#define SKIN_THERM_SENSOR0 0
64−#define SKIN_THERM_SENSOR1 1
65−#define SYS_THERM_SENSOR2 2
66−#define MSIC_DIE_THERM_SENSOR3 3
64+#define SKIN_THERM_SENSOR0 0
65+#define SKIN_THERM_SENSOR1 1
66+#define SYS_THERM_SENSOR2 2
67+#define MSIC_DIE_THERM_SENSOR3 3
6768
6869 /* ADC code range */
69−#define ADC_MAX 977
70−#define ADC_MIN 162
71−#define ADC_VAL0C 887
72−#define ADC_VAL20C 720
73−#define ADC_VAL40C 508
74−#define ADC_VAL60C 315
70+#define ADC_MAX 977
71+#define ADC_MIN 162
72+#define ADC_VAL0C 887
73+#define ADC_VAL20C 720
74+#define ADC_VAL40C 508
75+#define ADC_VAL60C 315
7576
7677 /* ADC base addresses */
77−#define ADC_CHNL_START_ADDR 0x1C5 /* increments by 1 */
78−#define ADC_DATA_START_ADDR 0x1D4 /* increments by 2 */
78+#define ADC_CHNL_START_ADDR 0x1C5 /* increments by 1 */
79+#define ADC_DATA_START_ADDR 0x1D4 /* increments by 2 */
7980
8081 /* MSIC die attributes */
81−#define MSIC_DIE_ADC_MIN 488
82−#define MSIC_DIE_ADC_MAX 1004
82+#define MSIC_DIE_ADC_MIN 488
83+#define MSIC_DIE_ADC_MAX 1004
8384
8485 /* This holds the address of the first free ADC channel,
8586 * among the 15 channels
@@ -87,15 +88,15 @@ · 1 unmodified line
8788 static int channel_index;
8889
8990 struct platform_info {
90− struct platform_device *pdev;
91− struct thermal_zone_device *tzd[MSIC_THERMAL_SENSORS];
91+ struct platform_device *pdev;
92+ struct thermal_zone_device *tzd[MSIC_THERMAL_SENSORS];
9293 };
9394
9495 struct thermal_device_info {
95− unsigned int chnl_addr;
96− int direct;
97− /* This holds the current temperature in millidegree celsius */
98− long curr_temp;
96+ unsigned int chnl_addr;
97+ int direct;
98+ /* This holds the current temperature in millidegree celsius */
99+ long curr_temp;
99100 };
100101
101102 /**
@@ -106,7 +107,7 @@ struct thermal_device_info { · 4 unmodified lines
106107 */
107108 static int to_msic_die_temp(uint16_t adc_val)
108109 {
109− return (368 * (adc_val) / 1000) - 220;
110+ return (368 * (adc_val) / 1000) - 220;
110111 }
111112
112113 /**
@@ -118,7 +119,7 @@ static int to_msic_die_temp(uint16_t adc_val) · 5 unmodified lines
118119 */
119120 static int is_valid_adc(uint16_t adc_val, uint16_t min, uint16_t max)
120121 {
121− return (adc_val >= min) && (adc_val <= max);
122+ return (adc_val >= min) && (adc_val <= max);
122123 }
123124
124125 /**
@@ -136,35 +137,35 @@ static int is_valid_adc(uint16_t adc_val, uint16_t min, uint16_t max) · 11 unmodified lines
136137 */
137138 static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp)
138139 {
139− int temp;
140−
141− /* Direct conversion for die temperature */
142− if (direct) {
143− if (is_valid_adc(adc_val, MSIC_DIE_ADC_MIN, MSIC_DIE_ADC_MAX)) {
144− *tp = to_msic_die_temp(adc_val) * 1000;
145− return 0;
146− }
147− return -ERANGE;
148− }
149−
150− if (!is_valid_adc(adc_val, ADC_MIN, ADC_MAX))
151− return -ERANGE;
152−
153− /* Linear approximation for skin temperature */
154− if (adc_val > ADC_VAL0C)
155− temp = 177 - (adc_val/5);
156− else if ((adc_val <= ADC_VAL0C) && (adc_val > ADC_VAL20C))
157− temp = 111 - (adc_val/8);
158− else if ((adc_val <= ADC_VAL20C) && (adc_val > ADC_VAL40C))
159− temp = 92 - (adc_val/10);
160− else if ((adc_val <= ADC_VAL40C) && (adc_val > ADC_VAL60C))
161− temp = 91 - (adc_val/10);
162− else
163− temp = 112 - (adc_val/6);
164−
165− /* Convert temperature in celsius to milli degree celsius */
166− *tp = temp * 1000;
167− return 0;
140+ int temp;
141+
142+ /* Direct conversion for die temperature */
143+ if (direct) {
144+ if (is_valid_adc(adc_val, MSIC_DIE_ADC_MIN, MSIC_DIE_ADC_MAX)) {
145+ *tp = to_msic_die_temp(adc_val) * 1000;
146+ return 0;
147+ }
148+ return -ERANGE;
149+ }
150+
151+ if (!is_valid_adc(adc_val, ADC_MIN, ADC_MAX))
152+ return -ERANGE;
153+
154+ /* Linear approximation for skin temperature */
155+ if (adc_val > ADC_VAL0C)
156+ temp = 177 - (adc_val/5);
157+ else if ((adc_val <= ADC_VAL0C) && (adc_val > ADC_VAL20C))
158+ temp = 111 - (adc_val/8);
159+ else if ((adc_val <= ADC_VAL20C) && (adc_val > ADC_VAL40C))
160+ temp = 92 - (adc_val/10);
161+ else if ((adc_val <= ADC_VAL40C) && (adc_val > ADC_VAL60C))
162+ temp = 91 - (adc_val/10);
163+ else
164+ temp = 112 - (adc_val/6);
165+
166+ /* Convert temperature in celsius to milli degree celsius */
167+ *tp = temp * 1000;
168+ return 0;
168169 }
169170
170171 /**
@@ -178,47 +179,47 @@ static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp) · 7 unmodified lines
178179 */
179180 static int mid_read_temp(struct thermal_zone_device *tzd, unsigned long *temp)
180181 {
181− struct thermal_device_info *td_info = tzd->devdata;
182− uint16_t adc_val, addr;
183− uint8_t data = 0;
184− int ret;
185− unsigned long curr_temp;
186−
187−
188− addr = td_info->chnl_addr;
189−
190− /* Enable the msic for conversion before reading */
191− ret = intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL3, MSIC_ADCRRDATA_ENBL);
192− if (ret)
193− return ret;
194−
195− /* Re-toggle the RRDATARD bit (temporary workaround) */
196− ret = intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL3, MSIC_ADCTHERM_ENBL);
197− if (ret)
198− return ret;
199−
200− /* Read the higher bits of data */
201− ret = intel_scu_ipc_ioread8(addr, &data);
202− if (ret)
203− return ret;
204−
205− /* Shift bits to accommodate the lower two data bits */
206− adc_val = (data << 2);
207− addr++;
208−
209− ret = intel_scu_ipc_ioread8(addr, &data);/* Read lower bits */
210− if (ret)
211− return ret;
212−
213− /* Adding lower two bits to the higher bits */
214− data &= 03;
215− adc_val += data;
216−
217− /* Convert ADC value to temperature */
218− ret = adc_to_temp(td_info->direct, adc_val, &curr_temp);
219− if (ret == 0)
220− *temp = td_info->curr_temp = curr_temp;
221− return ret;
182+ struct thermal_device_info *td_info = tzd->devdata;
183+ uint16_t adc_val, addr;
184+ uint8_t data = 0;
185+ int ret;
186+ unsigned long curr_temp;
187+
188+
189+ addr = td_info->chnl_addr;
190+
191+ /* Enable the msic for conversion before reading */
192+ ret = intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL3, MSIC_ADCRRDATA_ENBL);
193+ if (ret)
194+ return ret;
195+
196+ /* Re-toggle the RRDATARD bit (temporary workaround) */
197+ ret = intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL3, MSIC_ADCTHERM_ENBL);
198+ if (ret)
199+ return ret;
200+
201+ /* Read the higher bits of data */
202+ ret = intel_scu_ipc_ioread8(addr, &data);
203+ if (ret)
204+ return ret;
205+
206+ /* Shift bits to accommodate the lower two data bits */
207+ adc_val = (data << 2);
208+ addr++;
209+
210+ ret = intel_scu_ipc_ioread8(addr, &data);/* Read lower bits */
211+ if (ret)
212+ return ret;
213+
214+ /* Adding lower two bits to the higher bits */
215+ data &= 03;
216+ adc_val += data;
217+
218+ /* Convert ADC value to temperature */
219+ ret = adc_to_temp(td_info->direct, adc_val, &curr_temp);
220+ if (ret == 0)
221+ *temp = td_info->curr_temp = curr_temp;
222+ return ret;
222223 }
223224
224225 /**
@@ -231,22 +232,21 @@ static int mid_read_temp(struct thermal_zone_device *tzd, unsigned long *temp) · 6 unmodified lines
231232 */
232233 static int configure_adc(int val)
233234 {
234− int ret;
235− uint8_t data;
236−
237− ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data);
238− if (ret)
239− return ret;
240−
241− if (val) {
242− /* Enable and start the ADC */
243− data |= (MSIC_ADC_ENBL | MSIC_ADC_START);
244− } else {
245− /* Just stop the ADC */
246− data &= (~MSIC_ADC_START);
247− }
248−
249− return intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL1, data);
235+ int ret;
236+ uint8_t data;
237+
238+ ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data);
239+ if (ret)
240+ return ret;
241+
242+ if (val) {
243+ /* Enable and start the ADC */
244+ data |= (MSIC_ADC_ENBL | MSIC_ADC_START);
245+ } else {
246+ /* Just stop the ADC */
247+ data &= (~MSIC_ADC_START);
248+ }
249+ return intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL1, data);
250250 }
251251
252252 /**
@@ -259,30 +259,30 @@ static int configure_adc(int val) · 6 unmodified lines
259259 */
260260 static int set_up_therm_channel(u16 base_addr)
261261 {
262− int ret;
263−
264− /* Enable all the sensor channels */
265− ret = intel_scu_ipc_iowrite8(base_addr, SKIN_SENSOR0_CODE);
266− if (ret)
267− return ret;
268−
269− ret = intel_scu_ipc_iowrite8(base_addr + 1, SKIN_SENSOR1_CODE);
270− if (ret)
271− return ret;
272−
273− ret = intel_scu_ipc_iowrite8(base_addr + 2, SYS_SENSOR_CODE);
274− if (ret)
275− return ret;
276−
277− /* Since this is the last channel, set the stop bit
278− to 1 by ORing the DIE_SENSOR_CODE with 0x10 */
279− ret = intel_scu_ipc_iowrite8(base_addr + 3,
280− (MSIC_DIE_SENSOR_CODE | 0x10));
281− if (ret)
282− return ret;
283−
284− /* Enable ADC and start it */
285− return configure_adc(1);
262+ int ret;
263+
264+ /* Enable all the sensor channels */
265+ ret = intel_scu_ipc_iowrite8(base_addr, SKIN_SENSOR0_CODE);
266+ if (ret)
267+ return ret;
268+
269+ ret = intel_scu_ipc_iowrite8(base_addr + 1, SKIN_SENSOR1_CODE);
270+ if (ret)
271+ return ret;
272+
273+ ret = intel_scu_ipc_iowrite8(base_addr + 2, SYS_SENSOR_CODE);
274+ if (ret)
275+ return ret;
276+
277+ /* Since this is the last channel, set the stop bit
278+ * to 1 by ORing the DIE_SENSOR_CODE with 0x10 */
279+ ret = intel_scu_ipc_iowrite8(base_addr + 3,
280+ (MSIC_DIE_SENSOR_CODE | 0x10));
281+ if (ret)
282+ return ret;
283+
284+ /* Enable ADC and start it */
285+ return configure_adc(1);
286286 }
287287
288288 /**
@@ -293,13 +293,13 @@ static int set_up_therm_channel(u16 base_addr) · 4 unmodified lines
293293 */
294294 static int reset_stopbit(uint16_t addr)
295295 {
296− int ret;
297− uint8_t data;
298− ret = intel_scu_ipc_ioread8(addr, &data);
299− if (ret)
300− return ret;
301− /* Set the stop bit to zero */
302− return intel_scu_ipc_iowrite8(addr, (data & 0xEF));
296+ int ret;
297+ uint8_t data;
298+ ret = intel_scu_ipc_ioread8(addr, &data);
299+ if (ret)
300+ return ret;
301+ /* Set the stop bit to zero */
302+ return intel_scu_ipc_iowrite8(addr, (data & 0xEF));
303303 }
304304
305305 /**
@@ -317,30 +317,30 @@ static int reset_stopbit(uint16_t addr) · 11 unmodified lines
317317 */
318318 static int find_free_channel(void)
319319 {
320− int ret;
321− int i;
322− uint8_t data;
323−
324− /* check whether ADC is enabled */
325− ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data);
326− if (ret)
327− return ret;
328−
329− if ((data & MSIC_ADC_ENBL) == 0)
330− return 0;
331−
332− /* ADC is already enabled; Looking for an empty channel */
333− for (i = 0; i < ADC_CHANLS_MAX; i++) {
334− ret = intel_scu_ipc_ioread8(ADC_CHNL_START_ADDR + i, &data);
335− if (ret)
336− return ret;
337−
338− if (data & MSIC_STOPBIT_MASK) {
339− ret = i;
340− break;
341− }
342− }
343− return (ret > ADC_LOOP_MAX) ? (-EINVAL) : ret;
320+ int ret;
321+ int i;
322+ uint8_t data;
323+
324+ /* check whether ADC is enabled */
325+ ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data);
326+ if (ret)
327+ return ret;
328+
329+ if ((data & MSIC_ADC_ENBL) == 0)
330+ return 0;
331+
332+ /* ADC is already enabled; Looking for an empty channel */
333+ for (i = 0; i < ADC_CHANLS_MAX; i++) {
334+ ret = intel_scu_ipc_ioread8(ADC_CHNL_START_ADDR + i, &data);
335+ if (ret)
336+ return ret;
337+
338+ if (data & MSIC_STOPBIT_MASK) {
339+ ret = i;
340+ break;
341+ }
342+ }
343+ return (ret > ADC_LOOP_MAX) ? (-EINVAL) : ret;
344344 }
345345
346346 /**
@@ -351,48 +351,48 @@ static int find_free_channel(void) · 4 unmodified lines
351351 */
352352 static int mid_initialize_adc(struct device *dev)
353353 {
354− u8 data;
355− u16 base_addr;
356− int ret;
357−
358− /*
359− * Ensure that adctherm is disabled before we
360− * initialize the ADC
361− */
362− ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL3, &data);
363− if (ret)
364− return ret;
365−
366− if (data & MSIC_ADCTHERM_MASK)
367− dev_warn(dev, "ADCTHERM already set");
368−
369− /* Index of the first channel in which the stop bit is set */
370− channel_index = find_free_channel();
371− if (channel_index < 0) {
372− dev_err(dev, "No free ADC channels");
373− return channel_index;
374− }
375−
376− base_addr = ADC_CHNL_START_ADDR + channel_index;
377−
378− if (!(channel_index == 0 || channel_index == ADC_LOOP_MAX)) {
379− /* Reset stop bit for channels other than 0 and 12 */
380− ret = reset_stopbit(base_addr);
381− if (ret)
382− return ret;
383−
384− /* Index of the first free channel */
385− base_addr++;
386− channel_index++;
387− }
388−
389− ret = set_up_therm_channel(base_addr);
390− if (ret) {
391− dev_err(dev, "unable to enable ADC");
392− return ret;
393− }
394− dev_dbg(dev, "ADC initialization successful");
395− return ret;
354+ u8 data;
355+ u16 base_addr;
356+ int ret;
357+
358+ /*
359+ * Ensure that adctherm is disabled before we
360+ * initialize the ADC
361+ */
362+ ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL3, &data);
363+ if (ret)
364+ return ret;
365+
366+ if (data & MSIC_ADCTHERM_MASK)
367+ dev_warn(dev, "ADCTHERM already set");
368+
369+ /* Index of the first channel in which the stop bit is set */
370+ channel_index = find_free_channel();
371+ if (channel_index < 0) {
372+ dev_err(dev, "No free ADC channels");
373+ return channel_index;
374+ }
375+
376+ base_addr = ADC_CHNL_START_ADDR + channel_index;
377+
378+ if (!(channel_index == 0 || channel_index == ADC_LOOP_MAX)) {
379+ /* Reset stop bit for channels other than 0 and 12 */
380+ ret = reset_stopbit(base_addr);
381+ if (ret)
382+ return ret;
383+
384+ /* Index of the first free channel */
385+ base_addr++;
386+ channel_index++;
387+ }
388+
389+ ret = set_up_therm_channel(base_addr);
390+ if (ret) {
391+ dev_err(dev, "unable to enable ADC");
392+ return ret;
393+ }
394+ dev_dbg(dev, "ADC initialization successful");
395+ return ret;
396396 }
397397
398398 /**
@@ -403,18 +403,18 @@ static int mid_initialize_adc(struct device *dev) · 4 unmodified lines
403403 */
404404 static struct thermal_device_info *initialize_sensor(int index)
405405 {
406− struct thermal_device_info *td_info =
407− kzalloc(sizeof(struct thermal_device_info), GFP_KERNEL);
408−
409− if (!td_info)
410− return NULL;
411−
412− /* Set the base addr of the channel for this sensor */
413− td_info->chnl_addr = ADC_DATA_START_ADDR + 2 * (channel_index + index);
414− /* Sensor 3 is direct conversion */
415− if (index == 3)
416− td_info->direct = 1;
417− return td_info;
406+ struct thermal_device_info *td_info =
407+ kzalloc(sizeof(struct thermal_device_info), GFP_KERNEL);
408+
409+ if (!td_info)
410+ return NULL;
411+
412+ /* Set the base addr of the channel for this sensor */
413+ td_info->chnl_addr = ADC_DATA_START_ADDR + 2 * (channel_index + index);
414+ /* Sensor 3 is direct conversion */
415+ if (index == 3)
416+ td_info->direct = 1;
417+ return td_info;
418418 }
419419
420420 /**
@@ -425,7 +425,7 @@ static struct thermal_device_info *initialize_sensor(int index) · 4 unmodified lines
425425 */
426426 static int mid_thermal_resume(struct platform_device *pdev)
427427 {
428− return mid_initialize_adc(&pdev->dev);
428+ return mid_initialize_adc(&pdev->dev);
429429 }
430430
431431 /**
@@ -437,12 +437,12 @@ static int mid_thermal_resume(struct platform_device *pdev) · 5 unmodified lines
437437 */
438438 static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg)
439439 {
440− /*
441− * This just stops the ADC and does not disable it.
442− * temporary workaround until we have a generic ADC driver.
443− * If 0 is passed, it disables the ADC.
444− */
445− return configure_adc(0);
440+ /*
441+ * This just stops the ADC and does not disable it.
442+ * temporary workaround until we have a generic ADC driver.
443+ * If 0 is passed, it disables the ADC.
444+ */
445+ return configure_adc(0);
446446 }
447447
448448 /**
@@ -453,16 +453,15 @@ static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) · 4 unmodified lines
453453 */
454454 static int read_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp)
455455 {
456− WARN_ON(tzd == NULL);
457− return mid_read_temp(tzd, temp);
456+ WARN_ON(tzd == NULL);
457+ return mid_read_temp(tzd, temp);
458458 }
459459
460460 /* Can't be const */
461461 static struct thermal_zone_device_ops tzd_ops = {
462− .get_temp = read_curr_temp,
462+ .get_temp = read_curr_temp,
463463 };
464464
465−
466465 /**
467466 * mid_thermal_probe - mfld thermal initialize
468467 * @pdev: platform device structure
@@ -472,46 +471,45 @@ static struct thermal_zone_device_ops tzd_ops = { · 3 unmodified lines
472471 */
473472 static int mid_thermal_probe(struct platform_device *pdev)
474473 {
475− static char *name[MSIC_THERMAL_SENSORS] = {
476− "skin0", "skin1", "sys", "msicdie"
477− };
478−
479− int ret;
480− int i;
481− struct platform_info *pinfo;
482−
483− pinfo = kzalloc(sizeof(struct platform_info), GFP_KERNEL);
484− if (!pinfo)
485− return -ENOMEM;
486−
487− /* Initializing the hardware */
488− ret = mid_initialize_adc(&pdev->dev);
489− if (ret) {
490− dev_err(&pdev->dev, "ADC init failed");
491− kfree(pinfo);
492− return ret;
493− }
494−
495− /* Register each sensor with the generic thermal framework*/
496− for (i = 0; i < MSIC_THERMAL_SENSORS; i++) {
497− pinfo->tzd[i] = thermal_zone_device_register(name[i],
498− 0, initialize_sensor(i),
499− &tzd_ops, 0, 0, 0, 0);
500− if (IS_ERR(pinfo->tzd[i]))
501− goto reg_fail;
502− }
503−
504− pinfo->pdev = pdev;
505− platform_set_drvdata(pdev, pinfo);
506− return 0;
474+ static char *name[MSIC_THERMAL_SENSORS] = {
475+ "skin0", "skin1", "sys", "msicdie"
476+ };
477+
478+ int ret;
479+ int i;
480+ struct platform_info *pinfo;
481+
482+ pinfo = kzalloc(sizeof(struct platform_info), GFP_KERNEL);
483+ if (!pinfo)
484+ return -ENOMEM;
485+
486+ /* Initializing the hardware */
487+ ret = mid_initialize_adc(&pdev->dev);
488+ if (ret) {
489+ dev_err(&pdev->dev, "ADC init failed");
490+ kfree(pinfo);
491+ return ret;
492+ }
493+
494+ /* Register each sensor with the generic thermal framework*/
495+ for (i = 0; i < MSIC_THERMAL_SENSORS; i++) {
496+ pinfo->tzd[i] = thermal_zone_device_register(name[i],
497+ 0, initialize_sensor(i), &tzd_ops, 0, 0, 0, 0);
498+ if (IS_ERR(pinfo->tzd[i]))
499+ goto reg_fail;
500+ }
501+
502+ pinfo->pdev = pdev;
503+ platform_set_drvdata(pdev, pinfo);
504+ return 0;
507505
508506 reg_fail:
509− ret = PTR_ERR(pinfo->tzd[i]);
510− while (--i >= 0)
511− thermal_zone_device_unregister(pinfo->tzd[i]);
512− configure_adc(0);
513− kfree(pinfo);
514− return ret;
507+ ret = PTR_ERR(pinfo->tzd[i]);
508+ while (--i >= 0)
509+ thermal_zone_device_unregister(pinfo->tzd[i]);
510+ configure_adc(0);
511+ kfree(pinfo);
512+ return ret;
515513 }
516514
517515 /**
@@ -523,49 +521,46 @@ reg_fail: · 5 unmodified lines
523521 */
524522 static int mid_thermal_remove(struct platform_device *pdev)
525523 {
526− int i;
527− struct platform_info *pinfo = platform_get_drvdata(pdev);
524+ int i;
525+ struct platform_info *pinfo = platform_get_drvdata(pdev);
528526
529− for (i = 0; i < MSIC_THERMAL_SENSORS; i++)
530− thermal_zone_device_unregister(pinfo->tzd[i]);
527+ for (i = 0; i < MSIC_THERMAL_SENSORS; i++)
528+ thermal_zone_device_unregister(pinfo->tzd[i]);
531529
532− platform_set_drvdata(pdev, NULL);
530+ kfree(pinfo);
531+ platform_set_drvdata(pdev, NULL);
533532
534− /* Stop the ADC */
535− return configure_adc(0);
533+ /* Stop the ADC */
534+ return configure_adc(0);
536535 }
537536
538−/*********************************************************************
539− * Driver initialisation and finalization
540− *********************************************************************/
541−
542537 #define DRIVER_NAME "msic_sensor"
543538
544539 static const struct platform_device_id therm_id_table[] = {
545− { DRIVER_NAME, 1 },
546− { }
540+ { DRIVER_NAME, 1 },
541+ { }
547542 };
548543
549544 static struct platform_driver mid_thermal_driver = {
550− .driver = {
551− .name = DRIVER_NAME,
552− .owner = THIS_MODULE,
553− },
554− .probe = mid_thermal_probe,
555− .suspend = mid_thermal_suspend,
556− .resume = mid_thermal_resume,
557− .remove = __devexit_p(mid_thermal_remove),
558− .id_table = therm_id_table,
545+ .driver = {
546+ .name = DRIVER_NAME,
547+ .owner = THIS_MODULE,
548+ },
549+ .probe = mid_thermal_probe,
550+ .suspend = mid_thermal_suspend,
551+ .resume = mid_thermal_resume,
552+ .remove = __devexit_p(mid_thermal_remove),
553+ .id_table = therm_id_table,
559554 };
560555
561556 static int __init mid_thermal_module_init(void)
562557 {
563− return platform_driver_register(&mid_thermal_driver);
558+ return platform_driver_register(&mid_thermal_driver);
564559 }
565560
566561 static void __exit mid_thermal_module_exit(void)
567562 {
568− platform_driver_unregister(&mid_thermal_driver);
563+ platform_driver_unregister(&mid_thermal_driver);
569564 }
570565
571566 module_init(mid_thermal_module_init);
drivers/platform/x86/intel_oaktrail.c+396−0
@@ -0,0 +1,396 @@
1+/*
2+ * intel_oaktrail.c - Intel OakTrail Platform support.
3+ *
4+ * Copyright (C) 2010-2011 Intel Corporation
5+ * Author: Yin Kangkai (kangkai.yin@intel.com)
6+ *
7+ * based on Compal driver, Copyright (C) 2008 Cezary Jackiewicz
8+ * <cezary.jackiewicz (at) gmail.com>, based on MSI driver
9+ * Copyright (C) 2006 Lennart Poettering <mzxreary (at) 0pointer (dot) de>
10+ *
11+ * This program is free software; you can redistribute it and/or modify
12+ * it under the terms of the GNU General Public License as published by
13+ * the Free Software Foundation; either version 2 of the License, or
14+ * (at your option) any later version.
15+ *
16+ * This program is distributed in the hope that it will be useful, but
17+ * WITHOUT ANY WARRANTY; without even the implied warranty of
18+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19+ * General Public License for more details.
20+ *
21+ * You should have received a copy of the GNU General Public License
22+ * along with this program; if not, write to the Free Software
23+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24+ * 02110-1301, USA.
25+ *
26+ * This driver does below things:
27+ * 1. registers itself in the Linux backlight control in
28+ * /sys/class/backlight/intel_oaktrail/
29+ *
30+ * 2. registers in the rfkill subsystem here: /sys/class/rfkill/rfkillX/
31+ * for these components: wifi, bluetooth, wwan (3g), gps
32+ *
33+ * This driver might work on other products based on Oaktrail. If you
34+ * want to try it you can pass force=1 as argument to the module which
35+ * will force it to load even when the DMI data doesn't identify the
36+ * product as compatible.
37+ */
38+
39+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
40+
41+#include <linux/module.h>
42+#include <linux/kernel.h>
43+#include <linux/init.h>
44+#include <linux/acpi.h>
45+#include <linux/fb.h>
46+#include <linux/mutex.h>
47+#include <linux/err.h>
48+#include <linux/i2c.h>
49+#include <linux/backlight.h>
50+#include <linux/platform_device.h>
51+#include <linux/dmi.h>
52+#include <linux/rfkill.h>
53+#include <acpi/acpi_bus.h>
54+#include <acpi/acpi_drivers.h>
55+
56+
57+#define DRIVER_NAME "intel_oaktrail"
58+#define DRIVER_VERSION "0.4ac1"
59+
60+/*
61+ * This is the devices status address in EC space, and the control bits
62+ * definition:
63+ *
64+ * (1 << 0): Camera enable/disable, RW.
65+ * (1 << 1): Bluetooth enable/disable, RW.
66+ * (1 << 2): GPS enable/disable, RW.
67+ * (1 << 3): WiFi enable/disable, RW.
68+ * (1 << 4): WWAN (3G) enable/disalbe, RW.
69+ * (1 << 5): Touchscreen enable/disable, Read Only.
70+ */
71+#define OT_EC_DEVICE_STATE_ADDRESS 0xD6
72+
73+#define OT_EC_CAMERA_MASK (1 << 0)
74+#define OT_EC_BT_MASK (1 << 1)
75+#define OT_EC_GPS_MASK (1 << 2)
76+#define OT_EC_WIFI_MASK (1 << 3)
77+#define OT_EC_WWAN_MASK (1 << 4)
78+#define OT_EC_TS_MASK (1 << 5)
79+
80+/*
81+ * This is the address in EC space and commands used to control LCD backlight:
82+ *
83+ * Two steps needed to change the LCD backlight:
84+ * 1. write the backlight percentage into OT_EC_BL_BRIGHTNESS_ADDRESS;
85+ * 2. write OT_EC_BL_CONTROL_ON_DATA into OT_EC_BL_CONTROL_ADDRESS.
86+ *
87+ * To read the LCD back light, just read out the value from
88+ * OT_EC_BL_BRIGHTNESS_ADDRESS.
89+ *
90+ * LCD backlight brightness range: 0 - 100 (OT_EC_BL_BRIGHTNESS_MAX)
91+ */
92+#define OT_EC_BL_BRIGHTNESS_ADDRESS 0x44
93+#define OT_EC_BL_BRIGHTNESS_MAX 100
94+#define OT_EC_BL_CONTROL_ADDRESS 0x3A
95+#define OT_EC_BL_CONTROL_ON_DATA 0x1A
96+
97+
98+static int force;
99+module_param(force, bool, 0);
100+MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
101+
102+static struct platform_device *oaktrail_device;
103+static struct backlight_device *oaktrail_bl_device;
104+static struct rfkill *bt_rfkill;
105+static struct rfkill *gps_rfkill;
106+static struct rfkill *wifi_rfkill;
107+static struct rfkill *wwan_rfkill;
108+
109+
110+/* rfkill */
111+static int oaktrail_rfkill_set(void *data, bool blocked)
112+{
113+ u8 value;
114+ u8 result;
115+ unsigned long radio = (unsigned long) data;
116+
117+ ec_read(OT_EC_DEVICE_STATE_ADDRESS, &result);
118+
119+ if (!blocked)
120+ value = (u8) (result | radio);
121+ else
122+ value = (u8) (result & ~radio);
123+
124+ ec_write(OT_EC_DEVICE_STATE_ADDRESS, value);
125+
126+ return 0;
127+}
128+
129+static const struct rfkill_ops oaktrail_rfkill_ops = {
130+ .set_block = oaktrail_rfkill_set,
131+};
132+
133+static struct rfkill *oaktrail_rfkill_new(char *name, enum rfkill_type type,
134+ unsigned long mask)
135+{
136+ struct rfkill *rfkill_dev;
137+ u8 value;
138+ int err;
139+
140+ rfkill_dev = rfkill_alloc(name, &oaktrail_device->dev, type,
141+ &oaktrail_rfkill_ops, (void *)mask);
142+ if (!rfkill_dev)
143+ return ERR_PTR(-ENOMEM);
144+
145+ ec_read(OT_EC_DEVICE_STATE_ADDRESS, &value);
146+ rfkill_init_sw_state(rfkill_dev, (value & mask) != 1);
147+
148+ err = rfkill_register(rfkill_dev);
149+ if (err) {
150+ rfkill_destroy(rfkill_dev);
151+ return ERR_PTR(err);
152+ }
153+
154+ return rfkill_dev;
155+}
156+
157+static inline void __oaktrail_rfkill_cleanup(struct rfkill *rf)
158+{
159+ if (rf) {
160+ rfkill_unregister(rf);
161+ rfkill_destroy(rf);
162+ }
163+}
164+
165+static void oaktrail_rfkill_cleanup(void)
166+{
167+ __oaktrail_rfkill_cleanup(wifi_rfkill);
168+ __oaktrail_rfkill_cleanup(bt_rfkill);
169+ __oaktrail_rfkill_cleanup(gps_rfkill);
170+ __oaktrail_rfkill_cleanup(wwan_rfkill);
171+}
172+
173+static int oaktrail_rfkill_init(void)
174+{
175+ int ret;
176+
177+ wifi_rfkill = oaktrail_rfkill_new("oaktrail-wifi",
178+ RFKILL_TYPE_WLAN,
179+ OT_EC_WIFI_MASK);
180+ if (IS_ERR(wifi_rfkill)) {
181+ ret = PTR_ERR(wifi_rfkill);
182+ wifi_rfkill = NULL;
183+ goto cleanup;
184+ }
185+
186+ bt_rfkill = oaktrail_rfkill_new("oaktrail-bluetooth",
187+ RFKILL_TYPE_BLUETOOTH,
188+ OT_EC_BT_MASK);
189+ if (IS_ERR(bt_rfkill)) {
190+ ret = PTR_ERR(bt_rfkill);
191+ bt_rfkill = NULL;
192+ goto cleanup;
193+ }
194+
195+ gps_rfkill = oaktrail_rfkill_new("oaktrail-gps",
196+ RFKILL_TYPE_GPS,
197+ OT_EC_GPS_MASK);
198+ if (IS_ERR(gps_rfkill)) {
199+ ret = PTR_ERR(gps_rfkill);
200+ gps_rfkill = NULL;
201+ goto cleanup;
202+ }
203+
204+ wwan_rfkill = oaktrail_rfkill_new("oaktrail-wwan",
205+ RFKILL_TYPE_WWAN,
206+ OT_EC_WWAN_MASK);
207+ if (IS_ERR(wwan_rfkill)) {
208+ ret = PTR_ERR(wwan_rfkill);
209+ wwan_rfkill = NULL;
210+ goto cleanup;
211+ }
212+
213+ return 0;
214+
215+cleanup:
216+ oaktrail_rfkill_cleanup();
217+ return ret;
218+}
219+
220+
221+/* backlight */
222+static int get_backlight_brightness(struct backlight_device *b)
223+{
224+ u8 value;
225+ ec_read(OT_EC_BL_BRIGHTNESS_ADDRESS, &value);
226+
227+ return value;
228+}
229+
230+static int set_backlight_brightness(struct backlight_device *b)
231+{
232+ u8 percent = (u8) b->props.brightness;
233+ if (percent < 0 || percent > OT_EC_BL_BRIGHTNESS_MAX)
234+ return -EINVAL;
235+
236+ ec_write(OT_EC_BL_BRIGHTNESS_ADDRESS, percent);
237+ ec_write(OT_EC_BL_CONTROL_ADDRESS, OT_EC_BL_CONTROL_ON_DATA);
238+
239+ return 0;
240+}
241+
242+static const struct backlight_ops oaktrail_bl_ops = {
243+ .get_brightness = get_backlight_brightness,
244+ .update_status = set_backlight_brightness,
245+};
246+
247+static int oaktrail_backlight_init(void)
248+{
249+ struct backlight_device *bd;
250+ struct backlight_properties props;
251+
252+ memset(&props, 0, sizeof(struct backlight_properties));
253+ props.max_brightness = OT_EC_BL_BRIGHTNESS_MAX;
254+ bd = backlight_device_register(DRIVER_NAME,
255+ &oaktrail_device->dev, NULL,
256+ &oaktrail_bl_ops,
257+ &props);
258+
259+ if (IS_ERR(bd)) {
260+ oaktrail_bl_device = NULL;
261+ pr_warning("Unable to register backlight device\n");
262+ return PTR_ERR(bd);
263+ }
264+
265+ oaktrail_bl_device = bd;
266+
267+ bd->props.brightness = get_backlight_brightness(bd);
268+ bd->props.power = FB_BLANK_UNBLANK;
269+ backlight_update_status(bd);
270+
271+ return 0;
272+}
273+
274+static void oaktrail_backlight_exit(void)
275+{
276+ if (oaktrail_bl_device)
277+ backlight_device_unregister(oaktrail_bl_device);
278+}
279+
280+static int __devinit oaktrail_probe(struct platform_device *pdev)
281+{
282+ return 0;
283+}
284+
285+static int __devexit oaktrail_remove(struct platform_device *pdev)
286+{
287+ return 0;
288+}
289+
290+static struct platform_driver oaktrail_driver = {
291+ .driver = {
292+ .name = DRIVER_NAME,
293+ .owner = THIS_MODULE,
294+ },
295+ .probe = oaktrail_probe,
296+ .remove = __devexit_p(oaktrail_remove)
297+};
298+
299+static int dmi_check_cb(const struct dmi_system_id *id)
300+{
301+ pr_info("Identified model '%s'\n", id->ident);
302+ return 0;
303+}
304+
305+static struct dmi_system_id __initdata oaktrail_dmi_table[] = {
306+ {
307+ .ident = "OakTrail platform",
308+ .matches = {
309+ DMI_MATCH(DMI_PRODUCT_NAME, "OakTrail platform"),
310+ },
311+ .callback = dmi_check_cb
312+ },
313+ { }
314+};
315+
316+static int __init oaktrail_init(void)
317+{
318+ int ret;
319+
320+ if (acpi_disabled) {
321+ pr_err("ACPI needs to be enabled for this driver to work!\n");
322+ return -ENODEV;
323+ }
324+
325+ if (!force && !dmi_check_system(oaktrail_dmi_table)) {
326+ pr_err("Platform not recognized (You could try the module's force-parameter)");
327+ return -ENODEV;
328+ }
329+
330+ ret = platform_driver_register(&oaktrail_driver);
331+ if (ret) {
332+ pr_warning("Unable to register platform driver\n");
333+ goto err_driver_reg;
334+ }
335+
336+ oaktrail_device = platform_device_alloc(DRIVER_NAME, -1);
337+ if (!oaktrail_device) {
338+ pr_warning("Unable to allocate platform device\n");
339+ ret = -ENOMEM;
340+ goto err_device_alloc;
341+ }
342+
343+ ret = platform_device_add(oaktrail_device);
344+ if (ret) {
345+ pr_warning("Unable to add platform device\n");
346+ goto err_device_add;
347+ }
348+
349+ if (!acpi_video_backlight_support()) {
350+ ret = oaktrail_backlight_init();
351+ if (ret)
352+ goto err_backlight;
353+
354+ } else
355+ pr_info("Backlight controlled by ACPI video driver\n");
356+
357+ ret = oaktrail_rfkill_init();
358+ if (ret) {
359+ pr_warning("Setup rfkill failed\n");
360+ goto err_rfkill;
361+ }
362+
363+ pr_info("Driver "DRIVER_VERSION" successfully loaded\n");
364+ return 0;
365+
366+err_rfkill:
367+ oaktrail_backlight_exit();
368+err_backlight:
369+ platform_device_del(oaktrail_device);
370+err_device_add:
371+ platform_device_put(oaktrail_device);
372+err_device_alloc:
373+ platform_driver_unregister(&oaktrail_driver);
374+err_driver_reg:
375+
376+ return ret;
377+}
378+
379+static void __exit oaktrail_cleanup(void)
380+{
381+ oaktrail_backlight_exit();
382+ oaktrail_rfkill_cleanup();
383+ platform_device_unregister(oaktrail_device);
384+ platform_driver_unregister(&oaktrail_driver);
385+
386+ pr_info("Driver unloaded\n");
387+}
388+
389+module_init(oaktrail_init);
390+module_exit(oaktrail_cleanup);
391+
392+MODULE_AUTHOR("Yin Kangkai (kangkai.yin@intel.com)");
393+MODULE_DESCRIPTION("Intel Oaktrail Platform ACPI Extras");
394+MODULE_VERSION(DRIVER_VERSION);
395+MODULE_LICENSE("GPL");
396+MODULE_ALIAS("dmi:*:svnIntelCorporation:pnOakTrailplatform:*");
drivers/platform/x86/intel_pmic_gpio.c+7−7
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 * Moorestown platform PMIC chip
2020 */
2121
22+#define pr_fmt(fmt) "%s: " fmt, __func__
23+
2224 #include <linux/module.h>
2325 #include <linux/kernel.h>
2426 #include <linux/interrupt.h>
@@ -90,8 +92,7 @@ static void pmic_program_irqtype(int gpio, int type) · 65 unmodified lines
9092 static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
9193 {
9294 if (offset > 8) {
93− printk(KERN_ERR
94− "%s: only pin 0-7 support input\n", __func__);
95+ pr_err("only pin 0-7 support input\n");
9596 return -1;/* we only have 8 GPIO can use as input */
9697 }
9798 return intel_scu_ipc_update_register(GPIO0 + offset,
@@ -116,8 +117,7 @@ static int pmic_gpio_direction_output(struct gpio_chip *chip, · 18 unmodified lines
116117 value ? 1 << (offset - 16) : 0,
117118 1 << (offset - 16));
118119 else {
119− printk(KERN_ERR
120− "%s: invalid PMIC GPIO pin %d!\n", __func__, offset);
120+ pr_err("invalid PMIC GPIO pin %d!\n", offset);
121121 WARN_ON(1);
122122 }
123123
@@ -260,7 +260,7 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) · 136 unmodified lines
260260 /* setting up SRAM mapping for GPIOINT register */
261261 pg->gpiointr = ioremap_nocache(pdata->gpiointr, 8);
262262 if (!pg->gpiointr) {
263− printk(KERN_ERR "%s: Can not map GPIOINT.\n", __func__);
263+ pr_err("Can not map GPIOINT\n");
264264 retval = -EINVAL;
265265 goto err2;
266266 }
@@ -281,13 +281,13 @@ static int __devinit platform_pmic_gpio_probe(struct platform_device *pdev) · 14 unmodified lines
281281 pg->chip.dev = dev;
282282 retval = gpiochip_add(&pg->chip);
283283 if (retval) {
284− printk(KERN_ERR "%s: Can not add pmic gpio chip.\n", __func__);
284+ pr_err("Can not add pmic gpio chip\n");
285285 goto err;
286286 }
287287
288288 retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg);
289289 if (retval) {
290− printk(KERN_WARNING "pmic: Interrupt request failed\n");
290+ pr_warn("Interrupt request failed\n");
291291 goto err;
292292 }
293293
drivers/platform/x86/msi-laptop.c+5−6
@@ -447,7 +447,7 @@ static struct platform_device *msipf_device; · 446 unmodified lines
447447
448448 static int dmi_check_cb(const struct dmi_system_id *id)
449449 {
450− pr_info("Identified laptop model '%s'.\n", id->ident);
450+ pr_info("Identified laptop model '%s'\n", id->ident);
451451 return 1;
452452 }
453453
@@ -800,7 +800,7 @@ static void msi_laptop_input_destroy(void) · 346 unmodified lines
800800 input_unregister_device(msi_laptop_input_dev);
801801 }
802802
803−static int load_scm_model_init(struct platform_device *sdev)
803+static int __init load_scm_model_init(struct platform_device *sdev)
804804 {
805805 u8 data;
806806 int result;
@@ -875,8 +875,7 @@ static int __init msi_init(void) · 68 unmodified lines
875875 /* Register backlight stuff */
876876
877877 if (acpi_video_backlight_support()) {
878− pr_info("Brightness ignored, must be controlled "
879− "by ACPI video driver\n");
878+ pr_info("Brightness ignored, must be controlled by ACPI video driver\n");
880879 } else {
881880 struct backlight_properties props;
882881 memset(&props, 0, sizeof(struct backlight_properties));
@@ -930,7 +929,7 @@ static int __init msi_init(void) · 47 unmodified lines
930929 if (auto_brightness != 2)
931930 set_auto_brightness(auto_brightness);
932931
933− pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n");
932+ pr_info("driver " MSI_DRIVER_VERSION " successfully loaded\n");
934933
935934 return 0;
936935
@@ -978,7 +977,7 @@ static void __exit msi_cleanup(void) · 41 unmodified lines
978977 if (auto_brightness != 2)
979978 set_auto_brightness(1);
980979
981− pr_info("driver unloaded.\n");
980+ pr_info("driver unloaded\n");
982981 }
983982
984983 module_init(msi_init);
drivers/platform/x86/msi-wmi.c+20−25
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121 */
2222
23+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
2324
2425 #include <linux/kernel.h>
2526 #include <linux/input.h>
@@ -36,13 +37,10 @@ MODULE_ALIAS("wmi:551A1F84-FBDD-4125-91DB-3EA8F44F1D45"); · 10 unmodified lines
3637 MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2");
3738
3839 #define DRV_NAME "msi-wmi"
39−#define DRV_PFX DRV_NAME ": "
4040
4141 #define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45"
4242 #define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"
4343
44−#define dprintk(msg...) pr_debug(DRV_PFX msg)
45−
4644 #define SCANCODE_BASE 0xD0
4745 #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE
4846 #define MSI_WMI_BRIGHTNESSDOWN (SCANCODE_BASE + 1)
@@ -78,7 +76,7 @@ static int msi_wmi_query_block(int instance, int *ret) · 29 unmodified lines
7876
7977 if (!obj || obj->type != ACPI_TYPE_INTEGER) {
8078 if (obj) {
81− printk(KERN_ERR DRV_PFX "query block returned object "
79+ pr_err("query block returned object "
8280 "type: %d - buffer length:%d\n", obj->type,
8381 obj->type == ACPI_TYPE_BUFFER ?
8482 obj->buffer.length : 0);
@@ -97,8 +95,8 @@ static int msi_wmi_set_block(int instance, int value) · 12 unmodified lines
9795
9896 struct acpi_buffer input = { sizeof(int), &value };
9997
100− dprintk("Going to set block of instance: %d - value: %d\n",
101− instance, value);
98+ pr_debug("Going to set block of instance: %d - value: %d\n",
99+ instance, value);
102100
103101 status = wmi_set_block(MSIWMI_BIOS_GUID, instance, &input);
104102
@@ -112,20 +110,19 @@ static int bl_get(struct backlight_device *bd) · 7 unmodified lines
112110 /* Instance 1 is "get backlight", cmp with DSDT */
113111 err = msi_wmi_query_block(1, &ret);
114112 if (err) {
115− printk(KERN_ERR DRV_PFX "Could not query backlight: %d\n", err);
113+ pr_err("Could not query backlight: %d\n", err);
116114 return -EINVAL;
117115 }
118− dprintk("Get: Query block returned: %d\n", ret);
116+ pr_debug("Get: Query block returned: %d\n", ret);
119117 for (level = 0; level < ARRAY_SIZE(backlight_map); level++) {
120118 if (backlight_map[level] == ret) {
121− dprintk("Current backlight level: 0x%X - index: %d\n",
122− backlight_map[level], level);
119+ pr_debug("Current backlight level: 0x%X - index: %d\n",
120+ backlight_map[level], level);
123121 break;
124122 }
125123 }
126124 if (level == ARRAY_SIZE(backlight_map)) {
127− printk(KERN_ERR DRV_PFX "get: Invalid brightness value: 0x%X\n",
128− ret);
125+ pr_err("get: Invalid brightness value: 0x%X\n", ret);
129126 return -EINVAL;
130127 }
131128 return level;
@@ -156,7 +153,7 @@ static void msi_wmi_notify(u32 value, void *context) · 24 unmodified lines
156153
157154 status = wmi_get_event_data(value, &response);
158155 if (status != AE_OK) {
159− printk(KERN_INFO DRV_PFX "bad event status 0x%x\n", status);
156+ pr_info("bad event status 0x%x\n", status);
160157 return;
161158 }
162159
@@ -164,7 +161,7 @@ static void msi_wmi_notify(u32 value, void *context) · 1 unmodified line
164161
165162 if (obj && obj->type == ACPI_TYPE_INTEGER) {
166163 int eventcode = obj->integer.value;
167− dprintk("Eventcode: 0x%x\n", eventcode);
164+ pr_debug("Eventcode: 0x%x\n", eventcode);
168165 key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev,
169166 eventcode);
170167 if (key) {
@@ -175,8 +172,8 @@ static void msi_wmi_notify(u32 value, void *context) · 4 unmodified lines
175172 /* Ignore event if the same event happened in a 50 ms
176173 timeframe -> Key press may result in 10-20 GPEs */
177174 if (ktime_to_us(diff) < 1000 * 50) {
178− dprintk("Suppressed key event 0x%X - "
179− "Last press was %lld us ago\n",
175+ pr_debug("Suppressed key event 0x%X - "
176+ "Last press was %lld us ago\n",
180177 key->code, ktime_to_us(diff));
181178 return;
182179 }
@@ -187,17 +184,16 @@ static void msi_wmi_notify(u32 value, void *context) · 4 unmodified lines
187184 (!acpi_video_backlight_support() ||
188185 (key->code != MSI_WMI_BRIGHTNESSUP &&
189186 key->code != MSI_WMI_BRIGHTNESSDOWN))) {
190− dprintk("Send key: 0x%X - "
191− "Input layer keycode: %d\n", key->code,
192− key->keycode);
187+ pr_debug("Send key: 0x%X - "
188+ "Input layer keycode: %d\n",
189+ key->code, key->keycode);
193190 sparse_keymap_report_entry(msi_wmi_input_dev,
194191 key, 1, true);
195192 }
196193 } else
197− printk(KERN_INFO "Unknown key pressed - %x\n",
198− eventcode);
194+ pr_info("Unknown key pressed - %x\n", eventcode);
199195 } else
200− printk(KERN_INFO DRV_PFX "Unknown event received\n");
196+ pr_info("Unknown event received\n");
201197 kfree(response.pointer);
202198 }
203199
@@ -238,8 +234,7 @@ static int __init msi_wmi_init(void) · 34 unmodified lines
238234 int err;
239235
240236 if (!wmi_has_guid(MSIWMI_EVENT_GUID)) {
241− printk(KERN_ERR
242− "This machine doesn't have MSI-hotkeys through WMI\n");
237+ pr_err("This machine doesn't have MSI-hotkeys through WMI\n");
243238 return -ENODEV;
244239 }
245240 err = wmi_install_notify_handler(MSIWMI_EVENT_GUID,
@@ -270,7 +265,7 @@ static int __init msi_wmi_init(void) · 24 unmodified lines
270265
271266 backlight->props.brightness = err;
272267 }
273− dprintk("Event handler installed\n");
268+ pr_debug("Event handler installed\n");
274269
275270 return 0;
276271
drivers/platform/x86/sony-laptop.c+49−57
@@ -42,6 +42,8 @@ · 41 unmodified lines
4242 *
4343 */
4444
45+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
46+
4547 #include <linux/kernel.h>
4648 #include <linux/module.h>
4749 #include <linux/moduleparam.h>
@@ -70,10 +72,10 @@ · 22 unmodified lines
7072 #include <linux/miscdevice.h>
7173 #endif
7274
73−#define DRV_PFX "sony-laptop: "
74−#define dprintk(msg...) do { \
75− if (debug) \
76− pr_warn(DRV_PFX msg); \
75+#define dprintk(fmt, ...) \
76+do { \
77+ if (debug) \
78+ pr_warn(fmt, ##__VA_ARGS__); \
7779 } while (0)
7880
7981 #define SONY_LAPTOP_DRIVER_VERSION "0.6"
@@ -418,7 +420,7 @@ static int sony_laptop_setup_input(struct acpi_device *acpi_device) · 338 unmodified lines
418420 error = kfifo_alloc(&sony_laptop_input.fifo,
419421 SONY_LAPTOP_BUF_SIZE, GFP_KERNEL);
420422 if (error) {
421− pr_err(DRV_PFX "kfifo_alloc failed\n");
423+ pr_err("kfifo_alloc failed\n");
422424 goto err_dec_users;
423425 }
424426
@@ -702,7 +704,7 @@ static int acpi_callgetfunc(acpi_handle handle, char *name, int *result) · 277 unmodified lines
702704 return 0;
703705 }
704706
705− pr_warn(DRV_PFX "acpi_callreadfunc failed\n");
707+ pr_warn("acpi_callreadfunc failed\n");
706708
707709 return -1;
708710 }
@@ -728,8 +730,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value, · 19 unmodified lines
728730 if (status == AE_OK) {
729731 if (result != NULL) {
730732 if (out_obj.type != ACPI_TYPE_INTEGER) {
731− pr_warn(DRV_PFX "acpi_evaluate_object bad "
732− "return type\n");
733+ pr_warn("acpi_evaluate_object bad return type\n");
733734 return -1;
734735 }
735736 *result = out_obj.integer.value;
@@ -737,7 +738,7 @@ static int acpi_callsetfunc(acpi_handle handle, char *name, int value, · 1 unmodified line
737738 return 0;
738739 }
739740
740− pr_warn(DRV_PFX "acpi_evaluate_object failed\n");
741+ pr_warn("acpi_evaluate_object failed\n");
741742
742743 return -1;
743744 }
@@ -961,7 +962,6 @@ static int sony_backlight_get_brightness(struct backlight_device *bd) · 217 unmodified lines
961962 static int sony_nc_get_brightness_ng(struct backlight_device *bd)
962963 {
963964 int result;
964− int *handle = (int *)bl_get_data(bd);
965965 struct sony_backlight_props *sdev =
966966 (struct sony_backlight_props *)bl_get_data(bd);
967967
@@ -973,7 +973,6 @@ static int sony_nc_get_brightness_ng(struct backlight_device *bd) · 5 unmodified lines
973973 static int sony_nc_update_status_ng(struct backlight_device *bd)
974974 {
975975 int value, result;
976− int *handle = (int *)bl_get_data(bd);
977976 struct sony_backlight_props *sdev =
978977 (struct sony_backlight_props *)bl_get_data(bd);
979978
@@ -1104,10 +1103,8 @@ static void sony_nc_notify(struct acpi_device *device, u32 event) · 124 unmodified lines
11041103 }
11051104
11061105 if (!key_event->data)
1107− pr_info(DRV_PFX
1108− "Unknown event: 0x%x 0x%x\n",
1109− key_handle,
1110− ev);
1106+ pr_info("Unknown event: 0x%x 0x%x\n",
1107+ key_handle, ev);
11111108 else
11121109 sony_laptop_report_input_event(ev);
11131110 }
@@ -1128,7 +1125,7 @@ static acpi_status sony_walk_callback(acpi_handle handle, u32 level, · 14 unmodified lines
11281125 struct acpi_device_info *info;
11291126
11301127 if (ACPI_SUCCESS(acpi_get_object_info(handle, &info))) {
1131− pr_warn(DRV_PFX "method: name: %4.4s, args %X\n",
1128+ pr_warn("method: name: %4.4s, args %X\n",
11321129 (char *)&info->name, info->param_count);
11331130
11341131 kfree(info);
@@ -1169,7 +1166,7 @@ static int sony_nc_resume(struct acpi_device *device) · 34 unmodified lines
11691166 ret = acpi_callsetfunc(sony_nc_acpi_handle, *item->acpiset,
11701167 item->value, NULL);
11711168 if (ret < 0) {
1172− pr_err(DRV_PFX "%s: %d\n", __func__, ret);
1169+ pr_err("%s: %d\n", __func__, ret);
11731170 break;
11741171 }
11751172 }
@@ -1336,12 +1333,12 @@ static void sony_nc_rfkill_setup(struct acpi_device *device) · 160 unmodified lines
13361333
13371334 device_enum = (union acpi_object *) buffer.pointer;
13381335 if (!device_enum) {
1339− pr_err(DRV_PFX "No SN06 return object.");
1336+ pr_err("No SN06 return object\n");
13401337 goto out_no_enum;
13411338 }
13421339 if (device_enum->type != ACPI_TYPE_BUFFER) {
1343− pr_err(DRV_PFX "Invalid SN06 return object 0x%.2x\n",
1344− device_enum->type);
1340+ pr_err("Invalid SN06 return object 0x%.2x\n",
1341+ device_enum->type);
13451342 goto out_no_enum;
13461343 }
13471344
@@ -1662,7 +1659,7 @@ static void sony_nc_backlight_setup(void) · 314 unmodified lines
16621659 ops, &props);
16631660
16641661 if (IS_ERR(sony_bl_props.dev)) {
1665− pr_warn(DRV_PFX "unable to register backlight device\n");
1662+ pr_warn("unable to register backlight device\n");
16661663 sony_bl_props.dev = NULL;
16671664 } else
16681665 sony_bl_props.dev->props.brightness =
@@ -1682,8 +1679,7 @@ static int sony_nc_add(struct acpi_device *device) · 13 unmodified lines
16821679 acpi_handle handle;
16831680 struct sony_nc_value *item;
16841681
1685− pr_info(DRV_PFX "%s v%s.\n", SONY_NC_DRIVER_NAME,
1686− SONY_LAPTOP_DRIVER_VERSION);
1682+ pr_info("%s v%s\n", SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION);
16871683
16881684 sony_nc_acpi_device = device;
16891685 strcpy(acpi_device_class(device), "sony/hotkey");
@@ -1708,7 +1704,7 @@ static int sony_nc_add(struct acpi_device *device) · 18 unmodified lines
17081704 sony_nc_acpi_handle, 1, sony_walk_callback,
17091705 NULL, NULL, NULL);
17101706 if (ACPI_FAILURE(status)) {
1711− pr_warn(DRV_PFX "unable to walk acpi resources\n");
1707+ pr_warn("unable to walk acpi resources\n");
17121708 result = -ENODEV;
17131709 goto outpresent;
17141710 }
@@ -1736,13 +1732,12 @@ static int sony_nc_add(struct acpi_device *device) · 21 unmodified lines
17361732 /* setup input devices and helper fifo */
17371733 result = sony_laptop_setup_input(device);
17381734 if (result) {
1739− pr_err(DRV_PFX "Unable to create input devices.\n");
1735+ pr_err("Unable to create input devices\n");
17401736 goto outkbdbacklight;
17411737 }
17421738
17431739 if (acpi_video_backlight_support()) {
1744− pr_info(DRV_PFX "brightness ignored, must be "
1745− "controlled by ACPI video driver\n");
1740+ pr_info("brightness ignored, must be controlled by ACPI video driver\n");
17461741 } else {
17471742 sony_nc_backlight_setup();
17481743 }
@@ -2265,9 +2260,9 @@ out: · 516 unmodified lines
22652260 if (pcidev)
22662261 pci_dev_put(pcidev);
22672262
2268− pr_info(DRV_PFX "detected Type%d model\n",
2269− dev->model == SONYPI_DEVICE_TYPE1 ? 1 :
2270− dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3);
2263+ pr_info("detected Type%d model\n",
2264+ dev->model == SONYPI_DEVICE_TYPE1 ? 1 :
2265+ dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3);
22712266 }
22722267
22732268 /* camera tests and poweron/poweroff */
@@ -2313,7 +2308,7 @@ static int __sony_pic_camera_ready(void) · 39 unmodified lines
23132308 static int __sony_pic_camera_off(void)
23142309 {
23152310 if (!camera) {
2316− pr_warn(DRV_PFX "camera control not enabled\n");
2311+ pr_warn("camera control not enabled\n");
23172312 return -ENODEV;
23182313 }
23192314
@@ -2333,7 +2328,7 @@ static int __sony_pic_camera_on(void) · 13 unmodified lines
23332328 int i, j, x;
23342329
23352330 if (!camera) {
2336− pr_warn(DRV_PFX "camera control not enabled\n");
2331+ pr_warn("camera control not enabled\n");
23372332 return -ENODEV;
23382333 }
23392334
@@ -2356,7 +2351,7 @@ static int __sony_pic_camera_on(void) · 16 unmodified lines
23562351 }
23572352
23582353 if (j == 0) {
2359− pr_warn(DRV_PFX "failed to power on camera\n");
2354+ pr_warn("failed to power on camera\n");
23602355 return -ENODEV;
23612356 }
23622357
@@ -2412,8 +2407,7 @@ int sony_pic_camera_command(int command, u8 value) · 49 unmodified lines
24122407 ITERATIONS_SHORT);
24132408 break;
24142409 default:
2415− pr_err(DRV_PFX "sony_pic_camera_command invalid: %d\n",
2416− command);
2410+ pr_err("sony_pic_camera_command invalid: %d\n", command);
24172411 break;
24182412 }
24192413 mutex_unlock(&spic_dev.lock);
@@ -2819,7 +2813,7 @@ static int sonypi_compat_init(void) · 399 unmodified lines
28192813 error =
28202814 kfifo_alloc(&sonypi_compat.fifo, SONY_LAPTOP_BUF_SIZE, GFP_KERNEL);
28212815 if (error) {
2822− pr_err(DRV_PFX "kfifo_alloc failed\n");
2816+ pr_err("kfifo_alloc failed\n");
28232817 return error;
28242818 }
28252819
@@ -2829,12 +2823,12 @@ static int sonypi_compat_init(void) · 3 unmodified lines
28292823 sonypi_misc_device.minor = minor;
28302824 error = misc_register(&sonypi_misc_device);
28312825 if (error) {
2832− pr_err(DRV_PFX "misc_register failed\n");
2826+ pr_err("misc_register failed\n");
28332827 goto err_free_kfifo;
28342828 }
28352829 if (minor == -1)
2836− pr_info(DRV_PFX "device allocated minor is %d\n",
2837− sonypi_misc_device.minor);
2830+ pr_info("device allocated minor is %d\n",
2831+ sonypi_misc_device.minor);
28382832
28392833 return 0;
28402834
@@ -2893,8 +2887,8 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) · 52 unmodified lines
28932887 }
28942888 for (i = 0; i < p->interrupt_count; i++) {
28952889 if (!p->interrupts[i]) {
2896− pr_warn(DRV_PFX "Invalid IRQ %d\n",
2897− p->interrupts[i]);
2890+ pr_warn("Invalid IRQ %d\n",
2891+ p->interrupts[i]);
28982892 continue;
28992893 }
29002894 interrupt = kzalloc(sizeof(*interrupt),
@@ -2932,14 +2926,14 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) · 31 unmodified lines
29322926 ioport->io2.address_length);
29332927 }
29342928 else {
2935− pr_err(DRV_PFX "Unknown SPIC Type, more than 2 IO Ports\n");
2929+ pr_err("Unknown SPIC Type, more than 2 IO Ports\n");
29362930 return AE_ERROR;
29372931 }
29382932 return AE_OK;
29392933 }
29402934 default:
29412935 dprintk("Resource %d isn't an IRQ nor an IO port\n",
2942− resource->type);
2936+ resource->type);
29432937
29442938 case ACPI_RESOURCE_TYPE_END_TAG:
29452939 return AE_OK;
@@ -2960,7 +2954,7 @@ static int sony_pic_possible_resources(struct acpi_device *device) · 14 unmodified lines
29602954 dprintk("Evaluating _STA\n");
29612955 result = acpi_bus_get_status(device);
29622956 if (result) {
2963− pr_warn(DRV_PFX "Unable to read status\n");
2957+ pr_warn("Unable to read status\n");
29642958 goto end;
29652959 }
29662960
@@ -2976,8 +2970,7 @@ static int sony_pic_possible_resources(struct acpi_device *device) · 9 unmodified lines
29762970 status = acpi_walk_resources(device->handle, METHOD_NAME__PRS,
29772971 sony_pic_read_possible_resource, &spic_dev);
29782972 if (ACPI_FAILURE(status)) {
2979− pr_warn(DRV_PFX "Failure evaluating %s\n",
2980− METHOD_NAME__PRS);
2973+ pr_warn("Failure evaluating %s\n", METHOD_NAME__PRS);
29812974 result = -ENODEV;
29822975 }
29832976 end:
@@ -3090,7 +3083,7 @@ static int sony_pic_enable(struct acpi_device *device, · 106 unmodified lines
30903083
30913084 /* check for total failure */
30923085 if (ACPI_FAILURE(status)) {
3093− pr_err(DRV_PFX "Error evaluating _SRS\n");
3086+ pr_err("Error evaluating _SRS\n");
30943087 result = -ENODEV;
30953088 goto end;
30963089 }
@@ -3182,7 +3175,7 @@ static int sony_pic_remove(struct acpi_device *device, int type) · 85 unmodified lines
31823175 struct sony_pic_irq *irq, *tmp_irq;
31833176
31843177 if (sony_pic_disable(device)) {
3185− pr_err(DRV_PFX "Couldn't disable device.\n");
3178+ pr_err("Couldn't disable device\n");
31863179 return -ENXIO;
31873180 }
31883181
@@ -3222,8 +3215,7 @@ static int sony_pic_add(struct acpi_device *device) · 33 unmodified lines
32223215 struct sony_pic_ioport *io, *tmp_io;
32233216 struct sony_pic_irq *irq, *tmp_irq;
32243217
3225− pr_info(DRV_PFX "%s v%s.\n", SONY_PIC_DRIVER_NAME,
3226− SONY_LAPTOP_DRIVER_VERSION);
3218+ pr_info("%s v%s\n", SONY_PIC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION);
32273219
32283220 spic_dev.acpi_dev = device;
32293221 strcpy(acpi_device_class(device), "sony/hotkey");
@@ -3233,14 +3225,14 @@ static int sony_pic_add(struct acpi_device *device) · 3 unmodified lines
32333225 /* read _PRS resources */
32343226 result = sony_pic_possible_resources(device);
32353227 if (result) {
3236− pr_err(DRV_PFX "Unable to read possible resources.\n");
3228+ pr_err("Unable to read possible resources\n");
32373229 goto err_free_resources;
32383230 }
32393231
32403232 /* setup input devices and helper fifo */
32413233 result = sony_laptop_setup_input(device);
32423234 if (result) {
3243− pr_err(DRV_PFX "Unable to create input devices.\n");
3235+ pr_err("Unable to create input devices\n");
32443236 goto err_free_resources;
32453237 }
32463238
@@ -3281,7 +3273,7 @@ static int sony_pic_add(struct acpi_device *device) · 34 unmodified lines
32813273 }
32823274 }
32833275 if (!spic_dev.cur_ioport) {
3284− pr_err(DRV_PFX "Failed to request_region.\n");
3276+ pr_err("Failed to request_region\n");
32853277 result = -ENODEV;
32863278 goto err_remove_compat;
32873279 }
@@ -3301,7 +3293,7 @@ static int sony_pic_add(struct acpi_device *device) · 13 unmodified lines
33013293 }
33023294 }
33033295 if (!spic_dev.cur_irq) {
3304− pr_err(DRV_PFX "Failed to request_irq.\n");
3296+ pr_err("Failed to request_irq\n");
33053297 result = -ENODEV;
33063298 goto err_release_region;
33073299 }
@@ -3309,7 +3301,7 @@ static int sony_pic_add(struct acpi_device *device) · 1 unmodified line
33093301 /* set resource status _SRS */
33103302 result = sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq);
33113303 if (result) {
3312− pr_err(DRV_PFX "Couldn't enable device.\n");
3304+ pr_err("Couldn't enable device\n");
33133305 goto err_free_irq;
33143306 }
33153307
@@ -3418,7 +3410,7 @@ static int __init sony_laptop_init(void) · 102 unmodified lines
34183410 if (!no_spic && dmi_check_system(sonypi_dmi_table)) {
34193411 result = acpi_bus_register_driver(&sony_pic_driver);
34203412 if (result) {
3421− pr_err(DRV_PFX "Unable to register SPIC driver.");
3413+ pr_err("Unable to register SPIC driver\n");
34223414 goto out;
34233415 }
34243416 spic_drv_registered = 1;
@@ -3426,7 +3418,7 @@ static int __init sony_laptop_init(void) · 1 unmodified line
34263418
34273419 result = acpi_bus_register_driver(&sony_nc_driver);
34283420 if (result) {
3429− pr_err(DRV_PFX "Unable to register SNC driver.");
3421+ pr_err("Unable to register SNC driver\n");
34303422 goto out_unregister_pic;
34313423 }
34323424
drivers/platform/x86/tc1100-wmi.c+3−4
@@ -25,6 +25,8 @@ · 24 unmodified lines
2525 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2626 */
2727
28+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
29+
2830 #include <linux/kernel.h>
2931 #include <linux/module.h>
3032 #include <linux/slab.h>
@@ -40,9 +42,6 @@ · 9 unmodified lines
4042 #define TC1100_INSTANCE_WIRELESS 1
4143 #define TC1100_INSTANCE_JOGDIAL 2
4244
43−#define TC1100_LOGPREFIX "tc1100-wmi: "
44−#define TC1100_INFO KERN_INFO TC1100_LOGPREFIX
45−
4645 MODULE_AUTHOR("Jamey Hicks, Carlos Corbacho");
4746 MODULE_DESCRIPTION("HP Compaq TC1100 Tablet WMI Extras");
4847 MODULE_LICENSE("GPL");
@@ -264,7 +263,7 @@ static int __init tc1100_init(void) · 215 unmodified lines
264263 if (error)
265264 goto err_device_del;
266265
267− printk(TC1100_INFO "HP Compaq TC1100 Tablet WMI Extras loaded\n");
266+ pr_info("HP Compaq TC1100 Tablet WMI Extras loaded\n");
268267 return 0;
269268
270269 err_device_del:
drivers/platform/x86/thinkpad_acpi.c+197−293
@@ -21,6 +21,8 @@ · 20 unmodified lines
2121 * 02110-1301, USA.
2222 */
2323
24+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
25+
2426 #define TPACPI_VERSION "0.24"
2527 #define TPACPI_SYSFS_VERSION 0x020700
2628
@@ -224,17 +226,6 @@ enum tpacpi_hkey_event_t { · 197 unmodified lines
224226
225227 #define TPACPI_MAX_ACPI_ARGS 3
226228
227−/* printk headers */
228−#define TPACPI_LOG TPACPI_FILE ": "
229−#define TPACPI_EMERG KERN_EMERG TPACPI_LOG
230−#define TPACPI_ALERT KERN_ALERT TPACPI_LOG
231−#define TPACPI_CRIT KERN_CRIT TPACPI_LOG
232−#define TPACPI_ERR KERN_ERR TPACPI_LOG
233−#define TPACPI_WARN KERN_WARNING TPACPI_LOG
234−#define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG
235−#define TPACPI_INFO KERN_INFO TPACPI_LOG
236−#define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG
237−
238229 /* Debugging printk groups */
239230 #define TPACPI_DBG_ALL 0xffff
240231 #define TPACPI_DBG_DISCLOSETASK 0x8000
@@ -389,34 +380,36 @@ static int tpacpi_uwb_emulstate; · 148 unmodified lines
389380 * Debugging helpers
390381 */
391382
392−#define dbg_printk(a_dbg_level, format, arg...) \
393− do { if (dbg_level & (a_dbg_level)) \
394− printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \
395− } while (0)
383+#define dbg_printk(a_dbg_level, format, arg...) \
384+do { \
385+ if (dbg_level & (a_dbg_level)) \
386+ printk(KERN_DEBUG pr_fmt("%s: " format), \
387+ __func__, ##arg); \
388+} while (0)
396389
397390 #ifdef CONFIG_THINKPAD_ACPI_DEBUG
398391 #define vdbg_printk dbg_printk
399392 static const char *str_supported(int is_supported);
400393 #else
401−#define vdbg_printk(a_dbg_level, format, arg...) \
402− do { } while (0)
394+static inline const char *str_supported(int is_supported) { return ""; }
395+#define vdbg_printk(a_dbg_level, format, arg...) \
396+ no_printk(format, ##arg)
403397 #endif
404398
405399 static void tpacpi_log_usertask(const char * const what)
406400 {
407− printk(TPACPI_DEBUG "%s: access by process with PID %d\n",
408− what, task_tgid_vnr(current));
401+ printk(KERN_DEBUG pr_fmt("%s: access by process with PID %d\n"),
402+ what, task_tgid_vnr(current));
409403 }
410404
411−#define tpacpi_disclose_usertask(what, format, arg...) \
412− do { \
413− if (unlikely( \
414− (dbg_level & TPACPI_DBG_DISCLOSETASK) && \
415− (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
416− printk(TPACPI_DEBUG "%s: PID %d: " format, \
417− what, task_tgid_vnr(current), ## arg); \
418− } \
419− } while (0)
405+#define tpacpi_disclose_usertask(what, format, arg...) \
406+do { \
407+ if (unlikely((dbg_level & TPACPI_DBG_DISCLOSETASK) && \
408+ (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \
409+ printk(KERN_DEBUG pr_fmt("%s: PID %d: " format), \
410+ what, task_tgid_vnr(current), ## arg); \
411+ } \
412+} while (0)
420413
421414 /*
422415 * Quirk handling helpers
@@ -535,15 +528,6 @@ TPACPI_HANDLE(hkey, ec, "\\_SB.HKEY", /* 600e/x, 770e, 770x */ · 112 unmodified lines
535528 "HKEY", /* all others */
536529 ); /* 570 */
537530
538−TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */
539− "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
540− "\\_SB.PCI0.VID0", /* 770e */
541− "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
542− "\\_SB.PCI0.AGP.VGA", /* X100e and a few others */
543− "\\_SB.PCI0.AGP.VID", /* all others */
544− ); /* R30, R31 */
545−
546−
547531 /*************************************************************************
548532 * ACPI helpers
549533 */
@@ -563,7 +547,7 @@ static int acpi_evalf(acpi_handle handle, · 13 unmodified lines
563547 int quiet;
564548
565549 if (!*fmt) {
566− printk(TPACPI_ERR "acpi_evalf() called with empty format\n");
550+ pr_err("acpi_evalf() called with empty format\n");
567551 return 0;
568552 }
569553
@@ -588,7 +572,7 @@ static int acpi_evalf(acpi_handle handle, · 18 unmodified lines
588572 break;
589573 /* add more types as needed */
590574 default:
591− printk(TPACPI_ERR "acpi_evalf() called "
575+ pr_err("acpi_evalf() called "
592576 "with invalid format character '%c'\n", c);
593577 va_end(ap);
594578 return 0;
@@ -617,13 +601,13 @@ static int acpi_evalf(acpi_handle handle, · 22 unmodified lines
617601 break;
618602 /* add more types as needed */
619603 default:
620− printk(TPACPI_ERR "acpi_evalf() called "
604+ pr_err("acpi_evalf() called "
621605 "with invalid format character '%c'\n", res_type);
622606 return 0;
623607 }
624608
625609 if (!success && !quiet)
626− printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n",
610+ pr_err("acpi_evalf(%s, %s, ...) failed: %s\n",
627611 method, fmt0, acpi_format_exception(status));
628612
629613 return success;
@@ -767,8 +751,7 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm) · 137 unmodified lines
767751
768752 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device);
769753 if (rc < 0) {
770− printk(TPACPI_ERR "acpi_bus_get_device(%s) failed: %d\n",
771− ibm->name, rc);
754+ pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc);
772755 return -ENODEV;
773756 }
774757
@@ -781,12 +764,10 @@ static int __init setup_acpi_notify(struct ibm_struct *ibm) · 6 unmodified lines
781764 ibm->acpi->type, dispatch_acpi_notify, ibm);
782765 if (ACPI_FAILURE(status)) {
783766 if (status == AE_ALREADY_EXISTS) {
784− printk(TPACPI_NOTICE
785− "another device driver is already "
786− "handling %s events\n", ibm->name);
767+ pr_notice("another device driver is already "
768+ "handling %s events\n", ibm->name);
787769 } else {
788− printk(TPACPI_ERR
789− "acpi_install_notify_handler(%s) failed: %s\n",
770+ pr_err("acpi_install_notify_handler(%s) failed: %s\n",
790771 ibm->name, acpi_format_exception(status));
791772 }
792773 return -ENODEV;
@@ -811,8 +792,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) · 18 unmodified lines
811792
812793 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL);
813794 if (!ibm->acpi->driver) {
814− printk(TPACPI_ERR
815− "failed to allocate memory for ibm->acpi->driver\n");
795+ pr_err("failed to allocate memory for ibm->acpi->driver\n");
816796 return -ENOMEM;
817797 }
818798
@@ -823,7 +803,7 @@ static int __init register_tpacpi_subdriver(struct ibm_struct *ibm) · 4 unmodified lines
823803
824804 rc = acpi_bus_register_driver(ibm->acpi->driver);
825805 if (rc < 0) {
826− printk(TPACPI_ERR "acpi_bus_register_driver(%s) failed: %d\n",
806+ pr_err("acpi_bus_register_driver(%s) failed: %d\n",
827807 ibm->name, rc);
828808 kfree(ibm->acpi->driver);
829809 ibm->acpi->driver = NULL;
@@ -1081,15 +1061,14 @@ static int parse_strtoul(const char *buf, · 251 unmodified lines
10811061 static void tpacpi_disable_brightness_delay(void)
10821062 {
10831063 if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0))
1084− printk(TPACPI_NOTICE
1085− "ACPI backlight control delay disabled\n");
1064+ pr_notice("ACPI backlight control delay disabled\n");
10861065 }
10871066
10881067 static void printk_deprecated_attribute(const char * const what,
10891068 const char * const details)
10901069 {
10911070 tpacpi_log_usertask("deprecated sysfs attribute");
1092− printk(TPACPI_WARN "WARNING: sysfs attribute %s is deprecated and "
1071+ pr_warn("WARNING: sysfs attribute %s is deprecated and "
10931072 "will be removed. %s\n",
10941073 what, details);
10951074 }
@@ -1264,8 +1243,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, · 168 unmodified lines
12641243 &tpacpi_rfk_rfkill_ops,
12651244 atp_rfk);
12661245 if (!atp_rfk || !atp_rfk->rfkill) {
1267− printk(TPACPI_ERR
1268− "failed to allocate memory for rfkill class\n");
1246+ pr_err("failed to allocate memory for rfkill class\n");
12691247 kfree(atp_rfk);
12701248 return -ENOMEM;
12711249 }
@@ -1275,9 +1253,8 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, · 3 unmodified lines
12751253
12761254 sw_status = (tp_rfkops->get_status)();
12771255 if (sw_status < 0) {
1278− printk(TPACPI_ERR
1279− "failed to read initial state for %s, error %d\n",
1280− name, sw_status);
1256+ pr_err("failed to read initial state for %s, error %d\n",
1257+ name, sw_status);
12811258 } else {
12821259 sw_state = (sw_status == TPACPI_RFK_RADIO_OFF);
12831260 if (set_default) {
@@ -1291,9 +1268,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, · 7 unmodified lines
12911268
12921269 res = rfkill_register(atp_rfk->rfkill);
12931270 if (res < 0) {
1294− printk(TPACPI_ERR
1295− "failed to register %s rfkill switch: %d\n",
1296− name, res);
1271+ pr_err("failed to register %s rfkill switch: %d\n", name, res);
12971272 rfkill_destroy(atp_rfk->rfkill);
12981273 kfree(atp_rfk);
12991274 return res;
@@ -1301,7 +1276,7 @@ static int __init tpacpi_new_rfkill(const enum tpacpi_rfk_id id, · 1 unmodified line
13011276
13021277 tpacpi_rfkill_switches[id] = atp_rfk;
13031278
1304− printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n",
1279+ pr_info("rfkill switch %s: radio is %sblocked\n",
13051280 name, (sw_state || hw_state) ? "" : "un");
13061281 return 0;
13071282 }
@@ -1825,10 +1800,8 @@ static void __init tpacpi_check_outdated_fw(void) · 517 unmodified lines
18251800 * broken, or really stable to begin with, so it is
18261801 * best if the user upgrades the firmware anyway.
18271802 */
1828− printk(TPACPI_WARN
1829− "WARNING: Outdated ThinkPad BIOS/EC firmware\n");
1830− printk(TPACPI_WARN
1831− "WARNING: This firmware may be missing critical bug "
1803+ pr_warn("WARNING: Outdated ThinkPad BIOS/EC firmware\n");
1804+ pr_warn("WARNING: This firmware may be missing critical bug "
18321805 "fixes and/or important features\n");
18331806 }
18341807 }
@@ -2117,9 +2090,7 @@ void static hotkey_mask_warn_incomplete_mask(void) · 282 unmodified lines
21172090 (hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK);
21182091
21192092 if (wantedmask)
2120− printk(TPACPI_NOTICE
2121− "required events 0x%08x not enabled!\n",
2122− wantedmask);
2093+ pr_notice("required events 0x%08x not enabled!\n", wantedmask);
21232094 }
21242095
21252096 /*
@@ -2157,10 +2128,9 @@ static int hotkey_mask_set(u32 mask) · 31 unmodified lines
21572128 * a given event.
21582129 */
21592130 if (!hotkey_mask_get() && !rc && (fwmask & ~hotkey_acpi_mask)) {
2160− printk(TPACPI_NOTICE
2161− "asked for hotkey mask 0x%08x, but "
2162− "firmware forced it to 0x%08x\n",
2163− fwmask, hotkey_acpi_mask);
2131+ pr_notice("asked for hotkey mask 0x%08x, but "
2132+ "firmware forced it to 0x%08x\n",
2133+ fwmask, hotkey_acpi_mask);
21642134 }
21652135
21662136 if (tpacpi_lifecycle != TPACPI_LIFE_EXITING)
@@ -2184,13 +2154,11 @@ static int hotkey_user_mask_set(const u32 mask) · 17 unmodified lines
21842154 (mask == 0xffff || mask == 0xffffff ||
21852155 mask == 0xffffffff)) {
21862156 tp_warned.hotkey_mask_ff = 1;
2187− printk(TPACPI_NOTICE
2188− "setting the hotkey mask to 0x%08x is likely "
2189− "not the best way to go about it\n", mask);
2190− printk(TPACPI_NOTICE
2191− "please consider using the driver defaults, "
2192− "and refer to up-to-date thinkpad-acpi "
2193− "documentation\n");
2157+ pr_notice("setting the hotkey mask to 0x%08x is likely "
2158+ "not the best way to go about it\n", mask);
2159+ pr_notice("please consider using the driver defaults, "
2160+ "and refer to up-to-date thinkpad-acpi "
2161+ "documentation\n");
21942162 }
21952163
21962164 /* Try to enable what the user asked for, plus whatever we need.
@@ -2574,8 +2542,7 @@ static void hotkey_poll_setup(const bool may_warn) · 377 unmodified lines
25742542 NULL, TPACPI_NVRAM_KTHREAD_NAME);
25752543 if (IS_ERR(tpacpi_hotkey_task)) {
25762544 tpacpi_hotkey_task = NULL;
2577− printk(TPACPI_ERR
2578− "could not create kernel thread "
2545+ pr_err("could not create kernel thread "
25792546 "for hotkey polling\n");
25802547 }
25812548 }
@@ -2583,11 +2550,10 @@ static void hotkey_poll_setup(const bool may_warn) · 1 unmodified line
25832550 hotkey_poll_stop_sync();
25842551 if (may_warn && (poll_driver_mask || poll_user_mask) &&
25852552 hotkey_poll_freq == 0) {
2586− printk(TPACPI_NOTICE
2587− "hot keys 0x%08x and/or events 0x%08x "
2588− "require polling, which is currently "
2589− "disabled\n",
2590− poll_user_mask, poll_driver_mask);
2553+ pr_notice("hot keys 0x%08x and/or events 0x%08x "
2554+ "require polling, which is currently "
2555+ "disabled\n",
2556+ poll_user_mask, poll_driver_mask);
25912557 }
25922558 }
25932559 }
@@ -2811,13 +2777,13 @@ static ssize_t hotkey_source_mask_store(struct device *dev, · 217 unmodified lines
28112777 mutex_unlock(&hotkey_mutex);
28122778
28132779 if (rc < 0)
2814− printk(TPACPI_ERR "hotkey_source_mask: failed to update the"
2815− "firmware event mask!\n");
2780+ pr_err("hotkey_source_mask: "
2781+ "failed to update the firmware event mask!\n");
28162782
28172783 if (r_ev)
2818− printk(TPACPI_NOTICE "hotkey_source_mask: "
2819− "some important events were disabled: "
2820− "0x%04x\n", r_ev);
2784+ pr_notice("hotkey_source_mask: "
2785+ "some important events were disabled: 0x%04x\n",
2786+ r_ev);
28212787
28222788 tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\n", t);
28232789
@@ -3048,8 +3014,7 @@ static void hotkey_exit(void) · 224 unmodified lines
30483014 if (((tp_features.hotkey_mask &&
30493015 hotkey_mask_set(hotkey_orig_mask)) |
30503016 hotkey_status_set(false)) != 0)
3051− printk(TPACPI_ERR
3052− "failed to restore hot key mask "
3017+ pr_err("failed to restore hot key mask "
30533018 "to BIOS defaults\n");
30543019 }
30553020
@@ -3288,10 +3253,9 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 232 unmodified lines
32883253 for HKEY interface version 0x100 */
32893254 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) {
32903255 if ((hkeyv >> 8) != 1) {
3291− printk(TPACPI_ERR "unknown version of the "
3292− "HKEY interface: 0x%x\n", hkeyv);
3293− printk(TPACPI_ERR "please report this to %s\n",
3294− TPACPI_MAIL);
3256+ pr_err("unknown version of the HKEY interface: 0x%x\n",
3257+ hkeyv);
3258+ pr_err("please report this to %s\n", TPACPI_MAIL);
32953259 } else {
32963260 /*
32973261 * MHKV 0x100 in A31, R40, R40e,
@@ -3304,8 +3268,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 6 unmodified lines
33043268 /* Paranoia check AND init hotkey_all_mask */
33053269 if (!acpi_evalf(hkey_handle, &hotkey_all_mask,
33063270 "MHKA", "qd")) {
3307− printk(TPACPI_ERR
3308− "missing MHKA handler, "
3271+ pr_err("missing MHKA handler, "
33093272 "please report this to %s\n",
33103273 TPACPI_MAIL);
33113274 /* Fallback: pre-init for FN+F3,F4,F12 */
@@ -3343,16 +3306,14 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 31 unmodified lines
33433306 if (dbg_wlswemul) {
33443307 tp_features.hotkey_wlsw = 1;
33453308 radiosw_state = !!tpacpi_wlsw_emulstate;
3346− printk(TPACPI_INFO
3347− "radio switch emulation enabled\n");
3309+ pr_info("radio switch emulation enabled\n");
33483310 } else
33493311 #endif
33503312 /* Not all thinkpads have a hardware radio switch */
33513313 if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) {
33523314 tp_features.hotkey_wlsw = 1;
33533315 radiosw_state = !!status;
3354− printk(TPACPI_INFO
3355− "radio switch found; radios are %s\n",
3316+ pr_info("radio switch found; radios are %s\n",
33563317 enabled(status, 0));
33573318 }
33583319 if (tp_features.hotkey_wlsw)
@@ -3363,8 +3324,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 4 unmodified lines
33633324 if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) {
33643325 tp_features.hotkey_tablet = 1;
33653326 tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK);
3366− printk(TPACPI_INFO
3367− "possible tablet mode switch found; "
3327+ pr_info("possible tablet mode switch found; "
33683328 "ThinkPad in %s mode\n",
33693329 (tabletsw_state) ? "tablet" : "laptop");
33703330 res = add_to_attr_set(hotkey_dev_attributes,
@@ -3382,8 +3342,7 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 11 unmodified lines
33823342 hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE,
33833343 GFP_KERNEL);
33843344 if (!hotkey_keycode_map) {
3385− printk(TPACPI_ERR
3386− "failed to allocate memory for key map\n");
3345+ pr_err("failed to allocate memory for key map\n");
33873346 res = -ENOMEM;
33883347 goto err_exit;
33893348 }
@@ -3426,13 +3385,11 @@ static int __init hotkey_init(struct ibm_init_struct *iibm) · 36 unmodified lines
34263385 * userspace. tpacpi_detect_brightness_capabilities() must have
34273386 * been called before this point */
34283387 if (tp_features.bright_acpimode && acpi_video_backlight_support()) {
3429− printk(TPACPI_INFO
3430− "This ThinkPad has standard ACPI backlight "
3431− "brightness control, supported by the ACPI "
3432− "video driver\n");
3433− printk(TPACPI_NOTICE
3434− "Disabling thinkpad-acpi brightness events "
3435− "by default...\n");
3388+ pr_info("This ThinkPad has standard ACPI backlight "
3389+ "brightness control, supported by the ACPI "
3390+ "video driver\n");
3391+ pr_notice("Disabling thinkpad-acpi brightness events "
3392+ "by default...\n");
34363393
34373394 /* Disable brightness up/down on Lenovo thinkpads when
34383395 * ACPI is handling them, otherwise it is plain impossible
@@ -3539,8 +3496,7 @@ static bool hotkey_notify_wakeup(const u32 hkey, · 100 unmodified lines
35393496
35403497 case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */
35413498 case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */
3542− printk(TPACPI_ALERT
3543− "EMERGENCY WAKEUP: battery almost empty\n");
3499+ pr_alert("EMERGENCY WAKEUP: battery almost empty\n");
35443500 /* how to auto-heal: */
35453501 /* 2313: woke up from S3, go to S4/S5 */
35463502 /* 2413: woke up from S4, go to S5 */
@@ -3551,9 +3507,7 @@ static bool hotkey_notify_wakeup(const u32 hkey, · 4 unmodified lines
35513507 }
35523508
35533509 if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) {
3554− printk(TPACPI_INFO
3555− "woke up due to a hot-unplug "
3556− "request...\n");
3510+ pr_info("woke up due to a hot-unplug request...\n");
35573511 hotkey_wakeup_reason_notify_change();
35583512 }
35593513 return true;
@@ -3605,37 +3559,31 @@ static bool hotkey_notify_thermal(const u32 hkey, · 45 unmodified lines
36053559
36063560 switch (hkey) {
36073561 case TP_HKEY_EV_THM_TABLE_CHANGED:
3608− printk(TPACPI_INFO
3609− "EC reports that Thermal Table has changed\n");
3562+ pr_info("EC reports that Thermal Table has changed\n");
36103563 /* recommended action: do nothing, we don't have
36113564 * Lenovo ATM information */
36123565 return true;
36133566 case TP_HKEY_EV_ALARM_BAT_HOT:
3614− printk(TPACPI_CRIT
3615− "THERMAL ALARM: battery is too hot!\n");
3567+ pr_crit("THERMAL ALARM: battery is too hot!\n");
36163568 /* recommended action: warn user through gui */
36173569 break;
36183570 case TP_HKEY_EV_ALARM_BAT_XHOT:
3619− printk(TPACPI_ALERT
3620− "THERMAL EMERGENCY: battery is extremely hot!\n");
3571+ pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n");
36213572 /* recommended action: immediate sleep/hibernate */
36223573 break;
36233574 case TP_HKEY_EV_ALARM_SENSOR_HOT:
3624− printk(TPACPI_CRIT
3625− "THERMAL ALARM: "
3575+ pr_crit("THERMAL ALARM: "
36263576 "a sensor reports something is too hot!\n");
36273577 /* recommended action: warn user through gui, that */
36283578 /* some internal component is too hot */
36293579 break;
36303580 case TP_HKEY_EV_ALARM_SENSOR_XHOT:
3631− printk(TPACPI_ALERT
3632− "THERMAL EMERGENCY: "
3633− "a sensor reports something is extremely hot!\n");
3581+ pr_alert("THERMAL EMERGENCY: "
3582+ "a sensor reports something is extremely hot!\n");
36343583 /* recommended action: immediate sleep/hibernate */
36353584 break;
36363585 default:
3637− printk(TPACPI_ALERT
3638− "THERMAL ALERT: unknown thermal alarm received\n");
3586+ pr_alert("THERMAL ALERT: unknown thermal alarm received\n");
36393587 known = false;
36403588 }
36413589
@@ -3652,8 +3600,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) · 10 unmodified lines
36523600 bool known_ev;
36533601
36543602 if (event != 0x80) {
3655− printk(TPACPI_ERR
3656− "unknown HKEY notification event %d\n", event);
3603+ pr_err("unknown HKEY notification event %d\n", event);
36573604 /* forward it to userspace, maybe it knows how to handle it */
36583605 acpi_bus_generate_netlink_event(
36593606 ibm->acpi->device->pnp.device_class,
@@ -3664,7 +3611,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) · 4 unmodified lines
36643611
36653612 while (1) {
36663613 if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) {
3667− printk(TPACPI_ERR "failed to retrieve HKEY event\n");
3614+ pr_err("failed to retrieve HKEY event\n");
36683615 return;
36693616 }
36703617
@@ -3692,8 +3639,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) · 21 unmodified lines
36923639 switch (hkey) {
36933640 case TP_HKEY_EV_BAYEJ_ACK:
36943641 hotkey_autosleep_ack = 1;
3695− printk(TPACPI_INFO
3696− "bay ejected\n");
3642+ pr_info("bay ejected\n");
36973643 hotkey_wakeup_hotunplug_complete_notify_change();
36983644 known_ev = true;
36993645 break;
@@ -3709,8 +3655,7 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) · 9 unmodified lines
37093655 /* 0x4000-0x4FFF: dock-related wakeups */
37103656 if (hkey == TP_HKEY_EV_UNDOCK_ACK) {
37113657 hotkey_autosleep_ack = 1;
3712− printk(TPACPI_INFO
3713− "undocked\n");
3658+ pr_info("undocked\n");
37143659 hotkey_wakeup_hotunplug_complete_notify_change();
37153660 known_ev = true;
37163661 } else {
@@ -3741,11 +3686,9 @@ static void hotkey_notify(struct ibm_struct *ibm, u32 event) · 24 unmodified lines
37413686 known_ev = false;
37423687 }
37433688 if (!known_ev) {
3744− printk(TPACPI_NOTICE
3745− "unhandled HKEY event 0x%04x\n", hkey);
3746− printk(TPACPI_NOTICE
3747− "please report the conditions when this "
3748− "event happened to %s\n", TPACPI_MAIL);
3689+ pr_notice("unhandled HKEY event 0x%04x\n", hkey);
3690+ pr_notice("please report the conditions when this "
3691+ "event happened to %s\n", TPACPI_MAIL);
37493692 }
37503693
37513694 /* Legacy events */
@@ -3778,8 +3721,7 @@ static void hotkey_resume(void) · 26 unmodified lines
37783721
37793722 if (hotkey_status_set(true) < 0 ||
37803723 hotkey_mask_set(hotkey_acpi_mask) < 0)
3781− printk(TPACPI_ERR
3782− "error while attempting to reset the event "
3724+ pr_err("error while attempting to reset the event "
37833725 "firmware interface\n");
37843726
37853727 tpacpi_send_radiosw_update();
@@ -3824,14 +3766,12 @@ static void hotkey_enabledisable_warn(bool enable) · 38 unmodified lines
38243766 {
38253767 tpacpi_log_usertask("procfs hotkey enable/disable");
38263768 if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable),
3827− TPACPI_WARN
3828− "hotkey enable/disable functionality has been "
3829− "removed from the driver. Hotkeys are always "
3830− "enabled\n"))
3831− printk(TPACPI_ERR
3832− "Please remove the hotkey=enable module "
3833− "parameter, it is deprecated. Hotkeys are always "
3834− "enabled\n");
3769+ pr_fmt("hotkey enable/disable functionality has been "
3770+ "removed from the driver. "
3771+ "Hotkeys are always enabled.\n")))
3772+ pr_err("Please remove the hotkey=enable module "
3773+ "parameter, it is deprecated. "
3774+ "Hotkeys are always enabled.\n");
38353775 }
38363776
38373777 static int hotkey_write(char *buf)
@@ -4011,8 +3951,7 @@ static void bluetooth_shutdown(void) · 173 unmodified lines
40113951 /* Order firmware to save current state to NVRAM */
40123952 if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd",
40133953 TP_ACPI_BLTH_SAVE_STATE))
4014− printk(TPACPI_NOTICE
4015− "failed to save bluetooth state to NVRAM\n");
3954+ pr_notice("failed to save bluetooth state to NVRAM\n");
40163955 else
40173956 vdbg_printk(TPACPI_DBG_RFKILL,
40183957 "bluestooth state saved to NVRAM\n");
@@ -4051,8 +3990,7 @@ static int __init bluetooth_init(struct ibm_init_struct *iibm) · 32 unmodified lines
40513990 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
40523991 if (dbg_bluetoothemul) {
40533992 tp_features.bluetooth = 1;
4054− printk(TPACPI_INFO
4055− "bluetooth switch emulation enabled\n");
3993+ pr_info("bluetooth switch emulation enabled\n");
40563994 } else
40573995 #endif
40583996 if (tp_features.bluetooth &&
@@ -4203,8 +4141,7 @@ static void wan_shutdown(void) · 144 unmodified lines
42034141 /* Order firmware to save current state to NVRAM */
42044142 if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd",
42054143 TP_ACPI_WGSV_SAVE_STATE))
4206− printk(TPACPI_NOTICE
4207− "failed to save WWAN state to NVRAM\n");
4144+ pr_notice("failed to save WWAN state to NVRAM\n");
42084145 else
42094146 vdbg_printk(TPACPI_DBG_RFKILL,
42104147 "WWAN state saved to NVRAM\n");
@@ -4241,8 +4178,7 @@ static int __init wan_init(struct ibm_init_struct *iibm) · 30 unmodified lines
42414178 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
42424179 if (dbg_wwanemul) {
42434180 tp_features.wan = 1;
4244− printk(TPACPI_INFO
4245− "wwan switch emulation enabled\n");
4181+ pr_info("wwan switch emulation enabled\n");
42464182 } else
42474183 #endif
42484184 if (tp_features.wan &&
@@ -4382,8 +4318,7 @@ static int __init uwb_init(struct ibm_init_struct *iibm) · 133 unmodified lines
43824318 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES
43834319 if (dbg_uwbemul) {
43844320 tp_features.uwb = 1;
4385− printk(TPACPI_INFO
4386− "uwb switch emulation enabled\n");
4321+ pr_info("uwb switch emulation enabled\n");
43874322 } else
43884323 #endif
43894324 if (tp_features.uwb &&
@@ -4444,6 +4379,15 @@ static int video_orig_autosw; · 54 unmodified lines
44444379 static int video_autosw_get(void);
44454380 static int video_autosw_set(int enable);
44464381
4382+TPACPI_HANDLE(vid, root,
4383+ "\\_SB.PCI.AGP.VGA", /* 570 */
4384+ "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */
4385+ "\\_SB.PCI0.VID0", /* 770e */
4386+ "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */
4387+ "\\_SB.PCI0.AGP.VGA", /* X100e and a few others */
4388+ "\\_SB.PCI0.AGP.VID", /* all others */
4389+ ); /* R30, R31 */
4390+
44474391 TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */
44484392
44494393 static int __init video_init(struct ibm_init_struct *iibm)
@@ -4487,7 +4431,7 @@ static void video_exit(void) · 37 unmodified lines
44874431 dbg_printk(TPACPI_DBG_EXIT,
44884432 "restoring original video autoswitch mode\n");
44894433 if (video_autosw_set(video_orig_autosw))
4490− printk(TPACPI_ERR "error while trying to restore original "
4434+ pr_err("error while trying to restore original "
44914435 "video autoswitch mode\n");
44924436 }
44934437
@@ -4560,8 +4504,7 @@ static int video_outputsw_set(int status) · 66 unmodified lines
45604504 res = acpi_evalf(vid_handle, NULL,
45614505 "ASWT", "vdd", status * 0x100, 0);
45624506 if (!autosw && video_autosw_set(autosw)) {
4563− printk(TPACPI_ERR
4564− "video auto-switch left enabled due to error\n");
4507+ pr_err("video auto-switch left enabled due to error\n");
45654508 return -EIO;
45664509 }
45674510 break;
@@ -4630,8 +4573,7 @@ static int video_outputsw_cycle(void) · 62 unmodified lines
46304573 return -ENOSYS;
46314574 }
46324575 if (!autosw && video_autosw_set(autosw)) {
4633− printk(TPACPI_ERR
4634− "video auto-switch left enabled due to error\n");
4576+ pr_err("video auto-switch left enabled due to error\n");
46354577 return -EIO;
46364578 }
46374579
@@ -5348,7 +5290,7 @@ static int __init led_init(struct ibm_init_struct *iibm) · 710 unmodified lines
53485290 tpacpi_leds = kzalloc(sizeof(*tpacpi_leds) * TPACPI_LED_NUMLEDS,
53495291 GFP_KERNEL);
53505292 if (!tpacpi_leds) {
5351− printk(TPACPI_ERR "Out of memory for LED data\n");
5293+ pr_err("Out of memory for LED data\n");
53525294 return -ENOMEM;
53535295 }
53545296
@@ -5367,9 +5309,8 @@ static int __init led_init(struct ibm_init_struct *iibm) · 12 unmodified lines
53675309 }
53685310
53695311 #ifdef CONFIG_THINKPAD_ACPI_UNSAFE_LEDS
5370− printk(TPACPI_NOTICE
5371− "warning: userspace override of important "
5372− "firmware LEDs is enabled\n");
5312+ pr_notice("warning: userspace override of important "
5313+ "firmware LEDs is enabled\n");
53735314 #endif
53745315 return 0;
53755316 }
@@ -5639,17 +5580,16 @@ static void thermal_dump_all_sensors(void) · 263 unmodified lines
56395580 if (n <= 0)
56405581 return;
56415582
5642− printk(TPACPI_NOTICE
5643− "temperatures (Celsius):");
5583+ pr_notice("temperatures (Celsius):");
56445584
56455585 for (i = 0; i < n; i++) {
56465586 if (t.temp[i] != TPACPI_THERMAL_SENSOR_NA)
5647− printk(KERN_CONT " %d", (int)(t.temp[i] / 1000));
5587+ pr_cont(" %d", (int)(t.temp[i] / 1000));
56485588 else
5649− printk(KERN_CONT " N/A");
5589+ pr_cont(" N/A");
56505590 }
56515591
5652− printk(KERN_CONT "\n");
5592+ pr_cont("\n");
56535593 }
56545594
56555595 /* sysfs temp##_input -------------------------------------------------- */
@@ -5769,14 +5709,12 @@ static int __init thermal_init(struct ibm_init_struct *iibm) · 113 unmodified lines
57695709 if (ta1 == 0) {
57705710 /* This is sheer paranoia, but we handle it anyway */
57715711 if (acpi_tmp7) {
5772− printk(TPACPI_ERR
5773− "ThinkPad ACPI EC access misbehaving, "
5712+ pr_err("ThinkPad ACPI EC access misbehaving, "
57745713 "falling back to ACPI TMPx access "
57755714 "mode\n");
57765715 thermal_read_mode = TPACPI_THERMAL_ACPI_TMP07;
57775716 } else {
5778− printk(TPACPI_ERR
5779− "ThinkPad ACPI EC access misbehaving, "
5717+ pr_err("ThinkPad ACPI EC access misbehaving, "
57805718 "disabling thermal sensors access\n");
57815719 thermal_read_mode = TPACPI_THERMAL_NONE;
57825720 }
@@ -6129,8 +6067,8 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle) · 346 unmodified lines
61296067 if (ACPI_SUCCESS(acpi_evaluate_object(handle, "_BCL", NULL, &buffer))) {
61306068 obj = (union acpi_object *)buffer.pointer;
61316069 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {
6132− printk(TPACPI_ERR "Unknown _BCL data, "
6133− "please report this to %s\n", TPACPI_MAIL);
6070+ pr_err("Unknown _BCL data, please report this to %s\n",
6071+ TPACPI_MAIL);
61346072 rc = 0;
61356073 } else {
61366074 rc = obj->package.count;
@@ -6214,18 +6152,15 @@ static void __init tpacpi_detect_brightness_capabilities(void) · 77 unmodified lines
62146152 switch (b) {
62156153 case 16:
62166154 bright_maxlvl = 15;
6217− printk(TPACPI_INFO
6218− "detected a 16-level brightness capable ThinkPad\n");
6155+ pr_info("detected a 16-level brightness capable ThinkPad\n");
62196156 break;
62206157 case 8:
62216158 case 0:
62226159 bright_maxlvl = 7;
6223− printk(TPACPI_INFO
6224− "detected a 8-level brightness capable ThinkPad\n");
6160+ pr_info("detected a 8-level brightness capable ThinkPad\n");
62256161 break;
62266162 default:
6227− printk(TPACPI_ERR
6228− "Unsupported brightness interface, "
6163+ pr_err("Unsupported brightness interface, "
62296164 "please contact %s\n", TPACPI_MAIL);
62306165 tp_features.bright_unkfw = 1;
62316166 bright_maxlvl = b - 1;
@@ -6260,22 +6195,19 @@ static int __init brightness_init(struct ibm_init_struct *iibm) · 28 unmodified lines
62606195
62616196 if (acpi_video_backlight_support()) {
62626197 if (brightness_enable > 1) {
6263− printk(TPACPI_INFO
6264− "Standard ACPI backlight interface "
6265− "available, not loading native one.\n");
6198+ pr_info("Standard ACPI backlight interface "
6199+ "available, not loading native one\n");
62666200 return 1;
62676201 } else if (brightness_enable == 1) {
6268− printk(TPACPI_WARN
6269− "Cannot enable backlight brightness support, "
6202+ pr_warn("Cannot enable backlight brightness support, "
62706203 "ACPI is already handling it. Refer to the "
6271− "acpi_backlight kernel parameter\n");
6204+ "acpi_backlight kernel parameter.\n");
62726205 return 1;
62736206 }
62746207 } else if (tp_features.bright_acpimode && brightness_enable > 1) {
6275− printk(TPACPI_NOTICE
6276− "Standard ACPI backlight interface not "
6277− "available, thinkpad_acpi native "
6278− "brightness control enabled\n");
6208+ pr_notice("Standard ACPI backlight interface not "
6209+ "available, thinkpad_acpi native "
6210+ "brightness control enabled\n");
62796211 }
62806212
62816213 /*
@@ -6319,19 +6251,17 @@ static int __init brightness_init(struct ibm_init_struct *iibm) · 37 unmodified lines
63196251 if (IS_ERR(ibm_backlight_device)) {
63206252 int rc = PTR_ERR(ibm_backlight_device);
63216253 ibm_backlight_device = NULL;
6322− printk(TPACPI_ERR "Could not register backlight device\n");
6254+ pr_err("Could not register backlight device\n");
63236255 return rc;
63246256 }
63256257 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT,
63266258 "brightness is supported\n");
63276259
63286260 if (quirks & TPACPI_BRGHT_Q_ASK) {
6329− printk(TPACPI_NOTICE
6330− "brightness: will use unverified default: "
6331− "brightness_mode=%d\n", brightness_mode);
6332− printk(TPACPI_NOTICE
6333− "brightness: please report to %s whether it works well "
6334− "or not on your ThinkPad\n", TPACPI_MAIL);
6261+ pr_notice("brightness: will use unverified default: "
6262+ "brightness_mode=%d\n", brightness_mode);
6263+ pr_notice("brightness: please report to %s whether it works well "
6264+ "or not on your ThinkPad\n", TPACPI_MAIL);
63356265 }
63366266
63376267 /* Added by mistake in early 2007. Probably useless, but it could
@@ -6804,8 +6734,7 @@ static int __init volume_create_alsa_mixer(void) · 466 unmodified lines
68046734 rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE,
68056735 sizeof(struct tpacpi_alsa_data), &card);
68066736 if (rc < 0 || !card) {
6807− printk(TPACPI_ERR
6808− "Failed to create ALSA card structures: %d\n", rc);
6737+ pr_err("Failed to create ALSA card structures: %d\n", rc);
68096738 return 1;
68106739 }
68116740
@@ -6839,9 +6768,8 @@ static int __init volume_create_alsa_mixer(void) · 27 unmodified lines
68396768 ctl_vol = snd_ctl_new1(&volume_alsa_control_vol, NULL);
68406769 rc = snd_ctl_add(card, ctl_vol);
68416770 if (rc < 0) {
6842− printk(TPACPI_ERR
6843− "Failed to create ALSA volume control: %d\n",
6844− rc);
6771+ pr_err("Failed to create ALSA volume control: %d\n",
6772+ rc);
68456773 goto err_exit;
68466774 }
68476775 data->ctl_vol_id = &ctl_vol->id;
@@ -6850,8 +6778,7 @@ static int __init volume_create_alsa_mixer(void) · 2 unmodified lines
68506778 ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL);
68516779 rc = snd_ctl_add(card, ctl_mute);
68526780 if (rc < 0) {
6853− printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n",
6854− rc);
6781+ pr_err("Failed to create ALSA mute control: %d\n", rc);
68556782 goto err_exit;
68566783 }
68576784 data->ctl_mute_id = &ctl_mute->id;
@@ -6859,7 +6786,7 @@ static int __init volume_create_alsa_mixer(void) · 1 unmodified line
68596786 snd_card_set_dev(card, &tpacpi_pdev->dev);
68606787 rc = snd_card_register(card);
68616788 if (rc < 0) {
6862− printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc);
6789+ pr_err("Failed to register ALSA card: %d\n", rc);
68636790 goto err_exit;
68646791 }
68656792
@@ -6915,9 +6842,8 @@ static int __init volume_init(struct ibm_init_struct *iibm) · 49 unmodified lines
69156842 return -EINVAL;
69166843
69176844 if (volume_mode == TPACPI_VOL_MODE_UCMS_STEP) {
6918− printk(TPACPI_ERR
6919− "UCMS step volume mode not implemented, "
6920− "please contact %s\n", TPACPI_MAIL);
6845+ pr_err("UCMS step volume mode not implemented, "
6846+ "please contact %s\n", TPACPI_MAIL);
69216847 return 1;
69226848 }
69236849
@@ -6981,13 +6907,11 @@ static int __init volume_init(struct ibm_init_struct *iibm) · 57 unmodified lines
69816907
69826908 rc = volume_create_alsa_mixer();
69836909 if (rc) {
6984− printk(TPACPI_ERR
6985− "Could not create the ALSA mixer interface\n");
6910+ pr_err("Could not create the ALSA mixer interface\n");
69866911 return rc;
69876912 }
69886913
6989− printk(TPACPI_INFO
6990− "Console audio control enabled, mode: %s\n",
6914+ pr_info("Console audio control enabled, mode: %s\n",
69916915 (volume_control_allowed) ?
69926916 "override (read/write)" :
69936917 "monitor (read only)");
@@ -7049,12 +6973,10 @@ static int volume_write(char *buf) · 55 unmodified lines
70496973 if (!volume_control_allowed && tpacpi_lifecycle != TPACPI_LIFE_INIT) {
70506974 if (unlikely(!tp_warned.volume_ctrl_forbidden)) {
70516975 tp_warned.volume_ctrl_forbidden = 1;
7052− printk(TPACPI_NOTICE
7053− "Console audio control in monitor mode, "
7054− "changes are not allowed.\n");
7055− printk(TPACPI_NOTICE
7056− "Use the volume_control=1 module parameter "
7057− "to enable volume control\n");
6976+ pr_notice("Console audio control in monitor mode, "
6977+ "changes are not allowed\n");
6978+ pr_notice("Use the volume_control=1 module parameter "
6979+ "to enable volume control\n");
70586980 }
70596981 return -EPERM;
70606982 }
@@ -7129,8 +7051,7 @@ static void inline volume_alsa_notify_change(void) · 68 unmodified lines
71297051
71307052 static int __init volume_init(struct ibm_init_struct *iibm)
71317053 {
7132− printk(TPACPI_INFO
7133− "volume: disabled as there is no ALSA support in this kernel\n");
7054+ pr_info("volume: disabled as there is no ALSA support in this kernel\n");
71347055
71357056 return 1;
71367057 }
@@ -7337,9 +7258,8 @@ TPACPI_HANDLE(sfan, ec, "SFAN", /* 570 */ · 200 unmodified lines
73377258 static void fan_quirk1_setup(void)
73387259 {
73397260 if (fan_control_initial_status == 0x07) {
7340− printk(TPACPI_NOTICE
7341− "fan_init: initial fan status is unknown, "
7342− "assuming it is in auto mode\n");
7261+ pr_notice("fan_init: initial fan status is unknown, "
7262+ "assuming it is in auto mode\n");
73437263 tp_features.fan_ctrl_status_undef = 1;
73447264 }
73457265 }
@@ -7726,8 +7646,7 @@ static void fan_watchdog_reset(void) · 380 unmodified lines
77267646 if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task,
77277647 msecs_to_jiffies(fan_watchdog_maxinterval
77287648 * 1000))) {
7729− printk(TPACPI_ERR
7730− "failed to queue the fan watchdog, "
7649+ pr_err("failed to queue the fan watchdog, "
77317650 "watchdog will not trigger\n");
77327651 }
77337652 } else
@@ -7741,11 +7660,11 @@ static void fan_watchdog_fire(struct work_struct *ignored) · 7 unmodified lines
77417660 if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING)
77427661 return;
77437662
7744− printk(TPACPI_NOTICE "fan watchdog: enabling fan\n");
7663+ pr_notice("fan watchdog: enabling fan\n");
77457664 rc = fan_set_enable();
77467665 if (rc < 0) {
7747− printk(TPACPI_ERR "fan watchdog: error %d while enabling fan, "
7748− "will try again later...\n", -rc);
7666+ pr_err("fan watchdog: error %d while enabling fan, "
7667+ "will try again later...\n", -rc);
77497668 /* reschedule for later */
77507669 fan_watchdog_reset();
77517670 }
@@ -8049,8 +7968,7 @@ static int __init fan_init(struct ibm_init_struct *iibm) · 297 unmodified lines
80497968 "secondary fan support enabled\n");
80507969 }
80517970 } else {
8052− printk(TPACPI_ERR
8053− "ThinkPad ACPI EC access misbehaving, "
7971+ pr_err("ThinkPad ACPI EC access misbehaving, "
80547972 "fan status and control unavailable\n");
80557973 return 1;
80567974 }
@@ -8150,9 +8068,8 @@ static void fan_suspend(pm_message_t state) · 93 unmodified lines
81508068 fan_control_resume_level = 0;
81518069 rc = fan_get_status_safe(&fan_control_resume_level);
81528070 if (rc < 0)
8153− printk(TPACPI_NOTICE
8154− "failed to read fan level for later "
8155− "restore during resume: %d\n", rc);
8071+ pr_notice("failed to read fan level for later "
8072+ "restore during resume: %d\n", rc);
81568073
81578074 /* if it is undefined, don't attempt to restore it.
81588075 * KEEP THIS LAST */
@@ -8207,13 +8124,11 @@ static void fan_resume(void) · 48 unmodified lines
82078124 return;
82088125 }
82098126 if (do_set) {
8210− printk(TPACPI_NOTICE
8211− "restoring fan level to 0x%02x\n",
8212− fan_control_resume_level);
8127+ pr_notice("restoring fan level to 0x%02x\n",
8128+ fan_control_resume_level);
82138129 rc = fan_set_level_safe(fan_control_resume_level);
82148130 if (rc < 0)
8215− printk(TPACPI_NOTICE
8216− "failed to restore fan level: %d\n", rc);
8131+ pr_notice("failed to restore fan level: %d\n", rc);
82178132 }
82188133 }
82198134
@@ -8305,8 +8220,8 @@ static int fan_write_cmd_level(const char *cmd, int *rc) · 85 unmodified lines
83058220
83068221 *rc = fan_set_level_safe(level);
83078222 if (*rc == -ENXIO)
8308− printk(TPACPI_ERR "level command accepted for unsupported "
8309− "access mode %d", fan_control_access_mode);
8223+ pr_err("level command accepted for unsupported access mode %d\n",
8224+ fan_control_access_mode);
83108225 else if (!*rc)
83118226 tpacpi_disclose_usertask("procfs fan",
83128227 "set level to %d\n", level);
@@ -8321,8 +8236,8 @@ static int fan_write_cmd_enable(const char *cmd, int *rc) · 8 unmodified lines
83218236
83228237 *rc = fan_set_enable();
83238238 if (*rc == -ENXIO)
8324− printk(TPACPI_ERR "enable command accepted for unsupported "
8325− "access mode %d", fan_control_access_mode);
8239+ pr_err("enable command accepted for unsupported access mode %d\n",
8240+ fan_control_access_mode);
83268241 else if (!*rc)
83278242 tpacpi_disclose_usertask("procfs fan", "enable\n");
83288243
@@ -8336,8 +8251,8 @@ static int fan_write_cmd_disable(const char *cmd, int *rc) · 7 unmodified lines
83368251
83378252 *rc = fan_set_disable();
83388253 if (*rc == -ENXIO)
8339− printk(TPACPI_ERR "disable command accepted for unsupported "
8340− "access mode %d", fan_control_access_mode);
8254+ pr_err("disable command accepted for unsupported access mode %d\n",
8255+ fan_control_access_mode);
83418256 else if (!*rc)
83428257 tpacpi_disclose_usertask("procfs fan", "disable\n");
83438258
@@ -8356,8 +8271,8 @@ static int fan_write_cmd_speed(const char *cmd, int *rc) · 12 unmodified lines
83568271
83578272 *rc = fan_set_speed(speed);
83588273 if (*rc == -ENXIO)
8359− printk(TPACPI_ERR "speed command accepted for unsupported "
8360− "access mode %d", fan_control_access_mode);
8274+ pr_err("speed command accepted for unsupported access mode %d\n",
8275+ fan_control_access_mode);
83618276 else if (!*rc)
83628277 tpacpi_disclose_usertask("procfs fan",
83638278 "set speed to %d\n", speed);
@@ -8560,8 +8475,8 @@ static int __init ibm_init(struct ibm_init_struct *iibm) · 196 unmodified lines
85608475 if (ibm->acpi->notify) {
85618476 ret = setup_acpi_notify(ibm);
85628477 if (ret == -ENODEV) {
8563− printk(TPACPI_NOTICE "disabling subdriver %s\n",
8564− ibm->name);
8478+ pr_notice("disabling subdriver %s\n",
8479+ ibm->name);
85658480 ret = 0;
85668481 goto err_out;
85678482 }
@@ -8583,8 +8498,7 @@ static int __init ibm_init(struct ibm_init_struct *iibm) · 15 unmodified lines
85838498 entry = proc_create_data(ibm->name, mode, proc_dir,
85848499 &dispatch_proc_fops, ibm);
85858500 if (!entry) {
8586− printk(TPACPI_ERR "unable to create proc entry %s\n",
8587− ibm->name);
8501+ pr_err("unable to create proc entry %s\n", ibm->name);
85888502 ret = -ENODEV;
85898503 goto err_out;
85908504 }
@@ -8683,13 +8597,11 @@ static int __must_check __init get_thinkpad_model_data( · 92 unmodified lines
86838597 tp->ec_release = (ec_fw_string[4] << 8)
86848598 | ec_fw_string[5];
86858599 } else {
8686− printk(TPACPI_NOTICE
8687− "ThinkPad firmware release %s "
8688− "doesn't match the known patterns\n",
8689− ec_fw_string);
8690− printk(TPACPI_NOTICE
8691− "please report this to %s\n",
8692− TPACPI_MAIL);
8600+ pr_notice("ThinkPad firmware release %s "
8601+ "doesn't match the known patterns\n",
8602+ ec_fw_string);
8603+ pr_notice("please report this to %s\n",
8604+ TPACPI_MAIL);
86938605 }
86948606 break;
86958607 }
@@ -8733,8 +8645,7 @@ static int __init probe_for_thinkpad(void) · 37 unmodified lines
87338645 tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle);
87348646 if (!ec_handle) {
87358647 if (is_thinkpad)
8736− printk(TPACPI_ERR
8737− "Not yet supported ThinkPad detected!\n");
8648+ pr_err("Not yet supported ThinkPad detected!\n");
87388649 return -ENODEV;
87398650 }
87408651
@@ -8746,10 +8657,10 @@ static int __init probe_for_thinkpad(void) · 5 unmodified lines
87468657
87478658 static void __init thinkpad_acpi_init_banner(void)
87488659 {
8749− printk(TPACPI_INFO "%s v%s\n", TPACPI_DESC, TPACPI_VERSION);
8750− printk(TPACPI_INFO "%s\n", TPACPI_URL);
8660+ pr_info("%s v%s\n", TPACPI_DESC, TPACPI_VERSION);
8661+ pr_info("%s\n", TPACPI_URL);
87518662
8752− printk(TPACPI_INFO "ThinkPad BIOS %s, EC %s\n",
8663+ pr_info("ThinkPad BIOS %s, EC %s\n",
87538664 (thinkpad_id.bios_version_str) ?
87548665 thinkpad_id.bios_version_str : "unknown",
87558666 (thinkpad_id.ec_version_str) ?
@@ -8758,7 +8669,7 @@ static void __init thinkpad_acpi_init_banner(void) · 2 unmodified lines
87588669 BUG_ON(!thinkpad_id.vendor);
87598670
87608671 if (thinkpad_id.model_str)
8761− printk(TPACPI_INFO "%s %s, model %s\n",
8672+ pr_info("%s %s, model %s\n",
87628673 (thinkpad_id.vendor == PCI_VENDOR_ID_IBM) ?
87638674 "IBM" : ((thinkpad_id.vendor ==
87648675 PCI_VENDOR_ID_LENOVO) ?
@@ -9024,8 +8935,7 @@ static int __init thinkpad_acpi_module_init(void) · 259 unmodified lines
90248935
90258936 ret = get_thinkpad_model_data(&thinkpad_id);
90268937 if (ret) {
9027− printk(TPACPI_ERR
9028− "unable to get DMI data: %d\n", ret);
8938+ pr_err("unable to get DMI data: %d\n", ret);
90298939 thinkpad_acpi_module_exit();
90308940 return ret;
90318941 }
@@ -9051,16 +8961,14 @@ static int __init thinkpad_acpi_module_init(void) · 19 unmodified lines
90518961
90528962 proc_dir = proc_mkdir(TPACPI_PROC_DIR, acpi_root_dir);
90538963 if (!proc_dir) {
9054− printk(TPACPI_ERR
9055− "unable to create proc dir " TPACPI_PROC_DIR);
8964+ pr_err("unable to create proc dir " TPACPI_PROC_DIR "\n");
90568965 thinkpad_acpi_module_exit();
90578966 return -ENODEV;
90588967 }
90598968
90608969 ret = platform_driver_register(&tpacpi_pdriver);
90618970 if (ret) {
9062− printk(TPACPI_ERR
9063− "unable to register main platform driver\n");
8971+ pr_err("unable to register main platform driver\n");
90648972 thinkpad_acpi_module_exit();
90658973 return ret;
90668974 }
@@ -9068,8 +8976,7 @@ static int __init thinkpad_acpi_module_init(void) · 1 unmodified line
90688976
90698977 ret = platform_driver_register(&tpacpi_hwmon_pdriver);
90708978 if (ret) {
9071− printk(TPACPI_ERR
9072− "unable to register hwmon platform driver\n");
8979+ pr_err("unable to register hwmon platform driver\n");
90738980 thinkpad_acpi_module_exit();
90748981 return ret;
90758982 }
@@ -9082,8 +8989,7 @@ static int __init thinkpad_acpi_module_init(void) · 6 unmodified lines
90828989 &tpacpi_hwmon_pdriver.driver);
90838990 }
90848991 if (ret) {
9085− printk(TPACPI_ERR
9086− "unable to create sysfs driver attributes\n");
8992+ pr_err("unable to create sysfs driver attributes\n");
90878993 thinkpad_acpi_module_exit();
90888994 return ret;
90898995 }
@@ -9096,7 +9002,7 @@ static int __init thinkpad_acpi_module_init(void) · 6 unmodified lines
90969002 if (IS_ERR(tpacpi_pdev)) {
90979003 ret = PTR_ERR(tpacpi_pdev);
90989004 tpacpi_pdev = NULL;
9099− printk(TPACPI_ERR "unable to register platform device\n");
9005+ pr_err("unable to register platform device\n");
91009006 thinkpad_acpi_module_exit();
91019007 return ret;
91029008 }
@@ -9106,16 +9012,14 @@ static int __init thinkpad_acpi_module_init(void) · 3 unmodified lines
91069012 if (IS_ERR(tpacpi_sensors_pdev)) {
91079013 ret = PTR_ERR(tpacpi_sensors_pdev);
91089014 tpacpi_sensors_pdev = NULL;
9109− printk(TPACPI_ERR
9110− "unable to register hwmon platform device\n");
9015+ pr_err("unable to register hwmon platform device\n");
91119016 thinkpad_acpi_module_exit();
91129017 return ret;
91139018 }
91149019 ret = device_create_file(&tpacpi_sensors_pdev->dev,
91159020 &dev_attr_thinkpad_acpi_pdev_name);
91169021 if (ret) {
9117− printk(TPACPI_ERR
9118− "unable to create sysfs hwmon device attributes\n");
9022+ pr_err("unable to create sysfs hwmon device attributes\n");
91199023 thinkpad_acpi_module_exit();
91209024 return ret;
91219025 }
@@ -9124,14 +9028,14 @@ static int __init thinkpad_acpi_module_init(void) · 2 unmodified lines
91249028 if (IS_ERR(tpacpi_hwmon)) {
91259029 ret = PTR_ERR(tpacpi_hwmon);
91269030 tpacpi_hwmon = NULL;
9127− printk(TPACPI_ERR "unable to register hwmon device\n");
9031+ pr_err("unable to register hwmon device\n");
91289032 thinkpad_acpi_module_exit();
91299033 return ret;
91309034 }
91319035 mutex_init(&tpacpi_inputdev_send_mutex);
91329036 tpacpi_inputdev = input_allocate_device();
91339037 if (!tpacpi_inputdev) {
9134− printk(TPACPI_ERR "unable to allocate input device\n");
9038+ pr_err("unable to allocate input device\n");
91359039 thinkpad_acpi_module_exit();
91369040 return -ENOMEM;
91379041 } else {
@@ -9163,7 +9067,7 @@ static int __init thinkpad_acpi_module_init(void) · 25 unmodified lines
91639067
91649068 ret = input_register_device(tpacpi_inputdev);
91659069 if (ret < 0) {
9166− printk(TPACPI_ERR "unable to register input device\n");
9070+ pr_err("unable to register input device\n");
91679071 thinkpad_acpi_module_exit();
91689072 return ret;
91699073 } else {
drivers/platform/x86/topstar-laptop.c+1−1
@@ -194,7 +194,7 @@ static int __init topstar_laptop_init(void) · 193 unmodified lines
194194 if (ret < 0)
195195 return ret;
196196
197− printk(KERN_INFO "Topstar Laptop ACPI extras driver loaded\n");
197+ pr_info("ACPI extras driver loaded\n");
198198
199199 return 0;
200200 }
drivers/platform/x86/toshiba_acpi.c+28−31
@@ -35,6 +35,8 @@ · 34 unmodified lines
3535 *
3636 */
3737
38+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
39+
3840 #define TOSHIBA_ACPI_VERSION "0.19"
3941 #define PROC_INTERFACE_VERSION 1
4042
@@ -60,11 +62,6 @@ MODULE_AUTHOR("John Belmonte"); · 19 unmodified lines
6062 MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver");
6163 MODULE_LICENSE("GPL");
6264
63−#define MY_LOGPREFIX "toshiba_acpi: "
64−#define MY_ERR KERN_ERR MY_LOGPREFIX
65−#define MY_NOTICE KERN_NOTICE MY_LOGPREFIX
66−#define MY_INFO KERN_INFO MY_LOGPREFIX
67−
6865 /* Toshiba ACPI method paths */
6966 #define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM"
7067 #define TOSH_INTERFACE_1 "\\_SB_.VALD"
@@ -301,7 +298,7 @@ static int toshiba_illumination_available(void) · 230 unmodified lines
301298 in[0] = 0xf100;
302299 status = hci_raw(in, out);
303300 if (ACPI_FAILURE(status)) {
304− printk(MY_INFO "Illumination device not available\n");
301+ pr_info("Illumination device not available\n");
305302 return 0;
306303 }
307304 in[0] = 0xf400;
@@ -320,7 +317,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, · 12 unmodified lines
320317 in[0] = 0xf100;
321318 status = hci_raw(in, out);
322319 if (ACPI_FAILURE(status)) {
323− printk(MY_INFO "Illumination device not available\n");
320+ pr_info("Illumination device not available\n");
324321 return;
325322 }
326323
@@ -331,7 +328,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, · 4 unmodified lines
331328 in[2] = 1;
332329 status = hci_raw(in, out);
333330 if (ACPI_FAILURE(status)) {
334− printk(MY_INFO "ACPI call for illumination failed.\n");
331+ pr_info("ACPI call for illumination failed\n");
335332 return;
336333 }
337334 } else {
@@ -341,7 +338,7 @@ static void toshiba_illumination_set(struct led_classdev *cdev, · 3 unmodified lines
341338 in[2] = 0;
342339 status = hci_raw(in, out);
343340 if (ACPI_FAILURE(status)) {
344− printk(MY_INFO "ACPI call for illumination failed.\n");
341+ pr_info("ACPI call for illumination failed.\n");
345342 return;
346343 }
347344 }
@@ -364,7 +361,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev) · 16 unmodified lines
364361 in[0] = 0xf100;
365362 status = hci_raw(in, out);
366363 if (ACPI_FAILURE(status)) {
367− printk(MY_INFO "Illumination device not available\n");
364+ pr_info("Illumination device not available\n");
368365 return LED_OFF;
369366 }
370367
@@ -373,7 +370,7 @@ static enum led_brightness toshiba_illumination_get(struct led_classdev *cdev) · 2 unmodified lines
373370 in[1] = 0x14e;
374371 status = hci_raw(in, out);
375372 if (ACPI_FAILURE(status)) {
376− printk(MY_INFO "ACPI call for illumination failed.\n");
373+ pr_info("ACPI call for illumination failed.\n");
377374 return LED_OFF;
378375 }
379376
@@ -517,7 +514,7 @@ static int lcd_proc_show(struct seq_file *m, void *v) · 137 unmodified lines
517514 seq_printf(m, "brightness_levels: %d\n",
518515 HCI_LCD_BRIGHTNESS_LEVELS);
519516 } else {
520− printk(MY_ERR "Error reading LCD brightness\n");
517+ pr_err("Error reading LCD brightness\n");
521518 }
522519
523520 return 0;
@@ -592,7 +589,7 @@ static int video_proc_show(struct seq_file *m, void *v) · 68 unmodified lines
592589 seq_printf(m, "crt_out: %d\n", is_crt);
593590 seq_printf(m, "tv_out: %d\n", is_tv);
594591 } else {
595− printk(MY_ERR "Error reading video out status\n");
592+ pr_err("Error reading video out status\n");
596593 }
597594
598595 return 0;
@@ -686,7 +683,7 @@ static int fan_proc_show(struct seq_file *m, void *v) · 87 unmodified lines
686683 seq_printf(m, "running: %d\n", (value > 0));
687684 seq_printf(m, "force_on: %d\n", force_fan);
688685 } else {
689− printk(MY_ERR "Error reading fan status\n");
686+ pr_err("Error reading fan status\n");
690687 }
691688
692689 return 0;
@@ -750,9 +747,9 @@ static int keys_proc_show(struct seq_file *m, void *v) · 57 unmodified lines
750747 * some machines where system events sporadically
751748 * become disabled. */
752749 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
753− printk(MY_NOTICE "Re-enabled hotkeys\n");
750+ pr_notice("Re-enabled hotkeys\n");
754751 } else {
755− printk(MY_ERR "Error reading hotkey status\n");
752+ pr_err("Error reading hotkey status\n");
756753 goto end;
757754 }
758755 }
@@ -863,7 +860,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context) · 104 unmodified lines
863860
864861 if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev,
865862 value, 1, true)) {
866− printk(MY_INFO "Unknown key %x\n",
863+ pr_info("Unknown key %x\n",
867864 value);
868865 }
869866 } else if (hci_result == HCI_NOT_SUPPORTED) {
@@ -871,7 +868,7 @@ static void toshiba_acpi_notify(acpi_handle handle, u32 event, void *context) · 1 unmodified line
871868 * some machines where system events sporadically
872869 * become disabled. */
873870 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result);
874− printk(MY_NOTICE "Re-enabled hotkeys\n");
871+ pr_notice("Re-enabled hotkeys\n");
875872 }
876873 } while (hci_result != HCI_EMPTY);
877874 }
@@ -883,13 +880,13 @@ static int __init toshiba_acpi_setup_keyboard(char *device) · 5 unmodified lines
883880
884881 status = acpi_get_handle(NULL, device, &toshiba_acpi.handle);
885882 if (ACPI_FAILURE(status)) {
886− printk(MY_INFO "Unable to get notification device\n");
883+ pr_info("Unable to get notification device\n");
887884 return -ENODEV;
888885 }
889886
890887 toshiba_acpi.hotkey_dev = input_allocate_device();
891888 if (!toshiba_acpi.hotkey_dev) {
892− printk(MY_INFO "Unable to register input device\n");
889+ pr_info("Unable to register input device\n");
893890 return -ENOMEM;
894891 }
895892
@@ -905,21 +902,21 @@ static int __init toshiba_acpi_setup_keyboard(char *device) · 9 unmodified lines
905902 status = acpi_install_notify_handler(toshiba_acpi.handle,
906903 ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL);
907904 if (ACPI_FAILURE(status)) {
908− printk(MY_INFO "Unable to install hotkey notification\n");
905+ pr_info("Unable to install hotkey notification\n");
909906 error = -ENODEV;
910907 goto err_free_keymap;
911908 }
912909
913910 status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL);
914911 if (ACPI_FAILURE(status)) {
915− printk(MY_INFO "Unable to enable hotkeys\n");
912+ pr_info("Unable to enable hotkeys\n");
916913 error = -ENODEV;
917914 goto err_remove_notify;
918915 }
919916
920917 error = input_register_device(toshiba_acpi.hotkey_dev);
921918 if (error) {
922− printk(MY_INFO "Unable to register input device\n");
919+ pr_info("Unable to register input device\n");
923920 goto err_remove_notify;
924921 }
925922
@@ -980,17 +977,17 @@ static int __init toshiba_acpi_init(void) · 54 unmodified lines
980977 if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) {
981978 method_hci = TOSH_INTERFACE_1 GHCI_METHOD;
982979 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1))
983− printk(MY_INFO "Unable to activate hotkeys\n");
980+ pr_info("Unable to activate hotkeys\n");
984981 } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) {
985982 method_hci = TOSH_INTERFACE_2 GHCI_METHOD;
986983 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2))
987− printk(MY_INFO "Unable to activate hotkeys\n");
984+ pr_info("Unable to activate hotkeys\n");
988985 } else
989986 return -ENODEV;
990987
991− printk(MY_INFO "Toshiba Laptop ACPI Extras version %s\n",
988+ pr_info("Toshiba Laptop ACPI Extras version %s\n",
992989 TOSHIBA_ACPI_VERSION);
993− printk(MY_INFO " HCI method: %s\n", method_hci);
990+ pr_info(" HCI method: %s\n", method_hci);
994991
995992 mutex_init(&toshiba_acpi.mutex);
996993
@@ -998,7 +995,7 @@ static int __init toshiba_acpi_init(void) · 1 unmodified line
998995 -1, NULL, 0);
999996 if (IS_ERR(toshiba_acpi.p_dev)) {
1000997 ret = PTR_ERR(toshiba_acpi.p_dev);
1001− printk(MY_ERR "unable to register platform device\n");
998+ pr_err("unable to register platform device\n");
1002999 toshiba_acpi.p_dev = NULL;
10031000 toshiba_acpi_exit();
10041001 return ret;
@@ -1028,7 +1025,7 @@ static int __init toshiba_acpi_init(void) · 23 unmodified lines
10281025 if (IS_ERR(toshiba_backlight_device)) {
10291026 ret = PTR_ERR(toshiba_backlight_device);
10301027
1031− printk(KERN_ERR "Could not register toshiba backlight device\n");
1028+ pr_err("Could not register toshiba backlight device\n");
10321029 toshiba_backlight_device = NULL;
10331030 toshiba_acpi_exit();
10341031 return ret;
@@ -1042,14 +1039,14 @@ static int __init toshiba_acpi_init(void) · 7 unmodified lines
10421039 &toshiba_rfk_ops,
10431040 &toshiba_acpi);
10441041 if (!toshiba_acpi.bt_rfk) {
1045− printk(MY_ERR "unable to allocate rfkill device\n");
1042+ pr_err("unable to allocate rfkill device\n");
10461043 toshiba_acpi_exit();
10471044 return -ENOMEM;
10481045 }
10491046
10501047 ret = rfkill_register(toshiba_acpi.bt_rfk);
10511048 if (ret) {
1052− printk(MY_ERR "unable to register rfkill device\n");
1049+ pr_err("unable to register rfkill device\n");
10531050 rfkill_destroy(toshiba_acpi.bt_rfk);
10541051 toshiba_acpi_exit();
10551052 return ret;
drivers/platform/x86/toshiba_bluetooth.c+6−5
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 * delivered.
1818 */
1919
20+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
21+
2022 #include <linux/kernel.h>
2123 #include <linux/module.h>
2224 #include <linux/init.h>
@@ -70,14 +72,13 @@ static int toshiba_bluetooth_enable(acpi_handle handle) · 47 unmodified lines
7072 if (!(result & 0x01))
7173 return 0;
7274
73− printk(KERN_INFO "toshiba_bluetooth: Re-enabling Toshiba Bluetooth\n");
75+ pr_info("Re-enabling Toshiba Bluetooth\n");
7476 res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL);
7577 res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL);
7678 if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2))
7779 return 0;
7880
79− printk(KERN_WARNING "toshiba_bluetooth: Failed to re-enable "
80− "Toshiba Bluetooth\n");
81+ pr_warn("Failed to re-enable Toshiba Bluetooth\n");
8182
8283 return -ENODEV;
8384 }
@@ -107,8 +108,8 @@ static int toshiba_bt_rfkill_add(struct acpi_device *device) · 23 unmodified lines
107108 &bt_present);
108109
109110 if (!ACPI_FAILURE(status) && bt_present) {
110− printk(KERN_INFO "Detected Toshiba ACPI Bluetooth device - "
111− "installing RFKill handler\n");
111+ pr_info("Detected Toshiba ACPI Bluetooth device - "
112+ "installing RFKill handler\n");
112113 result = toshiba_bluetooth_enable(device->handle);
113114 }
114115
drivers/platform/x86/wmi.c+5−5
@@ -486,16 +486,16 @@ static void wmi_dump_wdg(const struct guid_block *g) · 485 unmodified lines
486486 pr_info("\tnotify_id: %02X\n", g->notify_id);
487487 pr_info("\treserved: %02X\n", g->reserved);
488488 pr_info("\tinstance_count: %d\n", g->instance_count);
489− pr_info("\tflags: %#x ", g->flags);
489+ pr_info("\tflags: %#x", g->flags);
490490 if (g->flags) {
491491 if (g->flags & ACPI_WMI_EXPENSIVE)
492− pr_cont("ACPI_WMI_EXPENSIVE ");
492+ pr_cont(" ACPI_WMI_EXPENSIVE");
493493 if (g->flags & ACPI_WMI_METHOD)
494− pr_cont("ACPI_WMI_METHOD ");
494+ pr_cont(" ACPI_WMI_METHOD");
495495 if (g->flags & ACPI_WMI_STRING)
496− pr_cont("ACPI_WMI_STRING ");
496+ pr_cont(" ACPI_WMI_STRING");
497497 if (g->flags & ACPI_WMI_EVENT)
498− pr_cont("ACPI_WMI_EVENT ");
498+ pr_cont(" ACPI_WMI_EVENT");
499499 }
500500 pr_cont("\n");
501501
drivers/platform/x86/xo15-ebook.c+3−2
@@ -11,6 +11,8 @@ · 10 unmodified lines
1111 * your option) any later version.
1212 */
1313
14+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
15+
1416 #include <linux/kernel.h>
1517 #include <linux/module.h>
1618 #include <linux/init.h>
@@ -20,7 +22,6 @@ · 3 unmodified lines
2022 #include <acpi/acpi_drivers.h>
2123
2224 #define MODULE_NAME "xo15-ebook"
23−#define PREFIX MODULE_NAME ": "
2425
2526 #define XO15_EBOOK_CLASS MODULE_NAME
2627 #define XO15_EBOOK_TYPE_UNKNOWN 0x00
@@ -105,7 +106,7 @@ static int ebook_switch_add(struct acpi_device *device) · 78 unmodified lines
105106 class = acpi_device_class(device);
106107
107108 if (strcmp(hid, XO15_EBOOK_HID)) {
108− printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid);
109+ pr_err("Unsupported hid [%s]\n", hid);
109110 error = -ENODEV;
110111 goto err_free_input;
111112 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t