mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-25 02:09:42 +00:00
platform-drivers-x86 for 4.10-3
fujitsu-laptop: - use brightness_set_blocking for LED-setting callbacks platform/x86: fix surface3_button build errors: - fix surface3_button build errors -----BEGIN PGP SIGNATURE----- iQEcBAABAgAGBQJYbxSIAAoJEKbMaAwKp364UOcIAJ6GVrHc2RiQDO+jJyNZyPaZ fZe8k2PC3C9hJwOcIbxsEcaJxbAs34RM87mpmKSodYyyGCTw7HDOHPuxdB67Aisx atjdBFbG6gjdW5jjtYzwfq2FD+PhEBWRiXbfaX4yMIJu1tEUfhUvYv4PMSpUSEFH mqECMEzHZHKzNoroceA5Tekk0L+Z7wjJDaw0ePA5zPYU6CC6Z9O/j1JF/zhdn9OL /+/tIB+K9eO7TQT8nTLCzCwapODGHYgD5HEz+orKeOL1fXknktvhfmhjjEHudtU4 egJ/c0IsAoIIymkuikP61uGhoKGUqJwjNeoctlSz8cTeBaaq63tvT6NZH7XdkCY= =wCRj -----END PGP SIGNATURE----- Merge tag 'platform-drivers-x86-v4.10-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86 Pull x86 platform driver fixes from Darren Hart: "Just two small fixes for platform drivers x86: - use brightness_set_blocking for LED-setting callbacks on Fujitsu laptops - fix surface3_button build errors" * tag 'platform-drivers-x86-v4.10-3' of git://git.infradead.org/users/dvhart/linux-platform-drivers-x86: platform/x86: fujitsu-laptop: use brightness_set_blocking for LED-setting callbacks platform/x86: fix surface3_button build errors
This commit is contained in:
commit
88ba6cae15
2 changed files with 22 additions and 22 deletions
|
@ -1034,7 +1034,7 @@ config SURFACE_PRO3_BUTTON
|
|||
|
||||
config SURFACE_3_BUTTON
|
||||
tristate "Power/home/volume buttons driver for Microsoft Surface 3 tablet"
|
||||
depends on ACPI && KEYBOARD_GPIO
|
||||
depends on ACPI && KEYBOARD_GPIO && I2C
|
||||
---help---
|
||||
This driver handles the power/home/volume buttons on the Microsoft Surface 3 tablet.
|
||||
|
||||
|
|
|
@ -177,43 +177,43 @@ static void acpi_fujitsu_hotkey_notify(struct acpi_device *device, u32 event);
|
|||
|
||||
#if IS_ENABLED(CONFIG_LEDS_CLASS)
|
||||
static enum led_brightness logolamp_get(struct led_classdev *cdev);
|
||||
static void logolamp_set(struct led_classdev *cdev,
|
||||
static int logolamp_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness);
|
||||
|
||||
static struct led_classdev logolamp_led = {
|
||||
.name = "fujitsu::logolamp",
|
||||
.brightness_get = logolamp_get,
|
||||
.brightness_set = logolamp_set
|
||||
.brightness_set_blocking = logolamp_set
|
||||
};
|
||||
|
||||
static enum led_brightness kblamps_get(struct led_classdev *cdev);
|
||||
static void kblamps_set(struct led_classdev *cdev,
|
||||
static int kblamps_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness);
|
||||
|
||||
static struct led_classdev kblamps_led = {
|
||||
.name = "fujitsu::kblamps",
|
||||
.brightness_get = kblamps_get,
|
||||
.brightness_set = kblamps_set
|
||||
.brightness_set_blocking = kblamps_set
|
||||
};
|
||||
|
||||
static enum led_brightness radio_led_get(struct led_classdev *cdev);
|
||||
static void radio_led_set(struct led_classdev *cdev,
|
||||
static int radio_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness);
|
||||
|
||||
static struct led_classdev radio_led = {
|
||||
.name = "fujitsu::radio_led",
|
||||
.brightness_get = radio_led_get,
|
||||
.brightness_set = radio_led_set
|
||||
.brightness_set_blocking = radio_led_set
|
||||
};
|
||||
|
||||
static enum led_brightness eco_led_get(struct led_classdev *cdev);
|
||||
static void eco_led_set(struct led_classdev *cdev,
|
||||
static int eco_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness);
|
||||
|
||||
static struct led_classdev eco_led = {
|
||||
.name = "fujitsu::eco_led",
|
||||
.brightness_get = eco_led_get,
|
||||
.brightness_set = eco_led_set
|
||||
.brightness_set_blocking = eco_led_set
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -267,48 +267,48 @@ static int call_fext_func(int cmd, int arg0, int arg1, int arg2)
|
|||
#if IS_ENABLED(CONFIG_LEDS_CLASS)
|
||||
/* LED class callbacks */
|
||||
|
||||
static void logolamp_set(struct led_classdev *cdev,
|
||||
static int logolamp_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
if (brightness >= LED_FULL) {
|
||||
call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
|
||||
call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_ON);
|
||||
} else if (brightness >= LED_HALF) {
|
||||
call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_ON);
|
||||
call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_ALWAYS, FUNC_LED_OFF);
|
||||
} else {
|
||||
call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, LOGOLAMP_POWERON, FUNC_LED_OFF);
|
||||
}
|
||||
}
|
||||
|
||||
static void kblamps_set(struct led_classdev *cdev,
|
||||
static int kblamps_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
if (brightness >= LED_FULL)
|
||||
call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_ON);
|
||||
else
|
||||
call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, KEYBOARD_LAMPS, FUNC_LED_OFF);
|
||||
}
|
||||
|
||||
static void radio_led_set(struct led_classdev *cdev,
|
||||
static int radio_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
if (brightness >= LED_FULL)
|
||||
call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON);
|
||||
return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, RADIO_LED_ON);
|
||||
else
|
||||
call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0);
|
||||
return call_fext_func(FUNC_RFKILL, 0x5, RADIO_LED_ON, 0x0);
|
||||
}
|
||||
|
||||
static void eco_led_set(struct led_classdev *cdev,
|
||||
static int eco_led_set(struct led_classdev *cdev,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
int curr;
|
||||
|
||||
curr = call_fext_func(FUNC_LEDS, 0x2, ECO_LED, 0x0);
|
||||
if (brightness >= LED_FULL)
|
||||
call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr | ECO_LED_ON);
|
||||
else
|
||||
call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON);
|
||||
return call_fext_func(FUNC_LEDS, 0x1, ECO_LED, curr & ~ECO_LED_ON);
|
||||
}
|
||||
|
||||
static enum led_brightness logolamp_get(struct led_classdev *cdev)
|
||||
|
|
Loading…
Reference in a new issue