linux/drivers/platform/x86/eeepc-laptop.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 *  eeepc-laptop.c - Asus Eee PC extras
 *
 *  Based on asus_acpi.c as patched for the Eee PC by Asus:
 *  ftp://ftp.asus.com/pub/ASUS/EeePC/701/ASUS_ACPI_071126.rar
 *  Based on eee.c from eeepc-linux
 */

#define pr_fmt(fmt)

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/platform_device.h>
#include <linux/backlight.h>
#include <linux/hwmon.h>
#include <linux/hwmon-sysfs.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/uaccess.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/rfkill.h>
#include <linux/pci.h>
#include <linux/pci_hotplug.h>
#include <linux/leds.h>
#include <linux/dmi.h>
#include <acpi/video.h>

#define EEEPC_LAPTOP_VERSION
#define EEEPC_LAPTOP_NAME
#define EEEPC_LAPTOP_FILE

#define EEEPC_ACPI_CLASS
#define EEEPC_ACPI_DEVICE_NAME
#define EEEPC_ACPI_HID

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

static bool hotplug_disabled;

module_param(hotplug_disabled, bool, 0444);
MODULE_PARM_DESC();

/*
 * Definitions for Asus EeePC
 */
#define NOTIFY_BRN_MIN
#define NOTIFY_BRN_MAX

enum {};

enum {};

static const char *cm_getv[] =;

static const char *cm_setv[] =;

static const struct key_entry eeepc_keymap[] =;

/*
 * This is the main structure, we can use it to store useful information
 */
struct eeepc_laptop {};

/*
 * ACPI Helpers
 */
static int write_acpi_int(acpi_handle handle, const char *method, int val)
{}

static int read_acpi_int(acpi_handle handle, const char *method, int *val)
{}

static int set_acpi(struct eeepc_laptop *eeepc, int cm, int value)
{}

static int get_acpi(struct eeepc_laptop *eeepc, int cm)
{}

static int acpi_setter_handle(struct eeepc_laptop *eeepc, int cm,
			      acpi_handle *handle)
{}


/*
 * Sys helpers
 */
static int parse_arg(const char *buf, int *val)
{}

static ssize_t store_sys_acpi(struct device *dev, int cm,
			      const char *buf, size_t count)
{}

static ssize_t show_sys_acpi(struct device *dev, int cm, char *buf)
{}

#define EEEPC_ACPI_SHOW_FUNC(_name, _cm)

#define EEEPC_ACPI_STORE_FUNC(_name, _cm)

#define EEEPC_CREATE_DEVICE_ATTR_RW(_name, _cm)

#define EEEPC_CREATE_DEVICE_ATTR_WO(_name, _cm)

EEEPC_CREATE_DEVICE_ATTR_RW();
EEEPC_CREATE_DEVICE_ATTR_RW();
EEEPC_CREATE_DEVICE_ATTR_WO();

struct eeepc_cpufv {};

static int get_cpufv(struct eeepc_laptop *eeepc, struct eeepc_cpufv *c)
{}

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

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

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

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

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


static DEVICE_ATTR_RW(cpufv);
static DEVICE_ATTR_RO(available_cpufv);
static DEVICE_ATTR_RW(cpufv_disabled);

static struct attribute *platform_attributes[] =;

static const struct attribute_group platform_attribute_group =;

static int eeepc_platform_init(struct eeepc_laptop *eeepc)
{}

static void eeepc_platform_exit(struct eeepc_laptop *eeepc)
{}

/*
 * LEDs
 */
/*
 * These functions actually update the LED's, and are called from a
 * workqueue. By doing this as separate work rather than when the LED
 * subsystem asks, we avoid messing with the Asus ACPI stuff during a
 * potentially bad time, such as a timer interrupt.
 */
static void tpd_led_update(struct work_struct *work)
{}

static void tpd_led_set(struct led_classdev *led_cdev,
			enum led_brightness value)
{}

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

static int eeepc_led_init(struct eeepc_laptop *eeepc)
{}

static void eeepc_led_exit(struct eeepc_laptop *eeepc)
{}

/*
 * PCI hotplug (for wlan rfkill)
 */
static bool eeepc_wlan_rfkill_blocked(struct eeepc_laptop *eeepc)
{}

static void eeepc_rfkill_hotplug(struct eeepc_laptop *eeepc, acpi_handle handle)
{}

static void eeepc_rfkill_hotplug_update(struct eeepc_laptop *eeepc, char *node)
{}

static void eeepc_rfkill_notify(acpi_handle handle, u32 event, void *data)
{}

static int eeepc_register_rfkill_notifier(struct eeepc_laptop *eeepc,
					  char *node)
{}

static void eeepc_unregister_rfkill_notifier(struct eeepc_laptop *eeepc,
					     char *node)
{}

static int eeepc_get_adapter_status(struct hotplug_slot *hotplug_slot,
				    u8 *value)
{}

static const struct hotplug_slot_ops eeepc_hotplug_slot_ops =;

static int eeepc_setup_pci_hotplug(struct eeepc_laptop *eeepc)
{}

/*
 * Rfkill devices
 */
static int eeepc_rfkill_set(void *data, bool blocked)
{}

static const struct rfkill_ops eeepc_rfkill_ops =;

static int eeepc_new_rfkill(struct eeepc_laptop *eeepc,
			    struct rfkill **rfkill,
			    const char *name,
			    enum rfkill_type type, int cm)
{}

static char EEEPC_RFKILL_NODE_1[] =;
static char EEEPC_RFKILL_NODE_2[] =;
static char EEEPC_RFKILL_NODE_3[] =;

static void eeepc_rfkill_exit(struct eeepc_laptop *eeepc)
{}

static int eeepc_rfkill_init(struct eeepc_laptop *eeepc)
{}

/*
 * Platform driver - hibernate/resume callbacks
 */
static int eeepc_hotk_thaw(struct device *device)
{}

static int eeepc_hotk_restore(struct device *device)
{}

static const struct dev_pm_ops eeepc_pm_ops =;

static struct platform_driver platform_driver =;

/*
 * Hwmon device
 */

#define EEEPC_EC_SC00
#define EEEPC_EC_FAN_PWM
#define EEEPC_EC_FAN_HRPM
#define EEEPC_EC_FAN_LRPM

#define EEEPC_EC_SFB0
#define EEEPC_EC_FAN_CTRL

static inline int eeepc_pwm_to_lmsensors(int value)
{}

static inline int eeepc_lmsensors_to_pwm(int value)
{}

static int eeepc_get_fan_pwm(void)
{}

static void eeepc_set_fan_pwm(int value)
{}

static int eeepc_get_fan_rpm(void)
{}

#define EEEPC_EC_FAN_CTRL_BIT
#define EEEPC_FAN_CTRL_MANUAL
#define EEEPC_FAN_CTRL_AUTO

static int eeepc_get_fan_ctrl(void)
{}

static void eeepc_set_fan_ctrl(int manual)
{}

static ssize_t store_sys_hwmon(void (*set)(int), const char *buf, size_t count)
{}

static ssize_t show_sys_hwmon(int (*get)(void), char *buf)
{}

#define EEEPC_SENSOR_SHOW_FUNC(_name, _get)

#define EEEPC_SENSOR_STORE_FUNC(_name, _set)

#define EEEPC_CREATE_SENSOR_ATTR_RW(_name, _get, _set)

#define EEEPC_CREATE_SENSOR_ATTR_RO(_name, _get)

EEEPC_CREATE_SENSOR_ATTR_RO();
EEEPC_CREATE_SENSOR_ATTR_RW();
EEEPC_CREATE_SENSOR_ATTR_RW();

static struct attribute *hwmon_attrs[] =;
ATTRIBUTE_GROUPS();

static int eeepc_hwmon_init(struct eeepc_laptop *eeepc)
{}

/*
 * Backlight device
 */
static int read_brightness(struct backlight_device *bd)
{}

static int set_brightness(struct backlight_device *bd, int value)
{}

static int update_bl_status(struct backlight_device *bd)
{}

static const struct backlight_ops eeepcbl_ops =;

static int eeepc_backlight_notify(struct eeepc_laptop *eeepc)
{}

static int eeepc_backlight_init(struct eeepc_laptop *eeepc)
{}

static void eeepc_backlight_exit(struct eeepc_laptop *eeepc)
{}


/*
 * Input device (i.e. hotkeys)
 */
static int eeepc_input_init(struct eeepc_laptop *eeepc)
{}

static void eeepc_input_exit(struct eeepc_laptop *eeepc)
{}

/*
 * ACPI driver
 */
static void eeepc_input_notify(struct eeepc_laptop *eeepc, int event)
{}

static void eeepc_acpi_notify(struct acpi_device *device, u32 event)
{}

static void eeepc_dmi_check(struct eeepc_laptop *eeepc)
{}

static void cmsg_quirk(struct eeepc_laptop *eeepc, int cm, const char *name)
{}

static void cmsg_quirks(struct eeepc_laptop *eeepc)
{}

static int eeepc_acpi_init(struct eeepc_laptop *eeepc)
{}

static void eeepc_enable_camera(struct eeepc_laptop *eeepc)
{}

static bool eeepc_device_present;

static int eeepc_acpi_add(struct acpi_device *device)
{}

static void eeepc_acpi_remove(struct acpi_device *device)
{}


static const struct acpi_device_id eeepc_device_ids[] =;
MODULE_DEVICE_TABLE(acpi, eeepc_device_ids);

static struct acpi_driver eeepc_acpi_driver =;


static int __init eeepc_laptop_init(void)
{}

static void __exit eeepc_laptop_exit(void)
{}

module_init();
module_exit(eeepc_laptop_exit);