// SPDX-License-Identifier: GPL-2.0
/*
* property.c - Unified device property interface.
*
* Copyright (C) 2014, Intel Corporation
* Authors: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
* Mika Westerberg <mika.westerberg@linux.intel.com>
*/
#include <linux/acpi.h>
#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_graph.h>
#include <linux/of_irq.h>
#include <linux/property.h>
#include <linux/etherdevice.h>
#include <linux/phy.h>
struct property_set {
struct device *dev;
struct fwnode_handle fwnode;
const struct property_entry *properties;
};
static const struct fwnode_operations pset_fwnode_ops;
static inline bool is_pset_node(const struct fwnode_handle *fwnode)
{
return !IS_ERR_OR_NULL(fwnode) && fwnode->ops == &pset_fwnode_ops;
}
#define to_pset_node(__fwnode) \
({ \
typeof(__fwnode) __to_pset_node_fwnode = __fwnode; \
\
is_pset_node(__to_pset_node_fwnode) ? \
container_of(__to_pset_node_fwnode, \
struct property_set, fwnode) : \
NULL; \
})
static const struct property_entry *
pset_prop_get(const struct property_set *pset, const char *name)
{
const struct property_entry