From patchwork Sat Jul 22 11:54:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 710075 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7796C41513 for ; Sat, 22 Jul 2023 11:55:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230143AbjGVLzF (ORCPT ); Sat, 22 Jul 2023 07:55:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229681AbjGVLzE (ORCPT ); Sat, 22 Jul 2023 07:55:04 -0400 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14C3C2D71 for ; Sat, 22 Jul 2023 04:54:48 -0700 (PDT) Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3143b72c5ffso2358998f8f.3 for ; Sat, 22 Jul 2023 04:54:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690026886; x=1690631686; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=02nknKMJYKlDUsZ+YqcOCSB4hUZzBMytrcBqER2E3Do=; b=umiYYc/aB79bh3drCR+5MHqjugR24HGF2bX6eebpo10/T5g1KdLjrFKA9OZsFVoQvG 0W6mbXmvzfG5Z+NZyJ14nhs198h4uDwOXKBP7oWxSPVGBnxb06jURRyvhP+sVoVpk1X6 dafrfaNRCd7Em/sC5tVbcRLq0wHnQkdzB8yV7tSYeinLE2N1xMdDxhwP+VjKZJjoXhPw iO7yFefbiOju0bALua9+h18ZdzL/VXQb8I/nNUY3Qz1PqeiJECNPM1uI1emjgNCB2d8I 6ruDO1BRhg+bvQsJq2cQe4W8xKinaWsj+hA7vjZsvcjCXEPbBTpCPqqwxWTFdpxZG/lA pAbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690026886; x=1690631686; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=02nknKMJYKlDUsZ+YqcOCSB4hUZzBMytrcBqER2E3Do=; b=JbRby64l99J8tNlgP+BMkTN+kl9ozqv+bFy6f7jIHUQBowxGt44Oo4zWEGWZbAy2O1 GOBP80ui+690jTIYb9mhIcMAgNH5vAiErnTBm7caiA1IGP75ghSO5AmTeeDnBTU2Y7Ha YVo/pxo7PEv7uRDMeGlVoyaWukmBaK9m7T3P9q8MhxecZAdAagPkdiYfTEgKb2hlVj1S BbEQwHxAyfrYzPehPb3AtZ+0xSJVTRoZK0H4bm6wRWoAY+jewJ2Et+vpgay6imLWbZYE oCUCvI9xRBarJpXZUfZo8xajJysEyL68Tz8zKsTnalmwAlzFz06KvRVl3J3+rhWg/u1y qIig== X-Gm-Message-State: ABy/qLa9GhhRAYJKWNq4aIQTofTfGKkJfz3XLN3/iWZtlZkp2yftefpp jK5SjwFOmCIO2BNgPxPiNBm5BkrB6hzZnjl25bU= X-Google-Smtp-Source: APBJJlFx0RAbdgVsEAvPtj2sTHjoNfSYVpuccjeLCL0FmCVV3bneOPClpiWLn8F3WdkbgnpvEW1zmg== X-Received: by 2002:a05:6000:10c:b0:315:a1d5:a3d5 with SMTP id o12-20020a056000010c00b00315a1d5a3d5mr3843614wrx.22.1690026886543; Sat, 22 Jul 2023 04:54:46 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id o8-20020adfeac8000000b003143b7449ffsm6726496wrn.25.2023.07.22.04.54.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 04:54:46 -0700 (PDT) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 1/3] media: dt-bindings: samsung,exynos4212-fimc-is: replace duplicate pmu node with phandle Date: Sat, 22 Jul 2023 13:54:39 +0200 Message-Id: <20230722115441.139628-1-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The FIMC IS camera must access the PMU (Power Management Unit) IO memory to control camera power. This was achieved by duplicating the PMU node as its child like: soc@0 { system-controller@10020000 { ... }; // Real PMU camera@11800000 { fimc-is@12000000 { // FIMC IS camera node pmu@10020000 { reg = <0x10020000 0x3000>; // Fake PMU node }; }; }; }; This is not a correct representation of the hardware. Mapping the PMU (Power Management Unit) IO memory should be via syscon-like phandle (samsung,pmu-syscon, already used for other drivers), not by duplicating "pmu" Devicetree node inside the FIMC IS. Signed-off-by: Krzysztof Kozlowski --- .../media/samsung,exynos4212-fimc-is.yaml | 15 ++++++++++----- .../devicetree/bindings/media/samsung,fimc.yaml | 5 +---- 2 files changed, 11 insertions(+), 9 deletions(-) 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>; From patchwork Sat Jul 22 11:54:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 705537 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03C5CEB64DC for ; Sat, 22 Jul 2023 11:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230168AbjGVLzI (ORCPT ); Sat, 22 Jul 2023 07:55:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230160AbjGVLzH (ORCPT ); Sat, 22 Jul 2023 07:55:07 -0400 Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 03F6830CB for ; Sat, 22 Jul 2023 04:54:49 -0700 (PDT) Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3142a9ff6d8so2379128f8f.3 for ; Sat, 22 Jul 2023 04:54:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690026888; x=1690631688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XSFvde0MCghYMGJ+cTysg5G2vmHEvabjCrJg5MGa8zU=; b=AJ0wW0mfEILVh321hQFNqbf7/MSRnMvsPEoBV/23yswWtY6gfHV77Js/MUkz2pUgZ9 SOuya4zd+jdxBQ6S9qMnutxMXM0x7xSdCrheVvaNnHfMhKSUcm7ZRK7m0xPcJS7aXJnf g5TrwQw89oXuOmRBE1CKYYl4hc+qt+EbnGVONO4X4jwiUtkPtmevXQO7OxiDI3m47wm4 Ggkz7fYlXwHitlq//b73pg/YYPgKgqeeylcgsIwvkuA7nwByirO/Fef05NbsIB7vD3HH Yd6m0D1mdhO1XyyBQVihMIMoGDJcAg7osKFOTEwhcc7Rt6DX9Xzj6aYwiVPW/XpBtYpa x0KA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690026888; x=1690631688; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XSFvde0MCghYMGJ+cTysg5G2vmHEvabjCrJg5MGa8zU=; b=KfTbmuVTCKQRocREjAG/tEf+0zUVPcdnVxOWU76vt3kKE2d2YaarZSyrhf/Q/z4wAd 42YmG8wfQkeRbbzVCTP3QkpYYfUewWX3K1hxTO94eQTU+o42IHbRs+7ykuk1ThMjVryn nqZJB/DzmlmEoGjDGGUEc/Uut3Z6wHRfuw4edMrh5OGF2/VNvAG9FShuhpLgKysTziNF wWc9Kr0JL/+tf9fjL7k01P9guIN9sdMdsFflnieYI1CGMIaa6uRJCuIRKM5rjYMzUDHC ywGGF4byqvanCqtyqWHBGGqOofqA/Lz09UVZZQOAMMT3yU1uG4BRHx1yHLV4vgqR4tHq D4yQ== X-Gm-Message-State: ABy/qLZAbxgO+s6/M6TJ25eZ//9l7sNjBwsJla/EGJEu6F7iHMf4i9Gt G01yRy7e2YPby6NP/C11/ks8vQ== X-Google-Smtp-Source: APBJJlF0yz9uTMrzF4wv7INQUV+nxRdzqO+OAi0W/JQtvnrWjafHc+cNBgjgrQ9tygnsAonn9T5KRw== X-Received: by 2002:adf:f592:0:b0:314:13e2:2f6c with SMTP id f18-20020adff592000000b0031413e22f6cmr3604699wro.58.1690026888105; Sat, 22 Jul 2023 04:54:48 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id o8-20020adfeac8000000b003143b7449ffsm6726496wrn.25.2023.07.22.04.54.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 04:54:47 -0700 (PDT) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 2/3] media: dt-bindings: samsung, fimc: correct unit addresses in DTS example Date: Sat, 22 Jul 2023 13:54:40 +0200 Message-Id: <20230722115441.139628-2-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230722115441.139628-1-krzysztof.kozlowski@linaro.org> References: <20230722115441.139628-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org The camera node's ranges property and unit addresses of its children were not correct. If camera is @11800000, then its fimc child is @0. Signed-off-by: Krzysztof Kozlowski Acked-by: Conor Dooley --- .../bindings/media/samsung,fimc.yaml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/Documentation/devicetree/bindings/media/samsung,fimc.yaml b/Documentation/devicetree/bindings/media/samsung,fimc.yaml index 530a08f5d3fe..88b176d594e2 100644 --- a/Documentation/devicetree/bindings/media/samsung,fimc.yaml +++ b/Documentation/devicetree/bindings/media/samsung,fimc.yaml @@ -117,7 +117,7 @@ examples: #clock-cells = <1>; #address-cells = <1>; #size-cells = <1>; - ranges = <0x0 0x0 0x18000000>; + ranges = <0x0 0x0 0xba1000>; clocks = <&clock CLK_SCLK_CAM0>, <&clock CLK_SCLK_CAM1>, <&clock CLK_PIXELASYNCM0>, <&clock CLK_PIXELASYNCM1>; @@ -132,9 +132,9 @@ examples: pinctrl-0 = <&cam_port_a_clk_active &cam_port_b_clk_active>; pinctrl-names = "default"; - fimc@11800000 { + fimc@0 { compatible = "samsung,exynos4212-fimc"; - reg = <0x11800000 0x1000>; + reg = <0x00000000 0x1000>; interrupts = ; clocks = <&clock CLK_FIMC0>, <&clock CLK_SCLK_FIMC0>; @@ -151,9 +151,9 @@ examples: /* ... FIMC 1-3 */ - csis@11880000 { + csis@80000 { compatible = "samsung,exynos4210-csis"; - reg = <0x11880000 0x4000>; + reg = <0x00080000 0x4000>; interrupts = ; clocks = <&clock CLK_CSIS0>, <&clock CLK_SCLK_CSIS0>; @@ -186,9 +186,9 @@ examples: /* ... CSIS 1 */ - fimc-lite@12390000 { + fimc-lite@b90000 { compatible = "samsung,exynos4212-fimc-lite"; - reg = <0x12390000 0x1000>; + reg = <0xb90000 0x1000>; interrupts = ; power-domains = <&pd_isp>; clocks = <&isp_clock CLK_ISP_FIMC_LITE0>; @@ -198,9 +198,9 @@ examples: /* ... FIMC-LITE 1 */ - fimc-is@12000000 { + fimc-is@800000 { compatible = "samsung,exynos4212-fimc-is"; - reg = <0x12000000 0x260000>; + reg = <0x00800000 0x260000>; interrupts = , ; clocks = <&isp_clock CLK_ISP_FIMC_LITE0>, @@ -242,9 +242,9 @@ examples: #size-cells = <1>; ranges; - i2c-isp@12140000 { + i2c-isp@940000 { compatible = "samsung,exynos4212-i2c-isp"; - reg = <0x12140000 0x100>; + reg = <0x00940000 0x100>; clocks = <&isp_clock CLK_ISP_I2C1_ISP>; clock-names = "i2c_isp"; pinctrl-0 = <&fimc_is_i2c1>; From patchwork Sat Jul 22 11:54:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 710074 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 930AEC001DC for ; Sat, 22 Jul 2023 11:55:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230191AbjGVLzK (ORCPT ); Sat, 22 Jul 2023 07:55:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230151AbjGVLzI (ORCPT ); Sat, 22 Jul 2023 07:55:08 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02AB43A9C for ; Sat, 22 Jul 2023 04:54:50 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-3fbea14700bso22132915e9.3 for ; Sat, 22 Jul 2023 04:54:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1690026889; x=1690631689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=TjYyx1DOBe25+JK0YNsnvu9lLSFEE0N2YMpAouIlyww=; b=C+TT7ZqGhAhjvW9XCQGZwb2gl5+vD14Jy8uq2oZSlz1LmbGcRH4HVqlRbJ7yx0vi+L d3o47Mw6VkqltdTx5xSm7yZqpyGvkPkvtkzk1Dno6M81vIm00sagL8OyBwyYLsjQOspI ZNiqhohXFXHwovf6TVkd1eBhJwA9S4qKMD6xnO+YWT9XRKQjrVO5XJhpJh52U1rHV9fN DCNc8tnmfzNRtHx6GJ1VQ88vcIFKoAeRz6zI5lam2axHjBH1G8DOvwNv/cy/MVRLfsyK hNn2ufh72RwpLDpiZxjWMpv5Iw+tt0uacRFE/0reEUBByjLI+/Zplq/mdFgbCHWUeiWl IbMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690026889; x=1690631689; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TjYyx1DOBe25+JK0YNsnvu9lLSFEE0N2YMpAouIlyww=; b=N6hxiK+p+uug55wv0zkFLgWaZbIk2Blmi7Focbwj6fkjMVRQ1eK7NeFyPOVhiRTygK MUCc4y/ZQY157FQel+P1kvF6sryEgdqzNWz+LE5mGRvxgYTojIEvBN3cC4uU77dGxjUq 7IIy6TmsOFnWRnblvmf2Mr9+z4T/kGTnLNf6N1sgqkZ/IyJ15HZC5d2OHb2AsFupe5bi hCIrlS5eV62MuuNJbPPRg5aZ45V1I18dMx80bWupn6yI0ccDG8v0iBub8s3JQjaE+gXo lkiHvOGSlqrpsm4OFYu3ib65kf4d/uFE3sSgK3L00paTXFEja3PxZwgs+iqEzwUm0yrF wJTw== X-Gm-Message-State: ABy/qLZPNipq28uIT+ighZd4sy7W2q19jUij7J3+nVnqqQnMMVrKF1w1 JJVHr4DymLJRBiawDqsEz3tQXw== X-Google-Smtp-Source: APBJJlEY3agtFHJh4XCfK/uXpCdvf1iQR+GPgbF18fSP6kHTWhHUnR54yznZ7cTxiGoOGLpivrEACg== X-Received: by 2002:adf:f848:0:b0:317:18a8:5fa1 with SMTP id d8-20020adff848000000b0031718a85fa1mr2615312wrq.69.1690026889447; Sat, 22 Jul 2023 04:54:49 -0700 (PDT) Received: from krzk-bin.. ([178.197.223.104]) by smtp.gmail.com with ESMTPSA id o8-20020adfeac8000000b003143b7449ffsm6726496wrn.25.2023.07.22.04.54.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 22 Jul 2023 04:54:49 -0700 (PDT) From: Krzysztof Kozlowski To: Sylwester Nawrocki , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alim Akhtar , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Krzysztof Kozlowski Subject: [PATCH 3/3] media: exynos4-is: fimc-is: replace duplicate pmu node with phandle Date: Sat, 22 Jul 2023 13:54:41 +0200 Message-Id: <20230722115441.139628-3-krzysztof.kozlowski@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230722115441.139628-1-krzysztof.kozlowski@linaro.org> References: <20230722115441.139628-1-krzysztof.kozlowski@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Devicetree for the FIMC IS camera included duplicated PMU node as its child like: soc@0 { system-controller@10020000 { ... }; // Real PMU camera@11800000 { fimc-is@12000000 { // FIMC IS camera node pmu@10020000 { reg = <0x10020000 0x3000>; // Fake PMU node }; }; }; }; This is not a correct representation of the hardware. Mapping the PMU (Power Management Unit) IO memory should be via syscon-like phandle (samsung,pmu-syscon, already used for other drivers), not by duplicating "pmu" Devicetree node inside the FIMC IS. Backward compatibility is preserved. Signed-off-by: Krzysztof Kozlowski --- .../platform/samsung/exynos4-is/fimc-is.c | 33 ++++++++++++++----- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-is.c b/drivers/media/platform/samsung/exynos4-is/fimc-is.c index 530a148fe4d3..c4c191771093 100644 --- a/drivers/media/platform/samsung/exynos4-is/fimc-is.c +++ b/drivers/media/platform/samsung/exynos4-is/fimc-is.c @@ -767,12 +767,32 @@ static void fimc_is_debugfs_create(struct fimc_is *is) static int fimc_is_runtime_resume(struct device *dev); static int fimc_is_runtime_suspend(struct device *dev); +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 ERR_PTR(-ENODEV); + } + + regs = of_iomap(node, 0); + of_node_put(node); + if (!regs) + return ERR_PTR(-ENOMEM); + + return regs; +} + static int fimc_is_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct fimc_is *is; struct resource res; - struct device_node *node; int ret; is = devm_kzalloc(&pdev->dev, sizeof(*is), GFP_KERNEL); @@ -794,14 +814,9 @@ static int fimc_is_probe(struct platform_device *pdev) if (IS_ERR(is->regs)) return PTR_ERR(is->regs); - node = of_get_child_by_name(dev->of_node, "pmu"); - if (!node) - return -ENODEV; - - is->pmu_regs = of_iomap(node, 0); - of_node_put(node); - if (!is->pmu_regs) - return -ENOMEM; + is->pmu_regs = fimc_is_get_pmu_regs(dev); + if (IS_ERR(is->pmu_regs)) + return PTR_ERR(is->pmu_regs); is->irq = irq_of_parse_and_map(dev->of_node, 0); if (!is->irq) {