linux/drivers/platform/chrome/cros_kbd_led_backlight.c

// SPDX-License-Identifier: GPL-2.0+
// Keyboard backlight LED driver for ChromeOS
//
// Copyright (C) 2012 Google, Inc.

#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 - keyboard LED driver data.
 * @init:			Init function.
 * @brightness_get:		Get LED brightness level.
 * @brightness_set:		Set LED brightness level.  Must not sleep.
 * @brightness_set_blocking:	Set LED brightness level.  It can block the
 *				caller for the time required for accessing a
 *				LED device register
 * @max_brightness:		Maximum brightness.
 *
 * See struct led_classdev in include/linux/leds.h for more details.
 */
struct keyboard_led_drvdata {};

#define KEYBOARD_BACKLIGHT_MAX

#ifdef CONFIG_ACPI

/* Keyboard LED ACPI Device must be defined in firmware */
#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 /* CONFIG_ACPI */

#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 /* IS_ENABLED(CONFIG_CROS_EC) */

static const __maybe_unused struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm = {};

#endif /* IS_ENABLED(CONFIG_CROS_EC) */

#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 /* IS_ENABLED(CONFIG_MFD_CROS_EC_DEV) */

static const struct keyboard_led_drvdata keyboard_led_drvdata_ec_pwm_mfd = {};

#endif /* IS_ENABLED(CONFIG_MFD_CROS_EC_DEV) */

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();