Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp2218903ybn; Thu, 26 Sep 2019 08:41:06 -0700 (PDT) X-Google-Smtp-Source: APXvYqyY1m5HmJi5+s6av3Li+6Ez92ynEMZyVHHSqTkSQto35lSVYmnX9b4NkNPpGrTvGLJg1I4R X-Received: by 2002:a05:6402:1681:: with SMTP id a1mr4397605edv.218.1569512465955; Thu, 26 Sep 2019 08:41:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569512465; cv=none; d=google.com; s=arc-20160816; b=IMUAMfwBY8hr3NTrA5OkUapXvTyvDh12LCJSNHa5n5MKBIEthIUF58QkQg0PaL2LVE GF+Sw7WH9gTBpLlXIcUIrlaNmSXtwCUty730NqQ5m1iqzkoP9+fa5M269eTrDD4gRs+U ddv0pA3ufpR3NX+HIpNBIqgHrI5fOtkoXv2HNyRD+XEFZ8UMrT2MtPBsoP3e7mmRWIW0 NvqJT264VWmLjcYYuvY5rxbKI2SBH/m4+zYOX07xOEObZ0C6UpqzkDlCDd1SXSzvrcif W56YBhr9KUgbYYCeJnEZ8kCqGA60Mg9w/yExJZfh1Qde5frX78Kbp8mutQWsj5EdVKlo qoAg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=JKYsMfdCgpKD/zH1cH+BaJghmmqRzRwXgY6Ci0hMASM=; b=PM/RFsa800DAXNGtTyYCsoSyQRp7foHGcHj639khXmd+JeudftND0BdYAKPYSCbaVD wTHWkp1aOk+7Zr2eFnGPjBaeivaR+d8YAzXS/S1QsuQRPl1GrJcUKcwWSxNyFIrcLsm/ jWrhO23EXyyfxcgbU3T7LcABV+dcIoTeI1+oiGjgPlWluRZ4K2N9g76jXYW0IMDWbhbv vqfcglCbIgvbrTK5qXRfUcVkBOQWqkbiE3ke//3mA6G7L1AGfc7t70YFSfilBE0lyzpW BUVhjWVFEqX4S2sQarhsVqnhECA6/whvgllM6lxrGMbbgcCK3xFt12nmX7RuXtJltW34 XFlw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fEL922Co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c26si1637072edx.353.2019.09.26.08.40.42; Thu, 26 Sep 2019 08:41:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fEL922Co; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727387AbfIZPgM (ORCPT + 99 others); Thu, 26 Sep 2019 11:36:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:56926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727374AbfIZPgM (ORCPT ); Thu, 26 Sep 2019 11:36:12 -0400 Received: from mail-qt1-f172.google.com (mail-qt1-f172.google.com [209.85.160.172]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6B53E21D56; Thu, 26 Sep 2019 15:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1569512170; bh=ncxPzpQz8BLxmfkZRs9G1Ix6IIyLzOR3M2H36B+FqsY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=fEL922CotjCRORMLKTbFZ4oOcDKY+QL4SzDHXhA20dsZO+6e1pGReHQw7W9/BbPZW rvz5PZOFelZpPB+HrQwBgBftjTE6vW81RXnexQz1jnGAjVpyutY8UX1YY8LO6hmFpk lFtpHbWHsHmu7cD8o8ucTCc1MDomh4AeENfIwoRc= Received: by mail-qt1-f172.google.com with SMTP id c21so3335207qtj.12; Thu, 26 Sep 2019 08:36:10 -0700 (PDT) X-Gm-Message-State: APjAAAWPYiBhxtFIHKKBN/e7D8qc0tsXzcYCVYSUGhN7DYAIVARLDZFV UU/W/qQCo656InJaVVlFW7dwKwxXsEXX2KkCLQ== X-Received: by 2002:ac8:6915:: with SMTP id e21mr4520639qtr.224.1569512169600; Thu, 26 Sep 2019 08:36:09 -0700 (PDT) MIME-Version: 1.0 References: <20190926125614.10408-1-m.szyprowski@samsung.com> <20190926140315.GA16002@pi3> <0d3831ae-e33d-774d-02f7-fba45a95d25c@samsung.com> In-Reply-To: <0d3831ae-e33d-774d-02f7-fba45a95d25c@samsung.com> From: Rob Herring Date: Thu, 26 Sep 2019 10:35:58 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] dt-bindings: gpu: Convert Samsung Image Scaler to dt-schema To: Maciej Falkowski Cc: Krzysztof Kozlowski , Marek Szyprowski , devicetree@vger.kernel.org, dri-devel , "linux-kernel@vger.kernel.org" , linux-samsung-soc , Mark Rutland , Inki Dae Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 26, 2019 at 9:47 AM Maciej Falkowski wrote: > > > On 9/26/19 4:03 PM, Krzysztof Kozlowski wrote: > > On Thu, Sep 26, 2019 at 02:56:14PM +0200, Marek Szyprowski wrote: > >> From: Maciej Falkowski > >> > >> Convert Samsung Image Scaler to newer dt-schema format. > >> > >> Signed-off-by: Maciej Falkowski > >> Signed-off-by: Marek Szyprowski > >> --- > >> v2: > >> - Removed quotation marks from string in 'compatible' property > >> - Added if-then statement for 'clocks' and 'clock-names' property > >> - Added include directive to example > >> - Added GIC_SPI macro to example > >> > >> Best regards, > >> Maciej Falkowski > >> --- > >> .../bindings/gpu/samsung-scaler.txt | 27 ------- > >> .../bindings/gpu/samsung-scaler.yaml | 71 +++++++++++++++++++ > >> 2 files changed, 71 insertions(+), 27 deletions(-) > >> delete mode 100644 Documentation/devicetree/bindings/gpu/samsung-scaler.txt > >> create mode 100644 Documentation/devicetree/bindings/gpu/samsung-scaler.yaml > >> > >> diff --git a/Documentation/devicetree/bindings/gpu/samsung-scaler.txt b/Documentation/devicetree/bindings/gpu/samsung-scaler.txt > >> deleted file mode 100644 > >> index 9c3d98105dfd..000000000000 > >> --- a/Documentation/devicetree/bindings/gpu/samsung-scaler.txt > >> +++ /dev/null > >> @@ -1,27 +0,0 @@ > >> -* Samsung Exynos Image Scaler > >> - > >> -Required properties: > >> - - compatible : value should be one of the following: > >> - (a) "samsung,exynos5420-scaler" for Scaler IP in Exynos5420 > >> - (b) "samsung,exynos5433-scaler" for Scaler IP in Exynos5433 > >> - > >> - - reg : Physical base address of the IP registers and length of memory > >> - mapped region. > >> - > >> - - interrupts : Interrupt specifier for scaler interrupt, according to format > >> - specific to interrupt parent. > >> - > >> - - clocks : Clock specifier for scaler clock, according to generic clock > >> - bindings. (See Documentation/devicetree/bindings/clock/exynos*.txt) > >> - > >> - - clock-names : Names of clocks. For exynos scaler, it should be "mscl" > >> - on 5420 and "pclk", "aclk" and "aclk_xiu" on 5433. > >> - > >> -Example: > >> - scaler@12800000 { > >> - compatible = "samsung,exynos5420-scaler"; > >> - reg = <0x12800000 0x1294>; > >> - interrupts = <0 220 IRQ_TYPE_LEVEL_HIGH>; > >> - clocks = <&clock CLK_MSCL0>; > >> - clock-names = "mscl"; > >> - }; > >> diff --git a/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml > >> new file mode 100644 > >> index 000000000000..af19930d052e > >> --- /dev/null > >> +++ b/Documentation/devicetree/bindings/gpu/samsung-scaler.yaml > >> @@ -0,0 +1,71 @@ > >> +# SPDX-License-Identifier: GPL-2.0 > >> +%YAML 1.2 > >> +--- > >> +$id: https://protect2.fireeye.com/url?k=1ffa720fd467d028.1ffbf940-9a5a550397b4da2b&u=http://devicetree.org/schemas/gpu/samsung-scaler.yaml# > >> +$schema: http://devicetree.org/meta-schemas/core.yaml# > >> + > >> +title: Samsung Exynos SoC Image Scaler > >> + > >> +maintainers: > >> + - Inki Dae > >> + > >> +properties: > >> + compatible: > >> + enum: > >> + - samsung,exynos5420-scaler > >> + - samsung,exynos5433-scaler > >> + > >> + reg: > >> + maxItems: 1 > >> + > >> + interrupts: > >> + maxItems: 1 > >> + > > Hi Krzysztof, Please work on your quoting. Reply below what you are replying to. > > By "Midgard" I assume that you referred to > 'Documentation/devicetree/bindings/gpu/arm,mali-midgard.yaml'. > > I think that 'clocks' and 'clock-names' properties before if statement > serve different purpose in this schema. > It totally has about 10 different compatibles grouped in five pairs. > Then schema declares for 'clocks' minItems as one and maxItems as two and > later it overrides this boundaries with if statement for particular > compatibles. It's not an override, but an AND. So what's under 'properties' has to be the looser constraints than what is under an if/then schema. > Well, then clearly, the purpose is to declare boundaries for all of > pairs and > not to provide easy-to-find definition for this properties. > > In my schema I directly set boundaries per compatible with single > if-else statement. > I didn't know what to put before then as if statement is already > self-explanatory. > > Best regards, > Maciej Falkowski > > > I am repeating myself... leave the clocks and clock-names. > > > > "I think it is worth to leave the clocks and clock-names here (could be > > empty or with min/max values for number of items). This makes it easy to > > find the properties by humans. I agree. Let me put it another way. You need to add an 'additionalProperties: false' and (I think) to make that work you'll need them listed here. Rob