#include <linux/acpi.h>
#include <linux/delay.h>
#include <linux/err.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/mfd/core.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
#include <linux/platform_device.h>
#include <linux/property.h>
#include <linux/slab.h>
struct keyboard_led { … };
struct keyboard_led_drvdata { … };
#define KEYBOARD_BACKLIGHT_MAX …
#ifdef CONFIG_ACPI
#define ACPI_KEYBOARD_BACKLIGHT_DEVICE …
#define ACPI_KEYBOARD_BACKLIGHT_READ …
#define ACPI_KEYBOARD_BACKLIGHT_WRITE …
static void keyboard_led_set_brightness_acpi(struct led_classdev *cdev,
enum led_brightness brightness)
{ … }
static enum led_brightness
keyboard_led_get_brightness_acpi(struct led_classdev *cdev)
{ … }
static int keyboard_led_init_acpi(struct platform_device *pdev)
{ … }
static const struct keyboard_led_drvdata keyboard_led_drvdata_acpi = …;
#endif
#if IS_ENABLED(CONFIG_CROS_EC)
static int
keyboard_led_set_brightness_ec_pwm(struct led_classdev *cdev,
enum led_brightness brightness)
{ … }
static enum led_brightness
keyboard_led_get_brightness_ec_pwm(struct led_classdev *cdev)
{ … }
static int keyboard_led_init_ec_pwm(struct platform_device *pdev)
{ … }
static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = …;
#else
static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};
#endif
#if IS_ENABLED(CONFIG_MFD_CROS_EC_DEV)
static int keyboard_led_init_ec_pwm_mfd(struct platform_device *pdev)
{ … }
static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = …;
#else
static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {};
#endif
static int keyboard_led_is_mfd_device(struct platform_device *pdev)
{ … }
static int keyboard_led_probe(struct platform_device *pdev)
{ … }
#ifdef CONFIG_ACPI
static const struct acpi_device_id keyboard_led_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, keyboard_led_acpi_match);
#endif
#ifdef CONFIG_OF
static const struct of_device_id keyboard_led_of_match[] = …;
MODULE_DEVICE_TABLE(of, keyboard_led_of_match);
#endif
static const struct platform_device_id keyboard_led_id[] = …;
MODULE_DEVICE_TABLE(platform, keyboard_led_id);
static struct platform_driver keyboard_led_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;