#include <linux/acpi.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/init.h>
#include <linux/input.h>
#include <linux/kernel.h>
#include <linux/leds.h>
#include <linux/module.h>
#include <linux/pci_ids.h>
#include <linux/power_supply.h>
#include <linux/sysfs.h>
#include <linux/types.h>
#include <acpi/battery.h>
enum kbled_type { … };
struct system76_data { … };
static const struct acpi_device_id device_ids[] = …;
MODULE_DEVICE_TABLE(acpi, device_ids);
static const enum led_brightness kb_levels[] = …;
static const int kb_colors[] = …;
static int system76_get(struct system76_data *data, char *method)
{ … }
static int system76_get_index(struct system76_data *data, char *method, int index)
{ … }
static int system76_get_object(struct system76_data *data, char *method, union acpi_object **obj)
{ … }
static char *system76_name(union acpi_object *obj, int index)
{ … }
static int system76_set(struct system76_data *data, char *method, int value)
{ … }
#define BATTERY_THRESHOLD_INVALID …
enum { … };
static ssize_t battery_get_threshold(int which, char *buf)
{ … }
static ssize_t battery_set_threshold(int which, const char *buf, size_t count)
{ … }
static ssize_t charge_control_start_threshold_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t charge_control_start_threshold_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(charge_control_start_threshold);
static ssize_t charge_control_end_threshold_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t charge_control_end_threshold_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{ … }
static DEVICE_ATTR_RW(charge_control_end_threshold);
static struct attribute *system76_battery_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static int system76_battery_add(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static int system76_battery_remove(struct power_supply *battery, struct acpi_battery_hook *hook)
{ … }
static struct acpi_battery_hook system76_battery_hook = …;
static void system76_battery_init(void)
{ … }
static void system76_battery_exit(void)
{ … }
static enum led_brightness ap_led_get(struct led_classdev *led)
{ … }
static int ap_led_set(struct led_classdev *led, enum led_brightness value)
{ … }
static enum led_brightness kb_led_get(struct led_classdev *led)
{ … }
static int kb_led_set(struct led_classdev *led, enum led_brightness value)
{ … }
static ssize_t kb_led_color_show(
struct device *dev,
struct device_attribute *dev_attr,
char *buf)
{ … }
static ssize_t kb_led_color_store(
struct device *dev,
struct device_attribute *dev_attr,
const char *buf,
size_t size)
{ … }
static struct device_attribute dev_attr_kb_led_color = …;
static struct attribute *system76_kb_led_color_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void kb_led_notify(struct system76_data *data)
{ … }
static void kb_led_hotkey_hardware(struct system76_data *data)
{ … }
static void kb_led_hotkey_toggle(struct system76_data *data)
{ … }
static void kb_led_hotkey_down(struct system76_data *data)
{ … }
static void kb_led_hotkey_up(struct system76_data *data)
{ … }
static void kb_led_hotkey_color(struct system76_data *data)
{ … }
static umode_t thermal_is_visible(const void *drvdata, enum hwmon_sensor_types type,
u32 attr, int channel)
{ … }
static int thermal_read(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, long *val)
{ … }
static int thermal_read_string(struct device *dev, enum hwmon_sensor_types type, u32 attr,
int channel, const char **str)
{ … }
static const struct hwmon_ops thermal_ops = …;
static const struct hwmon_channel_info * const thermal_channel_info[] = …;
static const struct hwmon_chip_info thermal_chip_info = …;
static void input_key(struct system76_data *data, unsigned int code)
{ … }
static void system76_notify(struct acpi_device *acpi_dev, u32 event)
{ … }
static int system76_add(struct acpi_device *acpi_dev)
{ … }
static void system76_remove(struct acpi_device *acpi_dev)
{ … }
static struct acpi_driver system76_driver = …;
module_acpi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;