From patchwork Wed Nov 10 19:49:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabien Parent X-Patchwork-Id: 12692197 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B55FBC433EF for ; Wed, 10 Nov 2021 19:51:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 89B916113E for ; Wed, 10 Nov 2021 19:51:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 89B916113E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=hI/4KGN1UhN7pJ+GaFdueyfkT9a1ubEkeB12UF/WRCw=; b=RUNhzMa6pWyzcG l11bdidm814PJxU2WVpim4y+QWn6sYvfAdnDcf0KAVbSNCHB+Km+zs7ziZwH+K8x60pqprs6WN9lo EqUlUG1QqzBj+3G2q6TxkQrmECX9KLbdVZhzu3JdLe7RB+1xj8tqYOuSWSQA1oYlso9nH7es2fK9g a3ohqTZ+2Z2tQhUyJjs0ePscrhl0L/eU5sOuDDGYV6hesZEAj1VBZhwiaN/LDaSNgDwzyBHlUJqMt wedwFN6jmgyGpGZX/lYSpv0BaiAx9Ls+evg/QjZ4wHrpu8HJArZqldRsyDQCC0qw0V5D7+4mIKEHG nhJOu6OVdCuD+SNp77GA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mktbz-006Cug-5P; Wed, 10 Nov 2021 19:50:23 +0000 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mktbs-006Cri-HQ for linux-arm-kernel@lists.infradead.org; Wed, 10 Nov 2021 19:50:18 +0000 Received: by mail-wr1-x431.google.com with SMTP id u1so5893722wru.13 for ; Wed, 10 Nov 2021 11:50:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=geLSRi4FCt+c/I7zdRe9IBFISJEgU+7yaWXyBuqJoC0=; b=AMC6DtiKrW4/kJuXCMqBXLO7d30/NDkVUgjoA3xt+8BDTPIkBASbs44NsB50hOfgdY wSrETvChMAyi7bBSePP6Vpzdu4PLQ7mpt4r67adfpEisJnhsFzn6xih+P9qzcgRzDSGS YhIg+UY8waGnEBKytlQxiRmTRkpq6hSYsiwNKBzp8t8VdhmNF4lIr9AZqOI2nlaua9BQ M9GQnrbHOtbkAcKehmnVtZ0fbBERNj2tCnWdgo/wbN3R2C4qqeA743+brPK8LOYm+2BU GwJcJneUJhJkC912U1neV887JwYzj4eB4kuYLxI9nTsYslD4IQMY/qN1qUWqb+Ak6oPx ifdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=geLSRi4FCt+c/I7zdRe9IBFISJEgU+7yaWXyBuqJoC0=; b=VkKyGVbuHb/kY6pnMKD04yaC4yy7p+soRF/Ig8lDmVVLAu7Nx5KezHSBhojauO9Twd 2U9MMfKpcWu7MatiaGDW3AKuL5zc1suIP8l7ivUkGCeT6IwJuxJFWnmmOFHifoGlL4vj bw4qdDm4tUrydM3jm492V8baJewQhgOtQnWOqDySHl2lWX3xTA8ZeORZgONBt3ymw4Y7 19i39JKxG2rZ8VWq1Uemky88yJkxeGAZcjHGNof2lFe8TDJFMXYdGsswxg5GjKH9Qk1N 9nWcDEDLZR9cgxGhP21xsCIUkUi4xq/2TWOTBokB296tjocA5LtC3feyQSmFqyfyI0BB fI/w== X-Gm-Message-State: AOAM530/m+ultimp+f+xXoBgIZrXp8U9inQ9NX2XiBLnjnVNrL7L5Ci+ MmqwciujKFtd71YzNkYHaESHgQ== X-Google-Smtp-Source: ABdhPJxhONkOR/1gFrmkF2ek8fxt5sSiYcS+5fvMHATAmxkVKqAjKFDEM6j4DBnNKFKTEfoZrwf5tQ== X-Received: by 2002:adf:d20e:: with SMTP id j14mr1926086wrh.220.1636573815138; Wed, 10 Nov 2021 11:50:15 -0800 (PST) Received: from localhost.localdomain ([88.160.162.107]) by smtp.gmail.com with ESMTPSA id k15sm750935wrx.53.2021.11.10.11.50.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 11:50:14 -0800 (PST) From: Fabien Parent To: Qii Wang , Rob Herring , Matthias Brugger Cc: 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 v3 1/4] dt-bindings: i2c: i2c-mt65xx: convert doc to yaml schema format Date: Wed, 10 Nov 2021 20:49:56 +0100 Message-Id: <20211110194959.20611-1-fparent@baylibre.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211110_115016_591767_E2CED5FB X-CRM114-Status: GOOD ( 21.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Convert the binding documentation for i2c-mt65xx driver to the YAML schema format. Signed-off-by: Fabien Parent --- v3: * rebased: added new compatible since last revision + added vbus-supply description * added clock-div description 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 | 51 --------- .../devicetree/bindings/i2c/i2c-mt65xx.yaml | 106 ++++++++++++++++++ 2 files changed, 106 insertions(+), 51 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 5ea216ae7084..000000000000 --- a/Documentation/devicetree/bindings/i2c/i2c-mt65xx.txt +++ /dev/null @@ -1,51 +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,mt8195-i2c", "mediatek,mt8192-i2c": for MediaTek MT8195 - "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. - - vbus-supply: phandle to the regulator that provides power to SCL/SDA. - -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..af0880fcc22b --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/i2c-mt65xx.yaml @@ -0,0 +1,106 @@ +# 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 + - items: + - enum: + - mediatek,mt8195-i2c + - const: mediatek,mt8192-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. + + vbus-supply: + $ref: /schemas/types.yaml#/definitions/phandle + description: phandle to the regulator that provides power to SCL/SDA. + + clock-div: + $ref: /schemas/types.yaml#/definitions/uint32 + description: Fixed frequency divider for I2C clock source. + minimum: 1 + +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"; + };