WIP FPC-III support
[linux/fpc-iii.git] / drivers / platform / x86 / intel_pmt_class.h
blobde8f8139ba3116ed9cbb0dc430fa7e071d107d62
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _INTEL_PMT_CLASS_H
3 #define _INTEL_PMT_CLASS_H
5 #include <linux/platform_device.h>
6 #include <linux/xarray.h>
7 #include <linux/types.h>
8 #include <linux/bits.h>
9 #include <linux/err.h>
10 #include <linux/io.h>
12 /* PMT access types */
13 #define ACCESS_BARID 2
14 #define ACCESS_LOCAL 3
16 /* PMT discovery base address/offset register layout */
17 #define GET_BIR(v) ((v) & GENMASK(2, 0))
18 #define GET_ADDRESS(v) ((v) & GENMASK(31, 3))
20 struct intel_pmt_entry {
21 struct bin_attribute pmt_bin_attr;
22 struct kobject *kobj;
23 void __iomem *disc_table;
24 void __iomem *base;
25 unsigned long base_addr;
26 size_t size;
27 u32 guid;
28 int devid;
31 struct intel_pmt_header {
32 u32 base_offset;
33 u32 size;
34 u32 guid;
35 u8 access_type;
38 struct intel_pmt_namespace {
39 const char *name;
40 struct xarray *xa;
41 const struct attribute_group *attr_grp;
42 int (*pmt_header_decode)(struct intel_pmt_entry *entry,
43 struct intel_pmt_header *header,
44 struct device *dev);
47 int intel_pmt_dev_create(struct intel_pmt_entry *entry,
48 struct intel_pmt_namespace *ns,
49 struct platform_device *pdev, int idx);
50 void intel_pmt_dev_destroy(struct intel_pmt_entry *entry,
51 struct intel_pmt_namespace *ns);
52 #endif