Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4686795pxu; Wed, 21 Oct 2020 02:44:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvC8ilgd9u+99/GigbO+P8md5PJTa/qhQQPqPoryGniFMvaTSlykQ2QjYDvTaypB0LZfXL X-Received: by 2002:a17:906:494:: with SMTP id f20mr2500344eja.285.1603273471522; Wed, 21 Oct 2020 02:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603273471; cv=none; d=google.com; s=arc-20160816; b=Sx5AjHNWVEeMmIdsYzDMOtIU20ysCQy6MsUHRzvx9/J8iG7OVxaNuYgiokaaVl+LeI lQMQhbcm7/Q1HdxUZgz6vvde21MGpzKkkyUYJLku5OhZzbqts4R0yN2pM99AGIuoR0qf jbquR3vgH3Z1clGFxuRIxhZhnpbjlNjEr5kdzZu/qRL0dR4ZIYTC6tawZrbmyiNeFKOv KbGdf4rbuovwc2H0Wbrkll5UoxDFeBRYwbDDeLI517lFoUgcZ3JrZS7DNr0N1N/PNkay XtPAEcMqS5votxj5TemsevdmcsxfV3i+kfOV8BSm6TmRN1PlfDTSlHkv1NFri9Y6b/5H WVUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=T7t4Jbg+7BOe3yZufnvrj+ez/m0+YX5r/cArdn8MbU4=; b=wkMDrQqIFQUsiUdKvaceCf7xAzo0oO2z4KhXwG+ldKiY79ika421w49con3m484w3b o/yMas0cT548+gRuEt25RRAaOws2h5f4m88+6bAqCD5NwJI/8GxIgxFPxaj0J/8yehtb H5fcnlGpYQIgt3Ju9yAIfr4Heu/u7Gu8gH3TYsRCLdwc4enRhcqGegNypXd9thfj2szk Hk3EfTqb25KFGr170TDsaFhiMUBk3xCH1LcnUMBWgGdaTqbVLh6EJfgWq1iY7AkQjAuS NXhW9o8NYDwJobTjcPze3pUTo1qucGPJXYGEiODV9e8oEu7sMxseZrTIlpjKLkC/IBGU wiFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r21si1157661ejo.534.2020.10.21.02.44.09; Wed, 21 Oct 2020 02:44:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2438182AbgJTTj2 (ORCPT + 99 others); Tue, 20 Oct 2020 15:39:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2438114AbgJTTj0 (ORCPT ); Tue, 20 Oct 2020 15:39:26 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0999DC0613D1; Tue, 20 Oct 2020 12:39:26 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id E77F81F44D9D From: Helen Koike To: linux-media@vger.kernel.org Cc: devicetree@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, robh+dt@kernel.org, heiko@sntech.de, kernel@collabora.com, hverkuil-cisco@xs4all.nl, dafna.hirschfeld@collabora.com, mark.rutland@arm.com, karthik.poduval@gmail.com, eddie.cai.linux@gmail.com, jbx6244@gmail.com, zhengsq@rock-chips.com, robin.murphy@arm.com Subject: [PATCH v6 5/9] media: staging: rkisp1: remove unecessary clocks Date: Tue, 20 Oct 2020 16:38:46 -0300 Message-Id: <20201020193850.1460644-6-helen.koike@collabora.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201020193850.1460644-1-helen.koike@collabora.com> References: <20201020193850.1460644-1-helen.koike@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org aclk_isp_wrap is a child of aclk_isp, and hclk_isp_wrap is a child of hclk_isp, thus we can remove parents from the list. Also, for the isp0, we only need the ISP clock, ACLK and HCLK. In the future we'll need a pixel clock for RK3288 and RK3399, and a JPEG clock for RK3288. So with the goal to cleanup the dt-bindings and remove it from staging, simplify clock names to isp, aclk and hclk. Assigned clocks are meant to refer to the full path in the clock tree, i.e. the leaf in the tree. For instance, in RK3399, the clock responsible for ACLK (ISP AXI CLOCK) is aclk_isp0_wrapper. For reference, this is the isp clock topology on RK3399: xin24m pll_npll npll clk_isp1 clk_isp0 pll_cpll cpll aclk_isp1 aclk_isp1_noc hclk_isp1 aclk_isp1_wrapper hclk_isp1_noc aclk_isp0 hclk_isp1_wrapper aclk_isp0_wrapper aclk_isp0_noc hclk_isp0 hclk_isp0_wrapper hclk_isp0_noc pclkin_isp1_wrapper Signed-off-by: Helen Koike Reviewed-by: Tomasz Figa --- Changes in V6: - Define clocks in the top level, and use if/else schema to define how many for each compatible as sugested by Rob Herring on https://patchwork.linuxtv.org/project/linux-media/patch/20200722155533.252844-6-helen.koike@collabora.com/#122626 --- .../bindings/media/rockchip-isp1.yaml | 44 +++++++++++++------ drivers/staging/media/rkisp1/rkisp1-dev.c | 8 ++-- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml index 62a6b9c959498..2004c054ed1a0 100644 --- a/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml +++ b/drivers/staging/media/rkisp1/Documentation/devicetree/bindings/media/rockchip-isp1.yaml @@ -24,20 +24,24 @@ properties: maxItems: 1 clocks: + minItems: 3 items: + # isp0 and isp1 - description: ISP clock - - description: ISP AXI clock clock - - description: ISP AXI clock wrapper clock - - description: ISP AHB clock clock - - description: ISP AHB wrapper clock + - description: ISP AXI clock + - description: ISP AHB clock + # only for isp1 + - description: ISP Pixel clock clock-names: + minItems: 3 items: - - const: clk_isp - - const: aclk_isp - - const: aclk_isp_wrap - - const: hclk_isp - - const: hclk_isp_wrap + # isp0 and isp1 + - const: isp + - const: aclk + - const: hclk + # only for isp1 + - const: pclk_isp iommus: maxItems: 1 @@ -116,6 +120,20 @@ required: - power-domains - ports +if: + properties: + compatible: + contains: + const: rockchip,rk3399-cif-isp +then: + properties: + clocks: + minItems: 3 + maxItems: 4 + clock-names: + minItems: 3 + maxItems: 4 + additionalProperties: false examples: @@ -134,11 +152,9 @@ examples: reg = <0x0 0xff910000 0x0 0x4000>; interrupts = ; clocks = <&cru SCLK_ISP0>, - <&cru ACLK_ISP0>, <&cru ACLK_ISP0_WRAPPER>, - <&cru HCLK_ISP0>, <&cru HCLK_ISP0_WRAPPER>; - clock-names = "clk_isp", - "aclk_isp", "aclk_isp_wrap", - "hclk_isp", "hclk_isp_wrap"; + <&cru ACLK_ISP0_WRAPPER>, + <&cru HCLK_ISP0_WRAPPER>; + clock-names = "isp", "aclk", "hclk"; iommus = <&isp0_mmu>; phys = <&dphy>; phy-names = "dphy"; diff --git a/drivers/staging/media/rkisp1/rkisp1-dev.c b/drivers/staging/media/rkisp1/rkisp1-dev.c index 91584695804bb..90d6543465562 100644 --- a/drivers/staging/media/rkisp1/rkisp1-dev.c +++ b/drivers/staging/media/rkisp1/rkisp1-dev.c @@ -405,11 +405,9 @@ static irqreturn_t rkisp1_isr(int irq, void *ctx) } static const char * const rk3399_isp_clks[] = { - "clk_isp", - "aclk_isp", - "hclk_isp", - "aclk_isp_wrap", - "hclk_isp_wrap", + "isp", + "aclk", + "hclk", }; static const struct rkisp1_match_data rk3399_isp_clk_data = { -- 2.28.0