aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform
diff options
context:
space:
mode:
authorMattia Dongili <malattia@linux.it>2012-06-09 00:18:08 -0400
committerMatthew Garrett <mjg@redhat.com>2012-06-26 14:42:59 -0400
commit4069d6f86bebce1a1e3456ef721511b4b81958f8 (patch)
treeef6a2b3b8e9486c049f436d60062795ca49c49dd /drivers/platform
parentaace99e57c90353a51952e9dd1f6f110eec30d15 (diff)
sony-laptop: use an enum for SNC event types
Signed-off-by: Mattia Dongili <malattia@linux.it> Signed-off-by: Matthew Garrett <mjg@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/sony-laptop.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index 210d4ae547c2..615ab06b6cd3 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1172,6 +1172,10 @@ static int sony_nc_hotkeys_decode(u32 event, unsigned int handle)
1172/* 1172/*
1173 * ACPI callbacks 1173 * ACPI callbacks
1174 */ 1174 */
1175enum event_types {
1176 HOTKEY = 1,
1177 KILLSWITCH
1178};
1175static void sony_nc_notify(struct acpi_device *device, u32 event) 1179static void sony_nc_notify(struct acpi_device *device, u32 event)
1176{ 1180{
1177 u32 real_ev = event; 1181 u32 real_ev = event;
@@ -1196,7 +1200,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1196 /* hotkey event */ 1200 /* hotkey event */
1197 case 0x0100: 1201 case 0x0100:
1198 case 0x0127: 1202 case 0x0127:
1199 ev_type = 1; 1203 ev_type = HOTKEY;
1200 real_ev = sony_nc_hotkeys_decode(event, handle); 1204 real_ev = sony_nc_hotkeys_decode(event, handle);
1201 1205
1202 if (real_ev > 0) 1206 if (real_ev > 0)
@@ -1216,7 +1220,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1216 * update the rfkill device status when the 1220 * update the rfkill device status when the
1217 * switch is moved. 1221 * switch is moved.
1218 */ 1222 */
1219 ev_type = 2; 1223 ev_type = KILLSWITCH;
1220 sony_call_snc_handle(handle, 0x0100, &result); 1224 sony_call_snc_handle(handle, 0x0100, &result);
1221 real_ev = result & 0x03; 1225 real_ev = result & 0x03;
1222 1226
@@ -1238,7 +1242,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
1238 1242
1239 } else { 1243 } else {
1240 /* old style event */ 1244 /* old style event */
1241 ev_type = 1; 1245 ev_type = HOTKEY;
1242 sony_laptop_report_input_event(real_ev); 1246 sony_laptop_report_input_event(real_ev);
1243 } 1247 }
1244 1248