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