summaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/isst_if.h
diff options
context:
space:
mode:
authorSrinivas Pandruvada2019-06-27 00:38:43 +0200
committerAndy Shevchenko2019-07-02 17:41:16 +0200
commit35f2c14d2a076b063a76c5bf275c46c0743ba3a0 (patch)
tree5e8b2293aae48b1e08e25a978215f03d6e406083 /include/uapi/linux/isst_if.h
parentplatform/x86: ISST: Update ioctl-number.txt for Intel Speed Select interface (diff)
downloadkernel-qcow2-linux-35f2c14d2a076b063a76c5bf275c46c0743ba3a0.tar.gz
kernel-qcow2-linux-35f2c14d2a076b063a76c5bf275c46c0743ba3a0.tar.xz
kernel-qcow2-linux-35f2c14d2a076b063a76c5bf275c46c0743ba3a0.zip
platform/x86: ISST: Add common API to register and handle ioctls
Encapsulate common functions which all Intel Speed Select Technology interface drivers can use. This creates API to register misc device for user kernel communication and handle all common IOCTLs. As part of the registry it allows a callback which is to handle domain specific ioctl processing. There can be multiple drivers register for services, which can be built as modules. So this driver handle contention during registry and as well as during removal. Once user space opened the misc device, the registered driver will be prevented from removal. Also once misc device is opened by the user space new client driver can't register, till the misc device is closed. There are two types of client drivers, one to handle mail box interface and the other is to allow direct read/write to some specific MMIO space. This common driver implements IOCTL ISST_IF_GET_PLATFORM_INFO. Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'include/uapi/linux/isst_if.h')
-rw-r--r--include/uapi/linux/isst_if.h41
1 files changed, 41 insertions, 0 deletions
diff --git a/include/uapi/linux/isst_if.h b/include/uapi/linux/isst_if.h
new file mode 100644
index 000000000000..fa94480b5f74
--- /dev/null
+++ b/include/uapi/linux/isst_if.h
@@ -0,0 +1,41 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Intel Speed Select Interface: OS to hardware Interface
+ * Copyright (c) 2019, Intel Corporation.
+ * All rights reserved.
+ *
+ * Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
+ */
+
+#ifndef __ISST_IF_H
+#define __ISST_IF_H
+
+#include <linux/types.h>
+
+/**
+ * struct isst_if_platform_info - Define platform information
+ * @api_version: Version of the firmware document, which this driver
+ * can communicate
+ * @driver_version: Driver version, which will help user to send right
+ * commands. Even if the firmware is capable, driver may
+ * not be ready
+ * @max_cmds_per_ioctl: Returns the maximum number of commands driver will
+ * accept in a single ioctl
+ * @mbox_supported: Support of mail box interface
+ * @mmio_supported: Support of mmio interface for core-power feature
+ *
+ * Used to return output of IOCTL ISST_IF_GET_PLATFORM_INFO. This
+ * information can be used by the user space, to get the driver, firmware
+ * support and also number of commands to send in a single IOCTL request.
+ */
+struct isst_if_platform_info {
+ __u16 api_version;
+ __u16 driver_version;
+ __u16 max_cmds_per_ioctl;
+ __u8 mbox_supported;
+ __u8 mmio_supported;
+};
+
+#define ISST_IF_MAGIC 0xFE
+#define ISST_IF_GET_PLATFORM_INFO _IOR(ISST_IF_MAGIC, 0, struct isst_if_platform_info *)
+#endif