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
...

-184
Documentation/laptops/acer-wmi.txt
··· 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.
+3 -8
MAINTAINERS
··· 223 223 F: drivers/platform/x86/acerhdf.c 224 224 225 225 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> 228 227 L: platform-driver-x86@vger.kernel.org 229 - W: http://code.google.com/p/aceracpi 230 228 S: Maintained 231 229 F: drivers/platform/x86/acer-wmi.c 232 230 ··· 269 271 F: drivers/acpi/video.c 270 272 271 273 ACPI WMI DRIVER 272 - M: Carlos Corbacho <carlos@strangeworlds.co.uk> 273 274 L: platform-driver-x86@vger.kernel.org 274 - W: http://www.lesswatts.org/projects/acpi/ 275 - S: Maintained 275 + S: Orphan 276 276 F: drivers/platform/x86/wmi.c 277 277 278 278 AD1889 ALSA SOUND DRIVER ··· 3029 3033 F: drivers/net/wireless/hostap/ 3030 3034 3031 3035 HP COMPAQ TC1100 TABLET WMI EXTRAS DRIVER 3032 - M: Carlos Corbacho <carlos@strangeworlds.co.uk> 3033 3036 L: platform-driver-x86@vger.kernel.org 3034 - S: Odd Fixes 3037 + S: Orphan 3035 3038 F: drivers/platform/x86/tc1100-wmi.c 3036 3039 3037 3040 HP100: Driver for HP 10/100 Mbit/s Voice Grade Network Adapter Series
+10 -1
drivers/platform/x86/Kconfig
··· 39 39 40 40 config ACERHDF 41 41 tristate "Acer Aspire One temperature and fan driver" 42 - depends on THERMAL && THERMAL_HWMON && ACPI 42 + depends on THERMAL && ACPI 43 43 ---help--- 44 44 This is a driver for Acer Aspire One netbooks. It allows to access 45 45 the temperature sensor and to control the fan. ··· 759 759 ---help--- 760 760 MXM is a standard for laptop graphics cards, the WMI interface 761 761 is required for switchable nvidia graphics machines 762 + 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. 762 771 763 772 endif # X86_PLATFORM_DEVICES
+2 -1
drivers/platform/x86/Makefile
··· 41 41 obj-$(CONFIG_XO15_EBOOK) += xo15-ebook.o 42 42 obj-$(CONFIG_IBM_RTL) += ibm_rtl.o 43 43 obj-$(CONFIG_SAMSUNG_LAPTOP) += samsung-laptop.o 44 - obj-$(CONFIG_INTEL_MFLD_THERMAL) += intel_mid_thermal.o 45 44 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
+159 -25
drivers/platform/x86/acer-wmi.c
··· 98 98 99 99 static const struct key_entry acer_wmi_keymap[] = { 100 100 {KE_KEY, 0x01, {KEY_WLAN} }, /* WiFi */ 101 + {KE_KEY, 0x03, {KEY_WLAN} }, /* WiFi */ 101 102 {KE_KEY, 0x12, {KEY_BLUETOOTH} }, /* BT */ 102 103 {KE_KEY, 0x21, {KEY_PROG1} }, /* Backup */ 103 104 {KE_KEY, 0x22, {KEY_PROG2} }, /* Arcade */ 104 105 {KE_KEY, 0x23, {KEY_PROG3} }, /* P_Key */ 105 106 {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} }, 106 117 {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */ 118 + {KE_IGNORE, 0x81, {KEY_SLEEP} }, 107 119 {KE_KEY, 0x82, {KEY_TOUCHPAD_TOGGLE} }, /* Touch Pad On/Off */ 120 + {KE_IGNORE, 0x83, {KEY_TOUCHPAD_TOGGLE} }, 108 121 {KE_END, 0} 109 122 }; 110 123 ··· 135 122 */ 136 123 #define ACER_WMID3_GDS_WIRELESS (1<<0) /* WiFi */ 137 124 #define ACER_WMID3_GDS_THREEG (1<<6) /* 3G */ 125 + #define ACER_WMID3_GDS_WIMAX (1<<7) /* WiMAX */ 138 126 #define ACER_WMID3_GDS_BLUETOOTH (1<<11) /* BT */ 139 127 140 128 struct lm_input_params { ··· 751 737 752 738 obj = (union acpi_object *) result.pointer; 753 739 if (obj && obj->type == ACPI_TYPE_BUFFER && 754 - obj->buffer.length == sizeof(u32)) { 740 + (obj->buffer.length == sizeof(u32) || 741 + obj->buffer.length == sizeof(u64))) { 755 742 tmp = *((u32 *) obj->buffer.pointer); 743 + } else if (obj->type == ACPI_TYPE_INTEGER) { 744 + tmp = (u32) obj->integer.value; 756 745 } else { 757 746 tmp = 0; 758 747 } ··· 883 866 884 867 obj = (union acpi_object *) out.pointer; 885 868 if (obj && obj->type == ACPI_TYPE_BUFFER && 886 - obj->buffer.length == sizeof(u32)) { 869 + (obj->buffer.length == sizeof(u32) || 870 + obj->buffer.length == sizeof(u64))) { 887 871 devices = *((u32 *) obj->buffer.pointer); 872 + } else if (obj->type == ACPI_TYPE_INTEGER) { 873 + devices = (u32) obj->integer.value; 888 874 } else { 889 875 kfree(out.pointer); 890 876 return AE_ERROR; ··· 896 876 dmi_walk(type_aa_dmi_decode, NULL); 897 877 if (!has_type_aa) { 898 878 interface->capability |= ACER_CAP_WIRELESS; 899 - interface->capability |= ACER_CAP_THREEG; 879 + if (devices & 0x40) 880 + interface->capability |= ACER_CAP_THREEG; 900 881 if (devices & 0x10) 901 882 interface->capability |= ACER_CAP_BLUETOOTH; 902 883 } ··· 982 961 * These will all fail silently if the value given is invalid, or the 983 962 * capability isn't available on the given interface 984 963 */ 985 - set_u32(mailled, ACER_CAP_MAILLED); 986 - if (!has_type_aa) 964 + if (mailled >= 0) 965 + set_u32(mailled, ACER_CAP_MAILLED); 966 + if (!has_type_aa && threeg >= 0) 987 967 set_u32(threeg, ACER_CAP_THREEG); 988 - set_u32(brightness, ACER_CAP_BRIGHTNESS); 968 + if (brightness >= 0) 969 + set_u32(brightness, ACER_CAP_BRIGHTNESS); 989 970 } 990 971 991 972 /* ··· 1104 1081 return AE_ERROR; 1105 1082 } 1106 1083 if (obj->buffer.length != 8) { 1107 - pr_warning("Unknown buffer length %d\n", obj->buffer.length); 1084 + pr_warn("Unknown buffer length %d\n", obj->buffer.length); 1108 1085 kfree(obj); 1109 1086 return AE_ERROR; 1110 1087 } ··· 1113 1090 kfree(obj); 1114 1091 1115 1092 if (return_value.error_code || return_value.ec_return_value) 1116 - pr_warning("Get Device Status failed: " 1117 - "0x%x - 0x%x\n", return_value.error_code, 1093 + pr_warn("Get Device Status failed: 0x%x - 0x%x\n", 1094 + return_value.error_code, 1118 1095 return_value.ec_return_value); 1119 1096 else 1120 1097 *value = !!(return_value.devices & device); ··· 1144 1121 1145 1122 } else { 1146 1123 return get_u32(value, cap); 1124 + } 1125 + } 1126 + 1127 + static acpi_status wmid3_set_device_status(u32 value, u16 device) 1128 + { 1129 + struct wmid3_gds_return_value return_value; 1130 + acpi_status status; 1131 + union acpi_object *obj; 1132 + u16 devices; 1133 + struct wmid3_gds_input_param params = { 1134 + .function_num = 0x1, 1135 + .hotkey_number = 0x01, 1136 + .devices = ACER_WMID3_GDS_WIRELESS & 1137 + ACER_WMID3_GDS_THREEG & 1138 + ACER_WMID3_GDS_WIMAX & 1139 + ACER_WMID3_GDS_BLUETOOTH, 1140 + }; 1141 + struct acpi_buffer input = { 1142 + sizeof(struct wmid3_gds_input_param), 1143 + &params 1144 + }; 1145 + struct acpi_buffer output = { ACPI_ALLOCATE_BUFFER, NULL }; 1146 + struct acpi_buffer output2 = { ACPI_ALLOCATE_BUFFER, NULL }; 1147 + 1148 + status = wmi_evaluate_method(WMID_GUID3, 0, 0x2, &input, &output); 1149 + if (ACPI_FAILURE(status)) 1150 + return status; 1151 + 1152 + obj = output.pointer; 1153 + 1154 + if (!obj) 1155 + return AE_ERROR; 1156 + else if (obj->type != ACPI_TYPE_BUFFER) { 1157 + kfree(obj); 1158 + return AE_ERROR; 1159 + } 1160 + if (obj->buffer.length != 8) { 1161 + pr_warning("Unknown buffer length %d\n", obj->buffer.length); 1162 + kfree(obj); 1163 + return AE_ERROR; 1164 + } 1165 + 1166 + return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer); 1167 + kfree(obj); 1168 + 1169 + if (return_value.error_code || return_value.ec_return_value) { 1170 + pr_warning("Get Current Device Status failed: " 1171 + "0x%x - 0x%x\n", return_value.error_code, 1172 + return_value.ec_return_value); 1173 + return status; 1174 + } 1175 + 1176 + devices = return_value.devices; 1177 + params.function_num = 0x2; 1178 + params.hotkey_number = 0x01; 1179 + params.devices = (value) ? (devices | device) : (devices & ~device); 1180 + 1181 + status = wmi_evaluate_method(WMID_GUID3, 0, 0x1, &input, &output2); 1182 + if (ACPI_FAILURE(status)) 1183 + return status; 1184 + 1185 + obj = output2.pointer; 1186 + 1187 + if (!obj) 1188 + return AE_ERROR; 1189 + else if (obj->type != ACPI_TYPE_BUFFER) { 1190 + kfree(obj); 1191 + return AE_ERROR; 1192 + } 1193 + if (obj->buffer.length != 4) { 1194 + pr_warning("Unknown buffer length %d\n", obj->buffer.length); 1195 + kfree(obj); 1196 + return AE_ERROR; 1197 + } 1198 + 1199 + return_value = *((struct wmid3_gds_return_value *)obj->buffer.pointer); 1200 + kfree(obj); 1201 + 1202 + if (return_value.error_code || return_value.ec_return_value) 1203 + pr_warning("Set Device Status failed: " 1204 + "0x%x - 0x%x\n", return_value.error_code, 1205 + return_value.ec_return_value); 1206 + 1207 + return status; 1208 + } 1209 + 1210 + static acpi_status set_device_status(u32 value, u32 cap) 1211 + { 1212 + if (wmi_has_guid(WMID_GUID3)) { 1213 + u16 device; 1214 + 1215 + switch (cap) { 1216 + case ACER_CAP_WIRELESS: 1217 + device = ACER_WMID3_GDS_WIRELESS; 1218 + break; 1219 + case ACER_CAP_BLUETOOTH: 1220 + device = ACER_WMID3_GDS_BLUETOOTH; 1221 + break; 1222 + case ACER_CAP_THREEG: 1223 + device = ACER_WMID3_GDS_THREEG; 1224 + break; 1225 + default: 1226 + return AE_ERROR; 1227 + } 1228 + return wmid3_set_device_status(value, device); 1229 + 1230 + } else { 1231 + return set_u32(value, cap); 1147 1232 } 1148 1233 } 1149 1234 ··· 1291 1160 u32 cap = (unsigned long)data; 1292 1161 1293 1162 if (rfkill_inited) { 1294 - status = set_u32(!blocked, cap); 1163 + status = set_device_status(!blocked, cap); 1295 1164 if (ACPI_FAILURE(status)) 1296 1165 return -ENODEV; 1297 1166 } ··· 1448 1317 1449 1318 status = wmi_get_event_data(value, &response); 1450 1319 if (status != AE_OK) { 1451 - pr_warning("bad event status 0x%x\n", status); 1320 + pr_warn("bad event status 0x%x\n", status); 1452 1321 return; 1453 1322 } 1454 1323 ··· 1457 1326 if (!obj) 1458 1327 return; 1459 1328 if (obj->type != ACPI_TYPE_BUFFER) { 1460 - pr_warning("Unknown response received %d\n", obj->type); 1329 + pr_warn("Unknown response received %d\n", obj->type); 1461 1330 kfree(obj); 1462 1331 return; 1463 1332 } 1464 1333 if (obj->buffer.length != 8) { 1465 - pr_warning("Unknown buffer length %d\n", obj->buffer.length); 1334 + pr_warn("Unknown buffer length %d\n", obj->buffer.length); 1466 1335 kfree(obj); 1467 1336 return; 1468 1337 } ··· 1474 1343 case WMID_HOTKEY_EVENT: 1475 1344 if (return_value.device_state) { 1476 1345 u16 device_state = return_value.device_state; 1477 - pr_debug("deivces states: 0x%x\n", device_state); 1346 + pr_debug("device state: 0x%x\n", device_state); 1478 1347 if (has_cap(ACER_CAP_WIRELESS)) 1479 1348 rfkill_set_sw_state(wireless_rfkill, 1480 1349 !(device_state & ACER_WMID3_GDS_WIRELESS)); ··· 1487 1356 } 1488 1357 if (!sparse_keymap_report_event(acer_wmi_input_dev, 1489 1358 return_value.key_num, 1, true)) 1490 - pr_warning("Unknown key number - 0x%x\n", 1359 + pr_warn("Unknown key number - 0x%x\n", 1491 1360 return_value.key_num); 1492 1361 break; 1493 1362 default: 1494 - pr_warning("Unknown function number - %d - %d\n", 1363 + pr_warn("Unknown function number - %d - %d\n", 1495 1364 return_value.function, return_value.key_num); 1496 1365 break; 1497 1366 } ··· 1520 1389 return AE_ERROR; 1521 1390 } 1522 1391 if (obj->buffer.length != 4) { 1523 - pr_warning("Unknown buffer length %d\n", obj->buffer.length); 1392 + pr_warn("Unknown buffer length %d\n", obj->buffer.length); 1524 1393 kfree(obj); 1525 1394 return AE_ERROR; 1526 1395 } ··· 1545 1414 status = wmid3_set_lm_mode(&params, &return_value); 1546 1415 1547 1416 if (return_value.error_code || return_value.ec_return_value) 1548 - pr_warning("Enabling EC raw mode failed: " 1549 - "0x%x - 0x%x\n", return_value.error_code, 1550 - return_value.ec_return_value); 1417 + pr_warn("Enabling EC raw mode failed: 0x%x - 0x%x\n", 1418 + return_value.error_code, 1419 + return_value.ec_return_value); 1551 1420 else 1552 - pr_info("Enabled EC raw mode"); 1421 + pr_info("Enabled EC raw mode\n"); 1553 1422 1554 1423 return status; 1555 1424 } ··· 1568 1437 status = wmid3_set_lm_mode(&params, &return_value); 1569 1438 1570 1439 if (return_value.error_code || return_value.ec_return_value) 1571 - pr_warning("Enabling Launch Manager failed: " 1572 - "0x%x - 0x%x\n", return_value.error_code, 1573 - return_value.ec_return_value); 1440 + pr_warn("Enabling Launch Manager failed: 0x%x - 0x%x\n", 1441 + return_value.error_code, 1442 + return_value.ec_return_value); 1574 1443 1575 1444 return status; 1576 1445 } ··· 1637 1506 1638 1507 obj = (union acpi_object *) out.pointer; 1639 1508 if (obj && obj->type == ACPI_TYPE_BUFFER && 1640 - obj->buffer.length == sizeof(u32)) { 1509 + (obj->buffer.length == sizeof(u32) || 1510 + obj->buffer.length == sizeof(u64))) { 1641 1511 devices = *((u32 *) obj->buffer.pointer); 1512 + } else if (obj->type == ACPI_TYPE_INTEGER) { 1513 + devices = (u32) obj->integer.value; 1642 1514 } 1643 1515 1644 1516 kfree(out.pointer);
+1 -3
drivers/platform/x86/acerhdf.c
··· 35 35 36 36 #include <linux/kernel.h> 37 37 #include <linux/module.h> 38 - #include <linux/fs.h> 39 38 #include <linux/dmi.h> 40 - #include <acpi/acpi_drivers.h> 41 - #include <linux/sched.h> 39 + #include <linux/acpi.h> 42 40 #include <linux/thermal.h> 43 41 #include <linux/platform_device.h> 44 42
+17 -17
drivers/platform/x86/asus-laptop.c
··· 318 318 319 319 if (status != AE_OK) { 320 320 if (ret) 321 - pr_warning("Error finding %s\n", method); 321 + pr_warn("Error finding %s\n", method); 322 322 return -ENODEV; 323 323 } 324 324 return 0; ··· 383 383 rv = acpi_evaluate_integer(asus->handle, METHOD_KBD_LIGHT_GET, 384 384 &params, &kblv); 385 385 if (ACPI_FAILURE(rv)) { 386 - pr_warning("Error reading kled level\n"); 386 + pr_warn("Error reading kled level\n"); 387 387 return -ENODEV; 388 388 } 389 389 return kblv; ··· 397 397 kblv = 0; 398 398 399 399 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"); 401 401 return -EINVAL; 402 402 } 403 403 return 0; ··· 531 531 rv = acpi_evaluate_integer(asus->handle, METHOD_BRIGHTNESS_GET, 532 532 NULL, &value); 533 533 if (ACPI_FAILURE(rv)) 534 - pr_warning("Error reading brightness\n"); 534 + pr_warn("Error reading brightness\n"); 535 535 536 536 return value; 537 537 } ··· 541 541 struct asus_laptop *asus = bl_get_data(bd); 542 542 543 543 if (write_acpi_int(asus->handle, METHOD_BRIGHTNESS_SET, value)) { 544 - pr_warning("Error changing brightness\n"); 544 + pr_warn("Error changing brightness\n"); 545 545 return -EIO; 546 546 } 547 547 return 0; ··· 730 730 rv = parse_arg(buf, count, &value); 731 731 if (rv > 0) { 732 732 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"); 734 734 return -ENODEV; 735 735 } 736 736 asus->ledd_status = (u32) value; ··· 752 752 rv = acpi_evaluate_integer(asus->handle, METHOD_WL_STATUS, 753 753 NULL, &status); 754 754 if (ACPI_FAILURE(rv)) { 755 - pr_warning("Error reading Wireless status\n"); 755 + pr_warn("Error reading Wireless status\n"); 756 756 return -EINVAL; 757 757 } 758 758 return !!(status & mask); ··· 764 764 static int asus_wlan_set(struct asus_laptop *asus, int status) 765 765 { 766 766 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); 768 768 return -EIO; 769 769 } 770 770 return 0; ··· 792 792 static int asus_bluetooth_set(struct asus_laptop *asus, int status) 793 793 { 794 794 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); 796 796 return -EIO; 797 797 } 798 798 return 0; ··· 821 821 static int asus_wimax_set(struct asus_laptop *asus, int status) 822 822 { 823 823 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); 825 825 return -EIO; 826 826 } 827 827 return 0; ··· 850 850 static int asus_wwan_set(struct asus_laptop *asus, int status) 851 851 { 852 852 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); 854 854 return -EIO; 855 855 } 856 856 return 0; ··· 880 880 { 881 881 /* no sanity check needed for now */ 882 882 if (write_acpi_int(asus->handle, METHOD_SWITCH_DISPLAY, value)) 883 - pr_warning("Error setting display\n"); 883 + pr_warn("Error setting display\n"); 884 884 return; 885 885 } 886 886 ··· 909 909 static void asus_als_switch(struct asus_laptop *asus, int value) 910 910 { 911 911 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"); 913 913 asus->light_switch = value; 914 914 } 915 915 ··· 937 937 static void asus_als_level(struct asus_laptop *asus, int value) 938 938 { 939 939 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"); 941 941 asus->light_level = value; 942 942 } 943 943 ··· 976 976 rv = acpi_evaluate_integer(asus->handle, METHOD_GPS_STATUS, 977 977 NULL, &status); 978 978 if (ACPI_FAILURE(rv)) { 979 - pr_warning("Error reading GPS status\n"); 979 + pr_warn("Error reading GPS status\n"); 980 980 return -ENODEV; 981 981 } 982 982 return !!status; ··· 1284 1284 */ 1285 1285 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus->dsdt_info); 1286 1286 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"); 1288 1288 1289 1289 /* We have to write 0 on init this far for all ASUS models */ 1290 1290 if (write_acpi_int_ret(asus->handle, "INIT", 0, &buffer)) { ··· 1296 1296 status = 1297 1297 acpi_evaluate_integer(asus->handle, "BSTS", NULL, &bsts_result); 1298 1298 if (ACPI_FAILURE(status)) 1299 - pr_warning("Error calling BSTS\n"); 1299 + pr_warn("Error calling BSTS\n"); 1300 1300 else if (bsts_result) 1301 1301 pr_notice("BSTS called, 0x%02x returned\n", 1302 1302 (uint) bsts_result);
+11 -11
drivers/platform/x86/asus-wmi.c
··· 425 425 if (asus->hotplug_slot) { 426 426 bus = pci_find_bus(0, 1); 427 427 if (!bus) { 428 - pr_warning("Unable to find PCI bus 1?\n"); 428 + pr_warn("Unable to find PCI bus 1?\n"); 429 429 goto out_unlock; 430 430 } 431 431 ··· 436 436 absent = (l == 0xffffffff); 437 437 438 438 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"); 445 445 goto out_unlock; 446 446 } 447 447 ··· 500 500 ACPI_SYSTEM_NOTIFY, 501 501 asus_rfkill_notify, asus); 502 502 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); 504 504 } else 505 505 return -ENODEV; 506 506 ··· 1223 1223 /* 1224 1224 * Platform device 1225 1225 */ 1226 - static int __init asus_wmi_platform_init(struct asus_wmi *asus) 1226 + static int asus_wmi_platform_init(struct asus_wmi *asus) 1227 1227 { 1228 1228 int rv; 1229 1229 ··· 1583 1583 int ret; 1584 1584 1585 1585 if (!wmi_has_guid(ASUS_WMI_MGMT_GUID)) { 1586 - pr_warning("Management GUID not found\n"); 1586 + pr_warn("Management GUID not found\n"); 1587 1587 return -ENODEV; 1588 1588 } 1589 1589 1590 1590 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"); 1592 1592 return -ENODEV; 1593 1593 } 1594 1594
+32 -45
drivers/platform/x86/asus_acpi.c
··· 30 30 * 31 31 */ 32 32 33 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 34 + 33 35 #include <linux/kernel.h> 34 36 #include <linux/module.h> 35 37 #include <linux/slab.h> ··· 583 581 if (read_acpi_int(NULL, ledname, &led_status)) 584 582 return led_status; 585 583 else 586 - printk(KERN_WARNING "Asus ACPI: Error reading LED " 587 - "status\n"); 584 + pr_warn("Error reading LED status\n"); 588 585 } 589 586 return (hotk->status & ledmask) ? 1 : 0; 590 587 } ··· 622 621 led_out = !led_out; 623 622 624 623 if (!write_acpi_int(hotk->handle, ledname, led_out, NULL)) 625 - printk(KERN_WARNING "Asus ACPI: LED (%s) write failed\n", 626 - ledname); 624 + pr_warn("LED (%s) write failed\n", ledname); 627 625 628 626 return rv; 629 627 } ··· 679 679 if (rv > 0) { 680 680 if (!write_acpi_int 681 681 (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"); 684 683 else 685 684 hotk->ledd_status = (u32) value; 686 685 } ··· 837 838 } else { 838 839 /* We don't have to check anything if we are here */ 839 840 if (!read_acpi_int(NULL, hotk->methods->lcd_status, &lcd)) 840 - printk(KERN_WARNING 841 - "Asus ACPI: Error reading LCD status\n"); 841 + pr_warn("Error reading LCD status\n"); 842 842 843 843 if (hotk->model == L2D) 844 844 lcd = ~lcd; ··· 869 871 the exact behaviour is simulated here */ 870 872 } 871 873 if (ACPI_FAILURE(status)) 872 - printk(KERN_WARNING "Asus ACPI: Error switching LCD\n"); 874 + pr_warn("Error switching LCD\n"); 873 875 } 874 876 return 0; 875 877 ··· 913 915 if (hotk->methods->brightness_get) { /* SPLV/GPLV laptop */ 914 916 if (!read_acpi_int(hotk->handle, hotk->methods->brightness_get, 915 917 &value)) 916 - printk(KERN_WARNING 917 - "Asus ACPI: Error reading brightness\n"); 918 + pr_warn("Error reading brightness\n"); 918 919 } else if (hotk->methods->brightness_status) { /* For D1 for example */ 919 920 if (!read_acpi_int(NULL, hotk->methods->brightness_status, 920 921 &value)) 921 - printk(KERN_WARNING 922 - "Asus ACPI: Error reading brightness\n"); 922 + pr_warn("Error reading brightness\n"); 923 923 } else /* No GPLV method */ 924 924 value = hotk->brightness; 925 925 return value; ··· 935 939 if (hotk->methods->brightness_set) { 936 940 if (!write_acpi_int(hotk->handle, hotk->methods->brightness_set, 937 941 value, NULL)) { 938 - printk(KERN_WARNING 939 - "Asus ACPI: Error changing brightness\n"); 942 + pr_warn("Error changing brightness\n"); 940 943 ret = -EIO; 941 944 } 942 945 goto out; ··· 950 955 NULL, NULL); 951 956 (value > 0) ? value-- : value++; 952 957 if (ACPI_FAILURE(status)) { 953 - printk(KERN_WARNING 954 - "Asus ACPI: Error changing brightness\n"); 958 + pr_warn("Error changing brightness\n"); 955 959 ret = -EIO; 956 960 } 957 961 } ··· 1002 1008 /* no sanity check needed for now */ 1003 1009 if (!write_acpi_int(hotk->handle, hotk->methods->display_set, 1004 1010 value, NULL)) 1005 - printk(KERN_WARNING "Asus ACPI: Error setting display\n"); 1011 + pr_warn("Error setting display\n"); 1006 1012 return; 1007 1013 } 1008 1014 ··· 1015 1021 int value = 0; 1016 1022 1017 1023 if (!read_acpi_int(hotk->handle, hotk->methods->display_get, &value)) 1018 - printk(KERN_WARNING 1019 - "Asus ACPI: Error reading display status\n"); 1024 + pr_warn("Error reading display status\n"); 1020 1025 value &= 0x07; /* needed for some models, shouldn't hurt others */ 1021 1026 seq_printf(m, "%d\n", value); 1022 1027 return 0; ··· 1061 1068 proc = proc_create_data(name, mode, acpi_device_dir(device), 1062 1069 proc_fops, acpi_driver_data(device)); 1063 1070 if (!proc) { 1064 - printk(KERN_WARNING " Unable to create %s fs entry\n", name); 1071 + pr_warn(" Unable to create %s fs entry\n", name); 1065 1072 return -1; 1066 1073 } 1067 1074 proc->uid = asus_uid; ··· 1078 1085 mode = S_IFREG | S_IRUGO | S_IWUSR | S_IWGRP; 1079 1086 } else { 1080 1087 mode = S_IFREG | S_IRUSR | S_IRGRP | S_IWUSR | S_IWGRP; 1081 - printk(KERN_WARNING " asus_uid and asus_gid parameters are " 1082 - "deprecated, use chown and chmod instead!\n"); 1088 + pr_warn(" asus_uid and asus_gid parameters are " 1089 + "deprecated, use chown and chmod instead!\n"); 1083 1090 } 1084 1091 1085 1092 acpi_device_dir(device) = asus_proc_dir; ··· 1092 1099 proc->uid = asus_uid; 1093 1100 proc->gid = asus_gid; 1094 1101 } else { 1095 - printk(KERN_WARNING " Unable to create " PROC_INFO 1096 - " fs entry\n"); 1102 + pr_warn(" Unable to create " PROC_INFO " fs entry\n"); 1097 1103 } 1098 1104 1099 1105 if (hotk->methods->mt_wled) { ··· 1275 1283 */ 1276 1284 status = acpi_get_table(ACPI_SIG_DSDT, 1, &asus_info); 1277 1285 if (ACPI_FAILURE(status)) 1278 - printk(KERN_WARNING " Couldn't get the DSDT table header\n"); 1286 + pr_warn(" Couldn't get the DSDT table header\n"); 1279 1287 1280 1288 /* We have to write 0 on init this far for all ASUS models */ 1281 1289 if (!write_acpi_int(hotk->handle, "INIT", 0, &buffer)) { 1282 - printk(KERN_ERR " Hotkey initialization failed\n"); 1290 + pr_err(" Hotkey initialization failed\n"); 1283 1291 return -ENODEV; 1284 1292 } 1285 1293 1286 1294 /* This needs to be called for some laptops to init properly */ 1287 1295 if (!read_acpi_int(hotk->handle, "BSTS", &bsts_result)) 1288 - printk(KERN_WARNING " Error calling BSTS\n"); 1296 + pr_warn(" Error calling BSTS\n"); 1289 1297 else if (bsts_result) 1290 - printk(KERN_NOTICE " BSTS called, 0x%02x returned\n", 1291 - bsts_result); 1298 + pr_notice(" BSTS called, 0x%02x returned\n", bsts_result); 1292 1299 1293 1300 /* 1294 1301 * Try to match the object returned by INIT to the specific model. ··· 1315 1324 if (asus_info && 1316 1325 strncmp(asus_info->oem_table_id, "ODEM", 4) == 0) { 1317 1326 hotk->model = P30; 1318 - printk(KERN_NOTICE 1319 - " Samsung P30 detected, supported\n"); 1327 + pr_notice(" Samsung P30 detected, supported\n"); 1320 1328 hotk->methods = &model_conf[hotk->model]; 1321 1329 kfree(model); 1322 1330 return 0; 1323 1331 } else { 1324 1332 hotk->model = M2E; 1325 - printk(KERN_NOTICE " unsupported model %s, trying " 1326 - "default values\n", string); 1327 - printk(KERN_NOTICE 1328 - " send /proc/acpi/dsdt to the developers\n"); 1333 + pr_notice(" unsupported model %s, trying default values\n", 1334 + string); 1335 + pr_notice(" send /proc/acpi/dsdt to the developers\n"); 1329 1336 kfree(model); 1330 1337 return -ENODEV; 1331 1338 } 1332 1339 } 1333 1340 hotk->methods = &model_conf[hotk->model]; 1334 - printk(KERN_NOTICE " %s model detected, supported\n", string); 1341 + pr_notice(" %s model detected, supported\n", string); 1335 1342 1336 1343 /* Sort of per-model blacklist */ 1337 1344 if (strncmp(string, "L2B", 3) == 0) ··· 1374 1385 if (hotk->device->status.present) { 1375 1386 result = asus_hotk_get_info(); 1376 1387 } else { 1377 - printk(KERN_ERR " Hotkey device not present, aborting\n"); 1388 + pr_err(" Hotkey device not present, aborting\n"); 1378 1389 return -EINVAL; 1379 1390 } 1380 1391 ··· 1388 1399 acpi_status status = AE_OK; 1389 1400 int result; 1390 1401 1391 - printk(KERN_NOTICE "Asus Laptop ACPI Extras version %s\n", 1392 - ASUS_ACPI_VERSION); 1402 + pr_notice("Asus Laptop ACPI Extras version %s\n", ASUS_ACPI_VERSION); 1393 1403 1394 1404 hotk = kzalloc(sizeof(struct asus_hotk), GFP_KERNEL); 1395 1405 if (!hotk) ··· 1416 1428 acpi_evaluate_object(NULL, hotk->methods->brightness_down, 1417 1429 NULL, NULL); 1418 1430 if (ACPI_FAILURE(status)) 1419 - printk(KERN_WARNING " Error changing brightness\n"); 1431 + pr_warn(" Error changing brightness\n"); 1420 1432 else { 1421 1433 status = 1422 1434 acpi_evaluate_object(NULL, 1423 1435 hotk->methods->brightness_up, 1424 1436 NULL, NULL); 1425 1437 if (ACPI_FAILURE(status)) 1426 - printk(KERN_WARNING " Strange, error changing" 1427 - " brightness\n"); 1438 + pr_warn(" Strange, error changing brightness\n"); 1428 1439 } 1429 1440 } 1430 1441 ··· 1475 1488 1476 1489 asus_proc_dir = proc_mkdir(PROC_ASUS, acpi_root_dir); 1477 1490 if (!asus_proc_dir) { 1478 - printk(KERN_ERR "Asus ACPI: Unable to create /proc entry\n"); 1491 + pr_err("Unable to create /proc entry\n"); 1479 1492 acpi_bus_unregister_driver(&asus_hotk_driver); 1480 1493 return -ENODEV; 1481 1494 } ··· 1500 1513 &asus_backlight_data, 1501 1514 &props); 1502 1515 if (IS_ERR(asus_backlight_device)) { 1503 - printk(KERN_ERR "Could not register asus backlight device\n"); 1516 + pr_err("Could not register asus backlight device\n"); 1504 1517 asus_backlight_device = NULL; 1505 1518 asus_acpi_exit(); 1506 1519 return -ENODEV;
+9 -13
drivers/platform/x86/compal-laptop.c
··· 68 68 * only enabled on a JHL90 board until it is verified that they work on the 69 69 * other boards too. See the extra_features variable. */ 70 70 71 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 72 + 71 73 #include <linux/module.h> 72 74 #include <linux/kernel.h> 73 75 #include <linux/init.h> ··· 762 760 763 761 static int dmi_check_cb(const struct dmi_system_id *id) 764 762 { 765 - printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s'\n", 766 - id->ident); 763 + pr_info("Identified laptop model '%s'\n", id->ident); 767 764 extra_features = false; 768 765 return 1; 769 766 } 770 767 771 768 static int dmi_check_cb_extra(const struct dmi_system_id *id) 772 769 { 773 - printk(KERN_INFO DRIVER_NAME": Identified laptop model '%s', " 774 - "enabling extra features\n", 770 + pr_info("Identified laptop model '%s', enabling extra features\n", 775 771 id->ident); 776 772 extra_features = true; 777 773 return 1; ··· 956 956 int ret; 957 957 958 958 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"); 961 960 return -ENODEV; 962 961 } 963 962 964 963 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"); 967 965 return -ENODEV; 968 966 } 969 967 ··· 996 998 if (ret) 997 999 goto err_rfkill; 998 1000 999 - printk(KERN_INFO DRIVER_NAME": Driver "DRIVER_VERSION 1000 - " successfully loaded\n"); 1001 + pr_info("Driver " DRIVER_VERSION " successfully loaded\n"); 1001 1002 return 0; 1002 1003 1003 1004 err_rfkill: ··· 1061 1064 rfkill_destroy(wifi_rfkill); 1062 1065 rfkill_destroy(bt_rfkill); 1063 1066 1064 - printk(KERN_INFO DRIVER_NAME": Driver unloaded\n"); 1067 + pr_info("Driver unloaded\n"); 1065 1068 } 1066 1069 1067 1070 static int __devexit compal_remove(struct platform_device *pdev) ··· 1071 1074 if (!extra_features) 1072 1075 return 0; 1073 1076 1074 - printk(KERN_INFO DRIVER_NAME": Unloading: resetting fan control " 1075 - "to motherboard\n"); 1077 + pr_info("Unloading: resetting fan control to motherboard\n"); 1076 1078 pwm_disable_control(); 1077 1079 1078 1080 data = platform_get_drvdata(pdev);
+6 -6
drivers/platform/x86/dell-laptop.c
··· 11 11 * published by the Free Software Foundation. 12 12 */ 13 13 14 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 15 + 14 16 #include <linux/module.h> 15 17 #include <linux/kernel.h> 16 18 #include <linux/init.h> ··· 436 434 int ret; 437 435 438 436 if (dmi_check_system(dell_blacklist)) { 439 - printk(KERN_INFO "dell-laptop: Blacklisted hardware detected - " 440 - "not enabling rfkill\n"); 437 + pr_info("Blacklisted hardware detected - not enabling rfkill\n"); 441 438 return 0; 442 439 } 443 440 ··· 607 606 dmi_walk(find_tokens, NULL); 608 607 609 608 if (!da_tokens) { 610 - printk(KERN_INFO "dell-laptop: Unable to find dmi tokens\n"); 609 + pr_info("Unable to find dmi tokens\n"); 611 610 return -ENODEV; 612 611 } 613 612 ··· 637 636 ret = dell_setup_rfkill(); 638 637 639 638 if (ret) { 640 - printk(KERN_WARNING "dell-laptop: Unable to setup rfkill\n"); 639 + pr_warn("Unable to setup rfkill\n"); 641 640 goto fail_rfkill; 642 641 } 643 642 644 643 ret = i8042_install_filter(dell_laptop_i8042_filter); 645 644 if (ret) { 646 - printk(KERN_WARNING 647 - "dell-laptop: Unable to install key filter\n"); 645 + pr_warn("Unable to install key filter\n"); 648 646 goto fail_filter; 649 647 } 650 648
+2 -1
drivers/platform/x86/dell-wmi-aio.c
··· 15 15 * along with this program; if not, write to the Free Software 16 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 17 17 */ 18 + 18 19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 19 20 20 21 #include <linux/kernel.h> ··· 139 138 140 139 guid = dell_wmi_aio_find(); 141 140 if (!guid) { 142 - pr_warning("No known WMI GUID found\n"); 141 + pr_warn("No known WMI GUID found\n"); 143 142 return -ENXIO; 144 143 } 145 144
+8 -9
drivers/platform/x86/dell-wmi.c
··· 23 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 24 */ 25 25 26 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 27 + 26 28 #include <linux/kernel.h> 27 29 #include <linux/module.h> 28 30 #include <linux/init.h> ··· 143 141 144 142 status = wmi_get_event_data(value, &response); 145 143 if (status != AE_OK) { 146 - printk(KERN_INFO "dell-wmi: bad event status 0x%x\n", status); 144 + pr_info("bad event status 0x%x\n", status); 147 145 return; 148 146 } 149 147 ··· 155 153 u16 *buffer_entry = (u16 *)obj->buffer.pointer; 156 154 157 155 if (dell_new_hk_type && (buffer_entry[1] != 0x10)) { 158 - printk(KERN_INFO "dell-wmi: Received unknown WMI event" 159 - " (0x%x)\n", buffer_entry[1]); 156 + pr_info("Received unknown WMI event (0x%x)\n", 157 + buffer_entry[1]); 160 158 kfree(obj); 161 159 return; 162 160 } ··· 169 167 key = sparse_keymap_entry_from_scancode(dell_wmi_input_dev, 170 168 reported_key); 171 169 if (!key) { 172 - printk(KERN_INFO "dell-wmi: Unknown key %x pressed\n", 173 - reported_key); 170 + pr_info("Unknown key %x pressed\n", reported_key); 174 171 } else if ((key->keycode == KEY_BRIGHTNESSUP || 175 172 key->keycode == KEY_BRIGHTNESSDOWN) && acpi_video) { 176 173 /* Don't report brightness notifications that will also ··· 276 275 acpi_status status; 277 276 278 277 if (!wmi_has_guid(DELL_EVENT_GUID)) { 279 - printk(KERN_WARNING "dell-wmi: No known WMI GUID found\n"); 278 + pr_warn("No known WMI GUID found\n"); 280 279 return -ENODEV; 281 280 } 282 281 ··· 291 290 dell_wmi_notify, NULL); 292 291 if (ACPI_FAILURE(status)) { 293 292 dell_wmi_input_destroy(); 294 - printk(KERN_ERR 295 - "dell-wmi: Unable to register notify handler - %d\n", 296 - status); 293 + pr_err("Unable to register notify handler - %d\n", status); 297 294 return -ENODEV; 298 295 } 299 296
+11 -10
drivers/platform/x86/eeepc-laptop.c
··· 228 228 return -ENODEV; 229 229 230 230 if (write_acpi_int(eeepc->handle, method, value)) 231 - pr_warning("Error writing %s\n", method); 231 + pr_warn("Error writing %s\n", method); 232 232 return 0; 233 233 } 234 234 ··· 243 243 return -ENODEV; 244 244 245 245 if (read_acpi_int(eeepc->handle, method, &value)) 246 - pr_warning("Error reading %s\n", method); 246 + pr_warn("Error reading %s\n", method); 247 247 return value; 248 248 } 249 249 ··· 261 261 status = acpi_get_handle(eeepc->handle, (char *)method, 262 262 handle); 263 263 if (status != AE_OK) { 264 - pr_warning("Error finding %s\n", method); 264 + pr_warn("Error finding %s\n", method); 265 265 return -ENODEV; 266 266 } 267 267 return 0; ··· 417 417 switch (value) { 418 418 case 0: 419 419 if (eeepc->cpufv_disabled) 420 - pr_warning("cpufv enabled (not officially supported " 420 + pr_warn("cpufv enabled (not officially supported " 421 421 "on this model)\n"); 422 422 eeepc->cpufv_disabled = false; 423 423 return rv; ··· 609 609 bus = port->subordinate; 610 610 611 611 if (!bus) { 612 - pr_warning("Unable to find PCI bus?\n"); 612 + pr_warn("Unable to find PCI bus 1?\n"); 613 613 goto out_unlock; 614 614 } 615 615 ··· 621 621 absent = (l == 0xffffffff); 622 622 623 623 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", 626 626 blocked ? "blocked" : "unblocked", 627 627 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"); 630 630 goto out_unlock; 631 631 } 632 632 ··· 691 691 eeepc_rfkill_notify, 692 692 eeepc); 693 693 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 + 695 696 /* 696 697 * Refresh pci hotplug in case the rfkill state was 697 698 * changed during setup.
+7 -7
drivers/platform/x86/eeepc-wmi.c
··· 84 84 static acpi_status eeepc_wmi_parse_device(acpi_handle handle, u32 level, 85 85 void *context, void **retval) 86 86 { 87 - pr_warning("Found legacy ATKD device (%s)", EEEPC_ACPI_HID); 87 + pr_warn("Found legacy ATKD device (%s)\n", EEEPC_ACPI_HID); 88 88 *(bool *)context = true; 89 89 return AE_CTRL_TERMINATE; 90 90 } ··· 105 105 static int eeepc_wmi_probe(struct platform_device *pdev) 106 106 { 107 107 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"); 114 114 return -EBUSY; 115 115 } 116 116 return 0;
+19 -20
drivers/platform/x86/fujitsu-laptop.c
··· 56 56 * 57 57 */ 58 58 59 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 60 + 59 61 #include <linux/module.h> 60 62 #include <linux/kernel.h> 61 63 #include <linux/init.h> ··· 587 585 static void dmi_check_cb_common(const struct dmi_system_id *id) 588 586 { 589 587 acpi_handle handle; 590 - printk(KERN_INFO "fujitsu-laptop: Identified laptop model '%s'.\n", 591 - id->ident); 588 + pr_info("Identified laptop model '%s'\n", id->ident); 592 589 if (use_alt_lcd_levels == -1) { 593 590 if (ACPI_SUCCESS(acpi_get_handle(NULL, 594 591 "\\_SB.PCI0.LPCB.FJEX.SBL2", &handle))) ··· 692 691 693 692 result = acpi_bus_update_power(fujitsu->acpi_handle, &state); 694 693 if (result) { 695 - printk(KERN_ERR "Error reading power state\n"); 694 + pr_err("Error reading power state\n"); 696 695 goto err_unregister_input_dev; 697 696 } 698 697 699 - printk(KERN_INFO "ACPI: %s [%s] (%s)\n", 698 + pr_info("ACPI: %s [%s] (%s)\n", 700 699 acpi_device_name(device), acpi_device_bid(device), 701 700 !device->power.state ? "on" : "off"); 702 701 ··· 708 707 if (ACPI_FAILURE 709 708 (acpi_evaluate_object 710 709 (device->handle, METHOD_NAME__INI, NULL, NULL))) 711 - printk(KERN_ERR "_INI Method failed\n"); 710 + pr_err("_INI Method failed\n"); 712 711 } 713 712 714 713 /* do config (detect defaults) */ ··· 828 827 error = kfifo_alloc(&fujitsu_hotkey->fifo, RINGBUFFERSIZE * sizeof(int), 829 828 GFP_KERNEL); 830 829 if (error) { 831 - printk(KERN_ERR "kfifo_alloc failed\n"); 830 + pr_err("kfifo_alloc failed\n"); 832 831 goto err_stop; 833 832 } 834 833 ··· 860 859 861 860 result = acpi_bus_update_power(fujitsu_hotkey->acpi_handle, &state); 862 861 if (result) { 863 - printk(KERN_ERR "Error reading power state\n"); 862 + pr_err("Error reading power state\n"); 864 863 goto err_unregister_input_dev; 865 864 } 866 865 867 - printk(KERN_INFO "ACPI: %s [%s] (%s)\n", 868 - acpi_device_name(device), acpi_device_bid(device), 869 - !device->power.state ? "on" : "off"); 866 + pr_info("ACPI: %s [%s] (%s)\n", 867 + acpi_device_name(device), acpi_device_bid(device), 868 + !device->power.state ? "on" : "off"); 870 869 871 870 fujitsu_hotkey->dev = device; 872 871 ··· 876 875 if (ACPI_FAILURE 877 876 (acpi_evaluate_object 878 877 (device->handle, METHOD_NAME__INI, NULL, NULL))) 879 - printk(KERN_ERR "_INI Method failed\n"); 878 + pr_err("_INI Method failed\n"); 880 879 } 881 880 882 881 i = 0; ··· 898 897 call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); 899 898 900 899 /* Suspect this is a keymap of the application panel, print it */ 901 - printk(KERN_INFO "fujitsu-laptop: BTNI: [0x%x]\n", 902 - call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0)); 900 + pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0)); 903 901 904 902 #if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) 905 903 if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) { ··· 907 907 if (result == 0) { 908 908 fujitsu_hotkey->logolamp_registered = 1; 909 909 } 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); 912 912 } 913 913 } 914 914 ··· 919 919 if (result == 0) { 920 920 fujitsu_hotkey->kblamps_registered = 1; 921 921 } 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); 924 924 } 925 925 } 926 926 #endif ··· 1169 1169 fujitsu->bl_device->props.power = 0; 1170 1170 } 1171 1171 1172 - printk(KERN_INFO "fujitsu-laptop: driver " FUJITSU_DRIVER_VERSION 1173 - " successfully loaded.\n"); 1172 + pr_info("driver " FUJITSU_DRIVER_VERSION " successfully loaded\n"); 1174 1173 1175 1174 return 0; 1176 1175 ··· 1215 1216 1216 1217 kfree(fujitsu); 1217 1218 1218 - printk(KERN_INFO "fujitsu-laptop: driver unloaded.\n"); 1219 + pr_info("driver unloaded\n"); 1219 1220 } 1220 1221 1221 1222 module_init(fujitsu_init);
+10 -9
drivers/platform/x86/hdaps.c
··· 26 26 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA 27 27 */ 28 28 29 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 30 + 29 31 #include <linux/delay.h> 30 32 #include <linux/platform_device.h> 31 33 #include <linux/input-polldev.h> ··· 240 238 __check_latch(0x1611, 0x01)) 241 239 goto out; 242 240 243 - printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x).\n", 241 + printk(KERN_DEBUG "hdaps: initial latch check good (0x%02x)\n", 244 242 __get_latch(0x1611)); 245 243 246 244 outb(0x17, 0x1610); ··· 301 299 if (ret) 302 300 return ret; 303 301 304 - printk(KERN_INFO "hdaps: device successfully initialized.\n"); 302 + pr_info("device successfully initialized\n"); 305 303 return 0; 306 304 } 307 305 ··· 482 480 /* hdaps_dmi_match - found a match. return one, short-circuiting the hunt. */ 483 481 static int __init hdaps_dmi_match(const struct dmi_system_id *id) 484 482 { 485 - printk(KERN_INFO "hdaps: %s detected.\n", id->ident); 483 + pr_info("%s detected\n", id->ident); 486 484 return 1; 487 485 } 488 486 ··· 490 488 static int __init hdaps_dmi_match_invert(const struct dmi_system_id *id) 491 489 { 492 490 hdaps_invert = (unsigned long)id->driver_data; 493 - printk(KERN_INFO "hdaps: inverting axis (%u) readings.\n", 494 - hdaps_invert); 491 + pr_info("inverting axis (%u) readings\n", hdaps_invert); 495 492 return hdaps_dmi_match(id); 496 493 } 497 494 ··· 544 543 int ret; 545 544 546 545 if (!dmi_check_system(hdaps_whitelist)) { 547 - printk(KERN_WARNING "hdaps: supported laptop not found!\n"); 546 + pr_warn("supported laptop not found!\n"); 548 547 ret = -ENODEV; 549 548 goto out; 550 549 } ··· 596 595 if (ret) 597 596 goto out_idev; 598 597 599 - printk(KERN_INFO "hdaps: driver successfully loaded.\n"); 598 + pr_info("driver successfully loaded\n"); 600 599 return 0; 601 600 602 601 out_idev: ··· 610 609 out_region: 611 610 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 612 611 out: 613 - printk(KERN_WARNING "hdaps: driver init failed (ret=%d)!\n", ret); 612 + pr_warn("driver init failed (ret=%d)!\n", ret); 614 613 return ret; 615 614 } 616 615 ··· 623 622 platform_driver_unregister(&hdaps_driver); 624 623 release_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS); 625 624 626 - printk(KERN_INFO "hdaps: driver unloaded.\n"); 625 + pr_info("driver unloaded\n"); 627 626 } 628 627 629 628 module_init(hdaps_init);
+17 -26
drivers/platform/x86/hp-wmi.c
··· 24 24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 25 25 */ 26 26 27 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 28 + 27 29 #include <linux/kernel.h> 28 30 #include <linux/module.h> 29 31 #include <linux/init.h> ··· 55 53 #define HPWMI_WIRELESS_QUERY 0x5 56 54 #define HPWMI_HOTKEY_QUERY 0xc 57 55 #define HPWMI_WIRELESS2_QUERY 0x1b 58 - 59 - #define PREFIX "HP WMI: " 60 - #define UNIMP "Unimplemented " 61 56 62 57 enum hp_wmi_radio { 63 58 HPWMI_WIFI = 0, ··· 227 228 228 229 if (bios_return->return_code) { 229 230 if (bios_return->return_code != HPWMI_RET_UNKNOWN_CMDTYPE) 230 - printk(KERN_WARNING PREFIX "query 0x%x returned " 231 - "error 0x%x\n", 232 - query, bios_return->return_code); 231 + pr_warn("query 0x%x returned error 0x%x\n", 232 + query, bios_return->return_code); 233 233 kfree(obj); 234 234 return bios_return->return_code; 235 235 } ··· 382 384 383 385 if (num >= state.count || 384 386 devstate->rfkill_id != rfkill2[i].id) { 385 - printk(KERN_WARNING PREFIX "power configuration of " 386 - "the wireless devices unexpectedly changed\n"); 387 + pr_warn("power configuration of the wireless devices unexpectedly changed\n"); 387 388 continue; 388 389 } 389 390 ··· 468 471 469 472 status = wmi_get_event_data(value, &response); 470 473 if (status != AE_OK) { 471 - printk(KERN_INFO PREFIX "bad event status 0x%x\n", status); 474 + pr_info("bad event status 0x%x\n", status); 472 475 return; 473 476 } 474 477 ··· 477 480 if (!obj) 478 481 return; 479 482 if (obj->type != ACPI_TYPE_BUFFER) { 480 - printk(KERN_INFO "hp-wmi: Unknown response received %d\n", 481 - obj->type); 483 + pr_info("Unknown response received %d\n", obj->type); 482 484 kfree(obj); 483 485 return; 484 486 } ··· 494 498 event_id = *location; 495 499 event_data = *(location + 2); 496 500 } else { 497 - printk(KERN_INFO "hp-wmi: Unknown buffer length %d\n", 498 - obj->buffer.length); 501 + pr_info("Unknown buffer length %d\n", obj->buffer.length); 499 502 kfree(obj); 500 503 return; 501 504 } ··· 522 527 523 528 if (!sparse_keymap_report_event(hp_wmi_input_dev, 524 529 key_code, 1, true)) 525 - printk(KERN_INFO PREFIX "Unknown key code - 0x%x\n", 526 - key_code); 530 + pr_info("Unknown key code - 0x%x\n", key_code); 527 531 break; 528 532 case HPWMI_WIRELESS: 529 533 if (rfkill2_count) { ··· 544 550 hp_wmi_get_hw_state(HPWMI_WWAN)); 545 551 break; 546 552 case HPWMI_CPU_BATTERY_THROTTLE: 547 - printk(KERN_INFO PREFIX UNIMP "CPU throttle because of 3 Cell" 548 - " battery event detected\n"); 553 + pr_info("Unimplemented CPU throttle because of 3 Cell battery event detected\n"); 549 554 break; 550 555 case HPWMI_LOCK_SWITCH: 551 556 break; 552 557 default: 553 - printk(KERN_INFO PREFIX "Unknown event_id - %d - 0x%x\n", 554 - event_id, event_data); 558 + pr_info("Unknown event_id - %d - 0x%x\n", event_id, event_data); 555 559 break; 556 560 } 557 561 } ··· 697 705 return err; 698 706 699 707 if (state.count > HPWMI_MAX_RFKILL2_DEVICES) { 700 - printk(KERN_WARNING PREFIX "unable to parse 0x1b query output\n"); 708 + pr_warn("unable to parse 0x1b query output\n"); 701 709 return -EINVAL; 702 710 } 703 711 ··· 719 727 name = "hp-wwan"; 720 728 break; 721 729 default: 722 - printk(KERN_WARNING PREFIX "unknown device type 0x%x\n", 723 - state.device[i].radio_type); 730 + pr_warn("unknown device type 0x%x\n", 731 + state.device[i].radio_type); 724 732 continue; 725 733 } 726 734 727 735 if (!state.device[i].vendor_id) { 728 - printk(KERN_WARNING PREFIX "zero device %d while %d " 729 - "reported\n", i, state.count); 736 + pr_warn("zero device %d while %d reported\n", 737 + i, state.count); 730 738 continue; 731 739 } 732 740 ··· 747 755 IS_HWBLOCKED(state.device[i].power)); 748 756 749 757 if (!(state.device[i].power & HPWMI_POWER_BIOS)) 750 - printk(KERN_INFO PREFIX "device %s blocked by BIOS\n", 751 - name); 758 + pr_info("device %s blocked by BIOS\n", name); 752 759 753 760 err = rfkill_register(rfkill); 754 761 if (err) {
+13 -10
drivers/platform/x86/ibm_rtl.c
··· 22 22 * 23 23 */ 24 24 25 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 26 + 25 27 #include <linux/kernel.h> 26 28 #include <linux/delay.h> 27 29 #include <linux/module.h> ··· 71 69 #define RTL_SIGNATURE 0x0000005f4c54525fULL 72 70 #define RTL_MASK 0x000000ffffffffffULL 73 71 74 - #define RTL_DEBUG(A, ...) do { \ 75 - if (debug) \ 76 - pr_info("ibm-rtl: " A, ##__VA_ARGS__ ); \ 72 + #define RTL_DEBUG(fmt, ...) \ 73 + do { \ 74 + if (debug) \ 75 + pr_info(fmt, ##__VA_ARGS__); \ 77 76 } while (0) 78 77 79 78 static DEFINE_MUTEX(rtl_lock); ··· 117 114 int ret = 0, count = 0; 118 115 static u32 cmd_port_val; 119 116 120 - RTL_DEBUG("%s(%d)\n", __FUNCTION__, value); 117 + RTL_DEBUG("%s(%d)\n", __func__, value); 121 118 122 119 value = value == 1 ? RTL_CMD_ENTER_PRTM : RTL_CMD_EXIT_PRTM; 123 120 ··· 147 144 while (ioread8(&rtl_table->command)) { 148 145 msleep(10); 149 146 if (count++ > 500) { 150 - pr_err("ibm-rtl: Hardware not responding to " 151 - "mode switch request\n"); 147 + pr_err("Hardware not responding to " 148 + "mode switch request\n"); 152 149 ret = -EIO; 153 150 break; 154 151 } ··· 253 250 int ret = -ENODEV, i; 254 251 255 252 if (force) 256 - pr_warning("ibm-rtl: module loaded by force\n"); 253 + pr_warn("module loaded by force\n"); 257 254 /* first ensure that we are running on IBM HW */ 258 255 else if (efi_enabled || !dmi_check_system(ibm_rtl_dmi_table)) 259 256 return -ENODEV; ··· 291 288 if ((readq(&tmp->signature) & RTL_MASK) == RTL_SIGNATURE) { 292 289 phys_addr_t addr; 293 290 unsigned int plen; 294 - RTL_DEBUG("found RTL_SIGNATURE at %#llx\n", (u64)tmp); 291 + RTL_DEBUG("found RTL_SIGNATURE at %p\n", tmp); 295 292 rtl_table = tmp; 296 293 /* The address, value, width and offset are platform 297 294 * dependent and found in the ibm_rtl_table */ 298 295 rtl_cmd_width = ioread8(&rtl_table->cmd_granularity); 299 296 rtl_cmd_type = ioread8(&rtl_table->cmd_address_type); 300 297 RTL_DEBUG("rtl_cmd_width = %u, rtl_cmd_type = %u\n", 301 - rtl_cmd_width, rtl_cmd_type); 298 + rtl_cmd_width, rtl_cmd_type); 302 299 addr = ioread32(&rtl_table->cmd_port_address); 303 300 RTL_DEBUG("addr = %#llx\n", (unsigned long long)addr); 304 301 plen = rtl_cmd_width/sizeof(char); 305 302 rtl_cmd_addr = rtl_port_map(addr, plen); 306 - RTL_DEBUG("rtl_cmd_addr = %#llx\n", (u64)rtl_cmd_addr); 303 + RTL_DEBUG("rtl_cmd_addr = %p\n", rtl_cmd_addr); 307 304 if (!rtl_cmd_addr) { 308 305 ret = -ENOMEM; 309 306 break;
+2
drivers/platform/x86/ideapad-laptop.c
··· 20 20 * 02110-1301, USA. 21 21 */ 22 22 23 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 24 + 23 25 #include <linux/kernel.h> 24 26 #include <linux/module.h> 25 27 #include <linux/init.h>
+3 -2
drivers/platform/x86/intel_menlow.c
··· 27 27 * to get/set bandwidth. 28 28 */ 29 29 30 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 31 + 30 32 #include <linux/kernel.h> 31 33 #include <linux/module.h> 32 34 #include <linux/init.h> ··· 137 135 acpi_evaluate_integer(handle, MEMORY_SET_BANDWIDTH, &arg_list, 138 136 &temp); 139 137 140 - printk(KERN_INFO 141 - "Bandwidth value was %ld: status is %d\n", state, status); 138 + pr_info("Bandwidth value was %ld: status is %d\n", state, status); 142 139 if (ACPI_FAILURE(status)) 143 140 return -EFAULT; 144 141
+30 -42
drivers/platform/x86/intel_mid_powerbtn.c
··· 23 23 #include <linux/slab.h> 24 24 #include <linux/platform_device.h> 25 25 #include <linux/input.h> 26 + 26 27 #include <asm/intel_scu_ipc.h> 27 28 28 29 #define DRIVER_NAME "msic_power_btn" 29 30 30 - #define MSIC_IRQ_STAT 0x02 31 - #define MSIC_IRQ_PB (1 << 0) 32 - #define MSIC_PB_CONFIG 0x3e 33 31 #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 */ 40 33 41 34 static irqreturn_t mfld_pb_isr(int irq, void *dev_id) 42 35 { 43 - struct mfld_pb_priv *priv = dev_id; 36 + struct input_dev *input = dev_id; 44 37 int ret; 45 38 u8 pbstat; 46 39 47 40 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 + } 53 49 54 50 return IRQ_HANDLED; 55 51 } 56 52 57 53 static int __devinit mfld_pb_probe(struct platform_device *pdev) 58 54 { 59 - struct mfld_pb_priv *priv; 60 55 struct input_dev *input; 61 - int irq; 56 + int irq = platform_get_irq(pdev, 0); 62 57 int error; 63 58 64 - irq = platform_get_irq(pdev, 0); 65 59 if (irq < 0) 66 60 return -EINVAL; 67 61 68 - priv = kzalloc(sizeof(struct mfld_pb_priv), GFP_KERNEL); 69 62 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; 73 66 } 74 - 75 - priv->input = input; 76 - priv->irq = irq; 77 67 78 68 input->name = pdev->name; 79 69 input->phys = "power-button/input0"; ··· 72 82 73 83 input_set_capability(input, EV_KEY, KEY_POWER); 74 84 75 - error = request_threaded_irq(priv->irq, NULL, mfld_pb_isr, 76 - 0, DRIVER_NAME, priv); 85 + error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0, 86 + DRIVER_NAME, input); 77 87 if (error) { 78 - dev_err(&pdev->dev, 79 - "unable to request irq %d for mfld power button\n", 80 - irq); 81 - goto err_free_mem; 88 + dev_err(&pdev->dev, "Unable to request irq %d for mfld power" 89 + "button\n", irq); 90 + goto err_free_input; 82 91 } 83 92 84 93 error = input_register_device(input); 85 94 if (error) { 86 - dev_err(&pdev->dev, 87 - "unable to register input dev, error %d\n", error); 95 + dev_err(&pdev->dev, "Unable to register input dev, error " 96 + "%d\n", error); 88 97 goto err_free_irq; 89 98 } 90 99 91 - platform_set_drvdata(pdev, priv); 100 + platform_set_drvdata(pdev, input); 92 101 return 0; 93 102 94 103 err_free_irq: 95 - free_irq(priv->irq, priv); 96 - err_free_mem: 104 + free_irq(irq, input); 105 + err_free_input: 97 106 input_free_device(input); 98 - kfree(priv); 99 107 return error; 100 108 } 101 109 102 110 static int __devexit mfld_pb_remove(struct platform_device *pdev) 103 111 { 104 - struct mfld_pb_priv *priv = platform_get_drvdata(pdev); 112 + struct input_dev *input = platform_get_drvdata(pdev); 113 + int irq = platform_get_irq(pdev, 0); 105 114 106 - free_irq(priv->irq, priv); 107 - input_unregister_device(priv->input); 108 - kfree(priv); 109 - 115 + free_irq(irq, input); 116 + input_unregister_device(input); 110 117 platform_set_drvdata(pdev, NULL); 118 + 111 119 return 0; 112 120 } 113 121
+263 -268
drivers/platform/x86/intel_mid_thermal.c
··· 37 37 #include <asm/intel_scu_ipc.h> 38 38 39 39 /* Number of thermal sensors */ 40 - #define MSIC_THERMAL_SENSORS 4 40 + #define MSIC_THERMAL_SENSORS 4 41 41 42 42 /* 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 46 46 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 51 51 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) 56 57 57 58 /* 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 62 63 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 67 68 68 69 /* 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 75 76 76 77 /* 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 */ 79 80 80 81 /* 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 83 84 84 85 /* This holds the address of the first free ADC channel, 85 86 * among the 15 channels ··· 88 87 static int channel_index; 89 88 90 89 struct platform_info { 91 - struct platform_device *pdev; 92 - struct thermal_zone_device *tzd[MSIC_THERMAL_SENSORS]; 90 + struct platform_device *pdev; 91 + struct thermal_zone_device *tzd[MSIC_THERMAL_SENSORS]; 93 92 }; 94 93 95 94 struct thermal_device_info { 96 - unsigned int chnl_addr; 97 - int direct; 98 - /* This holds the current temperature in millidegree celsius */ 99 - long curr_temp; 95 + unsigned int chnl_addr; 96 + int direct; 97 + /* This holds the current temperature in millidegree celsius */ 98 + long curr_temp; 100 99 }; 101 100 102 101 /** ··· 107 106 */ 108 107 static int to_msic_die_temp(uint16_t adc_val) 109 108 { 110 - return (368 * (adc_val) / 1000) - 220; 109 + return (368 * (adc_val) / 1000) - 220; 111 110 } 112 111 113 112 /** ··· 119 118 */ 120 119 static int is_valid_adc(uint16_t adc_val, uint16_t min, uint16_t max) 121 120 { 122 - return (adc_val >= min) && (adc_val <= max); 121 + return (adc_val >= min) && (adc_val <= max); 123 122 } 124 123 125 124 /** ··· 137 136 */ 138 137 static int adc_to_temp(int direct, uint16_t adc_val, unsigned long *tp) 139 138 { 140 - int temp; 139 + int temp; 141 140 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 - } 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 + } 150 149 151 - if (!is_valid_adc(adc_val, ADC_MIN, ADC_MAX)) 152 - return -ERANGE; 150 + if (!is_valid_adc(adc_val, ADC_MIN, ADC_MAX)) 151 + return -ERANGE; 153 152 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); 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); 165 164 166 - /* Convert temperature in celsius to milli degree celsius */ 167 - *tp = temp * 1000; 168 - return 0; 165 + /* Convert temperature in celsius to milli degree celsius */ 166 + *tp = temp * 1000; 167 + return 0; 169 168 } 170 169 171 170 /** ··· 179 178 */ 180 179 static int mid_read_temp(struct thermal_zone_device *tzd, unsigned long *temp) 181 180 { 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; 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; 187 186 188 187 189 - addr = td_info->chnl_addr; 188 + addr = td_info->chnl_addr; 190 189 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; 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; 195 194 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; 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; 200 199 201 - /* Read the higher bits of data */ 202 - ret = intel_scu_ipc_ioread8(addr, &data); 203 - if (ret) 204 - return ret; 200 + /* Read the higher bits of data */ 201 + ret = intel_scu_ipc_ioread8(addr, &data); 202 + if (ret) 203 + return ret; 205 204 206 - /* Shift bits to accommodate the lower two data bits */ 207 - adc_val = (data << 2); 208 - addr++; 205 + /* Shift bits to accommodate the lower two data bits */ 206 + adc_val = (data << 2); 207 + addr++; 209 208 210 - ret = intel_scu_ipc_ioread8(addr, &data);/* Read lower bits */ 211 - if (ret) 212 - return ret; 209 + ret = intel_scu_ipc_ioread8(addr, &data);/* Read lower bits */ 210 + if (ret) 211 + return ret; 213 212 214 - /* Adding lower two bits to the higher bits */ 215 - data &= 03; 216 - adc_val += data; 213 + /* Adding lower two bits to the higher bits */ 214 + data &= 03; 215 + adc_val += data; 217 216 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; 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; 223 222 } 224 223 225 224 /** ··· 232 231 */ 233 232 static int configure_adc(int val) 234 233 { 235 - int ret; 236 - uint8_t data; 234 + int ret; 235 + uint8_t data; 237 236 238 - ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data); 239 - if (ret) 240 - return ret; 237 + ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data); 238 + if (ret) 239 + return ret; 241 240 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 - 250 - return intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL1, data); 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 + return intel_scu_ipc_iowrite8(MSIC_THERM_ADC1CNTL1, data); 251 249 } 252 250 253 251 /** ··· 259 259 */ 260 260 static int set_up_therm_channel(u16 base_addr) 261 261 { 262 - int ret; 262 + int ret; 263 263 264 - /* Enable all the sensor channels */ 265 - ret = intel_scu_ipc_iowrite8(base_addr, SKIN_SENSOR0_CODE); 266 - if (ret) 267 - return ret; 264 + /* Enable all the sensor channels */ 265 + ret = intel_scu_ipc_iowrite8(base_addr, SKIN_SENSOR0_CODE); 266 + if (ret) 267 + return ret; 268 268 269 - ret = intel_scu_ipc_iowrite8(base_addr + 1, SKIN_SENSOR1_CODE); 270 - if (ret) 271 - return ret; 269 + ret = intel_scu_ipc_iowrite8(base_addr + 1, SKIN_SENSOR1_CODE); 270 + if (ret) 271 + return ret; 272 272 273 - ret = intel_scu_ipc_iowrite8(base_addr + 2, SYS_SENSOR_CODE); 274 - if (ret) 275 - return ret; 273 + ret = intel_scu_ipc_iowrite8(base_addr + 2, SYS_SENSOR_CODE); 274 + if (ret) 275 + return ret; 276 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; 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 283 284 - /* Enable ADC and start it */ 285 - return configure_adc(1); 284 + /* Enable ADC and start it */ 285 + return configure_adc(1); 286 286 } 287 287 288 288 /** ··· 293 293 */ 294 294 static int reset_stopbit(uint16_t addr) 295 295 { 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)); 303 303 } 304 304 305 305 /** ··· 317 317 */ 318 318 static int find_free_channel(void) 319 319 { 320 - int ret; 321 - int i; 322 - uint8_t data; 320 + int ret; 321 + int i; 322 + uint8_t data; 323 323 324 - /* check whether ADC is enabled */ 325 - ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data); 326 - if (ret) 327 - return ret; 324 + /* check whether ADC is enabled */ 325 + ret = intel_scu_ipc_ioread8(MSIC_THERM_ADC1CNTL1, &data); 326 + if (ret) 327 + return ret; 328 328 329 - if ((data & MSIC_ADC_ENBL) == 0) 330 - return 0; 329 + if ((data & MSIC_ADC_ENBL) == 0) 330 + return 0; 331 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; 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 337 338 - if (data & MSIC_STOPBIT_MASK) { 339 - ret = i; 340 - break; 341 - } 342 - } 343 - return (ret > ADC_LOOP_MAX) ? (-EINVAL) : ret; 338 + if (data & MSIC_STOPBIT_MASK) { 339 + ret = i; 340 + break; 341 + } 342 + } 343 + return (ret > ADC_LOOP_MAX) ? (-EINVAL) : ret; 344 344 } 345 345 346 346 /** ··· 351 351 */ 352 352 static int mid_initialize_adc(struct device *dev) 353 353 { 354 - u8 data; 355 - u16 base_addr; 356 - int ret; 354 + u8 data; 355 + u16 base_addr; 356 + int ret; 357 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; 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 365 366 - if (data & MSIC_ADCTHERM_MASK) 367 - dev_warn(dev, "ADCTHERM already set"); 366 + if (data & MSIC_ADCTHERM_MASK) 367 + dev_warn(dev, "ADCTHERM already set"); 368 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 - } 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 375 376 - base_addr = ADC_CHNL_START_ADDR + channel_index; 376 + base_addr = ADC_CHNL_START_ADDR + channel_index; 377 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; 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 383 384 - /* Index of the first free channel */ 385 - base_addr++; 386 - channel_index++; 387 - } 384 + /* Index of the first free channel */ 385 + base_addr++; 386 + channel_index++; 387 + } 388 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; 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; 396 396 } 397 397 398 398 /** ··· 403 403 */ 404 404 static struct thermal_device_info *initialize_sensor(int index) 405 405 { 406 - struct thermal_device_info *td_info = 407 - kzalloc(sizeof(struct thermal_device_info), GFP_KERNEL); 406 + struct thermal_device_info *td_info = 407 + kzalloc(sizeof(struct thermal_device_info), GFP_KERNEL); 408 408 409 - if (!td_info) 410 - return NULL; 409 + if (!td_info) 410 + return NULL; 411 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; 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; 418 418 } 419 419 420 420 /** ··· 425 425 */ 426 426 static int mid_thermal_resume(struct platform_device *pdev) 427 427 { 428 - return mid_initialize_adc(&pdev->dev); 428 + return mid_initialize_adc(&pdev->dev); 429 429 } 430 430 431 431 /** ··· 437 437 */ 438 438 static int mid_thermal_suspend(struct platform_device *pdev, pm_message_t mesg) 439 439 { 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); 446 446 } 447 447 448 448 /** ··· 453 453 */ 454 454 static int read_curr_temp(struct thermal_zone_device *tzd, unsigned long *temp) 455 455 { 456 - WARN_ON(tzd == NULL); 457 - return mid_read_temp(tzd, temp); 456 + WARN_ON(tzd == NULL); 457 + return mid_read_temp(tzd, temp); 458 458 } 459 459 460 460 /* Can't be const */ 461 461 static struct thermal_zone_device_ops tzd_ops = { 462 - .get_temp = read_curr_temp, 462 + .get_temp = read_curr_temp, 463 463 }; 464 - 465 464 466 465 /** 467 466 * mid_thermal_probe - mfld thermal initialize ··· 471 472 */ 472 473 static int mid_thermal_probe(struct platform_device *pdev) 473 474 { 474 - static char *name[MSIC_THERMAL_SENSORS] = { 475 - "skin0", "skin1", "sys", "msicdie" 476 - }; 475 + static char *name[MSIC_THERMAL_SENSORS] = { 476 + "skin0", "skin1", "sys", "msicdie" 477 + }; 477 478 478 - int ret; 479 - int i; 480 - struct platform_info *pinfo; 479 + int ret; 480 + int i; 481 + struct platform_info *pinfo; 481 482 482 - pinfo = kzalloc(sizeof(struct platform_info), GFP_KERNEL); 483 - if (!pinfo) 484 - return -ENOMEM; 483 + pinfo = kzalloc(sizeof(struct platform_info), GFP_KERNEL); 484 + if (!pinfo) 485 + return -ENOMEM; 485 486 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 - } 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 + } 493 494 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), 498 - &tzd_ops, 0, 0, 0, 0); 499 - if (IS_ERR(pinfo->tzd[i])) 500 - goto reg_fail; 501 - } 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), &tzd_ops, 0, 0, 0, 0); 499 + if (IS_ERR(pinfo->tzd[i])) 500 + goto reg_fail; 501 + } 502 502 503 - pinfo->pdev = pdev; 504 - platform_set_drvdata(pdev, pinfo); 505 - return 0; 503 + pinfo->pdev = pdev; 504 + platform_set_drvdata(pdev, pinfo); 505 + return 0; 506 506 507 507 reg_fail: 508 - ret = PTR_ERR(pinfo->tzd[i]); 509 - while (--i >= 0) 510 - thermal_zone_device_unregister(pinfo->tzd[i]); 511 - configure_adc(0); 512 - kfree(pinfo); 513 - return ret; 508 + ret = PTR_ERR(pinfo->tzd[i]); 509 + while (--i >= 0) 510 + thermal_zone_device_unregister(pinfo->tzd[i]); 511 + configure_adc(0); 512 + kfree(pinfo); 513 + return ret; 514 514 } 515 515 516 516 /** ··· 521 523 */ 522 524 static int mid_thermal_remove(struct platform_device *pdev) 523 525 { 524 - int i; 525 - struct platform_info *pinfo = platform_get_drvdata(pdev); 526 + int i; 527 + struct platform_info *pinfo = platform_get_drvdata(pdev); 526 528 527 - for (i = 0; i < MSIC_THERMAL_SENSORS; i++) 528 - thermal_zone_device_unregister(pinfo->tzd[i]); 529 + for (i = 0; i < MSIC_THERMAL_SENSORS; i++) 530 + thermal_zone_device_unregister(pinfo->tzd[i]); 529 531 530 - platform_set_drvdata(pdev, NULL); 532 + kfree(pinfo); 533 + platform_set_drvdata(pdev, NULL); 531 534 532 - /* Stop the ADC */ 533 - return configure_adc(0); 535 + /* Stop the ADC */ 536 + return configure_adc(0); 534 537 } 535 - 536 - /********************************************************************* 537 - * Driver initialisation and finalization 538 - *********************************************************************/ 539 538 540 539 #define DRIVER_NAME "msic_sensor" 541 540 542 541 static const struct platform_device_id therm_id_table[] = { 543 - { DRIVER_NAME, 1 }, 544 - { } 542 + { DRIVER_NAME, 1 }, 543 + { } 545 544 }; 546 545 547 546 static struct platform_driver mid_thermal_driver = { 548 - .driver = { 549 - .name = DRIVER_NAME, 550 - .owner = THIS_MODULE, 551 - }, 552 - .probe = mid_thermal_probe, 553 - .suspend = mid_thermal_suspend, 554 - .resume = mid_thermal_resume, 555 - .remove = __devexit_p(mid_thermal_remove), 556 - .id_table = therm_id_table, 547 + .driver = { 548 + .name = DRIVER_NAME, 549 + .owner = THIS_MODULE, 550 + }, 551 + .probe = mid_thermal_probe, 552 + .suspend = mid_thermal_suspend, 553 + .resume = mid_thermal_resume, 554 + .remove = __devexit_p(mid_thermal_remove), 555 + .id_table = therm_id_table, 557 556 }; 558 557 559 558 static int __init mid_thermal_module_init(void) 560 559 { 561 - return platform_driver_register(&mid_thermal_driver); 560 + return platform_driver_register(&mid_thermal_driver); 562 561 } 563 562 564 563 static void __exit mid_thermal_module_exit(void) 565 564 { 566 - platform_driver_unregister(&mid_thermal_driver); 565 + platform_driver_unregister(&mid_thermal_driver); 567 566 } 568 567 569 568 module_init(mid_thermal_module_init);
+396
drivers/platform/x86/intel_oaktrail.c
··· 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:*");
+7 -7
drivers/platform/x86/intel_pmic_gpio.c
··· 19 19 * Moorestown platform PMIC chip 20 20 */ 21 21 22 + #define pr_fmt(fmt) "%s: " fmt, __func__ 23 + 22 24 #include <linux/module.h> 23 25 #include <linux/kernel.h> 24 26 #include <linux/interrupt.h> ··· 92 90 static int pmic_gpio_direction_input(struct gpio_chip *chip, unsigned offset) 93 91 { 94 92 if (offset > 8) { 95 - printk(KERN_ERR 96 - "%s: only pin 0-7 support input\n", __func__); 93 + pr_err("only pin 0-7 support input\n"); 97 94 return -1;/* we only have 8 GPIO can use as input */ 98 95 } 99 96 return intel_scu_ipc_update_register(GPIO0 + offset, ··· 117 116 value ? 1 << (offset - 16) : 0, 118 117 1 << (offset - 16)); 119 118 else { 120 - printk(KERN_ERR 121 - "%s: invalid PMIC GPIO pin %d!\n", __func__, offset); 119 + pr_err("invalid PMIC GPIO pin %d!\n", offset); 122 120 WARN_ON(1); 123 121 } 124 122 ··· 260 260 /* setting up SRAM mapping for GPIOINT register */ 261 261 pg->gpiointr = ioremap_nocache(pdata->gpiointr, 8); 262 262 if (!pg->gpiointr) { 263 - printk(KERN_ERR "%s: Can not map GPIOINT.\n", __func__); 263 + pr_err("Can not map GPIOINT\n"); 264 264 retval = -EINVAL; 265 265 goto err2; 266 266 } ··· 281 281 pg->chip.dev = dev; 282 282 retval = gpiochip_add(&pg->chip); 283 283 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"); 285 285 goto err; 286 286 } 287 287 288 288 retval = request_irq(pg->irq, pmic_irq_handler, 0, "pmic", pg); 289 289 if (retval) { 290 - printk(KERN_WARNING "pmic: Interrupt request failed\n"); 290 + pr_warn("Interrupt request failed\n"); 291 291 goto err; 292 292 } 293 293
+5 -6
drivers/platform/x86/msi-laptop.c
··· 447 447 448 448 static int dmi_check_cb(const struct dmi_system_id *id) 449 449 { 450 - pr_info("Identified laptop model '%s'.\n", id->ident); 450 + pr_info("Identified laptop model '%s'\n", id->ident); 451 451 return 1; 452 452 } 453 453 ··· 800 800 input_unregister_device(msi_laptop_input_dev); 801 801 } 802 802 803 - static int load_scm_model_init(struct platform_device *sdev) 803 + static int __init load_scm_model_init(struct platform_device *sdev) 804 804 { 805 805 u8 data; 806 806 int result; ··· 875 875 /* Register backlight stuff */ 876 876 877 877 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"); 880 879 } else { 881 880 struct backlight_properties props; 882 881 memset(&props, 0, sizeof(struct backlight_properties)); ··· 929 930 if (auto_brightness != 2) 930 931 set_auto_brightness(auto_brightness); 931 932 932 - pr_info("driver "MSI_DRIVER_VERSION" successfully loaded.\n"); 933 + pr_info("driver " MSI_DRIVER_VERSION " successfully loaded\n"); 933 934 934 935 return 0; 935 936 ··· 977 978 if (auto_brightness != 2) 978 979 set_auto_brightness(1); 979 980 980 - pr_info("driver unloaded.\n"); 981 + pr_info("driver unloaded\n"); 981 982 } 982 983 983 984 module_init(msi_init);
+20 -25
drivers/platform/x86/msi-wmi.c
··· 20 20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 21 21 */ 22 22 23 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 23 24 24 25 #include <linux/kernel.h> 25 26 #include <linux/input.h> ··· 37 36 MODULE_ALIAS("wmi:B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2"); 38 37 39 38 #define DRV_NAME "msi-wmi" 40 - #define DRV_PFX DRV_NAME ": " 41 39 42 40 #define MSIWMI_BIOS_GUID "551A1F84-FBDD-4125-91DB-3EA8F44F1D45" 43 41 #define MSIWMI_EVENT_GUID "B6F3EEF2-3D2F-49DC-9DE3-85BCE18C62F2" 44 - 45 - #define dprintk(msg...) pr_debug(DRV_PFX msg) 46 42 47 43 #define SCANCODE_BASE 0xD0 48 44 #define MSI_WMI_BRIGHTNESSUP SCANCODE_BASE ··· 76 78 77 79 if (!obj || obj->type != ACPI_TYPE_INTEGER) { 78 80 if (obj) { 79 - printk(KERN_ERR DRV_PFX "query block returned object " 81 + pr_err("query block returned object " 80 82 "type: %d - buffer length:%d\n", obj->type, 81 83 obj->type == ACPI_TYPE_BUFFER ? 82 84 obj->buffer.length : 0); ··· 95 97 96 98 struct acpi_buffer input = { sizeof(int), &value }; 97 99 98 - dprintk("Going to set block of instance: %d - value: %d\n", 99 - instance, value); 100 + pr_debug("Going to set block of instance: %d - value: %d\n", 101 + instance, value); 100 102 101 103 status = wmi_set_block(MSIWMI_BIOS_GUID, instance, &input); 102 104 ··· 110 112 /* Instance 1 is "get backlight", cmp with DSDT */ 111 113 err = msi_wmi_query_block(1, &ret); 112 114 if (err) { 113 - printk(KERN_ERR DRV_PFX "Could not query backlight: %d\n", err); 115 + pr_err("Could not query backlight: %d\n", err); 114 116 return -EINVAL; 115 117 } 116 - dprintk("Get: Query block returned: %d\n", ret); 118 + pr_debug("Get: Query block returned: %d\n", ret); 117 119 for (level = 0; level < ARRAY_SIZE(backlight_map); level++) { 118 120 if (backlight_map[level] == ret) { 119 - dprintk("Current backlight level: 0x%X - index: %d\n", 120 - backlight_map[level], level); 121 + pr_debug("Current backlight level: 0x%X - index: %d\n", 122 + backlight_map[level], level); 121 123 break; 122 124 } 123 125 } 124 126 if (level == ARRAY_SIZE(backlight_map)) { 125 - printk(KERN_ERR DRV_PFX "get: Invalid brightness value: 0x%X\n", 126 - ret); 127 + pr_err("get: Invalid brightness value: 0x%X\n", ret); 127 128 return -EINVAL; 128 129 } 129 130 return level; ··· 153 156 154 157 status = wmi_get_event_data(value, &response); 155 158 if (status != AE_OK) { 156 - printk(KERN_INFO DRV_PFX "bad event status 0x%x\n", status); 159 + pr_info("bad event status 0x%x\n", status); 157 160 return; 158 161 } 159 162 ··· 161 164 162 165 if (obj && obj->type == ACPI_TYPE_INTEGER) { 163 166 int eventcode = obj->integer.value; 164 - dprintk("Eventcode: 0x%x\n", eventcode); 167 + pr_debug("Eventcode: 0x%x\n", eventcode); 165 168 key = sparse_keymap_entry_from_scancode(msi_wmi_input_dev, 166 169 eventcode); 167 170 if (key) { ··· 172 175 /* Ignore event if the same event happened in a 50 ms 173 176 timeframe -> Key press may result in 10-20 GPEs */ 174 177 if (ktime_to_us(diff) < 1000 * 50) { 175 - dprintk("Suppressed key event 0x%X - " 176 - "Last press was %lld us ago\n", 178 + pr_debug("Suppressed key event 0x%X - " 179 + "Last press was %lld us ago\n", 177 180 key->code, ktime_to_us(diff)); 178 181 return; 179 182 } ··· 184 187 (!acpi_video_backlight_support() || 185 188 (key->code != MSI_WMI_BRIGHTNESSUP && 186 189 key->code != MSI_WMI_BRIGHTNESSDOWN))) { 187 - dprintk("Send key: 0x%X - " 188 - "Input layer keycode: %d\n", key->code, 189 - key->keycode); 190 + pr_debug("Send key: 0x%X - " 191 + "Input layer keycode: %d\n", 192 + key->code, key->keycode); 190 193 sparse_keymap_report_entry(msi_wmi_input_dev, 191 194 key, 1, true); 192 195 } 193 196 } else 194 - printk(KERN_INFO "Unknown key pressed - %x\n", 195 - eventcode); 197 + pr_info("Unknown key pressed - %x\n", eventcode); 196 198 } else 197 - printk(KERN_INFO DRV_PFX "Unknown event received\n"); 199 + pr_info("Unknown event received\n"); 198 200 kfree(response.pointer); 199 201 } 200 202 ··· 234 238 int err; 235 239 236 240 if (!wmi_has_guid(MSIWMI_EVENT_GUID)) { 237 - printk(KERN_ERR 238 - "This machine doesn't have MSI-hotkeys through WMI\n"); 241 + pr_err("This machine doesn't have MSI-hotkeys through WMI\n"); 239 242 return -ENODEV; 240 243 } 241 244 err = wmi_install_notify_handler(MSIWMI_EVENT_GUID, ··· 265 270 266 271 backlight->props.brightness = err; 267 272 } 268 - dprintk("Event handler installed\n"); 273 + pr_debug("Event handler installed\n"); 269 274 270 275 return 0; 271 276
+49 -57
drivers/platform/x86/sony-laptop.c
··· 42 42 * 43 43 */ 44 44 45 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 46 + 45 47 #include <linux/kernel.h> 46 48 #include <linux/module.h> 47 49 #include <linux/moduleparam.h> ··· 72 70 #include <linux/miscdevice.h> 73 71 #endif 74 72 75 - #define DRV_PFX "sony-laptop: " 76 - #define dprintk(msg...) do { \ 77 - if (debug) \ 78 - pr_warn(DRV_PFX msg); \ 73 + #define dprintk(fmt, ...) \ 74 + do { \ 75 + if (debug) \ 76 + pr_warn(fmt, ##__VA_ARGS__); \ 79 77 } while (0) 80 78 81 79 #define SONY_LAPTOP_DRIVER_VERSION "0.6" ··· 420 418 error = kfifo_alloc(&sony_laptop_input.fifo, 421 419 SONY_LAPTOP_BUF_SIZE, GFP_KERNEL); 422 420 if (error) { 423 - pr_err(DRV_PFX "kfifo_alloc failed\n"); 421 + pr_err("kfifo_alloc failed\n"); 424 422 goto err_dec_users; 425 423 } 426 424 ··· 704 702 return 0; 705 703 } 706 704 707 - pr_warn(DRV_PFX "acpi_callreadfunc failed\n"); 705 + pr_warn("acpi_callreadfunc failed\n"); 708 706 709 707 return -1; 710 708 } ··· 730 728 if (status == AE_OK) { 731 729 if (result != NULL) { 732 730 if (out_obj.type != ACPI_TYPE_INTEGER) { 733 - pr_warn(DRV_PFX "acpi_evaluate_object bad " 734 - "return type\n"); 731 + pr_warn("acpi_evaluate_object bad return type\n"); 735 732 return -1; 736 733 } 737 734 *result = out_obj.integer.value; ··· 738 737 return 0; 739 738 } 740 739 741 - pr_warn(DRV_PFX "acpi_evaluate_object failed\n"); 740 + pr_warn("acpi_evaluate_object failed\n"); 742 741 743 742 return -1; 744 743 } ··· 962 961 static int sony_nc_get_brightness_ng(struct backlight_device *bd) 963 962 { 964 963 int result; 965 - int *handle = (int *)bl_get_data(bd); 966 964 struct sony_backlight_props *sdev = 967 965 (struct sony_backlight_props *)bl_get_data(bd); 968 966 ··· 973 973 static int sony_nc_update_status_ng(struct backlight_device *bd) 974 974 { 975 975 int value, result; 976 - int *handle = (int *)bl_get_data(bd); 977 976 struct sony_backlight_props *sdev = 978 977 (struct sony_backlight_props *)bl_get_data(bd); 979 978 ··· 1103 1104 } 1104 1105 1105 1106 if (!key_event->data) 1106 - pr_info(DRV_PFX 1107 - "Unknown event: 0x%x 0x%x\n", 1108 - key_handle, 1109 - ev); 1107 + pr_info("Unknown event: 0x%x 0x%x\n", 1108 + key_handle, ev); 1110 1109 else 1111 1110 sony_laptop_report_input_event(ev); 1112 1111 } ··· 1125 1128 struct acpi_device_info *info; 1126 1129 1127 1130 if (ACPI_SUCCESS(acpi_get_object_info(handle, &info))) { 1128 - pr_warn(DRV_PFX "method: name: %4.4s, args %X\n", 1131 + pr_warn("method: name: %4.4s, args %X\n", 1129 1132 (char *)&info->name, info->param_count); 1130 1133 1131 1134 kfree(info); ··· 1166 1169 ret = acpi_callsetfunc(sony_nc_acpi_handle, *item->acpiset, 1167 1170 item->value, NULL); 1168 1171 if (ret < 0) { 1169 - pr_err(DRV_PFX "%s: %d\n", __func__, ret); 1172 + pr_err("%s: %d\n", __func__, ret); 1170 1173 break; 1171 1174 } 1172 1175 } ··· 1333 1336 1334 1337 device_enum = (union acpi_object *) buffer.pointer; 1335 1338 if (!device_enum) { 1336 - pr_err(DRV_PFX "No SN06 return object."); 1339 + pr_err("No SN06 return object\n"); 1337 1340 goto out_no_enum; 1338 1341 } 1339 1342 if (device_enum->type != ACPI_TYPE_BUFFER) { 1340 - pr_err(DRV_PFX "Invalid SN06 return object 0x%.2x\n", 1341 - device_enum->type); 1343 + pr_err("Invalid SN06 return object 0x%.2x\n", 1344 + device_enum->type); 1342 1345 goto out_no_enum; 1343 1346 } 1344 1347 ··· 1659 1662 ops, &props); 1660 1663 1661 1664 if (IS_ERR(sony_bl_props.dev)) { 1662 - pr_warn(DRV_PFX "unable to register backlight device\n"); 1665 + pr_warn("unable to register backlight device\n"); 1663 1666 sony_bl_props.dev = NULL; 1664 1667 } else 1665 1668 sony_bl_props.dev->props.brightness = ··· 1679 1682 acpi_handle handle; 1680 1683 struct sony_nc_value *item; 1681 1684 1682 - pr_info(DRV_PFX "%s v%s.\n", SONY_NC_DRIVER_NAME, 1683 - SONY_LAPTOP_DRIVER_VERSION); 1685 + pr_info("%s v%s\n", SONY_NC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); 1684 1686 1685 1687 sony_nc_acpi_device = device; 1686 1688 strcpy(acpi_device_class(device), "sony/hotkey"); ··· 1704 1708 sony_nc_acpi_handle, 1, sony_walk_callback, 1705 1709 NULL, NULL, NULL); 1706 1710 if (ACPI_FAILURE(status)) { 1707 - pr_warn(DRV_PFX "unable to walk acpi resources\n"); 1711 + pr_warn("unable to walk acpi resources\n"); 1708 1712 result = -ENODEV; 1709 1713 goto outpresent; 1710 1714 } ··· 1732 1736 /* setup input devices and helper fifo */ 1733 1737 result = sony_laptop_setup_input(device); 1734 1738 if (result) { 1735 - pr_err(DRV_PFX "Unable to create input devices.\n"); 1739 + pr_err("Unable to create input devices\n"); 1736 1740 goto outkbdbacklight; 1737 1741 } 1738 1742 1739 1743 if (acpi_video_backlight_support()) { 1740 - pr_info(DRV_PFX "brightness ignored, must be " 1741 - "controlled by ACPI video driver\n"); 1744 + pr_info("brightness ignored, must be controlled by ACPI video driver\n"); 1742 1745 } else { 1743 1746 sony_nc_backlight_setup(); 1744 1747 } ··· 2260 2265 if (pcidev) 2261 2266 pci_dev_put(pcidev); 2262 2267 2263 - pr_info(DRV_PFX "detected Type%d model\n", 2264 - dev->model == SONYPI_DEVICE_TYPE1 ? 1 : 2265 - dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3); 2268 + pr_info("detected Type%d model\n", 2269 + dev->model == SONYPI_DEVICE_TYPE1 ? 1 : 2270 + dev->model == SONYPI_DEVICE_TYPE2 ? 2 : 3); 2266 2271 } 2267 2272 2268 2273 /* camera tests and poweron/poweroff */ ··· 2308 2313 static int __sony_pic_camera_off(void) 2309 2314 { 2310 2315 if (!camera) { 2311 - pr_warn(DRV_PFX "camera control not enabled\n"); 2316 + pr_warn("camera control not enabled\n"); 2312 2317 return -ENODEV; 2313 2318 } 2314 2319 ··· 2328 2333 int i, j, x; 2329 2334 2330 2335 if (!camera) { 2331 - pr_warn(DRV_PFX "camera control not enabled\n"); 2336 + pr_warn("camera control not enabled\n"); 2332 2337 return -ENODEV; 2333 2338 } 2334 2339 ··· 2351 2356 } 2352 2357 2353 2358 if (j == 0) { 2354 - pr_warn(DRV_PFX "failed to power on camera\n"); 2359 + pr_warn("failed to power on camera\n"); 2355 2360 return -ENODEV; 2356 2361 } 2357 2362 ··· 2407 2412 ITERATIONS_SHORT); 2408 2413 break; 2409 2414 default: 2410 - pr_err(DRV_PFX "sony_pic_camera_command invalid: %d\n", 2411 - command); 2415 + pr_err("sony_pic_camera_command invalid: %d\n", command); 2412 2416 break; 2413 2417 } 2414 2418 mutex_unlock(&spic_dev.lock); ··· 2813 2819 error = 2814 2820 kfifo_alloc(&sonypi_compat.fifo, SONY_LAPTOP_BUF_SIZE, GFP_KERNEL); 2815 2821 if (error) { 2816 - pr_err(DRV_PFX "kfifo_alloc failed\n"); 2822 + pr_err("kfifo_alloc failed\n"); 2817 2823 return error; 2818 2824 } 2819 2825 ··· 2823 2829 sonypi_misc_device.minor = minor; 2824 2830 error = misc_register(&sonypi_misc_device); 2825 2831 if (error) { 2826 - pr_err(DRV_PFX "misc_register failed\n"); 2832 + pr_err("misc_register failed\n"); 2827 2833 goto err_free_kfifo; 2828 2834 } 2829 2835 if (minor == -1) 2830 - pr_info(DRV_PFX "device allocated minor is %d\n", 2831 - sonypi_misc_device.minor); 2836 + pr_info("device allocated minor is %d\n", 2837 + sonypi_misc_device.minor); 2832 2838 2833 2839 return 0; 2834 2840 ··· 2887 2893 } 2888 2894 for (i = 0; i < p->interrupt_count; i++) { 2889 2895 if (!p->interrupts[i]) { 2890 - pr_warn(DRV_PFX "Invalid IRQ %d\n", 2891 - p->interrupts[i]); 2896 + pr_warn("Invalid IRQ %d\n", 2897 + p->interrupts[i]); 2892 2898 continue; 2893 2899 } 2894 2900 interrupt = kzalloc(sizeof(*interrupt), ··· 2926 2932 ioport->io2.address_length); 2927 2933 } 2928 2934 else { 2929 - pr_err(DRV_PFX "Unknown SPIC Type, more than 2 IO Ports\n"); 2935 + pr_err("Unknown SPIC Type, more than 2 IO Ports\n"); 2930 2936 return AE_ERROR; 2931 2937 } 2932 2938 return AE_OK; 2933 2939 } 2934 2940 default: 2935 2941 dprintk("Resource %d isn't an IRQ nor an IO port\n", 2936 - resource->type); 2942 + resource->type); 2937 2943 2938 2944 case ACPI_RESOURCE_TYPE_END_TAG: 2939 2945 return AE_OK; ··· 2954 2960 dprintk("Evaluating _STA\n"); 2955 2961 result = acpi_bus_get_status(device); 2956 2962 if (result) { 2957 - pr_warn(DRV_PFX "Unable to read status\n"); 2963 + pr_warn("Unable to read status\n"); 2958 2964 goto end; 2959 2965 } 2960 2966 ··· 2970 2976 status = acpi_walk_resources(device->handle, METHOD_NAME__PRS, 2971 2977 sony_pic_read_possible_resource, &spic_dev); 2972 2978 if (ACPI_FAILURE(status)) { 2973 - pr_warn(DRV_PFX "Failure evaluating %s\n", 2974 - METHOD_NAME__PRS); 2979 + pr_warn("Failure evaluating %s\n", METHOD_NAME__PRS); 2975 2980 result = -ENODEV; 2976 2981 } 2977 2982 end: ··· 3083 3090 3084 3091 /* check for total failure */ 3085 3092 if (ACPI_FAILURE(status)) { 3086 - pr_err(DRV_PFX "Error evaluating _SRS\n"); 3093 + pr_err("Error evaluating _SRS\n"); 3087 3094 result = -ENODEV; 3088 3095 goto end; 3089 3096 } ··· 3175 3182 struct sony_pic_irq *irq, *tmp_irq; 3176 3183 3177 3184 if (sony_pic_disable(device)) { 3178 - pr_err(DRV_PFX "Couldn't disable device.\n"); 3185 + pr_err("Couldn't disable device\n"); 3179 3186 return -ENXIO; 3180 3187 } 3181 3188 ··· 3215 3222 struct sony_pic_ioport *io, *tmp_io; 3216 3223 struct sony_pic_irq *irq, *tmp_irq; 3217 3224 3218 - pr_info(DRV_PFX "%s v%s.\n", SONY_PIC_DRIVER_NAME, 3219 - SONY_LAPTOP_DRIVER_VERSION); 3225 + pr_info("%s v%s\n", SONY_PIC_DRIVER_NAME, SONY_LAPTOP_DRIVER_VERSION); 3220 3226 3221 3227 spic_dev.acpi_dev = device; 3222 3228 strcpy(acpi_device_class(device), "sony/hotkey"); ··· 3225 3233 /* read _PRS resources */ 3226 3234 result = sony_pic_possible_resources(device); 3227 3235 if (result) { 3228 - pr_err(DRV_PFX "Unable to read possible resources.\n"); 3236 + pr_err("Unable to read possible resources\n"); 3229 3237 goto err_free_resources; 3230 3238 } 3231 3239 3232 3240 /* setup input devices and helper fifo */ 3233 3241 result = sony_laptop_setup_input(device); 3234 3242 if (result) { 3235 - pr_err(DRV_PFX "Unable to create input devices.\n"); 3243 + pr_err("Unable to create input devices\n"); 3236 3244 goto err_free_resources; 3237 3245 } 3238 3246 ··· 3273 3281 } 3274 3282 } 3275 3283 if (!spic_dev.cur_ioport) { 3276 - pr_err(DRV_PFX "Failed to request_region.\n"); 3284 + pr_err("Failed to request_region\n"); 3277 3285 result = -ENODEV; 3278 3286 goto err_remove_compat; 3279 3287 } ··· 3293 3301 } 3294 3302 } 3295 3303 if (!spic_dev.cur_irq) { 3296 - pr_err(DRV_PFX "Failed to request_irq.\n"); 3304 + pr_err("Failed to request_irq\n"); 3297 3305 result = -ENODEV; 3298 3306 goto err_release_region; 3299 3307 } ··· 3301 3309 /* set resource status _SRS */ 3302 3310 result = sony_pic_enable(device, spic_dev.cur_ioport, spic_dev.cur_irq); 3303 3311 if (result) { 3304 - pr_err(DRV_PFX "Couldn't enable device.\n"); 3312 + pr_err("Couldn't enable device\n"); 3305 3313 goto err_free_irq; 3306 3314 } 3307 3315 ··· 3410 3418 if (!no_spic && dmi_check_system(sonypi_dmi_table)) { 3411 3419 result = acpi_bus_register_driver(&sony_pic_driver); 3412 3420 if (result) { 3413 - pr_err(DRV_PFX "Unable to register SPIC driver."); 3421 + pr_err("Unable to register SPIC driver\n"); 3414 3422 goto out; 3415 3423 } 3416 3424 spic_drv_registered = 1; ··· 3418 3426 3419 3427 result = acpi_bus_register_driver(&sony_nc_driver); 3420 3428 if (result) { 3421 - pr_err(DRV_PFX "Unable to register SNC driver."); 3429 + pr_err("Unable to register SNC driver\n"); 3422 3430 goto out_unregister_pic; 3423 3431 } 3424 3432
+3 -4
drivers/platform/x86/tc1100-wmi.c
··· 25 25 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 26 26 */ 27 27 28 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 29 + 28 30 #include <linux/kernel.h> 29 31 #include <linux/module.h> 30 32 #include <linux/slab.h> ··· 41 39 42 40 #define TC1100_INSTANCE_WIRELESS 1 43 41 #define TC1100_INSTANCE_JOGDIAL 2 44 - 45 - #define TC1100_LOGPREFIX "tc1100-wmi: " 46 - #define TC1100_INFO KERN_INFO TC1100_LOGPREFIX 47 42 48 43 MODULE_AUTHOR("Jamey Hicks, Carlos Corbacho"); 49 44 MODULE_DESCRIPTION("HP Compaq TC1100 Tablet WMI Extras"); ··· 263 264 if (error) 264 265 goto err_device_del; 265 266 266 - printk(TC1100_INFO "HP Compaq TC1100 Tablet WMI Extras loaded\n"); 267 + pr_info("HP Compaq TC1100 Tablet WMI Extras loaded\n"); 267 268 return 0; 268 269 269 270 err_device_del:
+197 -293
drivers/platform/x86/thinkpad_acpi.c
··· 21 21 * 02110-1301, USA. 22 22 */ 23 23 24 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 25 + 24 26 #define TPACPI_VERSION "0.24" 25 27 #define TPACPI_SYSFS_VERSION 0x020700 26 28 ··· 226 224 227 225 #define TPACPI_MAX_ACPI_ARGS 3 228 226 229 - /* printk headers */ 230 - #define TPACPI_LOG TPACPI_FILE ": " 231 - #define TPACPI_EMERG KERN_EMERG TPACPI_LOG 232 - #define TPACPI_ALERT KERN_ALERT TPACPI_LOG 233 - #define TPACPI_CRIT KERN_CRIT TPACPI_LOG 234 - #define TPACPI_ERR KERN_ERR TPACPI_LOG 235 - #define TPACPI_WARN KERN_WARNING TPACPI_LOG 236 - #define TPACPI_NOTICE KERN_NOTICE TPACPI_LOG 237 - #define TPACPI_INFO KERN_INFO TPACPI_LOG 238 - #define TPACPI_DEBUG KERN_DEBUG TPACPI_LOG 239 - 240 227 /* Debugging printk groups */ 241 228 #define TPACPI_DBG_ALL 0xffff 242 229 #define TPACPI_DBG_DISCLOSETASK 0x8000 ··· 380 389 * Debugging helpers 381 390 */ 382 391 383 - #define dbg_printk(a_dbg_level, format, arg...) \ 384 - do { if (dbg_level & (a_dbg_level)) \ 385 - printk(TPACPI_DEBUG "%s: " format, __func__ , ## arg); \ 386 - } while (0) 392 + #define dbg_printk(a_dbg_level, format, arg...) \ 393 + do { \ 394 + if (dbg_level & (a_dbg_level)) \ 395 + printk(KERN_DEBUG pr_fmt("%s: " format), \ 396 + __func__, ##arg); \ 397 + } while (0) 387 398 388 399 #ifdef CONFIG_THINKPAD_ACPI_DEBUG 389 400 #define vdbg_printk dbg_printk 390 401 static const char *str_supported(int is_supported); 391 402 #else 392 - #define vdbg_printk(a_dbg_level, format, arg...) \ 393 - do { } while (0) 403 + static inline const char *str_supported(int is_supported) { return ""; } 404 + #define vdbg_printk(a_dbg_level, format, arg...) \ 405 + no_printk(format, ##arg) 394 406 #endif 395 407 396 408 static void tpacpi_log_usertask(const char * const what) 397 409 { 398 - printk(TPACPI_DEBUG "%s: access by process with PID %d\n", 399 - what, task_tgid_vnr(current)); 410 + printk(KERN_DEBUG pr_fmt("%s: access by process with PID %d\n"), 411 + what, task_tgid_vnr(current)); 400 412 } 401 413 402 - #define tpacpi_disclose_usertask(what, format, arg...) \ 403 - do { \ 404 - if (unlikely( \ 405 - (dbg_level & TPACPI_DBG_DISCLOSETASK) && \ 406 - (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \ 407 - printk(TPACPI_DEBUG "%s: PID %d: " format, \ 408 - what, task_tgid_vnr(current), ## arg); \ 409 - } \ 410 - } while (0) 414 + #define tpacpi_disclose_usertask(what, format, arg...) \ 415 + do { \ 416 + if (unlikely((dbg_level & TPACPI_DBG_DISCLOSETASK) && \ 417 + (tpacpi_lifecycle == TPACPI_LIFE_RUNNING))) { \ 418 + printk(KERN_DEBUG pr_fmt("%s: PID %d: " format), \ 419 + what, task_tgid_vnr(current), ## arg); \ 420 + } \ 421 + } while (0) 411 422 412 423 /* 413 424 * Quirk handling helpers ··· 528 535 "HKEY", /* all others */ 529 536 ); /* 570 */ 530 537 531 - TPACPI_HANDLE(vid, root, "\\_SB.PCI.AGP.VGA", /* 570 */ 532 - "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ 533 - "\\_SB.PCI0.VID0", /* 770e */ 534 - "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ 535 - "\\_SB.PCI0.AGP.VGA", /* X100e and a few others */ 536 - "\\_SB.PCI0.AGP.VID", /* all others */ 537 - ); /* R30, R31 */ 538 - 539 - 540 538 /************************************************************************* 541 539 * ACPI helpers 542 540 */ ··· 547 563 int quiet; 548 564 549 565 if (!*fmt) { 550 - printk(TPACPI_ERR "acpi_evalf() called with empty format\n"); 566 + pr_err("acpi_evalf() called with empty format\n"); 551 567 return 0; 552 568 } 553 569 ··· 572 588 break; 573 589 /* add more types as needed */ 574 590 default: 575 - printk(TPACPI_ERR "acpi_evalf() called " 591 + pr_err("acpi_evalf() called " 576 592 "with invalid format character '%c'\n", c); 577 593 va_end(ap); 578 594 return 0; ··· 601 617 break; 602 618 /* add more types as needed */ 603 619 default: 604 - printk(TPACPI_ERR "acpi_evalf() called " 620 + pr_err("acpi_evalf() called " 605 621 "with invalid format character '%c'\n", res_type); 606 622 return 0; 607 623 } 608 624 609 625 if (!success && !quiet) 610 - printk(TPACPI_ERR "acpi_evalf(%s, %s, ...) failed: %s\n", 626 + pr_err("acpi_evalf(%s, %s, ...) failed: %s\n", 611 627 method, fmt0, acpi_format_exception(status)); 612 628 613 629 return success; ··· 751 767 752 768 rc = acpi_bus_get_device(*ibm->acpi->handle, &ibm->acpi->device); 753 769 if (rc < 0) { 754 - printk(TPACPI_ERR "acpi_bus_get_device(%s) failed: %d\n", 755 - ibm->name, rc); 770 + pr_err("acpi_bus_get_device(%s) failed: %d\n", ibm->name, rc); 756 771 return -ENODEV; 757 772 } 758 773 ··· 764 781 ibm->acpi->type, dispatch_acpi_notify, ibm); 765 782 if (ACPI_FAILURE(status)) { 766 783 if (status == AE_ALREADY_EXISTS) { 767 - printk(TPACPI_NOTICE 768 - "another device driver is already " 769 - "handling %s events\n", ibm->name); 784 + pr_notice("another device driver is already " 785 + "handling %s events\n", ibm->name); 770 786 } else { 771 - printk(TPACPI_ERR 772 - "acpi_install_notify_handler(%s) failed: %s\n", 787 + pr_err("acpi_install_notify_handler(%s) failed: %s\n", 773 788 ibm->name, acpi_format_exception(status)); 774 789 } 775 790 return -ENODEV; ··· 792 811 793 812 ibm->acpi->driver = kzalloc(sizeof(struct acpi_driver), GFP_KERNEL); 794 813 if (!ibm->acpi->driver) { 795 - printk(TPACPI_ERR 796 - "failed to allocate memory for ibm->acpi->driver\n"); 814 + pr_err("failed to allocate memory for ibm->acpi->driver\n"); 797 815 return -ENOMEM; 798 816 } 799 817 ··· 803 823 804 824 rc = acpi_bus_register_driver(ibm->acpi->driver); 805 825 if (rc < 0) { 806 - printk(TPACPI_ERR "acpi_bus_register_driver(%s) failed: %d\n", 826 + pr_err("acpi_bus_register_driver(%s) failed: %d\n", 807 827 ibm->name, rc); 808 828 kfree(ibm->acpi->driver); 809 829 ibm->acpi->driver = NULL; ··· 1061 1081 static void tpacpi_disable_brightness_delay(void) 1062 1082 { 1063 1083 if (acpi_evalf(hkey_handle, NULL, "PWMS", "qvd", 0)) 1064 - printk(TPACPI_NOTICE 1065 - "ACPI backlight control delay disabled\n"); 1084 + pr_notice("ACPI backlight control delay disabled\n"); 1066 1085 } 1067 1086 1068 1087 static void printk_deprecated_attribute(const char * const what, 1069 1088 const char * const details) 1070 1089 { 1071 1090 tpacpi_log_usertask("deprecated sysfs attribute"); 1072 - printk(TPACPI_WARN "WARNING: sysfs attribute %s is deprecated and " 1091 + pr_warn("WARNING: sysfs attribute %s is deprecated and " 1073 1092 "will be removed. %s\n", 1074 1093 what, details); 1075 1094 } ··· 1243 1264 &tpacpi_rfk_rfkill_ops, 1244 1265 atp_rfk); 1245 1266 if (!atp_rfk || !atp_rfk->rfkill) { 1246 - printk(TPACPI_ERR 1247 - "failed to allocate memory for rfkill class\n"); 1267 + pr_err("failed to allocate memory for rfkill class\n"); 1248 1268 kfree(atp_rfk); 1249 1269 return -ENOMEM; 1250 1270 } ··· 1253 1275 1254 1276 sw_status = (tp_rfkops->get_status)(); 1255 1277 if (sw_status < 0) { 1256 - printk(TPACPI_ERR 1257 - "failed to read initial state for %s, error %d\n", 1258 - name, sw_status); 1278 + pr_err("failed to read initial state for %s, error %d\n", 1279 + name, sw_status); 1259 1280 } else { 1260 1281 sw_state = (sw_status == TPACPI_RFK_RADIO_OFF); 1261 1282 if (set_default) { ··· 1268 1291 1269 1292 res = rfkill_register(atp_rfk->rfkill); 1270 1293 if (res < 0) { 1271 - printk(TPACPI_ERR 1272 - "failed to register %s rfkill switch: %d\n", 1273 - name, res); 1294 + pr_err("failed to register %s rfkill switch: %d\n", name, res); 1274 1295 rfkill_destroy(atp_rfk->rfkill); 1275 1296 kfree(atp_rfk); 1276 1297 return res; ··· 1276 1301 1277 1302 tpacpi_rfkill_switches[id] = atp_rfk; 1278 1303 1279 - printk(TPACPI_INFO "rfkill switch %s: radio is %sblocked\n", 1304 + pr_info("rfkill switch %s: radio is %sblocked\n", 1280 1305 name, (sw_state || hw_state) ? "" : "un"); 1281 1306 return 0; 1282 1307 } ··· 1800 1825 * broken, or really stable to begin with, so it is 1801 1826 * best if the user upgrades the firmware anyway. 1802 1827 */ 1803 - printk(TPACPI_WARN 1804 - "WARNING: Outdated ThinkPad BIOS/EC firmware\n"); 1805 - printk(TPACPI_WARN 1806 - "WARNING: This firmware may be missing critical bug " 1828 + pr_warn("WARNING: Outdated ThinkPad BIOS/EC firmware\n"); 1829 + pr_warn("WARNING: This firmware may be missing critical bug " 1807 1830 "fixes and/or important features\n"); 1808 1831 } 1809 1832 } ··· 2090 2117 (hotkey_all_mask | TPACPI_HKEY_NVRAM_KNOWN_MASK); 2091 2118 2092 2119 if (wantedmask) 2093 - printk(TPACPI_NOTICE 2094 - "required events 0x%08x not enabled!\n", 2095 - wantedmask); 2120 + pr_notice("required events 0x%08x not enabled!\n", wantedmask); 2096 2121 } 2097 2122 2098 2123 /* ··· 2128 2157 * a given event. 2129 2158 */ 2130 2159 if (!hotkey_mask_get() && !rc && (fwmask & ~hotkey_acpi_mask)) { 2131 - printk(TPACPI_NOTICE 2132 - "asked for hotkey mask 0x%08x, but " 2133 - "firmware forced it to 0x%08x\n", 2134 - fwmask, hotkey_acpi_mask); 2160 + pr_notice("asked for hotkey mask 0x%08x, but " 2161 + "firmware forced it to 0x%08x\n", 2162 + fwmask, hotkey_acpi_mask); 2135 2163 } 2136 2164 2137 2165 if (tpacpi_lifecycle != TPACPI_LIFE_EXITING) ··· 2154 2184 (mask == 0xffff || mask == 0xffffff || 2155 2185 mask == 0xffffffff)) { 2156 2186 tp_warned.hotkey_mask_ff = 1; 2157 - printk(TPACPI_NOTICE 2158 - "setting the hotkey mask to 0x%08x is likely " 2159 - "not the best way to go about it\n", mask); 2160 - printk(TPACPI_NOTICE 2161 - "please consider using the driver defaults, " 2162 - "and refer to up-to-date thinkpad-acpi " 2163 - "documentation\n"); 2187 + pr_notice("setting the hotkey mask to 0x%08x is likely " 2188 + "not the best way to go about it\n", mask); 2189 + pr_notice("please consider using the driver defaults, " 2190 + "and refer to up-to-date thinkpad-acpi " 2191 + "documentation\n"); 2164 2192 } 2165 2193 2166 2194 /* Try to enable what the user asked for, plus whatever we need. ··· 2542 2574 NULL, TPACPI_NVRAM_KTHREAD_NAME); 2543 2575 if (IS_ERR(tpacpi_hotkey_task)) { 2544 2576 tpacpi_hotkey_task = NULL; 2545 - printk(TPACPI_ERR 2546 - "could not create kernel thread " 2577 + pr_err("could not create kernel thread " 2547 2578 "for hotkey polling\n"); 2548 2579 } 2549 2580 } ··· 2550 2583 hotkey_poll_stop_sync(); 2551 2584 if (may_warn && (poll_driver_mask || poll_user_mask) && 2552 2585 hotkey_poll_freq == 0) { 2553 - printk(TPACPI_NOTICE 2554 - "hot keys 0x%08x and/or events 0x%08x " 2555 - "require polling, which is currently " 2556 - "disabled\n", 2557 - poll_user_mask, poll_driver_mask); 2586 + pr_notice("hot keys 0x%08x and/or events 0x%08x " 2587 + "require polling, which is currently " 2588 + "disabled\n", 2589 + poll_user_mask, poll_driver_mask); 2558 2590 } 2559 2591 } 2560 2592 } ··· 2777 2811 mutex_unlock(&hotkey_mutex); 2778 2812 2779 2813 if (rc < 0) 2780 - printk(TPACPI_ERR "hotkey_source_mask: failed to update the" 2781 - "firmware event mask!\n"); 2814 + pr_err("hotkey_source_mask: " 2815 + "failed to update the firmware event mask!\n"); 2782 2816 2783 2817 if (r_ev) 2784 - printk(TPACPI_NOTICE "hotkey_source_mask: " 2785 - "some important events were disabled: " 2786 - "0x%04x\n", r_ev); 2818 + pr_notice("hotkey_source_mask: " 2819 + "some important events were disabled: 0x%04x\n", 2820 + r_ev); 2787 2821 2788 2822 tpacpi_disclose_usertask("hotkey_source_mask", "set to 0x%08lx\n", t); 2789 2823 ··· 3014 3048 if (((tp_features.hotkey_mask && 3015 3049 hotkey_mask_set(hotkey_orig_mask)) | 3016 3050 hotkey_status_set(false)) != 0) 3017 - printk(TPACPI_ERR 3018 - "failed to restore hot key mask " 3051 + pr_err("failed to restore hot key mask " 3019 3052 "to BIOS defaults\n"); 3020 3053 } 3021 3054 ··· 3253 3288 for HKEY interface version 0x100 */ 3254 3289 if (acpi_evalf(hkey_handle, &hkeyv, "MHKV", "qd")) { 3255 3290 if ((hkeyv >> 8) != 1) { 3256 - printk(TPACPI_ERR "unknown version of the " 3257 - "HKEY interface: 0x%x\n", hkeyv); 3258 - printk(TPACPI_ERR "please report this to %s\n", 3259 - TPACPI_MAIL); 3291 + pr_err("unknown version of the HKEY interface: 0x%x\n", 3292 + hkeyv); 3293 + pr_err("please report this to %s\n", TPACPI_MAIL); 3260 3294 } else { 3261 3295 /* 3262 3296 * MHKV 0x100 in A31, R40, R40e, ··· 3268 3304 /* Paranoia check AND init hotkey_all_mask */ 3269 3305 if (!acpi_evalf(hkey_handle, &hotkey_all_mask, 3270 3306 "MHKA", "qd")) { 3271 - printk(TPACPI_ERR 3272 - "missing MHKA handler, " 3307 + pr_err("missing MHKA handler, " 3273 3308 "please report this to %s\n", 3274 3309 TPACPI_MAIL); 3275 3310 /* Fallback: pre-init for FN+F3,F4,F12 */ ··· 3306 3343 if (dbg_wlswemul) { 3307 3344 tp_features.hotkey_wlsw = 1; 3308 3345 radiosw_state = !!tpacpi_wlsw_emulstate; 3309 - printk(TPACPI_INFO 3310 - "radio switch emulation enabled\n"); 3346 + pr_info("radio switch emulation enabled\n"); 3311 3347 } else 3312 3348 #endif 3313 3349 /* Not all thinkpads have a hardware radio switch */ 3314 3350 if (acpi_evalf(hkey_handle, &status, "WLSW", "qd")) { 3315 3351 tp_features.hotkey_wlsw = 1; 3316 3352 radiosw_state = !!status; 3317 - printk(TPACPI_INFO 3318 - "radio switch found; radios are %s\n", 3353 + pr_info("radio switch found; radios are %s\n", 3319 3354 enabled(status, 0)); 3320 3355 } 3321 3356 if (tp_features.hotkey_wlsw) ··· 3324 3363 if (!res && acpi_evalf(hkey_handle, &status, "MHKG", "qd")) { 3325 3364 tp_features.hotkey_tablet = 1; 3326 3365 tabletsw_state = !!(status & TP_HOTKEY_TABLET_MASK); 3327 - printk(TPACPI_INFO 3328 - "possible tablet mode switch found; " 3366 + pr_info("possible tablet mode switch found; " 3329 3367 "ThinkPad in %s mode\n", 3330 3368 (tabletsw_state) ? "tablet" : "laptop"); 3331 3369 res = add_to_attr_set(hotkey_dev_attributes, ··· 3342 3382 hotkey_keycode_map = kmalloc(TPACPI_HOTKEY_MAP_SIZE, 3343 3383 GFP_KERNEL); 3344 3384 if (!hotkey_keycode_map) { 3345 - printk(TPACPI_ERR 3346 - "failed to allocate memory for key map\n"); 3385 + pr_err("failed to allocate memory for key map\n"); 3347 3386 res = -ENOMEM; 3348 3387 goto err_exit; 3349 3388 } ··· 3385 3426 * userspace. tpacpi_detect_brightness_capabilities() must have 3386 3427 * been called before this point */ 3387 3428 if (tp_features.bright_acpimode && acpi_video_backlight_support()) { 3388 - printk(TPACPI_INFO 3389 - "This ThinkPad has standard ACPI backlight " 3390 - "brightness control, supported by the ACPI " 3391 - "video driver\n"); 3392 - printk(TPACPI_NOTICE 3393 - "Disabling thinkpad-acpi brightness events " 3394 - "by default...\n"); 3429 + pr_info("This ThinkPad has standard ACPI backlight " 3430 + "brightness control, supported by the ACPI " 3431 + "video driver\n"); 3432 + pr_notice("Disabling thinkpad-acpi brightness events " 3433 + "by default...\n"); 3395 3434 3396 3435 /* Disable brightness up/down on Lenovo thinkpads when 3397 3436 * ACPI is handling them, otherwise it is plain impossible ··· 3496 3539 3497 3540 case TP_HKEY_EV_WKUP_S3_BATLOW: /* Battery on critical low level/S3 */ 3498 3541 case TP_HKEY_EV_WKUP_S4_BATLOW: /* Battery on critical low level/S4 */ 3499 - printk(TPACPI_ALERT 3500 - "EMERGENCY WAKEUP: battery almost empty\n"); 3542 + pr_alert("EMERGENCY WAKEUP: battery almost empty\n"); 3501 3543 /* how to auto-heal: */ 3502 3544 /* 2313: woke up from S3, go to S4/S5 */ 3503 3545 /* 2413: woke up from S4, go to S5 */ ··· 3507 3551 } 3508 3552 3509 3553 if (hotkey_wakeup_reason != TP_ACPI_WAKEUP_NONE) { 3510 - printk(TPACPI_INFO 3511 - "woke up due to a hot-unplug " 3512 - "request...\n"); 3554 + pr_info("woke up due to a hot-unplug request...\n"); 3513 3555 hotkey_wakeup_reason_notify_change(); 3514 3556 } 3515 3557 return true; ··· 3559 3605 3560 3606 switch (hkey) { 3561 3607 case TP_HKEY_EV_THM_TABLE_CHANGED: 3562 - printk(TPACPI_INFO 3563 - "EC reports that Thermal Table has changed\n"); 3608 + pr_info("EC reports that Thermal Table has changed\n"); 3564 3609 /* recommended action: do nothing, we don't have 3565 3610 * Lenovo ATM information */ 3566 3611 return true; 3567 3612 case TP_HKEY_EV_ALARM_BAT_HOT: 3568 - printk(TPACPI_CRIT 3569 - "THERMAL ALARM: battery is too hot!\n"); 3613 + pr_crit("THERMAL ALARM: battery is too hot!\n"); 3570 3614 /* recommended action: warn user through gui */ 3571 3615 break; 3572 3616 case TP_HKEY_EV_ALARM_BAT_XHOT: 3573 - printk(TPACPI_ALERT 3574 - "THERMAL EMERGENCY: battery is extremely hot!\n"); 3617 + pr_alert("THERMAL EMERGENCY: battery is extremely hot!\n"); 3575 3618 /* recommended action: immediate sleep/hibernate */ 3576 3619 break; 3577 3620 case TP_HKEY_EV_ALARM_SENSOR_HOT: 3578 - printk(TPACPI_CRIT 3579 - "THERMAL ALARM: " 3621 + pr_crit("THERMAL ALARM: " 3580 3622 "a sensor reports something is too hot!\n"); 3581 3623 /* recommended action: warn user through gui, that */ 3582 3624 /* some internal component is too hot */ 3583 3625 break; 3584 3626 case TP_HKEY_EV_ALARM_SENSOR_XHOT: 3585 - printk(TPACPI_ALERT 3586 - "THERMAL EMERGENCY: " 3587 - "a sensor reports something is extremely hot!\n"); 3627 + pr_alert("THERMAL EMERGENCY: " 3628 + "a sensor reports something is extremely hot!\n"); 3588 3629 /* recommended action: immediate sleep/hibernate */ 3589 3630 break; 3590 3631 default: 3591 - printk(TPACPI_ALERT 3592 - "THERMAL ALERT: unknown thermal alarm received\n"); 3632 + pr_alert("THERMAL ALERT: unknown thermal alarm received\n"); 3593 3633 known = false; 3594 3634 } 3595 3635 ··· 3600 3652 bool known_ev; 3601 3653 3602 3654 if (event != 0x80) { 3603 - printk(TPACPI_ERR 3604 - "unknown HKEY notification event %d\n", event); 3655 + pr_err("unknown HKEY notification event %d\n", event); 3605 3656 /* forward it to userspace, maybe it knows how to handle it */ 3606 3657 acpi_bus_generate_netlink_event( 3607 3658 ibm->acpi->device->pnp.device_class, ··· 3611 3664 3612 3665 while (1) { 3613 3666 if (!acpi_evalf(hkey_handle, &hkey, "MHKP", "d")) { 3614 - printk(TPACPI_ERR "failed to retrieve HKEY event\n"); 3667 + pr_err("failed to retrieve HKEY event\n"); 3615 3668 return; 3616 3669 } 3617 3670 ··· 3639 3692 switch (hkey) { 3640 3693 case TP_HKEY_EV_BAYEJ_ACK: 3641 3694 hotkey_autosleep_ack = 1; 3642 - printk(TPACPI_INFO 3643 - "bay ejected\n"); 3695 + pr_info("bay ejected\n"); 3644 3696 hotkey_wakeup_hotunplug_complete_notify_change(); 3645 3697 known_ev = true; 3646 3698 break; ··· 3655 3709 /* 0x4000-0x4FFF: dock-related wakeups */ 3656 3710 if (hkey == TP_HKEY_EV_UNDOCK_ACK) { 3657 3711 hotkey_autosleep_ack = 1; 3658 - printk(TPACPI_INFO 3659 - "undocked\n"); 3712 + pr_info("undocked\n"); 3660 3713 hotkey_wakeup_hotunplug_complete_notify_change(); 3661 3714 known_ev = true; 3662 3715 } else { ··· 3686 3741 known_ev = false; 3687 3742 } 3688 3743 if (!known_ev) { 3689 - printk(TPACPI_NOTICE 3690 - "unhandled HKEY event 0x%04x\n", hkey); 3691 - printk(TPACPI_NOTICE 3692 - "please report the conditions when this " 3693 - "event happened to %s\n", TPACPI_MAIL); 3744 + pr_notice("unhandled HKEY event 0x%04x\n", hkey); 3745 + pr_notice("please report the conditions when this " 3746 + "event happened to %s\n", TPACPI_MAIL); 3694 3747 } 3695 3748 3696 3749 /* Legacy events */ ··· 3721 3778 3722 3779 if (hotkey_status_set(true) < 0 || 3723 3780 hotkey_mask_set(hotkey_acpi_mask) < 0) 3724 - printk(TPACPI_ERR 3725 - "error while attempting to reset the event " 3781 + pr_err("error while attempting to reset the event " 3726 3782 "firmware interface\n"); 3727 3783 3728 3784 tpacpi_send_radiosw_update(); ··· 3766 3824 { 3767 3825 tpacpi_log_usertask("procfs hotkey enable/disable"); 3768 3826 if (!WARN((tpacpi_lifecycle == TPACPI_LIFE_RUNNING || !enable), 3769 - TPACPI_WARN 3770 - "hotkey enable/disable functionality has been " 3771 - "removed from the driver. Hotkeys are always " 3772 - "enabled\n")) 3773 - printk(TPACPI_ERR 3774 - "Please remove the hotkey=enable module " 3775 - "parameter, it is deprecated. Hotkeys are always " 3776 - "enabled\n"); 3827 + pr_fmt("hotkey enable/disable functionality has been " 3828 + "removed from the driver. " 3829 + "Hotkeys are always enabled.\n"))) 3830 + pr_err("Please remove the hotkey=enable module " 3831 + "parameter, it is deprecated. " 3832 + "Hotkeys are always enabled.\n"); 3777 3833 } 3778 3834 3779 3835 static int hotkey_write(char *buf) ··· 3951 4011 /* Order firmware to save current state to NVRAM */ 3952 4012 if (!acpi_evalf(NULL, NULL, "\\BLTH", "vd", 3953 4013 TP_ACPI_BLTH_SAVE_STATE)) 3954 - printk(TPACPI_NOTICE 3955 - "failed to save bluetooth state to NVRAM\n"); 4014 + pr_notice("failed to save bluetooth state to NVRAM\n"); 3956 4015 else 3957 4016 vdbg_printk(TPACPI_DBG_RFKILL, 3958 4017 "bluestooth state saved to NVRAM\n"); ··· 3990 4051 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 3991 4052 if (dbg_bluetoothemul) { 3992 4053 tp_features.bluetooth = 1; 3993 - printk(TPACPI_INFO 3994 - "bluetooth switch emulation enabled\n"); 4054 + pr_info("bluetooth switch emulation enabled\n"); 3995 4055 } else 3996 4056 #endif 3997 4057 if (tp_features.bluetooth && ··· 4141 4203 /* Order firmware to save current state to NVRAM */ 4142 4204 if (!acpi_evalf(NULL, NULL, "\\WGSV", "vd", 4143 4205 TP_ACPI_WGSV_SAVE_STATE)) 4144 - printk(TPACPI_NOTICE 4145 - "failed to save WWAN state to NVRAM\n"); 4206 + pr_notice("failed to save WWAN state to NVRAM\n"); 4146 4207 else 4147 4208 vdbg_printk(TPACPI_DBG_RFKILL, 4148 4209 "WWAN state saved to NVRAM\n"); ··· 4178 4241 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 4179 4242 if (dbg_wwanemul) { 4180 4243 tp_features.wan = 1; 4181 - printk(TPACPI_INFO 4182 - "wwan switch emulation enabled\n"); 4244 + pr_info("wwan switch emulation enabled\n"); 4183 4245 } else 4184 4246 #endif 4185 4247 if (tp_features.wan && ··· 4318 4382 #ifdef CONFIG_THINKPAD_ACPI_DEBUGFACILITIES 4319 4383 if (dbg_uwbemul) { 4320 4384 tp_features.uwb = 1; 4321 - printk(TPACPI_INFO 4322 - "uwb switch emulation enabled\n"); 4385 + pr_info("uwb switch emulation enabled\n"); 4323 4386 } else 4324 4387 #endif 4325 4388 if (tp_features.uwb && ··· 4379 4444 static int video_autosw_get(void); 4380 4445 static int video_autosw_set(int enable); 4381 4446 4447 + TPACPI_HANDLE(vid, root, 4448 + "\\_SB.PCI.AGP.VGA", /* 570 */ 4449 + "\\_SB.PCI0.AGP0.VID0", /* 600e/x, 770x */ 4450 + "\\_SB.PCI0.VID0", /* 770e */ 4451 + "\\_SB.PCI0.VID", /* A21e, G4x, R50e, X30, X40 */ 4452 + "\\_SB.PCI0.AGP.VGA", /* X100e and a few others */ 4453 + "\\_SB.PCI0.AGP.VID", /* all others */ 4454 + ); /* R30, R31 */ 4455 + 4382 4456 TPACPI_HANDLE(vid2, root, "\\_SB.PCI0.AGPB.VID"); /* G41 */ 4383 4457 4384 4458 static int __init video_init(struct ibm_init_struct *iibm) ··· 4431 4487 dbg_printk(TPACPI_DBG_EXIT, 4432 4488 "restoring original video autoswitch mode\n"); 4433 4489 if (video_autosw_set(video_orig_autosw)) 4434 - printk(TPACPI_ERR "error while trying to restore original " 4490 + pr_err("error while trying to restore original " 4435 4491 "video autoswitch mode\n"); 4436 4492 } 4437 4493 ··· 4504 4560 res = acpi_evalf(vid_handle, NULL, 4505 4561 "ASWT", "vdd", status * 0x100, 0); 4506 4562 if (!autosw && video_autosw_set(autosw)) { 4507 - printk(TPACPI_ERR 4508 - "video auto-switch left enabled due to error\n"); 4563 + pr_err("video auto-switch left enabled due to error\n"); 4509 4564 return -EIO; 4510 4565 } 4511 4566 break; ··· 4573 4630 return -ENOSYS; 4574 4631 } 4575 4632 if (!autosw && video_autosw_set(autosw)) { 4576 - printk(TPACPI_ERR 4577 - "video auto-switch left enabled due to error\n"); 4633 + pr_err("video auto-switch left enabled due to error\n"); 4578 4634 return -EIO; 4579 4635 } 4580 4636 ··· 5290 5348 tpacpi_leds = kzalloc(sizeof(*tpacpi_leds) * TPACPI_LED_NUMLEDS, 5291 5349 GFP_KERNEL); 5292 5350 if (!tpacpi_leds) { 5293 - printk(TPACPI_ERR "Out of memory for LED data\n"); 5351 + pr_err("Out of memory for LED data\n"); 5294 5352 return -ENOMEM; 5295 5353 } 5296 5354 ··· 5309 5367 } 5310 5368 5311 5369 #ifdef CONFIG_THINKPAD_ACPI_UNSAFE_LEDS 5312 - printk(TPACPI_NOTICE 5313 - "warning: userspace override of important " 5314 - "firmware LEDs is enabled\n"); 5370 + pr_notice("warning: userspace override of important " 5371 + "firmware LEDs is enabled\n"); 5315 5372 #endif 5316 5373 return 0; 5317 5374 } ··· 5580 5639 if (n <= 0) 5581 5640 return; 5582 5641 5583 - printk(TPACPI_NOTICE 5584 - "temperatures (Celsius):"); 5642 + pr_notice("temperatures (Celsius):"); 5585 5643 5586 5644 for (i = 0; i < n; i++) { 5587 5645 if (t.temp[i] != TPACPI_THERMAL_SENSOR_NA) 5588 - printk(KERN_CONT " %d", (int)(t.temp[i] / 1000)); 5646 + pr_cont(" %d", (int)(t.temp[i] / 1000)); 5589 5647 else 5590 - printk(KERN_CONT " N/A"); 5648 + pr_cont(" N/A"); 5591 5649 } 5592 5650 5593 - printk(KERN_CONT "\n"); 5651 + pr_cont("\n"); 5594 5652 } 5595 5653 5596 5654 /* sysfs temp##_input -------------------------------------------------- */ ··· 5709 5769 if (ta1 == 0) { 5710 5770 /* This is sheer paranoia, but we handle it anyway */ 5711 5771 if (acpi_tmp7) { 5712 - printk(TPACPI_ERR 5713 - "ThinkPad ACPI EC access misbehaving, " 5772 + pr_err("ThinkPad ACPI EC access misbehaving, " 5714 5773 "falling back to ACPI TMPx access " 5715 5774 "mode\n"); 5716 5775 thermal_read_mode = TPACPI_THERMAL_ACPI_TMP07; 5717 5776 } else { 5718 - printk(TPACPI_ERR 5719 - "ThinkPad ACPI EC access misbehaving, " 5777 + pr_err("ThinkPad ACPI EC access misbehaving, " 5720 5778 "disabling thermal sensors access\n"); 5721 5779 thermal_read_mode = TPACPI_THERMAL_NONE; 5722 5780 } ··· 6067 6129 if (ACPI_SUCCESS(acpi_evaluate_object(handle, "_BCL", NULL, &buffer))) { 6068 6130 obj = (union acpi_object *)buffer.pointer; 6069 6131 if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) { 6070 - printk(TPACPI_ERR "Unknown _BCL data, " 6071 - "please report this to %s\n", TPACPI_MAIL); 6132 + pr_err("Unknown _BCL data, please report this to %s\n", 6133 + TPACPI_MAIL); 6072 6134 rc = 0; 6073 6135 } else { 6074 6136 rc = obj->package.count; ··· 6152 6214 switch (b) { 6153 6215 case 16: 6154 6216 bright_maxlvl = 15; 6155 - printk(TPACPI_INFO 6156 - "detected a 16-level brightness capable ThinkPad\n"); 6217 + pr_info("detected a 16-level brightness capable ThinkPad\n"); 6157 6218 break; 6158 6219 case 8: 6159 6220 case 0: 6160 6221 bright_maxlvl = 7; 6161 - printk(TPACPI_INFO 6162 - "detected a 8-level brightness capable ThinkPad\n"); 6222 + pr_info("detected a 8-level brightness capable ThinkPad\n"); 6163 6223 break; 6164 6224 default: 6165 - printk(TPACPI_ERR 6166 - "Unsupported brightness interface, " 6225 + pr_err("Unsupported brightness interface, " 6167 6226 "please contact %s\n", TPACPI_MAIL); 6168 6227 tp_features.bright_unkfw = 1; 6169 6228 bright_maxlvl = b - 1; ··· 6195 6260 6196 6261 if (acpi_video_backlight_support()) { 6197 6262 if (brightness_enable > 1) { 6198 - printk(TPACPI_INFO 6199 - "Standard ACPI backlight interface " 6200 - "available, not loading native one.\n"); 6263 + pr_info("Standard ACPI backlight interface " 6264 + "available, not loading native one\n"); 6201 6265 return 1; 6202 6266 } else if (brightness_enable == 1) { 6203 - printk(TPACPI_WARN 6204 - "Cannot enable backlight brightness support, " 6267 + pr_warn("Cannot enable backlight brightness support, " 6205 6268 "ACPI is already handling it. Refer to the " 6206 - "acpi_backlight kernel parameter\n"); 6269 + "acpi_backlight kernel parameter.\n"); 6207 6270 return 1; 6208 6271 } 6209 6272 } else if (tp_features.bright_acpimode && brightness_enable > 1) { 6210 - printk(TPACPI_NOTICE 6211 - "Standard ACPI backlight interface not " 6212 - "available, thinkpad_acpi native " 6213 - "brightness control enabled\n"); 6273 + pr_notice("Standard ACPI backlight interface not " 6274 + "available, thinkpad_acpi native " 6275 + "brightness control enabled\n"); 6214 6276 } 6215 6277 6216 6278 /* ··· 6251 6319 if (IS_ERR(ibm_backlight_device)) { 6252 6320 int rc = PTR_ERR(ibm_backlight_device); 6253 6321 ibm_backlight_device = NULL; 6254 - printk(TPACPI_ERR "Could not register backlight device\n"); 6322 + pr_err("Could not register backlight device\n"); 6255 6323 return rc; 6256 6324 } 6257 6325 vdbg_printk(TPACPI_DBG_INIT | TPACPI_DBG_BRGHT, 6258 6326 "brightness is supported\n"); 6259 6327 6260 6328 if (quirks & TPACPI_BRGHT_Q_ASK) { 6261 - printk(TPACPI_NOTICE 6262 - "brightness: will use unverified default: " 6263 - "brightness_mode=%d\n", brightness_mode); 6264 - printk(TPACPI_NOTICE 6265 - "brightness: please report to %s whether it works well " 6266 - "or not on your ThinkPad\n", TPACPI_MAIL); 6329 + pr_notice("brightness: will use unverified default: " 6330 + "brightness_mode=%d\n", brightness_mode); 6331 + pr_notice("brightness: please report to %s whether it works well " 6332 + "or not on your ThinkPad\n", TPACPI_MAIL); 6267 6333 } 6268 6334 6269 6335 /* Added by mistake in early 2007. Probably useless, but it could ··· 6734 6804 rc = snd_card_create(alsa_index, alsa_id, THIS_MODULE, 6735 6805 sizeof(struct tpacpi_alsa_data), &card); 6736 6806 if (rc < 0 || !card) { 6737 - printk(TPACPI_ERR 6738 - "Failed to create ALSA card structures: %d\n", rc); 6807 + pr_err("Failed to create ALSA card structures: %d\n", rc); 6739 6808 return 1; 6740 6809 } 6741 6810 ··· 6768 6839 ctl_vol = snd_ctl_new1(&volume_alsa_control_vol, NULL); 6769 6840 rc = snd_ctl_add(card, ctl_vol); 6770 6841 if (rc < 0) { 6771 - printk(TPACPI_ERR 6772 - "Failed to create ALSA volume control: %d\n", 6773 - rc); 6842 + pr_err("Failed to create ALSA volume control: %d\n", 6843 + rc); 6774 6844 goto err_exit; 6775 6845 } 6776 6846 data->ctl_vol_id = &ctl_vol->id; ··· 6778 6850 ctl_mute = snd_ctl_new1(&volume_alsa_control_mute, NULL); 6779 6851 rc = snd_ctl_add(card, ctl_mute); 6780 6852 if (rc < 0) { 6781 - printk(TPACPI_ERR "Failed to create ALSA mute control: %d\n", 6782 - rc); 6853 + pr_err("Failed to create ALSA mute control: %d\n", rc); 6783 6854 goto err_exit; 6784 6855 } 6785 6856 data->ctl_mute_id = &ctl_mute->id; ··· 6786 6859 snd_card_set_dev(card, &tpacpi_pdev->dev); 6787 6860 rc = snd_card_register(card); 6788 6861 if (rc < 0) { 6789 - printk(TPACPI_ERR "Failed to register ALSA card: %d\n", rc); 6862 + pr_err("Failed to register ALSA card: %d\n", rc); 6790 6863 goto err_exit; 6791 6864 } 6792 6865 ··· 6842 6915 return -EINVAL; 6843 6916 6844 6917 if (volume_mode == TPACPI_VOL_MODE_UCMS_STEP) { 6845 - printk(TPACPI_ERR 6846 - "UCMS step volume mode not implemented, " 6847 - "please contact %s\n", TPACPI_MAIL); 6918 + pr_err("UCMS step volume mode not implemented, " 6919 + "please contact %s\n", TPACPI_MAIL); 6848 6920 return 1; 6849 6921 } 6850 6922 ··· 6907 6981 6908 6982 rc = volume_create_alsa_mixer(); 6909 6983 if (rc) { 6910 - printk(TPACPI_ERR 6911 - "Could not create the ALSA mixer interface\n"); 6984 + pr_err("Could not create the ALSA mixer interface\n"); 6912 6985 return rc; 6913 6986 } 6914 6987 6915 - printk(TPACPI_INFO 6916 - "Console audio control enabled, mode: %s\n", 6988 + pr_info("Console audio control enabled, mode: %s\n", 6917 6989 (volume_control_allowed) ? 6918 6990 "override (read/write)" : 6919 6991 "monitor (read only)"); ··· 6973 7049 if (!volume_control_allowed && tpacpi_lifecycle != TPACPI_LIFE_INIT) { 6974 7050 if (unlikely(!tp_warned.volume_ctrl_forbidden)) { 6975 7051 tp_warned.volume_ctrl_forbidden = 1; 6976 - printk(TPACPI_NOTICE 6977 - "Console audio control in monitor mode, " 6978 - "changes are not allowed.\n"); 6979 - printk(TPACPI_NOTICE 6980 - "Use the volume_control=1 module parameter " 6981 - "to enable volume control\n"); 7052 + pr_notice("Console audio control in monitor mode, " 7053 + "changes are not allowed\n"); 7054 + pr_notice("Use the volume_control=1 module parameter " 7055 + "to enable volume control\n"); 6982 7056 } 6983 7057 return -EPERM; 6984 7058 } ··· 7051 7129 7052 7130 static int __init volume_init(struct ibm_init_struct *iibm) 7053 7131 { 7054 - printk(TPACPI_INFO 7055 - "volume: disabled as there is no ALSA support in this kernel\n"); 7132 + pr_info("volume: disabled as there is no ALSA support in this kernel\n"); 7056 7133 7057 7134 return 1; 7058 7135 } ··· 7258 7337 static void fan_quirk1_setup(void) 7259 7338 { 7260 7339 if (fan_control_initial_status == 0x07) { 7261 - printk(TPACPI_NOTICE 7262 - "fan_init: initial fan status is unknown, " 7263 - "assuming it is in auto mode\n"); 7340 + pr_notice("fan_init: initial fan status is unknown, " 7341 + "assuming it is in auto mode\n"); 7264 7342 tp_features.fan_ctrl_status_undef = 1; 7265 7343 } 7266 7344 } ··· 7646 7726 if (!queue_delayed_work(tpacpi_wq, &fan_watchdog_task, 7647 7727 msecs_to_jiffies(fan_watchdog_maxinterval 7648 7728 * 1000))) { 7649 - printk(TPACPI_ERR 7650 - "failed to queue the fan watchdog, " 7729 + pr_err("failed to queue the fan watchdog, " 7651 7730 "watchdog will not trigger\n"); 7652 7731 } 7653 7732 } else ··· 7660 7741 if (tpacpi_lifecycle != TPACPI_LIFE_RUNNING) 7661 7742 return; 7662 7743 7663 - printk(TPACPI_NOTICE "fan watchdog: enabling fan\n"); 7744 + pr_notice("fan watchdog: enabling fan\n"); 7664 7745 rc = fan_set_enable(); 7665 7746 if (rc < 0) { 7666 - printk(TPACPI_ERR "fan watchdog: error %d while enabling fan, " 7667 - "will try again later...\n", -rc); 7747 + pr_err("fan watchdog: error %d while enabling fan, " 7748 + "will try again later...\n", -rc); 7668 7749 /* reschedule for later */ 7669 7750 fan_watchdog_reset(); 7670 7751 } ··· 7968 8049 "secondary fan support enabled\n"); 7969 8050 } 7970 8051 } else { 7971 - printk(TPACPI_ERR 7972 - "ThinkPad ACPI EC access misbehaving, " 8052 + pr_err("ThinkPad ACPI EC access misbehaving, " 7973 8053 "fan status and control unavailable\n"); 7974 8054 return 1; 7975 8055 } ··· 8068 8150 fan_control_resume_level = 0; 8069 8151 rc = fan_get_status_safe(&fan_control_resume_level); 8070 8152 if (rc < 0) 8071 - printk(TPACPI_NOTICE 8072 - "failed to read fan level for later " 8073 - "restore during resume: %d\n", rc); 8153 + pr_notice("failed to read fan level for later " 8154 + "restore during resume: %d\n", rc); 8074 8155 8075 8156 /* if it is undefined, don't attempt to restore it. 8076 8157 * KEEP THIS LAST */ ··· 8124 8207 return; 8125 8208 } 8126 8209 if (do_set) { 8127 - printk(TPACPI_NOTICE 8128 - "restoring fan level to 0x%02x\n", 8129 - fan_control_resume_level); 8210 + pr_notice("restoring fan level to 0x%02x\n", 8211 + fan_control_resume_level); 8130 8212 rc = fan_set_level_safe(fan_control_resume_level); 8131 8213 if (rc < 0) 8132 - printk(TPACPI_NOTICE 8133 - "failed to restore fan level: %d\n", rc); 8214 + pr_notice("failed to restore fan level: %d\n", rc); 8134 8215 } 8135 8216 } 8136 8217 ··· 8220 8305 8221 8306 *rc = fan_set_level_safe(level); 8222 8307 if (*rc == -ENXIO) 8223 - printk(TPACPI_ERR "level command accepted for unsupported " 8224 - "access mode %d", fan_control_access_mode); 8308 + pr_err("level command accepted for unsupported access mode %d\n", 8309 + fan_control_access_mode); 8225 8310 else if (!*rc) 8226 8311 tpacpi_disclose_usertask("procfs fan", 8227 8312 "set level to %d\n", level); ··· 8236 8321 8237 8322 *rc = fan_set_enable(); 8238 8323 if (*rc == -ENXIO) 8239 - printk(TPACPI_ERR "enable command accepted for unsupported " 8240 - "access mode %d", fan_control_access_mode); 8324 + pr_err("enable command accepted for unsupported access mode %d\n", 8325 + fan_control_access_mode); 8241 8326 else if (!*rc) 8242 8327 tpacpi_disclose_usertask("procfs fan", "enable\n"); 8243 8328 ··· 8251 8336 8252 8337 *rc = fan_set_disable(); 8253 8338 if (*rc == -ENXIO) 8254 - printk(TPACPI_ERR "disable command accepted for unsupported " 8255 - "access mode %d", fan_control_access_mode); 8339 + pr_err("disable command accepted for unsupported access mode %d\n", 8340 + fan_control_access_mode); 8256 8341 else if (!*rc) 8257 8342 tpacpi_disclose_usertask("procfs fan", "disable\n"); 8258 8343 ··· 8271 8356 8272 8357 *rc = fan_set_speed(speed); 8273 8358 if (*rc == -ENXIO) 8274 - printk(TPACPI_ERR "speed command accepted for unsupported " 8275 - "access mode %d", fan_control_access_mode); 8359 + pr_err("speed command accepted for unsupported access mode %d\n", 8360 + fan_control_access_mode); 8276 8361 else if (!*rc) 8277 8362 tpacpi_disclose_usertask("procfs fan", 8278 8363 "set speed to %d\n", speed); ··· 8475 8560 if (ibm->acpi->notify) { 8476 8561 ret = setup_acpi_notify(ibm); 8477 8562 if (ret == -ENODEV) { 8478 - printk(TPACPI_NOTICE "disabling subdriver %s\n", 8479 - ibm->name); 8563 + pr_notice("disabling subdriver %s\n", 8564 + ibm->name); 8480 8565 ret = 0; 8481 8566 goto err_out; 8482 8567 } ··· 8498 8583 entry = proc_create_data(ibm->name, mode, proc_dir, 8499 8584 &dispatch_proc_fops, ibm); 8500 8585 if (!entry) { 8501 - printk(TPACPI_ERR "unable to create proc entry %s\n", 8502 - ibm->name); 8586 + pr_err("unable to create proc entry %s\n", ibm->name); 8503 8587 ret = -ENODEV; 8504 8588 goto err_out; 8505 8589 } ··· 8597 8683 tp->ec_release = (ec_fw_string[4] << 8) 8598 8684 | ec_fw_string[5]; 8599 8685 } else { 8600 - printk(TPACPI_NOTICE 8601 - "ThinkPad firmware release %s " 8602 - "doesn't match the known patterns\n", 8603 - ec_fw_string); 8604 - printk(TPACPI_NOTICE 8605 - "please report this to %s\n", 8606 - TPACPI_MAIL); 8686 + pr_notice("ThinkPad firmware release %s " 8687 + "doesn't match the known patterns\n", 8688 + ec_fw_string); 8689 + pr_notice("please report this to %s\n", 8690 + TPACPI_MAIL); 8607 8691 } 8608 8692 break; 8609 8693 } ··· 8645 8733 tpacpi_acpi_handle_locate("ec", TPACPI_ACPI_EC_HID, &ec_handle); 8646 8734 if (!ec_handle) { 8647 8735 if (is_thinkpad) 8648 - printk(TPACPI_ERR 8649 - "Not yet supported ThinkPad detected!\n"); 8736 + pr_err("Not yet supported ThinkPad detected!\n"); 8650 8737 return -ENODEV; 8651 8738 } 8652 8739 ··· 8657 8746 8658 8747 static void __init thinkpad_acpi_init_banner(void) 8659 8748 { 8660 - printk(TPACPI_INFO "%s v%s\n", TPACPI_DESC, TPACPI_VERSION); 8661 - printk(TPACPI_INFO "%s\n", TPACPI_URL); 8749 + pr_info("%s v%s\n", TPACPI_DESC, TPACPI_VERSION); 8750 + pr_info("%s\n", TPACPI_URL); 8662 8751 8663 - printk(TPACPI_INFO "ThinkPad BIOS %s, EC %s\n", 8752 + pr_info("ThinkPad BIOS %s, EC %s\n", 8664 8753 (thinkpad_id.bios_version_str) ? 8665 8754 thinkpad_id.bios_version_str : "unknown", 8666 8755 (thinkpad_id.ec_version_str) ? ··· 8669 8758 BUG_ON(!thinkpad_id.vendor); 8670 8759 8671 8760 if (thinkpad_id.model_str) 8672 - printk(TPACPI_INFO "%s %s, model %s\n", 8761 + pr_info("%s %s, model %s\n", 8673 8762 (thinkpad_id.vendor == PCI_VENDOR_ID_IBM) ? 8674 8763 "IBM" : ((thinkpad_id.vendor == 8675 8764 PCI_VENDOR_ID_LENOVO) ? ··· 8935 9024 8936 9025 ret = get_thinkpad_model_data(&thinkpad_id); 8937 9026 if (ret) { 8938 - printk(TPACPI_ERR 8939 - "unable to get DMI data: %d\n", ret); 9027 + pr_err("unable to get DMI data: %d\n", ret); 8940 9028 thinkpad_acpi_module_exit(); 8941 9029 return ret; 8942 9030 } ··· 8961 9051 8962 9052 proc_dir = proc_mkdir(TPACPI_PROC_DIR, acpi_root_dir); 8963 9053 if (!proc_dir) { 8964 - printk(TPACPI_ERR 8965 - "unable to create proc dir " TPACPI_PROC_DIR); 9054 + pr_err("unable to create proc dir " TPACPI_PROC_DIR "\n"); 8966 9055 thinkpad_acpi_module_exit(); 8967 9056 return -ENODEV; 8968 9057 } 8969 9058 8970 9059 ret = platform_driver_register(&tpacpi_pdriver); 8971 9060 if (ret) { 8972 - printk(TPACPI_ERR 8973 - "unable to register main platform driver\n"); 9061 + pr_err("unable to register main platform driver\n"); 8974 9062 thinkpad_acpi_module_exit(); 8975 9063 return ret; 8976 9064 } ··· 8976 9068 8977 9069 ret = platform_driver_register(&tpacpi_hwmon_pdriver); 8978 9070 if (ret) { 8979 - printk(TPACPI_ERR 8980 - "unable to register hwmon platform driver\n"); 9071 + pr_err("unable to register hwmon platform driver\n"); 8981 9072 thinkpad_acpi_module_exit(); 8982 9073 return ret; 8983 9074 } ··· 8989 9082 &tpacpi_hwmon_pdriver.driver); 8990 9083 } 8991 9084 if (ret) { 8992 - printk(TPACPI_ERR 8993 - "unable to create sysfs driver attributes\n"); 9085 + pr_err("unable to create sysfs driver attributes\n"); 8994 9086 thinkpad_acpi_module_exit(); 8995 9087 return ret; 8996 9088 } ··· 9002 9096 if (IS_ERR(tpacpi_pdev)) { 9003 9097 ret = PTR_ERR(tpacpi_pdev); 9004 9098 tpacpi_pdev = NULL; 9005 - printk(TPACPI_ERR "unable to register platform device\n"); 9099 + pr_err("unable to register platform device\n"); 9006 9100 thinkpad_acpi_module_exit(); 9007 9101 return ret; 9008 9102 } ··· 9012 9106 if (IS_ERR(tpacpi_sensors_pdev)) { 9013 9107 ret = PTR_ERR(tpacpi_sensors_pdev); 9014 9108 tpacpi_sensors_pdev = NULL; 9015 - printk(TPACPI_ERR 9016 - "unable to register hwmon platform device\n"); 9109 + pr_err("unable to register hwmon platform device\n"); 9017 9110 thinkpad_acpi_module_exit(); 9018 9111 return ret; 9019 9112 } 9020 9113 ret = device_create_file(&tpacpi_sensors_pdev->dev, 9021 9114 &dev_attr_thinkpad_acpi_pdev_name); 9022 9115 if (ret) { 9023 - printk(TPACPI_ERR 9024 - "unable to create sysfs hwmon device attributes\n"); 9116 + pr_err("unable to create sysfs hwmon device attributes\n"); 9025 9117 thinkpad_acpi_module_exit(); 9026 9118 return ret; 9027 9119 } ··· 9028 9124 if (IS_ERR(tpacpi_hwmon)) { 9029 9125 ret = PTR_ERR(tpacpi_hwmon); 9030 9126 tpacpi_hwmon = NULL; 9031 - printk(TPACPI_ERR "unable to register hwmon device\n"); 9127 + pr_err("unable to register hwmon device\n"); 9032 9128 thinkpad_acpi_module_exit(); 9033 9129 return ret; 9034 9130 } 9035 9131 mutex_init(&tpacpi_inputdev_send_mutex); 9036 9132 tpacpi_inputdev = input_allocate_device(); 9037 9133 if (!tpacpi_inputdev) { 9038 - printk(TPACPI_ERR "unable to allocate input device\n"); 9134 + pr_err("unable to allocate input device\n"); 9039 9135 thinkpad_acpi_module_exit(); 9040 9136 return -ENOMEM; 9041 9137 } else { ··· 9067 9163 9068 9164 ret = input_register_device(tpacpi_inputdev); 9069 9165 if (ret < 0) { 9070 - printk(TPACPI_ERR "unable to register input device\n"); 9166 + pr_err("unable to register input device\n"); 9071 9167 thinkpad_acpi_module_exit(); 9072 9168 return ret; 9073 9169 } else {
+1 -1
drivers/platform/x86/topstar-laptop.c
··· 194 194 if (ret < 0) 195 195 return ret; 196 196 197 - printk(KERN_INFO "Topstar Laptop ACPI extras driver loaded\n"); 197 + pr_info("ACPI extras driver loaded\n"); 198 198 199 199 return 0; 200 200 }
+28 -31
drivers/platform/x86/toshiba_acpi.c
··· 35 35 * 36 36 */ 37 37 38 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 39 + 38 40 #define TOSHIBA_ACPI_VERSION "0.19" 39 41 #define PROC_INTERFACE_VERSION 1 40 42 ··· 61 59 MODULE_AUTHOR("John Belmonte"); 62 60 MODULE_DESCRIPTION("Toshiba Laptop ACPI Extras Driver"); 63 61 MODULE_LICENSE("GPL"); 64 - 65 - #define MY_LOGPREFIX "toshiba_acpi: " 66 - #define MY_ERR KERN_ERR MY_LOGPREFIX 67 - #define MY_NOTICE KERN_NOTICE MY_LOGPREFIX 68 - #define MY_INFO KERN_INFO MY_LOGPREFIX 69 62 70 63 /* Toshiba ACPI method paths */ 71 64 #define METHOD_LCD_BRIGHTNESS "\\_SB_.PCI0.VGA_.LCD_._BCM" ··· 298 301 in[0] = 0xf100; 299 302 status = hci_raw(in, out); 300 303 if (ACPI_FAILURE(status)) { 301 - printk(MY_INFO "Illumination device not available\n"); 304 + pr_info("Illumination device not available\n"); 302 305 return 0; 303 306 } 304 307 in[0] = 0xf400; ··· 317 320 in[0] = 0xf100; 318 321 status = hci_raw(in, out); 319 322 if (ACPI_FAILURE(status)) { 320 - printk(MY_INFO "Illumination device not available\n"); 323 + pr_info("Illumination device not available\n"); 321 324 return; 322 325 } 323 326 ··· 328 331 in[2] = 1; 329 332 status = hci_raw(in, out); 330 333 if (ACPI_FAILURE(status)) { 331 - printk(MY_INFO "ACPI call for illumination failed.\n"); 334 + pr_info("ACPI call for illumination failed\n"); 332 335 return; 333 336 } 334 337 } else { ··· 338 341 in[2] = 0; 339 342 status = hci_raw(in, out); 340 343 if (ACPI_FAILURE(status)) { 341 - printk(MY_INFO "ACPI call for illumination failed.\n"); 344 + pr_info("ACPI call for illumination failed.\n"); 342 345 return; 343 346 } 344 347 } ··· 361 364 in[0] = 0xf100; 362 365 status = hci_raw(in, out); 363 366 if (ACPI_FAILURE(status)) { 364 - printk(MY_INFO "Illumination device not available\n"); 367 + pr_info("Illumination device not available\n"); 365 368 return LED_OFF; 366 369 } 367 370 ··· 370 373 in[1] = 0x14e; 371 374 status = hci_raw(in, out); 372 375 if (ACPI_FAILURE(status)) { 373 - printk(MY_INFO "ACPI call for illumination failed.\n"); 376 + pr_info("ACPI call for illumination failed.\n"); 374 377 return LED_OFF; 375 378 } 376 379 ··· 514 517 seq_printf(m, "brightness_levels: %d\n", 515 518 HCI_LCD_BRIGHTNESS_LEVELS); 516 519 } else { 517 - printk(MY_ERR "Error reading LCD brightness\n"); 520 + pr_err("Error reading LCD brightness\n"); 518 521 } 519 522 520 523 return 0; ··· 589 592 seq_printf(m, "crt_out: %d\n", is_crt); 590 593 seq_printf(m, "tv_out: %d\n", is_tv); 591 594 } else { 592 - printk(MY_ERR "Error reading video out status\n"); 595 + pr_err("Error reading video out status\n"); 593 596 } 594 597 595 598 return 0; ··· 683 686 seq_printf(m, "running: %d\n", (value > 0)); 684 687 seq_printf(m, "force_on: %d\n", force_fan); 685 688 } else { 686 - printk(MY_ERR "Error reading fan status\n"); 689 + pr_err("Error reading fan status\n"); 687 690 } 688 691 689 692 return 0; ··· 747 750 * some machines where system events sporadically 748 751 * become disabled. */ 749 752 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); 750 - printk(MY_NOTICE "Re-enabled hotkeys\n"); 753 + pr_notice("Re-enabled hotkeys\n"); 751 754 } else { 752 - printk(MY_ERR "Error reading hotkey status\n"); 755 + pr_err("Error reading hotkey status\n"); 753 756 goto end; 754 757 } 755 758 } ··· 860 863 861 864 if (!sparse_keymap_report_event(toshiba_acpi.hotkey_dev, 862 865 value, 1, true)) { 863 - printk(MY_INFO "Unknown key %x\n", 866 + pr_info("Unknown key %x\n", 864 867 value); 865 868 } 866 869 } else if (hci_result == HCI_NOT_SUPPORTED) { ··· 868 871 * some machines where system events sporadically 869 872 * become disabled. */ 870 873 hci_write1(HCI_SYSTEM_EVENT, 1, &hci_result); 871 - printk(MY_NOTICE "Re-enabled hotkeys\n"); 874 + pr_notice("Re-enabled hotkeys\n"); 872 875 } 873 876 } while (hci_result != HCI_EMPTY); 874 877 } ··· 880 883 881 884 status = acpi_get_handle(NULL, device, &toshiba_acpi.handle); 882 885 if (ACPI_FAILURE(status)) { 883 - printk(MY_INFO "Unable to get notification device\n"); 886 + pr_info("Unable to get notification device\n"); 884 887 return -ENODEV; 885 888 } 886 889 887 890 toshiba_acpi.hotkey_dev = input_allocate_device(); 888 891 if (!toshiba_acpi.hotkey_dev) { 889 - printk(MY_INFO "Unable to register input device\n"); 892 + pr_info("Unable to register input device\n"); 890 893 return -ENOMEM; 891 894 } 892 895 ··· 902 905 status = acpi_install_notify_handler(toshiba_acpi.handle, 903 906 ACPI_DEVICE_NOTIFY, toshiba_acpi_notify, NULL); 904 907 if (ACPI_FAILURE(status)) { 905 - printk(MY_INFO "Unable to install hotkey notification\n"); 908 + pr_info("Unable to install hotkey notification\n"); 906 909 error = -ENODEV; 907 910 goto err_free_keymap; 908 911 } 909 912 910 913 status = acpi_evaluate_object(toshiba_acpi.handle, "ENAB", NULL, NULL); 911 914 if (ACPI_FAILURE(status)) { 912 - printk(MY_INFO "Unable to enable hotkeys\n"); 915 + pr_info("Unable to enable hotkeys\n"); 913 916 error = -ENODEV; 914 917 goto err_remove_notify; 915 918 } 916 919 917 920 error = input_register_device(toshiba_acpi.hotkey_dev); 918 921 if (error) { 919 - printk(MY_INFO "Unable to register input device\n"); 922 + pr_info("Unable to register input device\n"); 920 923 goto err_remove_notify; 921 924 } 922 925 ··· 977 980 if (is_valid_acpi_path(TOSH_INTERFACE_1 GHCI_METHOD)) { 978 981 method_hci = TOSH_INTERFACE_1 GHCI_METHOD; 979 982 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_1)) 980 - printk(MY_INFO "Unable to activate hotkeys\n"); 983 + pr_info("Unable to activate hotkeys\n"); 981 984 } else if (is_valid_acpi_path(TOSH_INTERFACE_2 GHCI_METHOD)) { 982 985 method_hci = TOSH_INTERFACE_2 GHCI_METHOD; 983 986 if (toshiba_acpi_setup_keyboard(TOSH_INTERFACE_2)) 984 - printk(MY_INFO "Unable to activate hotkeys\n"); 987 + pr_info("Unable to activate hotkeys\n"); 985 988 } else 986 989 return -ENODEV; 987 990 988 - printk(MY_INFO "Toshiba Laptop ACPI Extras version %s\n", 991 + pr_info("Toshiba Laptop ACPI Extras version %s\n", 989 992 TOSHIBA_ACPI_VERSION); 990 - printk(MY_INFO " HCI method: %s\n", method_hci); 993 + pr_info(" HCI method: %s\n", method_hci); 991 994 992 995 mutex_init(&toshiba_acpi.mutex); 993 996 ··· 995 998 -1, NULL, 0); 996 999 if (IS_ERR(toshiba_acpi.p_dev)) { 997 1000 ret = PTR_ERR(toshiba_acpi.p_dev); 998 - printk(MY_ERR "unable to register platform device\n"); 1001 + pr_err("unable to register platform device\n"); 999 1002 toshiba_acpi.p_dev = NULL; 1000 1003 toshiba_acpi_exit(); 1001 1004 return ret; ··· 1025 1028 if (IS_ERR(toshiba_backlight_device)) { 1026 1029 ret = PTR_ERR(toshiba_backlight_device); 1027 1030 1028 - printk(KERN_ERR "Could not register toshiba backlight device\n"); 1031 + pr_err("Could not register toshiba backlight device\n"); 1029 1032 toshiba_backlight_device = NULL; 1030 1033 toshiba_acpi_exit(); 1031 1034 return ret; ··· 1039 1042 &toshiba_rfk_ops, 1040 1043 &toshiba_acpi); 1041 1044 if (!toshiba_acpi.bt_rfk) { 1042 - printk(MY_ERR "unable to allocate rfkill device\n"); 1045 + pr_err("unable to allocate rfkill device\n"); 1043 1046 toshiba_acpi_exit(); 1044 1047 return -ENOMEM; 1045 1048 } 1046 1049 1047 1050 ret = rfkill_register(toshiba_acpi.bt_rfk); 1048 1051 if (ret) { 1049 - printk(MY_ERR "unable to register rfkill device\n"); 1052 + pr_err("unable to register rfkill device\n"); 1050 1053 rfkill_destroy(toshiba_acpi.bt_rfk); 1051 1054 toshiba_acpi_exit(); 1052 1055 return ret;
+6 -5
drivers/platform/x86/toshiba_bluetooth.c
··· 17 17 * delivered. 18 18 */ 19 19 20 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 21 + 20 22 #include <linux/kernel.h> 21 23 #include <linux/module.h> 22 24 #include <linux/init.h> ··· 72 70 if (!(result & 0x01)) 73 71 return 0; 74 72 75 - printk(KERN_INFO "toshiba_bluetooth: Re-enabling Toshiba Bluetooth\n"); 73 + pr_info("Re-enabling Toshiba Bluetooth\n"); 76 74 res1 = acpi_evaluate_object(handle, "AUSB", NULL, NULL); 77 75 res2 = acpi_evaluate_object(handle, "BTPO", NULL, NULL); 78 76 if (!ACPI_FAILURE(res1) || !ACPI_FAILURE(res2)) 79 77 return 0; 80 78 81 - printk(KERN_WARNING "toshiba_bluetooth: Failed to re-enable " 82 - "Toshiba Bluetooth\n"); 79 + pr_warn("Failed to re-enable Toshiba Bluetooth\n"); 83 80 84 81 return -ENODEV; 85 82 } ··· 108 107 &bt_present); 109 108 110 109 if (!ACPI_FAILURE(status) && bt_present) { 111 - printk(KERN_INFO "Detected Toshiba ACPI Bluetooth device - " 112 - "installing RFKill handler\n"); 110 + pr_info("Detected Toshiba ACPI Bluetooth device - " 111 + "installing RFKill handler\n"); 113 112 result = toshiba_bluetooth_enable(device->handle); 114 113 } 115 114
+5 -5
drivers/platform/x86/wmi.c
··· 486 486 pr_info("\tnotify_id: %02X\n", g->notify_id); 487 487 pr_info("\treserved: %02X\n", g->reserved); 488 488 pr_info("\tinstance_count: %d\n", g->instance_count); 489 - pr_info("\tflags: %#x ", g->flags); 489 + pr_info("\tflags: %#x", g->flags); 490 490 if (g->flags) { 491 491 if (g->flags & ACPI_WMI_EXPENSIVE) 492 - pr_cont("ACPI_WMI_EXPENSIVE "); 492 + pr_cont(" ACPI_WMI_EXPENSIVE"); 493 493 if (g->flags & ACPI_WMI_METHOD) 494 - pr_cont("ACPI_WMI_METHOD "); 494 + pr_cont(" ACPI_WMI_METHOD"); 495 495 if (g->flags & ACPI_WMI_STRING) 496 - pr_cont("ACPI_WMI_STRING "); 496 + pr_cont(" ACPI_WMI_STRING"); 497 497 if (g->flags & ACPI_WMI_EVENT) 498 - pr_cont("ACPI_WMI_EVENT "); 498 + pr_cont(" ACPI_WMI_EVENT"); 499 499 } 500 500 pr_cont("\n"); 501 501
+3 -2
drivers/platform/x86/xo15-ebook.c
··· 11 11 * your option) any later version. 12 12 */ 13 13 14 + #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 15 + 14 16 #include <linux/kernel.h> 15 17 #include <linux/module.h> 16 18 #include <linux/init.h> ··· 22 20 #include <acpi/acpi_drivers.h> 23 21 24 22 #define MODULE_NAME "xo15-ebook" 25 - #define PREFIX MODULE_NAME ": " 26 23 27 24 #define XO15_EBOOK_CLASS MODULE_NAME 28 25 #define XO15_EBOOK_TYPE_UNKNOWN 0x00 ··· 106 105 class = acpi_device_class(device); 107 106 108 107 if (strcmp(hid, XO15_EBOOK_HID)) { 109 - printk(KERN_ERR PREFIX "Unsupported hid [%s]\n", hid); 108 + pr_err("Unsupported hid [%s]\n", hid); 110 109 error = -ENODEV; 111 110 goto err_free_input; 112 111 }