linux/drivers/acpi/device_sysfs.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * drivers/acpi/device_sysfs.c - ACPI device sysfs attributes and modalias.
 *
 * Copyright (C) 2015, Intel Corp.
 * Author: Mika Westerberg <[email protected]>
 * Author: Rafael J. Wysocki <[email protected]>
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 *
 * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 */

#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/export.h>
#include <linux/nls.h>

#include "internal.h"

static ssize_t acpi_object_path(acpi_handle handle, char *buf)
{}

struct acpi_data_node_attr {};

#define DATA_NODE_ATTR(_name)

static ssize_t data_node_show_path(struct acpi_data_node *dn, char *buf)
{}

DATA_NODE_ATTR();

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

#define to_data_node(k)
#define to_attr(a)

static ssize_t acpi_data_node_attr_show(struct kobject *kobj,
					struct attribute *attr, char *buf)
{}

static const struct sysfs_ops acpi_data_node_sysfs_ops =;

static void acpi_data_node_release(struct kobject *kobj)
{}

static const struct kobj_type acpi_data_node_ktype =;

static void acpi_expose_nondev_subnodes(struct kobject *kobj,
					struct acpi_device_data *data)
{}

static void acpi_hide_nondev_subnodes(struct acpi_device_data *data)
{}

/**
 * create_pnp_modalias - Create hid/cid(s) string for modalias and uevent
 * @acpi_dev: ACPI device object.
 * @modalias: Buffer to print into.
 * @size: Size of the buffer.
 *
 * Creates hid/cid(s) string needed for modalias and uevent
 * e.g. on a device with hid:IBM0001 and cid:ACPI0001 you get:
 * char *modalias: "acpi:IBM0001:ACPI0001"
 * Return: 0: no _HID and no _CID
 *         -EINVAL: output error
 *         -ENOMEM: output is truncated
 */
static int create_pnp_modalias(const struct acpi_device *acpi_dev, char *modalias,
			       int size)
{}

/**
 * create_of_modalias - Creates DT compatible string for modalias and uevent
 * @acpi_dev: ACPI device object.
 * @modalias: Buffer to print into.
 * @size: Size of the buffer.
 *
 * Expose DT compatible modalias as of:NnameTCcompatible.  This function should
 * only be called for devices having ACPI_DT_NAMESPACE_HID in their list of
 * ACPI/PNP IDs.
 */
static int create_of_modalias(const struct acpi_device *acpi_dev, char *modalias,
			      int size)
{}

int __acpi_device_uevent_modalias(const struct acpi_device *adev,
				  struct kobj_uevent_env *env)
{}

/**
 * acpi_device_uevent_modalias - uevent modalias for ACPI-enumerated devices.
 * @dev: Struct device to get ACPI device node.
 * @env: Environment variables of the kobject uevent.
 *
 * Create the uevent modalias field for ACPI-enumerated devices.
 *
 * Because other buses do not support ACPI HIDs & CIDs, e.g. for a device with
 * hid:IBM0001 and cid:ACPI0001 you get: "acpi:IBM0001:ACPI0001".
 */
int acpi_device_uevent_modalias(const struct device *dev, struct kobj_uevent_env *env)
{}
EXPORT_SYMBOL_GPL();

static int __acpi_device_modalias(const struct acpi_device *adev, char *buf, int size)
{}

/**
 * acpi_device_modalias - modalias sysfs attribute for ACPI-enumerated devices.
 * @dev: Struct device to get ACPI device node.
 * @buf: The buffer to save pnp_modalias and of_modalias.
 * @size: Size of buffer.
 *
 * Create the modalias sysfs attribute for ACPI-enumerated devices.
 *
 * Because other buses do not support ACPI HIDs & CIDs, e.g. for a device with
 * hid:IBM0001 and cid:ACPI0001 you get: "acpi:IBM0001:ACPI0001".
 */
int acpi_device_modalias(struct device *dev, char *buf, int size)
{}
EXPORT_SYMBOL_GPL();

static ssize_t
modalias_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(modalias);

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

static DEVICE_ATTR_RO(real_power_state);

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

static DEVICE_ATTR_RO(power_state);

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

static DEVICE_ATTR_WO(eject);

static ssize_t
hid_show(struct device *dev, struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(hid);

static ssize_t uid_show(struct device *dev,
			struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(uid);

static ssize_t adr_show(struct device *dev,
			struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(adr);

static ssize_t path_show(struct device *dev,
			 struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(path);

/* sysfs file that shows description text from the ACPI _STR method */
static ssize_t description_show(struct device *dev,
				struct device_attribute *attr,
				char *buf)
{}
static DEVICE_ATTR_RO(description);

static ssize_t
sun_show(struct device *dev, struct device_attribute *attr,
	 char *buf)
{}
static DEVICE_ATTR_RO(sun);

static ssize_t
hrv_show(struct device *dev, struct device_attribute *attr,
	 char *buf)
{}
static DEVICE_ATTR_RO(hrv);

static ssize_t status_show(struct device *dev, struct device_attribute *attr,
				char *buf)
{}
static DEVICE_ATTR_RO(status);

static struct attribute *acpi_attrs[] =;

static bool acpi_show_attr(struct acpi_device *dev, const struct device_attribute *attr)
{}

static umode_t acpi_attr_is_visible(struct kobject *kobj,
				    struct attribute *attr,
				    int attrno)
{}

static const struct attribute_group acpi_group =;

const struct attribute_group *acpi_groups[] =;

/**
 * acpi_device_setup_files - Create sysfs attributes of an ACPI device.
 * @dev: ACPI device object.
 */
void acpi_device_setup_files(struct acpi_device *dev)
{}

/**
 * acpi_device_remove_files - Remove sysfs attributes of an ACPI device.
 * @dev: ACPI device object.
 */
void acpi_device_remove_files(struct acpi_device *dev)
{}