Skip to content

Commit f989711

Browse files
gmarulldleach02
authored andcommitted
pm: s/power-domain/power-domains and add power-domain-names
Some devices may belong to >1 power domain, so with the current design this is something not possible to describe. It's worth to note that Linux also uses the `power-domains` naming scheme, not `power-domain`. This patch also introduces `power-domain-names` so that each entry in `power-domains` can be given a name if needed. `#power-domain-cells` is now required as well. Signed-off-by: Gerard Marull-Paretas <gerard@teslabs.com>
1 parent 5ae51cf commit f989711

File tree

21 files changed

+124
-60
lines changed

21 files changed

+124
-60
lines changed

doc/services/pm/device_runtime.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ asynchronously, it will be put into the
2626
:c:enumerator:`PM_DEVICE_STATE_SUSPENDING` state first and then into the
2727
:c:enumerator:`PM_DEVICE_STATE_SUSPENDED` state when the action is run.
2828

29-
For devices on a power domain (via the devicetree 'power-domain' property), device runtime
29+
For devices on a power domain (via the devicetree 'power-domains' property), device runtime
3030
power management automatically attempts to request and release the dependent domain
3131
in response to :c:func:`pm_device_runtime_get` and :c:func:`pm_device_runtime_put`
3232
calls on the child device.

doc/services/pm/power_domain.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@ Devices belonging to this device can be declared referring it in the
131131
&gpio0 {
132132
compatible = "zephyr,gpio-emul";
133133
gpio-controller;
134-
power-domain = <&gpio_domain>;
134+
power-domains = <&gpio_domain>;
135135
};
136136
137137
&gpio1 {
138138
compatible = "zephyr,gpio-emul";
139139
gpio-controller;
140-
power-domain = <&gpio_domain>;
140+
power-domains = <&gpio_domain>;
141141
};
142142
143143
All devices under a domain will be notified when the domain changes

dts/bindings/base/base.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ properties:
9393
type: string-array
9494
description: Provided names of mailbox / IPM channel specifiers
9595

96+
power-domains:
97+
type: phandle-array
98+
description: Power domain specifiers
99+
100+
power-domain-names:
101+
type: string-array
102+
description: Provided names of power domain specifiers
103+
104+
"#power-domain-cells":
105+
type: int
106+
description: Number of cells in power-domains property
107+
96108
zephyr,deferred-init:
97109
type: boolean
98110
description: |

dts/bindings/base/pm.yaml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,6 @@ properties:
1616
Wake up capable devices are disabled (interruptions will not wake up
1717
the system) by default but they can be enabled at runtime if necessary.
1818
19-
power-domain:
20-
type: phandle
21-
description: |
22-
23-
Power domain the device belongs to.
24-
25-
The device will be notified when the power domain it belongs to is either
26-
suspended or resumed.
27-
2819
zephyr,pm-device-runtime-auto:
2920
type: boolean
3021
description: |

dts/bindings/power-domain/intel,adsp-power-domain.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@ properties:
1717
read_address (PWRSTS) to set power active or confirm power active
1818
for a desired domain.
1919
Same for write and read addresses
20+
21+
"#power-domain-cells":
22+
const: 0

dts/bindings/power-domain/nxp,scu-pd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,6 @@ properties:
1515
Number used by the firmware running on the SCU to identify
1616
the resource on which the PD-related operations are to be
1717
performed.
18+
19+
"#power-domain-cells":
20+
const: 0

dts/bindings/power-domain/power-domain-gpio-monitor.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,6 @@ properties:
2020
required: true
2121
description: |
2222
GPIO to use to sense if rail is powered on.
23+
24+
"#power-domain-cells":
25+
const: 0

dts/bindings/power-domain/power-domain-gpio.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,6 @@ properties:
2828
type: int
2929
default: 0
3030
description: Off delay time, in microseconds
31+
32+
"#power-domain-cells":
33+
const: 0

dts/bindings/power-domain/power-domain.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ description: Properties for power domains
66
compatible: "power-domain"
77

88
include: base.yaml
9+
10+
properties:
11+
"#power-domain-cells":
12+
const: 0

dts/xtensa/intel/intel_adsp_ace15_mtpm.dtsi

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
fifo = <0x0008>;
151151
interrupts = <0x08 0 0>;
152152
interrupt-parent = <&ace_intc>;
153-
power-domain = <&hub_ulp_domain>;
153+
power-domains = <&hub_ulp_domain>;
154154
};
155155

156156
dmic1: dmic1@10000 {
@@ -160,7 +160,7 @@
160160
fifo = <0x0108>;
161161
interrupts = <0x09 0 0>;
162162
interrupt-parent = <&ace_intc>;
163-
power-domain = <&hub_ulp_domain>;
163+
power-domains = <&hub_ulp_domain>;
164164
};
165165

166166
/*
@@ -285,7 +285,7 @@
285285
dmas = <&lpgpdma0 2
286286
&lpgpdma0 3>;
287287
dma-names = "tx", "rx";
288-
power-domain = <&io0_domain>;
288+
power-domains = <&io0_domain>;
289289
ssp-index = <0>;
290290
status = "okay";
291291

@@ -307,7 +307,7 @@
307307
dmas = <&lpgpdma0 4
308308
&lpgpdma0 5>;
309309
dma-names = "tx", "rx";
310-
power-domain = <&io0_domain>;
310+
power-domains = <&io0_domain>;
311311
ssp-index = <1>;
312312
status = "okay";
313313

@@ -329,7 +329,7 @@
329329
dmas = <&lpgpdma0 6
330330
&lpgpdma0 7>;
331331
dma-names = "tx", "rx";
332-
power-domain = <&io0_domain>;
332+
power-domains = <&io0_domain>;
333333
ssp-index = <2>;
334334
status = "okay";
335335

@@ -387,38 +387,47 @@
387387
hub_ulp_domain: hub_ulp_domain {
388388
compatible = "intel,adsp-power-domain";
389389
bit-position = <15>;
390+
#power-domain-cells = <0>;
390391
};
391392
ml1_domain: ml1_domain {
392393
compatible = "intel,adsp-power-domain";
393394
bit-position = <13>;
395+
#power-domain-cells = <0>;
394396
};
395397
ml0_domain: ml0_domain {
396398
compatible = "intel,adsp-power-domain";
397399
bit-position = <12>;
400+
#power-domain-cells = <0>;
398401
};
399402
io3_domain: io3_domain {
400403
compatible = "intel,adsp-power-domain";
401404
bit-position = <11>;
405+
#power-domain-cells = <0>;
402406
};
403407
io2_domain: io2_domain {
404408
compatible = "intel,adsp-power-domain";
405409
bit-position = <10>;
410+
#power-domain-cells = <0>;
406411
};
407412
io1_domain: io1_domain {
408413
compatible = "intel,adsp-power-domain";
409414
bit-position = <9>;
415+
#power-domain-cells = <0>;
410416
};
411417
io0_domain: io0_domain {
412418
compatible = "intel,adsp-power-domain";
413419
bit-position = <8>;
420+
#power-domain-cells = <0>;
414421
};
415422
hub_hp_domain: hub_hp_domain {
416423
compatible = "intel,adsp-power-domain";
417424
bit-position = <6>;
425+
#power-domain-cells = <0>;
418426
};
419427
hst_domain: hst_domain {
420428
compatible = "intel,adsp-power-domain";
421429
bit-position = <4>;
430+
#power-domain-cells = <0>;
422431
};
423432
};
424433

@@ -464,7 +473,7 @@
464473
dma-buf-addr-alignment = <128>;
465474
dma-buf-size-alignment = <32>;
466475
dma-copy-alignment = <16>;
467-
power-domain = <&io0_domain>;
476+
power-domains = <&io0_domain>;
468477
status = "okay";
469478
};
470479

@@ -476,7 +485,7 @@
476485
dma-buf-addr-alignment = <128>;
477486
dma-buf-size-alignment = <32>;
478487
dma-copy-alignment = <16>;
479-
power-domain = <&io0_domain>;
488+
power-domains = <&io0_domain>;
480489
status = "okay";
481490
};
482491

@@ -488,7 +497,7 @@
488497
dma-buf-addr-alignment = <128>;
489498
dma-buf-size-alignment = <32>;
490499
dma-copy-alignment = <16>;
491-
power-domain = <&hst_domain>;
500+
power-domains = <&hst_domain>;
492501
interrupts = <13 0 0>;
493502
interrupt-parent = <&ace_intc>;
494503
status = "okay";
@@ -502,7 +511,7 @@
502511
dma-buf-addr-alignment = <128>;
503512
dma-buf-size-alignment = <32>;
504513
dma-copy-alignment = <16>;
505-
power-domain = <&hst_domain>;
514+
power-domains = <&hst_domain>;
506515
interrupts = <12 0 0>;
507516
interrupt-parent = <&ace_intc>;
508517
status = "okay";
@@ -541,7 +550,7 @@
541550
dma-buf-size-alignment = <4>;
542551
dma-copy-alignment = <4>;
543552
status = "okay";
544-
power-domain = <&hub_ulp_domain>;
553+
power-domains = <&hub_ulp_domain>;
545554
zephyr,pm-device-runtime-auto;
546555
};
547556

@@ -555,7 +564,7 @@
555564
dma-buf-size-alignment = <4>;
556565
dma-copy-alignment = <4>;
557566
status = "okay";
558-
power-domain = <&io0_domain>;
567+
power-domains = <&io0_domain>;
559568
zephyr,pm-device-runtime-auto;
560569
};
561570

@@ -568,7 +577,7 @@
568577
interrupt-parent = <&core_intc>;
569578
dma-buf-size-alignment = <4>;
570579
dma-copy-alignment = <4>;
571-
power-domain = <&io0_domain>;
580+
power-domains = <&io0_domain>;
572581
status = "okay";
573582
zephyr,pm-device-runtime-auto;
574583
};

0 commit comments

Comments
 (0)