diff options
author | Alan Jenkins <alan-jenkins@tuffmail.co.uk> | 2017-02-08 08:46:27 -0500 |
---|---|---|
committer | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2017-02-26 10:01:07 -0500 |
commit | 8ef27bd3410c4e5856bac2315ef51224926020e0 (patch) | |
tree | 5689cadd0823adf4257e744261959ad13fbf70df | |
parent | 1650602691f4e8ea8f6e306452a72ac9a611932a (diff) |
platform/x86: fujitsu-laptop: rename FUNC_RFKILL to FUNC_FLAGS
FUNC subfunction 0x1000 is currently referred to as FUNC_RFKILL, which
is misleading, because it handles more than just radio devices (also
lid, dock, LEDs). Rename the FUNC_RFKILL constant to FUNC_FLAGS.
Replace "rfkill" with "flags" in the names of its associated fields
inside struct fujitsu_laptop.
Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
[kempniu: rebase patch, rewrite commit message]
Signed-off-by: Michał Kępień <kernel@kempniu.pl>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>
-rw-r--r-- | drivers/platform/x86/fujitsu-laptop.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c index 6cdd1b334e8a..55d696262301 100644 --- a/drivers/platform/x86/fujitsu-laptop.c +++ b/drivers/platform/x86/fujitsu-laptop.c | |||
@@ -89,7 +89,7 @@ | |||
89 | #define ACPI_FUJITSU_NOTIFY_CODE1 0x80 | 89 | #define ACPI_FUJITSU_NOTIFY_CODE1 0x80 |
90 | 90 | ||
91 | /* FUNC interface - command values */ | 91 | /* FUNC interface - command values */ |
92 | #define FUNC_RFKILL 0x1000 | 92 | #define FUNC_FLAGS 0x1000 |
93 | #define FUNC_LEDS 0x1001 | 93 | #define FUNC_LEDS 0x1001 |
94 | #define FUNC_BUTTONS 0x1002 | 94 | #define FUNC_BUTTONS 0x1002 |
95 | #define FUNC_BACKLIGHT 0x1004 | 95 | #define FUNC_BACKLIGHT 0x1004 |
@@ -163,8 +163,8 @@ struct fujitsu_laptop { | |||
163 | struct platform_device *pf_device; | 163 | struct platform_device *pf_device; |
164 | struct kfifo fifo; | 164 | struct kfifo fifo; |
165 | spinlock_t fifo_lock; | 165 | spinlock_t fifo_lock; |
166 | int rfkill_supported; | 166 | int flags_supported; |
167 | int rfkill_state; | 167 | int flags_state; |
168 | int logolamp_registered; | 168 | int logolamp_registered; |
169 | int kblamps_registered; | 169 | int kblamps_registered; |
170 | int radio_led_registered; | 170 | int radio_led_registered; |
@@ -300,9 +300,9 @@ static int radio_led_set(struct led_classdev *cdev, | |||
300 | enum led_brightness brightness) | 300 | enum led_brightness brightness) |
301 | { | 301 | { |
302 | if (brightness >= LED_FULL) | 302 | if (brightness >= LED_FULL) |
303 | return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON); | 303 | return call_fext_func(FUNC_FLAGS, 0x5, RADIO_LED_ON, RADIO_LED_ON); |
304 | else | 304 | else |
305 | return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0); | 305 | return call_fext_func(FUNC_FLAGS, 0x5, RADIO_LED_ON, 0x0); |
306 | } | 306 | } |
307 | 307 | ||
308 | static int eco_led_set(struct led_classdev *cdev, | 308 | static int eco_led_set(struct led_classdev *cdev, |
@@ -346,7 +346,7 @@ static enum led_brightness radio_led_get(struct led_classdev *cdev) | |||
346 | { | 346 | { |
347 | enum led_brightness brightness = LED_OFF; | 347 | enum led_brightness brightness = LED_OFF; |
348 | 348 | ||
349 | if (call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0) & RADIO_LED_ON) | 349 | if (call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0) & RADIO_LED_ON) |
350 | brightness = LED_FULL; | 350 | brightness = LED_FULL; |
351 | 351 | ||
352 | return brightness; | 352 | return brightness; |
@@ -567,9 +567,9 @@ static ssize_t | |||
567 | show_lid_state(struct device *dev, | 567 | show_lid_state(struct device *dev, |
568 | struct device_attribute *attr, char *buf) | 568 | struct device_attribute *attr, char *buf) |
569 | { | 569 | { |
570 | if (!(fujitsu_laptop->rfkill_supported & 0x100)) | 570 | if (!(fujitsu_laptop->flags_supported & 0x100)) |
571 | return sprintf(buf, "unknown\n"); | 571 | return sprintf(buf, "unknown\n"); |
572 | if (fujitsu_laptop->rfkill_state & 0x100) | 572 | if (fujitsu_laptop->flags_state & 0x100) |
573 | return sprintf(buf, "open\n"); | 573 | return sprintf(buf, "open\n"); |
574 | else | 574 | else |
575 | return sprintf(buf, "closed\n"); | 575 | return sprintf(buf, "closed\n"); |
@@ -579,9 +579,9 @@ static ssize_t | |||
579 | show_dock_state(struct device *dev, | 579 | show_dock_state(struct device *dev, |
580 | struct device_attribute *attr, char *buf) | 580 | struct device_attribute *attr, char *buf) |
581 | { | 581 | { |
582 | if (!(fujitsu_laptop->rfkill_supported & 0x200)) | 582 | if (!(fujitsu_laptop->flags_supported & 0x200)) |
583 | return sprintf(buf, "unknown\n"); | 583 | return sprintf(buf, "unknown\n"); |
584 | if (fujitsu_laptop->rfkill_state & 0x200) | 584 | if (fujitsu_laptop->flags_state & 0x200) |
585 | return sprintf(buf, "docked\n"); | 585 | return sprintf(buf, "docked\n"); |
586 | else | 586 | else |
587 | return sprintf(buf, "undocked\n"); | 587 | return sprintf(buf, "undocked\n"); |
@@ -591,9 +591,9 @@ static ssize_t | |||
591 | show_radios_state(struct device *dev, | 591 | show_radios_state(struct device *dev, |
592 | struct device_attribute *attr, char *buf) | 592 | struct device_attribute *attr, char *buf) |
593 | { | 593 | { |
594 | if (!(fujitsu_laptop->rfkill_supported & 0x20)) | 594 | if (!(fujitsu_laptop->flags_supported & 0x20)) |
595 | return sprintf(buf, "unknown\n"); | 595 | return sprintf(buf, "unknown\n"); |
596 | if (fujitsu_laptop->rfkill_state & 0x20) | 596 | if (fujitsu_laptop->flags_state & 0x20) |
597 | return sprintf(buf, "on\n"); | 597 | return sprintf(buf, "on\n"); |
598 | else | 598 | else |
599 | return sprintf(buf, "killed\n"); | 599 | return sprintf(buf, "killed\n"); |
@@ -920,17 +920,17 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) | |||
920 | ; /* No action, result is discarded */ | 920 | ; /* No action, result is discarded */ |
921 | vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i); | 921 | vdbg_printk(FUJLAPTOP_DBG_INFO, "Discarded %i ringbuffer entries\n", i); |
922 | 922 | ||
923 | fujitsu_laptop->rfkill_supported = | 923 | fujitsu_laptop->flags_supported = |
924 | call_fext_func(FUNC_RFKILL, 0x0, 0x0, 0x0); | 924 | call_fext_func(FUNC_FLAGS, 0x0, 0x0, 0x0); |
925 | 925 | ||
926 | /* Make sure our bitmask of supported functions is cleared if the | 926 | /* Make sure our bitmask of supported functions is cleared if the |
927 | RFKILL function block is not implemented, like on the S7020. */ | 927 | RFKILL function block is not implemented, like on the S7020. */ |
928 | if (fujitsu_laptop->rfkill_supported == UNSUPPORTED_CMD) | 928 | if (fujitsu_laptop->flags_supported == UNSUPPORTED_CMD) |
929 | fujitsu_laptop->rfkill_supported = 0; | 929 | fujitsu_laptop->flags_supported = 0; |
930 | 930 | ||
931 | if (fujitsu_laptop->rfkill_supported) | 931 | if (fujitsu_laptop->flags_supported) |
932 | fujitsu_laptop->rfkill_state = | 932 | fujitsu_laptop->flags_state = |
933 | call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); | 933 | call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0); |
934 | 934 | ||
935 | /* Suspect this is a keymap of the application panel, print it */ | 935 | /* Suspect this is a keymap of the application panel, print it */ |
936 | pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0)); | 936 | pr_info("BTNI: [0x%x]\n", call_fext_func(FUNC_BUTTONS, 0x0, 0x0, 0x0)); |
@@ -1093,9 +1093,9 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event) | |||
1093 | return; | 1093 | return; |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | if (fujitsu_laptop->rfkill_supported) | 1096 | if (fujitsu_laptop->flags_supported) |
1097 | fujitsu_laptop->rfkill_state = | 1097 | fujitsu_laptop->flags_state = |
1098 | call_fext_func(FUNC_RFKILL, 0x4, 0x0, 0x0); | 1098 | call_fext_func(FUNC_FLAGS, 0x4, 0x0, 0x0); |
1099 | 1099 | ||
1100 | i = 0; | 1100 | i = 0; |
1101 | while ((irb = | 1101 | while ((irb = |
@@ -1135,10 +1135,10 @@ static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event) | |||
1135 | 1135 | ||
1136 | /* On some models (first seen on the Skylake-based Lifebook | 1136 | /* On some models (first seen on the Skylake-based Lifebook |
1137 | * E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is | 1137 | * E736/E746/E756), the touchpad toggle hotkey (Fn+F4) is |
1138 | * handled in software; its state is queried using FUNC_RFKILL | 1138 | * handled in software; its state is queried using FUNC_FLAGS |
1139 | */ | 1139 | */ |
1140 | if ((fujitsu_laptop->rfkill_supported & BIT(26)) && | 1140 | if ((fujitsu_laptop->flags_supported & BIT(26)) && |
1141 | (call_fext_func(FUNC_RFKILL, 0x1, 0x0, 0x0) & BIT(26))) { | 1141 | (call_fext_func(FUNC_FLAGS, 0x1, 0x0, 0x0) & BIT(26))) { |
1142 | keycode = KEY_TOUCHPAD_TOGGLE; | 1142 | keycode = KEY_TOUCHPAD_TOGGLE; |
1143 | input_report_key(input, keycode, 1); | 1143 | input_report_key(input, keycode, 1); |
1144 | input_sync(input); | 1144 | input_sync(input); |