Skip to content

Commit

Permalink
sony-laptop: use an enum for SNC event types
Browse files Browse the repository at this point in the history
Signed-off-by: Mattia Dongili <malattia@linux.it>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
  • Loading branch information
Mattia Dongili authored and Matthew Garrett committed Jun 26, 2012
1 parent aace99e commit 4069d6f
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/platform/x86/sony-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1172,6 +1172,10 @@ static int sony_nc_hotkeys_decode(u32 event, unsigned int handle)
/*
* ACPI callbacks
*/
enum event_types {
HOTKEY = 1,
KILLSWITCH
};
static void sony_nc_notify(struct acpi_device *device, u32 event)
{
u32 real_ev = event;
Expand All @@ -1196,7 +1200,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
/* hotkey event */
case 0x0100:
case 0x0127:
ev_type = 1;
ev_type = HOTKEY;
real_ev = sony_nc_hotkeys_decode(event, handle);

if (real_ev > 0)
Expand All @@ -1216,7 +1220,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
* update the rfkill device status when the
* switch is moved.
*/
ev_type = 2;
ev_type = KILLSWITCH;
sony_call_snc_handle(handle, 0x0100, &result);
real_ev = result & 0x03;

Expand All @@ -1238,7 +1242,7 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)

} else {
/* old style event */
ev_type = 1;
ev_type = HOTKEY;
sony_laptop_report_input_event(real_ev);
}

Expand Down

0 comments on commit 4069d6f

Please sign in to comment.