[1/3] dt-bindings: nvmem: qcom,spmi-sdam: fix example 'reg' property
Commit Message
The SPMI PMIC register region width is fixed and should not be encoded
in the devicetree.
Amend the example with a parent pmic node with the expected
'#address-cells' and '#size-cells' and fix up the 'reg' property.
Fixes: 9664a6b54c57 ("dt-bindings: nvmem: add binding for QTI SPMI SDAM")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
.../bindings/nvmem/qcom,spmi-sdam.yaml | 31 +++++++++++--------
1 file changed, 18 insertions(+), 13 deletions(-)
Comments
On 20/03/2023 14:57, Johan Hovold wrote:
> The SPMI PMIC register region width is fixed and should not be encoded
> in the devicetree.
>
> Amend the example with a parent pmic node with the expected
> '#address-cells' and '#size-cells' and fix up the 'reg' property.
>
> Fixes: 9664a6b54c57 ("dt-bindings: nvmem: add binding for QTI SPMI SDAM")
I would argue there is nothing to fix - the original example in that
context was correct, because examples have size-cells=1.
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Best regards,
Krzysztof
On Mon, Mar 20, 2023 at 03:12:41PM +0100, Krzysztof Kozlowski wrote:
> On 20/03/2023 14:57, Johan Hovold wrote:
> > The SPMI PMIC register region width is fixed and should not be encoded
> > in the devicetree.
> >
> > Amend the example with a parent pmic node with the expected
> > '#address-cells' and '#size-cells' and fix up the 'reg' property.
> >
> > Fixes: 9664a6b54c57 ("dt-bindings: nvmem: add binding for QTI SPMI SDAM")
>
> I would argue there is nothing to fix - the original example in that
> context was correct, because examples have size-cells=1.
But you'll never find these PMIC functions on a memory-mapped or other
bus with size-cells != 0 so I'd still say that the example is broken
(and it is definitely misleading as I found out the hard way).
Johan
@@ -42,17 +42,22 @@ unevaluatedProperties: false
examples:
- |
- sdam_1: nvram@b000 {
- #address-cells = <1>;
- #size-cells = <1>;
- compatible = "qcom,spmi-sdam";
- reg = <0xb000 0x100>;
- ranges = <0 0xb000 0x100>;
-
- /* Data cells */
- restart_reason: restart@50 {
- reg = <0x50 0x1>;
- bits = <6 2>;
- };
- };
+ pmic {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ sdam_1: nvram@b000 {
+ compatible = "qcom,spmi-sdam";
+ reg = <0xb000>;
+ #address-cells = <1>;
+ #size-cells = <1>;
+ ranges = <0 0xb000 0x100>;
+
+ /* Data cells */
+ restart_reason: restart@50 {
+ reg = <0x50 0x1>;
+ bits = <6 2>;
+ };
+ };
+ };
...