Message ID | 20230807131256.254243-1-krzysztof.kozlowski@linaro.org |
---|---|
State | Superseded |
Headers | show |
Series | [v2,1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle | expand |
On 11/08/2023 11:49, Hans Verkuil wrote: > Hi Krzysztof, > > On 08/08/2023 01:13, Andi Shyti wrote: >> Hi Krzysztof, >> >> [...] >> >>> +static void __iomem *fimc_is_get_pmu_regs(struct device *dev) >>> +{ >>> + struct device_node *node; >>> + void __iomem *regs; >>> + >>> + node = of_parse_phandle(dev->of_node, "samsung,pmu-syscon", 0); >>> + if (!node) { >>> + dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n"); >>> + node = of_get_child_by_name(dev->of_node, "pmu"); >>> + if (!node) >>> + return IOMEM_ERR_PTR(-ENODEV); >> >> in my opinion this should be: >> >> ... >> if (!node) >> return IOMEM_ERR_PTR(-ENODEV); >> >> dev_warn(dev, "Finding PMU node via deprecated method, update your DTB\n"); >> >> Because if you don't have both "samsung,pmu-syscon and "pmu" then >> the warning should not be printed and you need to return -ENODEV. > > I agree with Andi for this part. > > The only time you want to see this message is if samsung,pmu-syscon is > missing AND pmu is present. If both are missing, then just return ENODEV as > it was before. OK, understood. I will send a v3. Best regards, Krzysztof
diff --git a/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml b/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml index 3691cd4962b2..3a5ff3f47060 100644 --- a/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml +++ b/Documentation/devicetree/bindings/media/samsung,exynos4212-fimc-is.yaml @@ -75,13 +75,20 @@ properties: power-domains: maxItems: 1 + samsung,pmu-syscon: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Power Management Unit (PMU) system controller interface, used to + power/start the ISP. + patternProperties: "^pmu@[0-9a-f]+$": type: object additionalProperties: false + deprecated: true description: Node representing the SoC's Power Management Unit (duplicated with the - correct PMU node in the SoC). + correct PMU node in the SoC). Deprecated, use samsung,pmu-syscon. properties: reg: @@ -131,6 +138,7 @@ required: - clock-names - interrupts - ranges + - samsung,pmu-syscon - '#size-cells' additionalProperties: false @@ -179,15 +187,12 @@ examples: <&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>; iommu-names = "isp", "drc", "fd", "mcuctl"; power-domains = <&pd_isp>; + samsung,pmu-syscon = <&pmu_system_controller>; #address-cells = <1>; #size-cells = <1>; ranges; - pmu@10020000 { - reg = <0x10020000 0x3000>; - }; - i2c-isp@12140000 { compatible = "samsung,exynos4212-i2c-isp"; reg = <0x12140000 0x100>; diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml index 79ff6d83a9fd..530a08f5d3fe 100644 --- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml +++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml @@ -236,15 +236,12 @@ examples: <&sysmmu_fimc_fd>, <&sysmmu_fimc_mcuctl>; iommu-names = "isp", "drc", "fd", "mcuctl"; power-domains = <&pd_isp>; + samsung,pmu-syscon = <&pmu_system_controller>; #address-cells = <1>; #size-cells = <1>; ranges; - pmu@10020000 { - reg = <0x10020000 0x3000>; - }; - i2c-isp@12140000 { compatible = "samsung,exynos4212-i2c-isp"; reg = <0x12140000 0x100>;