#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/gpio/consumer.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/of.h>
#include "leds.h"
enum ns2_led_modes { … };
struct ns2_led_modval { … } __packed;
struct ns2_led { … };
static int ns2_led_get_mode(struct ns2_led *led, enum ns2_led_modes *mode)
{ … }
static void ns2_led_set_mode(struct ns2_led *led, enum ns2_led_modes mode)
{ … }
static void ns2_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static int ns2_led_set_blocking(struct led_classdev *led_cdev,
enum led_brightness value)
{ … }
static ssize_t ns2_led_sata_store(struct device *dev,
struct device_attribute *attr,
const char *buff, size_t count)
{ … }
static ssize_t ns2_led_sata_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(sata, 0644, ns2_led_sata_show, ns2_led_sata_store);
static struct attribute *ns2_led_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int ns2_led_register(struct device *dev, struct fwnode_handle *node,
struct ns2_led *led)
{ … }
static int ns2_led_probe(struct platform_device *pdev)
{ … }
static const struct of_device_id of_ns2_leds_match[] = …;
MODULE_DEVICE_TABLE(of, of_ns2_leds_match);
static struct platform_driver ns2_led_driver = …;
module_platform_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS(…) …;