提交 d89bcc83 编写于 作者: M Michał Kępień 提交者: Darren Hart (VMware)

platform/x86: fujitsu-laptop: select LEDS_CLASS

Follow common subsystem practice of selecting LEDS_CLASS instead of
riddling module code with #ifdefs.
Signed-off-by: NMichał Kępień <kernel@kempniu.pl>
Reviewed-by: NJonathan Woithe <jwoithe@just42.net>
Signed-off-by: NDarren Hart (VMware) <dvhart@infradead.org>
上级 b8998305
...@@ -182,8 +182,8 @@ config FUJITSU_LAPTOP ...@@ -182,8 +182,8 @@ config FUJITSU_LAPTOP
depends on INPUT depends on INPUT
depends on BACKLIGHT_CLASS_DEVICE depends on BACKLIGHT_CLASS_DEVICE
depends on ACPI_VIDEO || ACPI_VIDEO = n depends on ACPI_VIDEO || ACPI_VIDEO = n
depends on LEDS_CLASS || LEDS_CLASS=n
select INPUT_SPARSEKMAP select INPUT_SPARSEKMAP
select LEDS_CLASS
---help--- ---help---
This is a driver for laptops built by Fujitsu: This is a driver for laptops built by Fujitsu:
......
...@@ -59,11 +59,9 @@ ...@@ -59,11 +59,9 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/sparse-keymap.h> #include <linux/input/sparse-keymap.h>
#include <linux/kfifo.h> #include <linux/kfifo.h>
#include <linux/leds.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <linux/slab.h> #include <linux/slab.h>
#if IS_ENABLED(CONFIG_LEDS_CLASS)
#include <linux/leds.h>
#endif
#include <acpi/video.h> #include <acpi/video.h>
#define FUJITSU_DRIVER_VERSION "0.6.0" #define FUJITSU_DRIVER_VERSION "0.6.0"
...@@ -94,7 +92,6 @@ ...@@ -94,7 +92,6 @@
#define FLAG_LID 0x100 #define FLAG_LID 0x100
#define FLAG_DOCK 0x200 #define FLAG_DOCK 0x200
#if IS_ENABLED(CONFIG_LEDS_CLASS)
/* FUNC interface - LED control */ /* FUNC interface - LED control */
#define FUNC_LED_OFF 0x1 #define FUNC_LED_OFF 0x1
#define FUNC_LED_ON 0x30001 #define FUNC_LED_ON 0x30001
...@@ -104,7 +101,6 @@ ...@@ -104,7 +101,6 @@
#define RADIO_LED_ON 0x20 #define RADIO_LED_ON 0x20
#define ECO_LED 0x10000 #define ECO_LED 0x10000
#define ECO_LED_ON 0x80000 #define ECO_LED_ON 0x80000
#endif
/* Hotkey details */ /* Hotkey details */
#define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */ #define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */
...@@ -165,7 +161,6 @@ struct fujitsu_laptop { ...@@ -165,7 +161,6 @@ struct fujitsu_laptop {
static struct fujitsu_laptop *fujitsu_laptop; static struct fujitsu_laptop *fujitsu_laptop;
#if IS_ENABLED(CONFIG_LEDS_CLASS)
static enum led_brightness logolamp_get(struct led_classdev *cdev); static enum led_brightness logolamp_get(struct led_classdev *cdev);
static int logolamp_set(struct led_classdev *cdev, static int logolamp_set(struct led_classdev *cdev,
enum led_brightness brightness); enum led_brightness brightness);
...@@ -206,7 +201,6 @@ static struct led_classdev eco_led = { ...@@ -206,7 +201,6 @@ static struct led_classdev eco_led = {
.brightness_get = eco_led_get, .brightness_get = eco_led_get,
.brightness_set_blocking = eco_led_set .brightness_set_blocking = eco_led_set
}; };
#endif
#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG #ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
static u32 dbg_level = 0x03; static u32 dbg_level = 0x03;
...@@ -238,7 +232,6 @@ static int call_fext_func(int func, int op, int feature, int state) ...@@ -238,7 +232,6 @@ static int call_fext_func(int func, int op, int feature, int state)
return value; return value;
} }
#if IS_ENABLED(CONFIG_LEDS_CLASS)
/* LED class callbacks */ /* LED class callbacks */
static int logolamp_set(struct led_classdev *cdev, static int logolamp_set(struct led_classdev *cdev,
...@@ -334,7 +327,6 @@ static enum led_brightness eco_led_get(struct led_classdev *cdev) ...@@ -334,7 +327,6 @@ static enum led_brightness eco_led_get(struct led_classdev *cdev)
return brightness; return brightness;
} }
#endif
/* Hardware access for LCD brightness control */ /* Hardware access for LCD brightness control */
...@@ -830,7 +822,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) ...@@ -830,7 +822,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
if (error) if (error)
goto err_free_fifo; goto err_free_fifo;
#if IS_ENABLED(CONFIG_LEDS_CLASS)
if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) { if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
result = led_classdev_register(&fujitsu_laptop->pf_device->dev, result = led_classdev_register(&fujitsu_laptop->pf_device->dev,
&logolamp_led); &logolamp_led);
...@@ -887,7 +878,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device) ...@@ -887,7 +878,6 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
result); result);
} }
} }
#endif
return result; return result;
...@@ -901,7 +891,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device) ...@@ -901,7 +891,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
{ {
struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device); struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device);
#if IS_ENABLED(CONFIG_LEDS_CLASS)
if (fujitsu_laptop->logolamp_registered) if (fujitsu_laptop->logolamp_registered)
led_classdev_unregister(&logolamp_led); led_classdev_unregister(&logolamp_led);
...@@ -913,7 +902,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device) ...@@ -913,7 +902,6 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
if (fujitsu_laptop->eco_led_registered) if (fujitsu_laptop->eco_led_registered)
led_classdev_unregister(&eco_led); led_classdev_unregister(&eco_led);
#endif
fujitsu_laptop_platform_remove(); fujitsu_laptop_platform_remove();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册