1 // SPDX-License-Identifier: GPL-2.0-only
3 * OMAP IOMMU quirks for various TI SoCs
5 * Copyright (C) 2015-2019 Texas Instruments Incorporated - http://www.ti.com/
6 * Suman Anna <s-anna@ti.com>
9 #include <linux/platform_device.h>
10 #include <linux/err.h>
12 #include "omap_hwmod.h"
13 #include "omap_device.h"
14 #include "powerdomain.h"
16 int omap_iommu_set_pwrdm_constraint(struct platform_device
*pdev
, bool request
,
19 struct powerdomain
*pwrdm
;
20 struct omap_device
*od
;
23 od
= to_omap_device(pdev
);
27 if (od
->hwmods_cnt
!= 1)
30 pwrdm
= omap_hwmod_get_pwrdm(od
->hwmods
[0]);
35 *pwrst
= pwrdm_read_next_pwrst(pwrdm
);
37 if (*pwrst
> PWRDM_POWER_RET
)
40 next_pwrst
= request
? PWRDM_POWER_ON
: *pwrst
;
42 return pwrdm_set_next_pwrst(pwrdm
, next_pwrst
);