This source file includes following definitions.
- omap_iommu_set_pwrdm_constraint
1
2
3
4
5
6
7
8
9 #include <linux/platform_device.h>
10 #include <linux/err.h>
11
12 #include "omap_hwmod.h"
13 #include "omap_device.h"
14 #include "powerdomain.h"
15
16 int omap_iommu_set_pwrdm_constraint(struct platform_device *pdev, bool request,
17 u8 *pwrst)
18 {
19 struct powerdomain *pwrdm;
20 struct omap_device *od;
21 u8 next_pwrst;
22
23 od = to_omap_device(pdev);
24 if (!od)
25 return -ENODEV;
26
27 if (od->hwmods_cnt != 1)
28 return -EINVAL;
29
30 pwrdm = omap_hwmod_get_pwrdm(od->hwmods[0]);
31 if (!pwrdm)
32 return -EINVAL;
33
34 if (request)
35 *pwrst = pwrdm_read_next_pwrst(pwrdm);
36
37 if (*pwrst > PWRDM_POWER_RET)
38 return 0;
39
40 next_pwrst = request ? PWRDM_POWER_ON : *pwrst;
41
42 return pwrdm_set_next_pwrst(pwrdm, next_pwrst);
43 }