linux/drivers/platform/x86/dell/alienware-wmi.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Alienware AlienFX control
 *
 * Copyright (C) 2014 Dell Inc <[email protected]>
 */

#define pr_fmt(fmt)

#include <linux/acpi.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/dmi.h>
#include <linux/leds.h>

#define LEGACY_CONTROL_GUID
#define LEGACY_POWER_CONTROL_GUID
#define WMAX_CONTROL_GUID

#define WMAX_METHOD_HDMI_SOURCE
#define WMAX_METHOD_HDMI_STATUS
#define WMAX_METHOD_BRIGHTNESS
#define WMAX_METHOD_ZONE_CONTROL
#define WMAX_METHOD_HDMI_CABLE
#define WMAX_METHOD_AMPLIFIER_CABLE
#define WMAX_METHOD_DEEP_SLEEP_CONTROL
#define WMAX_METHOD_DEEP_SLEEP_STATUS

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

enum INTERFACE_FLAGS {};

enum LEGACY_CONTROL_STATES {};

enum WMAX_CONTROL_STATES {};

struct quirk_entry {};

static struct quirk_entry *quirks;


static struct quirk_entry quirk_inspiron5675 =;

static struct quirk_entry quirk_unknown =;

static struct quirk_entry quirk_x51_r1_r2 =;

static struct quirk_entry quirk_x51_r3 =;

static struct quirk_entry quirk_asm100 =;

static struct quirk_entry quirk_asm200 =;

static struct quirk_entry quirk_asm201 =;

static int __init dmi_matched(const struct dmi_system_id *dmi)
{}

static const struct dmi_system_id alienware_quirks[] __initconst =;

struct color_platform {} __packed;

struct platform_zone {};

struct wmax_brightness_args {};

struct wmax_basic_args {};

struct legacy_led_args {} __packed;

struct wmax_led_args {} __packed;

static struct platform_device *platform_device;
static struct device_attribute *zone_dev_attrs;
static struct attribute **zone_attrs;
static struct platform_zone *zone_data;

static struct platform_driver platform_driver =;

static struct attribute_group zone_attribute_group =;

static u8 interface;
static u8 lighting_control_state;
static u8 global_brightness;

/*
 * Helpers used for zone control
 */
static int parse_rgb(const char *buf, struct platform_zone *zone)
{}

static struct platform_zone *match_zone(struct device_attribute *attr)
{}

/*
 * Individual RGB zone control
 */
static int alienware_update_led(struct platform_zone *zone)
{}

static ssize_t zone_show(struct device *dev, struct device_attribute *attr,
			 char *buf)
{}

static ssize_t zone_set(struct device *dev, struct device_attribute *attr,
			const char *buf, size_t count)
{}

/*
 * LED Brightness (Global)
 */
static int wmax_brightness(int brightness)
{}

static void global_led_set(struct led_classdev *led_cdev,
			   enum led_brightness brightness)
{}

static enum led_brightness global_led_get(struct led_classdev *led_cdev)
{}

static struct led_classdev global_led =;

/*
 * Lighting control state device attribute (Global)
 */
static ssize_t show_control_state(struct device *dev,
				  struct device_attribute *attr, char *buf)
{}

static ssize_t store_control_state(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t count)
{}

static DEVICE_ATTR(lighting_control_state, 0644, show_control_state,
		   store_control_state);

static int alienware_zone_init(struct platform_device *dev)
{}

static void alienware_zone_exit(struct platform_device *dev)
{}

static acpi_status alienware_wmax_command(struct wmax_basic_args *in_args,
					  u32 command, int *out_data)
{}

/*
 *	The HDMI mux sysfs node indicates the status of the HDMI input mux.
 *	It can toggle between standard system GPU output and HDMI input.
 */
static ssize_t show_hdmi_cable(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}

static ssize_t show_hdmi_source(struct device *dev,
				struct device_attribute *attr, char *buf)
{}

static ssize_t toggle_hdmi_source(struct device *dev,
				  struct device_attribute *attr,
				  const char *buf, size_t count)
{}

static DEVICE_ATTR(cable, S_IRUGO, show_hdmi_cable, NULL);
static DEVICE_ATTR(source, S_IRUGO | S_IWUSR, show_hdmi_source,
		   toggle_hdmi_source);

static struct attribute *hdmi_attrs[] =;

static const struct attribute_group hdmi_attribute_group =;

static void remove_hdmi(struct platform_device *dev)
{}

static int create_hdmi(struct platform_device *dev)
{}

/*
 * Alienware GFX amplifier support
 * - Currently supports reading cable status
 * - Leaving expansion room to possibly support dock/undock events later
 */
static ssize_t show_amplifier_status(struct device *dev,
				     struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR(status, S_IRUGO, show_amplifier_status, NULL);

static struct attribute *amplifier_attrs[] =;

static const struct attribute_group amplifier_attribute_group =;

static void remove_amplifier(struct platform_device *dev)
{}

static int create_amplifier(struct platform_device *dev)
{}

/*
 * Deep Sleep Control support
 * - Modifies BIOS setting for deep sleep control allowing extra wakeup events
 */
static ssize_t show_deepsleep_status(struct device *dev,
				     struct device_attribute *attr, char *buf)
{}

static ssize_t toggle_deepsleep(struct device *dev,
				struct device_attribute *attr,
				const char *buf, size_t count)
{}

static DEVICE_ATTR(deepsleep, S_IRUGO | S_IWUSR, show_deepsleep_status, toggle_deepsleep);

static struct attribute *deepsleep_attrs[] =;

static const struct attribute_group deepsleep_attribute_group =;

static void remove_deepsleep(struct platform_device *dev)
{}

static int create_deepsleep(struct platform_device *dev)
{}

static int __init alienware_wmi_init(void)
{}

module_init();

static void __exit alienware_wmi_exit(void)
{}

module_exit(alienware_wmi_exit);