static void arm_smmu_remove_device(struct device *dev)
{
-------- struct iommu_fwspec *fwspec = dev->iommu_fwspec;
++++++++ struct iommu_fwspec *fwspec = dev_iommu_fwspec_get(dev);
struct arm_smmu_master_cfg *cfg;
struct arm_smmu_device *smmu;
----- ---
+++++ +++ int ret;
if (!fwspec || fwspec->ops != &arm_smmu_ops)
return;
{ .compatible = "arm,mmu-401", .data = &arm_mmu401 },
{ .compatible = "arm,mmu-500", .data = &arm_mmu500 },
{ .compatible = "cavium,smmu-v2", .data = &cavium_smmuv2 },
+++++ +++ { .compatible = "qcom,smmu-v2", .data = &qcom_smmuv2 },
{ },
};
-------- MODULE_DEVICE_TABLE(of, arm_smmu_of_match);
#ifdef CONFIG_ACPI
static int acpi_smmu_get_data(u32 model, struct arm_smmu_device *smmu)
if (!bitmap_empty(smmu->context_map, ARM_SMMU_MAX_CBS))
dev_err(&pdev->dev, "removing device with active domains!\n");
+++++ +++ arm_smmu_rpm_get(smmu);
/* Turn the thing off */
writel(sCR0_CLIENTPD, ARM_SMMU_GR0_NS(smmu) + ARM_SMMU_GR0_sCR0);
----- -- return 0;
+++++ +++ arm_smmu_rpm_put(smmu);
+++++ +++
+++++ +++ if (pm_runtime_enabled(smmu->dev))
+++++ +++ pm_runtime_force_suspend(smmu->dev);
+++++ +++ else
+++++ +++ clk_bulk_disable(smmu->num_clks, smmu->clks);
+++++ +++
+++++ +++ clk_bulk_unprepare(smmu->num_clks, smmu->clks);
-
- return 0;
- }
-
- static void arm_smmu_device_shutdown(struct platform_device *pdev)
- {
- arm_smmu_device_remove(pdev);
}
----- -- static void arm_smmu_device_shutdown(struct platform_device *pdev)
-static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
+++++ +++static int __maybe_unused arm_smmu_runtime_resume(struct device *dev)
{
----- -- arm_smmu_device_remove(pdev);
+++++ ++ struct arm_smmu_device *smmu = dev_get_drvdata(dev);
+++++ +++ int ret;
+++++ +++
+++++ +++ ret = clk_bulk_enable(smmu->num_clks, smmu->clks);
+++++ +++ if (ret)
+++++ +++ return ret;
+++++ ++
+++++ ++ arm_smmu_device_reset(smmu);
+++++ +++
+++++ ++ return 0;
}
----- -- static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
-static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
+++++ +++static int __maybe_unused arm_smmu_runtime_suspend(struct device *dev)
+{
+ struct arm_smmu_device *smmu = dev_get_drvdata(dev);
+
----- -- arm_smmu_device_reset(smmu);
+++++ +++ clk_bulk_disable(smmu->num_clks, smmu->clks);
+++++ +++
+ return 0;
+}
+
----- -- static SIMPLE_DEV_PM_OPS(arm_smmu_pm_ops, NULL, arm_smmu_pm_resume);
+++++ +++static int __maybe_unused arm_smmu_pm_resume(struct device *dev)
+++++ +++{
+++++ +++ if (pm_runtime_suspended(dev))
+++++ +++ return 0;
+++++ +++
+++++ +++ return arm_smmu_runtime_resume(dev);
+++++ +++}
+++++ +++
+++++ +++static int __maybe_unused arm_smmu_pm_suspend(struct device *dev)
+++++ +++{
+++++ +++ if (pm_runtime_suspended(dev))
+++++ +++ return 0;
+++++ +++
+++++ +++ return arm_smmu_runtime_suspend(dev);
+++++ +++}
+++++ +++
+++++ +++static const struct dev_pm_ops arm_smmu_pm_ops = {
+++++ +++ SET_SYSTEM_SLEEP_PM_OPS(arm_smmu_pm_suspend, arm_smmu_pm_resume)
+++++ +++ SET_RUNTIME_PM_OPS(arm_smmu_runtime_suspend,
+++++ +++ arm_smmu_runtime_resume, NULL)
+++++ +++};
static struct platform_driver arm_smmu_driver = {
.driver = {
if (!ipmmu_pdev)
return -ENODEV;
-------- dev->iommu_fwspec->iommu_priv = platform_get_drvdata(ipmmu_pdev);
- ------ return 0;
- ------ }
++++++++ fwspec->iommu_priv = platform_get_drvdata(ipmmu_pdev);
+
- ------ static bool ipmmu_slave_whitelist(struct device *dev)
- ------ {
- ------ /* By default, do not allow use of IPMMU */
- ------ return false;
+ ++++++ return 0;
}
-static bool ipmmu_slave_whitelist(struct device *dev)
-{
- /* By default, do not allow use of IPMMU */
- return false;
-}
-
static const struct soc_device_attribute soc_rcar_gen3[] = {
+ +++++++ { .soc_id = "r8a774a1", },
+ +++++++ { .soc_id = "r8a774c0", },
{ .soc_id = "r8a7795", },
{ .soc_id = "r8a7796", },
{ .soc_id = "r8a77965", },