#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/kfifo.h>
+#include <linux/leds.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
-#include <linux/leds.h>
-#endif
#include <acpi/video.h>
#define FUJITSU_DRIVER_VERSION "0.6.0"
#define FLAG_LID 0x100
#define FLAG_DOCK 0x200
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
/* FUNC interface - LED control */
#define FUNC_LED_OFF 0x1
#define FUNC_LED_ON 0x30001
#define RADIO_LED_ON 0x20
#define ECO_LED 0x10000
#define ECO_LED_ON 0x80000
-#endif
/* Hotkey details */
#define KEY1_CODE 0x410 /* codes for the keys in the GIRB register */
static struct fujitsu_laptop *fujitsu_laptop;
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
static enum led_brightness logolamp_get(struct led_classdev *cdev);
static int logolamp_set(struct led_classdev *cdev,
enum led_brightness brightness);
.brightness_get = eco_led_get,
.brightness_set_blocking = eco_led_set
};
-#endif
#ifdef CONFIG_FUJITSU_LAPTOP_DEBUG
static u32 dbg_level = 0x03;
return value;
}
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
/* LED class callbacks */
static int logolamp_set(struct led_classdev *cdev,
return brightness;
}
-#endif
/* Hardware access for LCD brightness control */
if (error)
goto err_free_fifo;
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
result = led_classdev_register(&fujitsu_laptop->pf_device->dev,
&logolamp_led);
result);
}
}
-#endif
return result;
{
struct fujitsu_laptop *fujitsu_laptop = acpi_driver_data(device);
-#if IS_ENABLED(CONFIG_LEDS_CLASS)
if (fujitsu_laptop->logolamp_registered)
led_classdev_unregister(&logolamp_led);
if (fujitsu_laptop->eco_led_registered)
led_classdev_unregister(&eco_led);
-#endif
fujitsu_laptop_platform_remove();