linux/drivers/platform/x86/system76_acpi.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * System76 ACPI Driver
 *
 * Copyright (C) 2023 System76
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */

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

// Array of keyboard LED brightness levels
static const enum led_brightness kb_levels[] =;

// Array of keyboard LED colors in 24-bit RGB format
static const int kb_colors[] =;

// Get a System76 ACPI device value by name
static int system76_get(struct system76_data *data, char *method)
{}

// Get a System76 ACPI device value by name with index
static int system76_get_index(struct system76_data *data, char *method, int index)
{}

// Get a System76 ACPI device object by name
static int system76_get_object(struct system76_data *data, char *method, union acpi_object **obj)
{}

// Get a name from a System76 ACPI device object
static char *system76_name(union acpi_object *obj, int index)
{}

// Set a System76 ACPI device value by name
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)
{}

// Get the airplane mode LED brightness
static enum led_brightness ap_led_get(struct led_classdev *led)
{}

// Set the airplane mode LED brightness
static int ap_led_set(struct led_classdev *led, enum led_brightness value)
{}

// Get the last set keyboard LED brightness
static enum led_brightness kb_led_get(struct led_classdev *led)
{}

// Set the keyboard LED brightness
static int kb_led_set(struct led_classdev *led, enum led_brightness value)
{}

// Get the last set keyboard LED color
static ssize_t kb_led_color_show(
	struct device *dev,
	struct device_attribute *dev_attr,
	char *buf)
{}

// Set the keyboard LED color
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();

// Notify that the keyboard LED was changed by hardware
static void kb_led_notify(struct system76_data *data)
{}

// Read keyboard LED brightness as set by hardware
static void kb_led_hotkey_hardware(struct system76_data *data)
{}

// Toggle the keyboard LED
static void kb_led_hotkey_toggle(struct system76_data *data)
{}

// Decrease the keyboard LED brightness
static void kb_led_hotkey_down(struct system76_data *data)
{}

// Increase the keyboard LED brightness
static void kb_led_hotkey_up(struct system76_data *data)
{}

// Cycle the keyboard LED color
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 =;

// Allocate up to 8 fans and temperatures
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)
{}

// Handle ACPI notification
static void system76_notify(struct acpi_device *acpi_dev, u32 event)
{}

// Add a System76 ACPI device
static int system76_add(struct acpi_device *acpi_dev)
{}

// Remove a System76 ACPI device
static void system76_remove(struct acpi_device *acpi_dev)
{}

static struct acpi_driver system76_driver =;
module_acpi_driver();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();