Skip to content

Commit 2c07b0f

Browse files
committed
Merge branch 'opp/empty' into opp/linux-next
2 parents e91e3d9 + 6ee70e8 commit 2c07b0f

2 files changed

Lines changed: 58 additions & 3 deletions

File tree

  • Documentation/devicetree/bindings/opp
  • drivers/opp

Documentation/devicetree/bindings/opp/opp.txt

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ Required properties:
6565

6666
- OPP nodes: One or more OPP nodes describing voltage-current-frequency
6767
combinations. Their name isn't significant but their phandle can be used to
68-
reference an OPP.
68+
reference an OPP. These are mandatory except for the case where the OPP table
69+
is present only to indicate dependency between devices using the opp-shared
70+
property.
6971

7072
Optional properties:
7173
- opp-shared: Indicates that device nodes using this OPP Table Node's phandle
@@ -568,3 +570,53 @@ Example 6: opp-microvolt-<name>, opp-microamp-<name>:
568570
};
569571
};
570572
};
573+
574+
Example 7: Single cluster Quad-core ARM cortex A53, OPP points from firmware,
575+
distinct clock controls but two sets of clock/voltage/current lines.
576+
577+
/ {
578+
cpus {
579+
#address-cells = <2>;
580+
#size-cells = <0>;
581+
582+
cpu@0 {
583+
compatible = "arm,cortex-a53";
584+
reg = <0x0 0x100>;
585+
next-level-cache = <&A53_L2>;
586+
clocks = <&dvfs_controller 0>;
587+
operating-points-v2 = <&cpu_opp0_table>;
588+
};
589+
cpu@1 {
590+
compatible = "arm,cortex-a53";
591+
reg = <0x0 0x101>;
592+
next-level-cache = <&A53_L2>;
593+
clocks = <&dvfs_controller 1>;
594+
operating-points-v2 = <&cpu_opp0_table>;
595+
};
596+
cpu@2 {
597+
compatible = "arm,cortex-a53";
598+
reg = <0x0 0x102>;
599+
next-level-cache = <&A53_L2>;
600+
clocks = <&dvfs_controller 2>;
601+
operating-points-v2 = <&cpu_opp1_table>;
602+
};
603+
cpu@3 {
604+
compatible = "arm,cortex-a53";
605+
reg = <0x0 0x103>;
606+
next-level-cache = <&A53_L2>;
607+
clocks = <&dvfs_controller 3>;
608+
operating-points-v2 = <&cpu_opp1_table>;
609+
};
610+
611+
};
612+
613+
cpu_opp0_table: opp0_table {
614+
compatible = "operating-points-v2";
615+
opp-shared;
616+
};
617+
618+
cpu_opp1_table: opp1_table {
619+
compatible = "operating-points-v2";
620+
opp-shared;
621+
};
622+
};

drivers/opp/of.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,8 @@ static void _opp_table_alloc_required_tables(struct opp_table *opp_table,
170170
/* Traversing the first OPP node is all we need */
171171
np = of_get_next_available_child(opp_np, NULL);
172172
if (!np) {
173-
dev_err(dev, "Empty OPP table\n");
173+
dev_warn(dev, "Empty OPP table\n");
174+
174175
return;
175176
}
176177

@@ -378,7 +379,9 @@ int dev_pm_opp_of_find_icc_paths(struct device *dev,
378379
struct icc_path **paths;
379380

380381
ret = _bandwidth_supported(dev, opp_table);
381-
if (ret <= 0)
382+
if (ret == -EINVAL)
383+
return 0; /* Empty OPP table is a valid corner-case, let's not fail */
384+
else if (ret <= 0)
382385
return ret;
383386

384387
ret = 0;

0 commit comments

Comments
 (0)