Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp900763lqt; Fri, 19 Apr 2024 14:09:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4OmCehLJxeJ5R2I4APuEc6jgf66C26V5V+MP9hMYObnFT7fkor1rqgH+XZgLiZ3tRXH6wso7aP4vjyaFpafQrmo0u5uLE97jeTP83kA== X-Google-Smtp-Source: AGHT+IHcVW9AX+zbQOCuhVpehmFRdlO8vi3886UePCyizT1YqV4dCxyPtmormqX4oKPJN/U1c7Ay X-Received: by 2002:a17:90a:d716:b0:2a7:a775:f537 with SMTP id y22-20020a17090ad71600b002a7a775f537mr3219703pju.46.1713560998814; Fri, 19 Apr 2024 14:09:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713560998; cv=pass; d=google.com; s=arc-20160816; b=RxnflqT/Y4CPKt7ShxSrd0oTUuLoOQ4Ulupa3nP3RqI2gm6JsZR71ApPBLQke4QRC9 xJaMZ/2c3kRwL6hKp0viyrPj0L8pzEfeaaH/kaT/Rf0qCWsahsfVDAJW/YfNIVMvXLaX KP4PthurSFmyvHFy03FDmc181mSnMleVCyG2zYYzpK+NKB7sOPly+M+XjKhHg28GaEv8 tuzArRvWNEpSVDr2PbSDfW/7v5jtVjsZz8WzcD2gS4QImxatWCAopu5ncyNsBB4s8GIt KmZjLDD9a7LKXx9x9gM9o7M8ORGnyHBMc2HieqWNsvoa6TIMLQn/us+nqKsuEoyPq0DU +UNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=RfFUndXPjRL/ri9QigddlSDBpYWV6cBuaTvLfxZDoYI=; fh=qkMyw0YA8iNImvxfeFfFpeYJpP9B60rSfvZ6deK1bSc=; b=JYPJOmaU9S03sIZvbDEtOtfMoFe2baoYMeszKzLAZfAm2XEAEmYgxc9BKpDBL2qrxN 8m8F7jaja0I5s9dQ1WqcUHLzLjK6Hq9acef49VT8lJ6+01kXOO9iliXWsAlaspIdVQSR 8Le5rJ1Lj+MAkE497bky7BfF+pqVujAe1T0X1y8Wq2abzOtnyv6hiN9W3GOfs0v1/eR/ Kq+Y7iX49CvLeMwux/UE+YSodEXjUGBS6V+6xgW9u+irqHwYgB4x2Vr/ASnu0sWmfhO9 ng2qmO+ppSGAvJjrVMfCSEx4AVFU9dOa6dhkFGHLg+gHW8tGfde1i4a+IS+oV13ClBsv gxWQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JnxsxPzy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151954-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s2-20020a17090a698200b002a28be9e69fsi3869055pjj.130.2024.04.19.14.09.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 14:09:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151954-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=JnxsxPzy; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151954-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5D49C282E72 for ; Fri, 19 Apr 2024 21:09:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 34C4A2E84F; Fri, 19 Apr 2024 21:09:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JnxsxPzy" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55A2610961; Fri, 19 Apr 2024 21:09:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713560991; cv=none; b=hqIajs5jvZw593ZMvpdH9+wnHMVbRem59qh4LVMIL3YnX2E+4lS3YtypCL6rfRygxaIEmCRKNnXAELkAha7ZYLgRhwmvbi261ZGHsidWONspraatMZGFevbk6gLQ1+b+eZo3BEuMPYOB2wAK/LnYr9XCgVHldh3ljhnhJTdKJJg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713560991; c=relaxed/simple; bh=GCzclxZJWdtU2QJtBJyOMVjTATOp6d+Ec7EbDgAUeng=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=afW0qt+B9KhBHlJM9k+3UaUSmBwISUGT0Hy7hz13No6zWfk47w8kY/KvXR7ebVtC7z1Fhyr8Fot1oIomKNhKyKDxHfYAs3iTMRYkqdznwEw4luhPWeR4pFGxuv3Sze/ID2ymABw8q9Z6lvwZaRrG71DFRLCq3dIwgRG768aES7U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JnxsxPzy; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 06124C072AA; Fri, 19 Apr 2024 21:09:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713560991; bh=GCzclxZJWdtU2QJtBJyOMVjTATOp6d+Ec7EbDgAUeng=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=JnxsxPzyZ3dJPAKcq4cF9uOQE/sl9utZo26jG/Tit6BcMQr/AoTwWES+NDFgkZ0ig bMOAXacUhQTihh1hMipxDINNet9tJ8CyN1DgJUP+XUpDg4tx2iIRWcxyDz/g/Go3NX 6AT0JLKPySKUVymiIRPe/lo3vBGoxUhzDkTMifzQg6C1aXQaLbfYolqqHxyMc0pLcv 1PH/9JldpM1li2/p5BzW04N769oWuCTHxq9da/3YzoB7EnhW+dQPMX1eEbz/C7wsPW j3OKmLtmOq0pVUzuLLi6muprtTBxHwjNYT03uUNMLUVi/juEf/Fal9aGggmVolwg47 r/7sq/pLYhD8w== Date: Fri, 19 Apr 2024 16:09:49 -0500 From: Rob Herring To: Jan Dakinevich Cc: Neil Armstrong , Jerome Brunet , Michael Turquette , Stephen Boyd , Krzysztof Kozlowski , Conor Dooley , Kevin Hilman , Martin Blumenstingl , Philipp Zabel , Jiucheng Xu , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [RFC PATCH v3 4/6] dt-bindings: clock: meson: document A1 SoC audio clock controller driver Message-ID: <20240419210949.GA3979121-robh@kernel.org> References: <20240419125812.983409-1-jan.dakinevich@salutedevices.com> <20240419125812.983409-5-jan.dakinevich@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240419125812.983409-5-jan.dakinevich@salutedevices.com> On Fri, Apr 19, 2024 at 03:58:10PM +0300, Jan Dakinevich wrote: > Add device tree bindings for A1 SoC audio clock and reset controllers. > > Signed-off-by: Jan Dakinevich > --- > > This controller has 6 mandatory and up to 20 optional clocks. To describe > this, I use 'additionalItems'. It produces correct processed-schema.json: > > "clock-names": { > "maxItems": 26, > "items": [ > { > "const": "pclk" > }, > { > "const": "dds_in" > }, > { > "const": "fclk_div2" > }, > { > "const": "fclk_div3" > }, > { > "const": "hifi_pll" > }, > { > "const": "xtal" > } > ], > "additionalItems": { > "oneOf": [ > { > "pattern": "^slv_sclk[0-9]$" > }, > { > "pattern": "^slv_lrclk[0-9]$" > } > ] > }, > "type": "array", > "minItems": 6 > }, > > and it behaves as expected. However, the checking is followed by > complaints like this: > > Documentation/devicetree/bindings/clock/amlogic,a1-audio-clkc.yaml: properties:clock-names:additionalItems: {'oneOf': [{'pattern': '^slv_sclk[0-9]$'}, {'pattern': '^slv_lrclk[0-9]$'}]} is not of type 'boolean' > > And indeed, 'additionalItems' has boolean type in meta-schema. So, how to > do it right? The meta-schemas are written both to prevent nonsense that json-schema allows by default (e.g additionalitems (wrong case)) and constraints to follow the patterns we expect. I'm happy to loosen the latter case if there's really a need. Generally, most bindings shouldn't be using 'additionalItems' at all as all entries should be defined, but there's a few exceptions. Here, the only reasoning I see is 26 entries is a lot to write out, but that wouldn't really justify it. As Krzysztof pointed out, you either have the clocks in the h/w or you don't, so saying they are variable is suspect. Rob