162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
262306a36Sopenharmony_ci/* Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES.
362306a36Sopenharmony_ci */
462306a36Sopenharmony_ci#ifndef __LINUX_IOMMU_PRIV_H
562306a36Sopenharmony_ci#define __LINUX_IOMMU_PRIV_H
662306a36Sopenharmony_ci
762306a36Sopenharmony_ci#include <linux/iommu.h>
862306a36Sopenharmony_ci
962306a36Sopenharmony_cistatic inline const struct iommu_ops *dev_iommu_ops(struct device *dev)
1062306a36Sopenharmony_ci{
1162306a36Sopenharmony_ci	/*
1262306a36Sopenharmony_ci	 * Assume that valid ops must be installed if iommu_probe_device()
1362306a36Sopenharmony_ci	 * has succeeded. The device ops are essentially for internal use
1462306a36Sopenharmony_ci	 * within the IOMMU subsystem itself, so we should be able to trust
1562306a36Sopenharmony_ci	 * ourselves not to misuse the helper.
1662306a36Sopenharmony_ci	 */
1762306a36Sopenharmony_ci	return dev->iommu->iommu_dev->ops;
1862306a36Sopenharmony_ci}
1962306a36Sopenharmony_ci
2062306a36Sopenharmony_ciint iommu_group_replace_domain(struct iommu_group *group,
2162306a36Sopenharmony_ci			       struct iommu_domain *new_domain);
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciint iommu_device_register_bus(struct iommu_device *iommu,
2462306a36Sopenharmony_ci			      const struct iommu_ops *ops, struct bus_type *bus,
2562306a36Sopenharmony_ci			      struct notifier_block *nb);
2662306a36Sopenharmony_civoid iommu_device_unregister_bus(struct iommu_device *iommu,
2762306a36Sopenharmony_ci				 struct bus_type *bus,
2862306a36Sopenharmony_ci				 struct notifier_block *nb);
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_ci#endif /* __LINUX_IOMMU_PRIV_H */
31