linux/drivers/thermal/intel/int340x_thermal/acpi_thermal_rel.c

// SPDX-License-Identifier: GPL-2.0-only
/* acpi_thermal_rel.c driver for exporting ACPI thermal relationship
 *
 * Copyright (c) 2014 Intel Corp
 */

/*
 * Two functionalities included:
 * 1. Export _TRT, _ART, via misc device interface to the userspace.
 * 2. Provide parsing result to kernel drivers
 *
 */
#include <linux/init.h>
#include <linux/export.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/acpi.h>
#include <linux/uaccess.h>
#include <linux/miscdevice.h>
#include <linux/fs.h>
#include "acpi_thermal_rel.h"

static acpi_handle acpi_thermal_rel_handle;
static DEFINE_SPINLOCK(acpi_thermal_rel_chrdev_lock);
static int acpi_thermal_rel_chrdev_count;	/* #times opened */
static int acpi_thermal_rel_chrdev_exclu;	/* already open exclusive? */

static int acpi_thermal_rel_open(struct inode *inode, struct file *file)
{}

static int acpi_thermal_rel_release(struct inode *inode, struct file *file)
{}

/**
 * acpi_parse_trt - Thermal Relationship Table _TRT for passive cooling
 *
 * @handle: ACPI handle of the device contains _TRT
 * @trt_count: the number of valid entries resulted from parsing _TRT
 * @trtp: pointer to pointer of array of _TRT entries in parsing result
 * @create_dev: whether to create platform devices for target and source
 *
 */
int acpi_parse_trt(acpi_handle handle, int *trt_count, struct trt **trtp,
		bool create_dev)
{}
EXPORT_SYMBOL();

/**
 * acpi_parse_art - Parse Active Relationship Table _ART
 *
 * @handle: ACPI handle of the device contains _ART
 * @art_count: the number of valid entries resulted from parsing _ART
 * @artp: pointer to pointer of array of art entries in parsing result
 * @create_dev: whether to create platform devices for target and source
 *
 */
int acpi_parse_art(acpi_handle handle, int *art_count, struct art **artp,
		bool create_dev)
{}
EXPORT_SYMBOL();

/*
 * acpi_parse_psvt - Passive Table (PSVT) for passive cooling
 *
 * @handle: ACPI handle of the device which contains PSVT
 * @psvt_count: the number of valid entries resulted from parsing PSVT
 * @psvtp: pointer to array of psvt entries
 *
 */
static int acpi_parse_psvt(acpi_handle handle, int *psvt_count, struct psvt **psvtp)
{}

/* get device name from acpi handle */
static void get_single_name(acpi_handle handle, char *name)
{}

static int fill_art(char __user *ubuf)
{}

static int fill_trt(char __user *ubuf)
{}

static int fill_psvt(char __user *ubuf)
{}

static long acpi_thermal_rel_ioctl(struct file *f, unsigned int cmd,
				   unsigned long __arg)
{}

static const struct file_operations acpi_thermal_rel_fops =;

static struct miscdevice acpi_thermal_rel_misc_device =;

int acpi_thermal_rel_misc_device_add(acpi_handle handle)
{}
EXPORT_SYMBOL();

int acpi_thermal_rel_misc_device_remove(acpi_handle handle)
{}
EXPORT_SYMBOL();

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