Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp100097pxj; Thu, 20 May 2021 05:26:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC+QDLMoqOiY0Y+P2CsefZ6BUIA12377DK8u+1SeUlBw8amtNzs+5uk7giqJrJdTUYJsxs X-Received: by 2002:a17:907:1c0f:: with SMTP id nc15mr4545745ejc.27.1621513592997; Thu, 20 May 2021 05:26:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621513592; cv=none; d=google.com; s=arc-20160816; b=zr266uLHr2R21a3hRrbdHFe/ouLY6paSYVi3ovqZPt6i3VmbU3F4q+q4U/XEI83pk6 LQPlXCkXxZibwgHJqzgqThaswOWbeBzUnNl8w3Ct5STyymC4qUiFGTzT9RGodH+Z22le Wd5uzIQbdHL8JGmGeXLwStbAPFNy5CgY0Nghn7AUEDIq33hEb7juSyHOGUHZbIcVuyA/ pWAN1T02ct3dyGpbwobtTe59N9ISNKFaWTRdHm92RqLkVJGpqD6lBOa+en073DwzQwoE va8RlmByb9ieRwlHq6qlSWKpaAvHGhaI5WyCGCariU9SouS0LCr15r39zP4YHtGs2dA7 Svwg== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=hkbd3ZNvjGsOfD3AtfBISF0Ql1q34vUavLh2tmeeXiY=; b=jOpRv9YlPb4Ya0V2uqWz9Ot2cFvatNlsocEIlP9/l12JuZOyzpsgq14019lm+aZNeX 1Nl9fEYSvu/hNbVFYkX4CTjmCK0sKPlXM64WYvy+UPDP2a1sIb0Xn7wFy7QRoGyd3ucg JGcEpfrmIKf1IYz3P1A/usSymX/NdRvfqYYUZ7LNy0MG0KpizYCDdJt8aNHiKDc9mZuL L3iZFluSPwyRTpDndphleGp2NI3y+HK8rYl58SBJvNJadHmifjYnWfJH6MBqL4eP9Xy5 Yr8kCXLD9pjLQgeL6iRrpcyULEU2ASMhH61Nyfrf4dusAh1zlk5mej1p+YXuSc55Ot6P FWuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AbuR8D31; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx12si2274481edb.17.2021.05.20.05.26.09; Thu, 20 May 2021 05:26:32 -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; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=AbuR8D31; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233265AbhETMZV (ORCPT + 99 others); Thu, 20 May 2021 08:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232253AbhETMZP (ORCPT ); Thu, 20 May 2021 08:25:15 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8997EC0438C7 for ; Thu, 20 May 2021 04:21:10 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id u4-20020a05600c00c4b02901774b80945cso5177434wmm.3 for ; Thu, 20 May 2021 04:21:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hkbd3ZNvjGsOfD3AtfBISF0Ql1q34vUavLh2tmeeXiY=; b=AbuR8D31D0aEydN9/qBTqKVe762diEtY52hlBCNUqPOBMR1/4MruCFDWdmypmSvYlx mjXBc56vIghamZhnPYqYkTblnJmeGyYXEk5+zM013Cniioh2svZjE2a2Yg+gdNhJ2Gkw AFueyd3oABPgMAPqKW/B2RRrPWpi2h8J3fG56vYLjllgEPoi+2Su3aO5I8pAjTvHHXUn h/b9OQXH4XgRx3C0+rHXKlB4hIKGzl9i8K5VYNVoovqKM9eLUAabQaSuzmmXg5g8JIRT orAeQgRTIg6ATo/vZX4mwx9kHLmUs6yx2R1qkzKvs3uy3NR3B6oFy5p0dhR1BVxTHxNc 1HhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=hkbd3ZNvjGsOfD3AtfBISF0Ql1q34vUavLh2tmeeXiY=; b=RPpBCOxHtWLkroG1MntxBBQgyW4U8xtkVus1YKCfLbefsvc+b4uyRKuNq13LyxJ62Q h03DAC+uMWh/9ceimRvqwMuaPYO20aMlg2o8LDXgUzVTr7TthbXx10ACrzeF844uEw72 qwfTrmjDcZOyg/tRcx5pD+IQBvEHqEiwNU9osoGrQY3tXhh1rxjR9AQC3QaqPkO/gVEe z+5vnjZYhruv44/L4nv3eeCRE1W/p5Q5qE5ZhVB31fbXad5G4DDQY77DuGnr8cZJp6G4 B1+uc3Eb+/cYjhgeeKF0X+KyKSYruX2IQ/7p4Mc9n9vaaqPLygzGp/AYXr1YiCSvGyip B5rA== X-Gm-Message-State: AOAM5335gMulIUNaPs8OYPunHi5Sxn+yvx5e/w/Glngd1qmW5JqVI/ZM bL4VKd8Fb/v6WUy1QoV5TzN3PQ== X-Received: by 2002:a7b:c24a:: with SMTP id b10mr3511825wmj.157.1621509669146; Thu, 20 May 2021 04:21:09 -0700 (PDT) Received: from localhost.localdomain ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id o11sm2756646wrq.93.2021.05.20.04.21.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 May 2021 04:21:08 -0700 (PDT) From: Fabien Parent To: Qii Wang , Rob Herring , Matthias Brugger Cc: mkorpershoek@baylibre.com, Fabien Parent , linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/4] dt-bindings: i2c: i2c-mt65xx: convert doc to yaml schema format Date: Thu, 20 May 2021 13:21:02 +0200 Message-Id: <20210520112106.77190-1-fparent@baylibre.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Convert the binding documentation for i2c-mt65xx driver to the YAML schema format. Signed-off-by: Fabien Parent --- v2: * write compatibles in a more compact way * set the node pattern to be "^i2c@[0-9a-f]+$" instead of "^i2c[0-9]*@[0-9a-f]+"$ .../devicetree/bindings/i2c/i2c-mt65xx.txt | 49 ---------- .../devicetree/bindings/i2c/i2c-mt65xx.yaml | 93 +++++++++++++++++++ 2 files changed, 93 insertions(+), 49 deletions(-) delete mode 100644 Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt create mode 100644 Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt deleted file mode 100644 index 7f0194fdd0cc..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt +++ /dev/null @@ -1,49 +0,0 @@ -* MediaTek's I2C controller - -The MediaTek's I2C controller is used to interface with I2C devices. - -Required properties: - - compatible: value should be either of the following. - "mediatek,mt2701-i2c", "mediatek,mt6577-i2c": for MediaTek MT2701 - "mediatek,mt2712-i2c": for MediaTek MT2712 - "mediatek,mt6577-i2c": for MediaTek MT6577 - "mediatek,mt6589-i2c": for MediaTek MT6589 - "mediatek,mt6797-i2c", "mediatek,mt6577-i2c": for MediaTek MT6797 - "mediatek,mt7622-i2c": for MediaTek MT7622 - "mediatek,mt7623-i2c", "mediatek,mt6577-i2c": for MediaTek MT7623 - "mediatek,mt7629-i2c", "mediatek,mt2712-i2c": for MediaTek MT7629 - "mediatek,mt8173-i2c": for MediaTek MT8173 - "mediatek,mt8183-i2c": for MediaTek MT8183 - "mediatek,mt8192-i2c": for MediaTek MT8192 - "mediatek,mt8516-i2c", "mediatek,mt2712-i2c": for MediaTek MT8516 - - reg: physical base address of the controller and dma base, length of memory - mapped region. - - interrupts: interrupt number to the cpu. - - clock-div: the fixed value for frequency divider of clock source in i2c - module. Each IC may be different. - - clocks: clock name from clock manager - - clock-names: Must include "main" and "dma", "arb" is for multi-master that - one bus has more than two i2c controllers, if enable have-pmic need include - "pmic" extra. - -Optional properties: - - clock-frequency: Frequency in Hz of the bus when transfer, the default value - is 100000. - - mediatek,have-pmic: platform can control i2c form special pmic side. - Only mt6589 and mt8135 support this feature. - - mediatek,use-push-pull: IO config use push-pull mode. - -Example: - - i2c0: i2c@1100d000 { - compatible = "mediatek,mt6577-i2c"; - reg = <0x1100d000 0x70>, - <0x11000300 0x80>; - interrupts = ; - clock-frequency = <400000>; - mediatek,have-pmic; - clock-div = <16>; - clocks = <&i2c0_ck>, <&ap_dma_ck>; - clock-names = "main", "dma"; - }; - diff --git a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml new file mode 100644 index 000000000000..41cedb4930de --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml @@ -0,0 +1,93 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: "http://devicetree.org/schemas/i2c/i2c-mt65xx.yaml#" +$schema: "http://devicetree.org/meta-schemas/core.yaml#" + +title: MediaTek I2C Controller + +maintainers: + - Qii Wang + - Matthias Brugger + +allOf: + - $ref: /schemas/i2c/i2c-controller.yaml# + +properties: + $nodename: + pattern: "^i2c@[0-9a-f]+$" + + compatible: + oneOf: + - enum: + - mediatek,mt2712-i2c + - mediatek,mt6577-i2c + - mediatek,mt6589-i2c + - mediatek,mt7622-i2c + - mediatek,mt8173-i2c + - mediatek,mt8183-i2c + - mediatek,mt8192-i2c + - items: + - enum: + - mediatek,mt2701-i2c + - mediatek,mt6797-i2c + - mediatek,mt7623-i2c + - const: mediatek,mt6577-i2c + - items: + - enum: + - mediatek,mt7629-i2c + - mediatek,mt8516-i2c + - const: mediatek,mt2712-i2c + + clocks: + minItems: 2 + maxItems: 4 + items: + - description: Controller clock + - description: DMA clock + - description: ARB clock for multi-master when a bus has more than + one i2c controllers + - description: PMIC clock. Only when mediatek,have-pmic is set. + + clock-names: + minItems: 2 + maxItems: 4 + items: + - const: main + - const: dma + - const: arb + - const: pmic + + mediatek,have-pmic: + $ref: /schemas/types.yaml#/definitions/flag + description: Platform can control I2C from the PMIC + + mediatek,use-push-pull: + $ref: /schemas/types.yaml#/definitions/flag + description: IO config use push-pull mode. + +required: + - compatible + - reg + - interrupts + - clocks + - clock-names + - clock-div + +unevaluatedProperties: false + +examples: + - | + #include + #include + i2c0: i2c@1100d000 { + compatible = "mediatek,mt6577-i2c"; + reg = <0x1100d000 0x70>, + <0x11000300 0x80>; + interrupts = ; + clock-frequency = <400000>; + mediatek,have-pmic; + clock-div = <16>; + clocks = <&i2c0_ck>, <&ap_dma_ck>; + clock-names = "main", "dma"; + }; -- 2.31.1