#include <linux/acpi.h>
#include <linux/bitfield.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/io-64-nonatomic-lo-hi.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/perf_event.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#define NI_NODE_TYPE …
#define NI_NODE_TYPE_NODE_ID …
#define NI_NODE_TYPE_NODE_TYPE …
#define NI_CHILD_NODE_INFO …
#define NI_CHILD_PTR(n) …
#define NI700_PMUSELA …
#define NI_PERIPHERAL_ID0 …
#define NI_PIDR0_PART_7_0 …
#define NI_PERIPHERAL_ID1 …
#define NI_PIDR1_PART_11_8 …
#define NI_PERIPHERAL_ID2 …
#define NI_PIDR2_VERSION …
#define NI_PMEVCNTR(n) …
#define NI_PMCCNTR_L …
#define NI_PMCCNTR_U …
#define NI_PMEVTYPER(n) …
#define NI_PMEVTYPER_NODE_TYPE …
#define NI_PMEVTYPER_NODE_ID …
#define NI_PMCNTENSET …
#define NI_PMCNTENCLR …
#define NI_PMINTENSET …
#define NI_PMINTENCLR …
#define NI_PMOVSCLR …
#define NI_PMOVSSET …
#define NI_PMCFGR …
#define NI_PMCR …
#define NI_PMCR_RESET_CCNT …
#define NI_PMCR_RESET_EVCNT …
#define NI_PMCR_ENABLE …
#define NI_NUM_COUNTERS …
#define NI_CCNT_IDX …
#define NI_CONFIG_TYPE …
#define NI_CONFIG_NODEID …
#define NI_CONFIG_EVENTID …
#define NI_EVENT_TYPE(event) …
#define NI_EVENT_NODEID(event) …
#define NI_EVENT_EVENTID(event) …
enum ni_part { … };
enum ni_node_type { … };
struct arm_ni_node { … };
struct arm_ni_unit { … };
struct arm_ni_cd { … };
struct arm_ni { … };
#define cd_to_ni(cd) …
#define pmu_to_cd(p) …
#define cd_for_each_unit(cd, u) …
static int arm_ni_hp_state;
struct arm_ni_event_attr { … };
#define NI_EVENT_ATTR(_name, _type) …
static ssize_t arm_ni_event_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static umode_t arm_ni_event_attr_is_visible(struct kobject *kobj,
struct attribute *attr, int unused)
{ … }
static struct attribute *arm_ni_event_attrs[] = …;
static const struct attribute_group arm_ni_event_attrs_group = …;
struct arm_ni_format_attr { … };
#define NI_FORMAT_ATTR(_name, _fld) …
static ssize_t arm_ni_format_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static struct attribute *arm_ni_format_attrs[] = …;
static const struct attribute_group arm_ni_format_attrs_group = …;
static ssize_t arm_ni_cpumask_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static struct device_attribute arm_ni_cpumask_attr = …;
static ssize_t arm_ni_identifier_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static struct device_attribute arm_ni_identifier_attr = …;
static struct attribute *arm_ni_other_attrs[] = …;
static const struct attribute_group arm_ni_other_attr_group = …;
static const struct attribute_group *arm_ni_attr_groups[] = …;
static void arm_ni_pmu_enable(struct pmu *pmu)
{ … }
static void arm_ni_pmu_disable(struct pmu *pmu)
{ … }
struct arm_ni_val { … };
static bool arm_ni_val_count_event(struct perf_event *evt, struct arm_ni_val *val)
{ … }
static int arm_ni_validate_group(struct perf_event *event)
{ … }
static int arm_ni_event_init(struct perf_event *event)
{ … }
static u64 arm_ni_read_ccnt(struct arm_ni_cd *cd)
{ … }
static void arm_ni_event_read(struct perf_event *event)
{ … }
static void arm_ni_event_start(struct perf_event *event, int flags)
{ … }
static void arm_ni_event_stop(struct perf_event *event, int flags)
{ … }
static void arm_ni_init_ccnt(struct arm_ni_cd *cd)
{ … }
static void arm_ni_init_evcnt(struct arm_ni_cd *cd, int idx)
{ … }
static int arm_ni_event_add(struct perf_event *event, int flags)
{ … }
static void arm_ni_event_del(struct perf_event *event, int flags)
{ … }
static irqreturn_t arm_ni_handle_irq(int irq, void *dev_id)
{ … }
static int arm_ni_init_cd(struct arm_ni *ni, struct arm_ni_node *node, u64 res_start)
{ … }
static void arm_ni_probe_domain(void __iomem *base, struct arm_ni_node *node)
{ … }
static int arm_ni_probe(struct platform_device *pdev)
{ … }
static void arm_ni_remove(struct platform_device *pdev)
{ … }
#ifdef CONFIG_OF
static const struct of_device_id arm_ni_of_match[] = …;
MODULE_DEVICE_TABLE(of, arm_ni_of_match);
#endif
#ifdef CONFIG_ACPI
static const struct acpi_device_id arm_ni_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, arm_ni_acpi_match);
#endif
static struct platform_driver arm_ni_driver = …;
static void arm_ni_pmu_migrate(struct arm_ni_cd *cd, unsigned int cpu)
{ … }
static int arm_ni_pmu_online_cpu(unsigned int cpu, struct hlist_node *cpuhp_node)
{ … }
static int arm_ni_pmu_offline_cpu(unsigned int cpu, struct hlist_node *cpuhp_node)
{ … }
static int __init arm_ni_init(void)
{ … }
static void __exit arm_ni_exit(void)
{ … }
module_init(…) …;
module_exit(arm_ni_exit);
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;