mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-08 14:13:53 +00:00
bdca0c077f
Device drivers (eg ARM SMMU) need to know if a specific component is part of the IORT table, so that kernel data structures are not initialized at initcalls time if the respective component is not part of the IORT table. To this end, this patch adds a trivial function that allows detecting if a given IORT node type is present or not in the ACPI table, providing an ACPI IORT equivalent for of_find_matching_node(). Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Reviewed-by: Tomasz Nowicki <tn@semihalf.com> Tested-by: Hanjun Guo <hanjun.guo@linaro.org> Tested-by: Tomasz Nowicki <tn@semihalf.com> Acked-by: Hanjun Guo <hanjun.guo@linaro.org> Cc: Hanjun Guo <hanjun.guo@linaro.org> Cc: Tomasz Nowicki <tn@semihalf.com> Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net> Signed-off-by: Will Deacon <will.deacon@arm.com>
48 lines
1.7 KiB
C
48 lines
1.7 KiB
C
/*
|
|
* Copyright (C) 2016, Semihalf
|
|
* Author: Tomasz Nowicki <tn@semihalf.com>
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms and conditions of the GNU General Public License,
|
|
* version 2, as published by the Free Software Foundation.
|
|
*
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
* more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License along with
|
|
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
* Place - Suite 330, Boston, MA 02111-1307 USA.
|
|
*/
|
|
|
|
#ifndef __ACPI_IORT_H__
|
|
#define __ACPI_IORT_H__
|
|
|
|
#include <linux/acpi.h>
|
|
#include <linux/fwnode.h>
|
|
#include <linux/irqdomain.h>
|
|
|
|
int iort_register_domain_token(int trans_id, struct fwnode_handle *fw_node);
|
|
void iort_deregister_domain_token(int trans_id);
|
|
struct fwnode_handle *iort_find_domain_token(int trans_id);
|
|
#ifdef CONFIG_ACPI_IORT
|
|
void acpi_iort_init(void);
|
|
bool iort_node_match(u8 type);
|
|
u32 iort_msi_map_rid(struct device *dev, u32 req_id);
|
|
struct irq_domain *iort_get_device_domain(struct device *dev, u32 req_id);
|
|
#else
|
|
static inline void acpi_iort_init(void) { }
|
|
static inline bool iort_node_match(u8 type) { return false; }
|
|
static inline u32 iort_msi_map_rid(struct device *dev, u32 req_id)
|
|
{ return req_id; }
|
|
static inline struct irq_domain *iort_get_device_domain(struct device *dev,
|
|
u32 req_id)
|
|
{ return NULL; }
|
|
#endif
|
|
|
|
#define IORT_ACPI_DECLARE(name, table_id, fn) \
|
|
ACPI_DECLARE_PROBE_ENTRY(iort, name, table_id, 0, NULL, 0, fn)
|
|
|
|
#endif /* __ACPI_IORT_H__ */
|