From patchwork Fri Sep 20 00:09:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Packham X-Patchwork-Id: 1987607 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.a=rsa-sha256 header.s=mail181024 header.b=DJjaeQdW; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2604:1380:4601:e00::3; helo=am.mirrors.kernel.org; envelope-from=devicetree+bounces-104004-incoming-dt=patchwork.ozlabs.org@vger.kernel.org; receiver=patchwork.ozlabs.org) Received: from am.mirrors.kernel.org (am.mirrors.kernel.org [IPv6:2604:1380:4601:e00::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4X8t704xDqz1y2J for ; Fri, 20 Sep 2024 10:09:48 +1000 (AEST) 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4B9AA1F22CBB for ; Fri, 20 Sep 2024 00:09:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0273B33CA; Fri, 20 Sep 2024 00:09:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b="DJjaeQdW" X-Original-To: devicetree@vger.kernel.org Received: from gate2.alliedtelesis.co.nz (gate2.alliedtelesis.co.nz [202.36.163.20]) (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 541491388 for ; Fri, 20 Sep 2024 00:09:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.36.163.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726790978; cv=none; b=Gs3gX/Vqm2MFBfxFrh3CkWtco2QppN5R9UCZc5Uc8keFDG1i7QZ5KkUKPuy5T2UHmXYjCFAN6SkgCjk6XsE4zpK8hJ9+MjQd164t4HRbvmrYLnw3oqYc1CGO+SR3nEunteB2fxz9UXrC1JnxZHP55Q64r9SrlfwB/y2fhnWl9pY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726790978; c=relaxed/simple; bh=sn/FlAe2hCqNUqc1Pro3QgAj5R9aEYkp9m2CvWvYGc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sz2ZCMZPHiO4/BCA4x0DgnWKEz1wBPulhIZrXbfim9h3L3OHAhC6CtR/hVjcIdphZe47WzWhAFIgyM4aYlmEkHOipKbAE/cy2T53WU/y+CTufhko7bXmM6rC8XuBzW9Vp93L18Qk7DmVa8YAdvGM0TSMSSc4exGS8SSWkhbbBmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz; spf=pass smtp.mailfrom=alliedtelesis.co.nz; dkim=pass (2048-bit key) header.d=alliedtelesis.co.nz header.i=@alliedtelesis.co.nz header.b=DJjaeQdW; arc=none smtp.client-ip=202.36.163.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=alliedtelesis.co.nz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alliedtelesis.co.nz Received: from svr-chch-seg1.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 3516B2C0580; Fri, 20 Sep 2024 12:09:33 +1200 (NZST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1726790973; bh=2I2K6N0RsgC/T5TnR71VnjrUfzEdBRS8BBLiTkX7NOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DJjaeQdWb7yE8mjdpZLZ4sJkTqU1Ltb0YDM5Zs4030YEPAuaX+5l69kOkpnXjhlcA emhFnyJer+s0sa0JjpnQp9sumnaAUmURw0wsZGwHEiXDt+B+FwL+9Uw3RjjPh10OZa sGYkh1S/1PAeOoH/RbdXHEWH2/LOYvBGPTehtTbeBq5sgezowbQ6VLSFVGKxARGWVm FjeFDO9AIu9WHGYoNcpdiW/TWnMLTLIluCytfJHU2HDbpyMSMj2aDYhgtkHdI/j7oR CzPUyd+iPUVVWtzaFG/MUMX/PfKKAMqIDAyEWQib4tIH85v8RUgWhn8yUYG8W1dL0L TCNjTns+ZxKEw== Received: from pat.atlnz.lc (Not Verified[10.32.16.33]) by svr-chch-seg1.atlnz.lc with Trustwave SEG (v8,2,6,11305) id ; Fri, 20 Sep 2024 12:09:32 +1200 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.30]) by pat.atlnz.lc (Postfix) with ESMTP id CC54A13EE6D; Fri, 20 Sep 2024 12:09:32 +1200 (NZST) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id C766328044C; Fri, 20 Sep 2024 12:09:32 +1200 (NZST) From: Chris Packham To: andi.shyti@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, tsbogend@alpha.franken.de Cc: linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, Chris Packham Subject: [PATCH v2 1/3] dt-bindings: i2c: Add RTL9300 I2C controller Date: Fri, 20 Sep 2024 12:09:28 +1200 Message-ID: <20240920000930.1828086-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.46.1 In-Reply-To: <20240920000930.1828086-1-chris.packham@alliedtelesis.co.nz> References: <20240920000930.1828086-1-chris.packham@alliedtelesis.co.nz> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SEG-SpamProfiler-Analysis: v=2.4 cv=Id0kWnqa c=1 sm=1 tr=0 ts=66ecbd3c a=KLBiSEs5mFS1a/PbTCJxuA==:117 a=EaEq8P2WXUwA:10 a=gEfo2CItAAAA:8 a=NEAV23lmAAAA:8 a=VwQbUJbxAAAA:8 a=UgJECxHJAAAA:8 a=oDVXf_xxoK2ozSEg8_sA:9 a=3ZKOabzyN94A:10 a=sptkURWiP4Gy88Gu7hUp:22 a=-El7cUbtino8hM1DCn8D:22 X-SEG-SpamProfiler-Score: 0 x-atlnz-ls: pat Add dtschema for the I2C controller on the RTL9300 SoC. The I2C controllers on this SoC are part of the "switch" block which is represented here as a syscon node. The SCL pins are dependent on the I2C controller (GPIO8 for the first controller, GPIO 17 for the second). The SDA pins can be assigned to either one of the I2C controllers (but not both). Signed-off-by: Chris Packham --- Notes: Changes in v2: - Use reg property for controller registers - Remove global-control-offset (will be hard coded in driver) - Integrated the multiplexing function. Child nodes now represent the available SDA lines .../bindings/i2c/realtek,rtl9300-i2c.yaml | 82 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 88 insertions(+) create mode 100644 Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml diff --git a/Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml b/Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml new file mode 100644 index 000000000000..e8c37239b299 --- /dev/null +++ b/Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml @@ -0,0 +1,82 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/i2c/realtek,rtl9300-i2c.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Realtek RTL I2C Controller + +maintainers: + - Chris Packham + +description: + The RTL9300 SoC has two I2C controllers. Each of these has an SCL line (which + if not-used for SCL can be a GPIO). There are 8 common SDA lines that can be + assigned to either I2C controller. + +properties: + compatible: + const: realtek,rtl9300-i2c + + reg: + description: Register offset and size this I2C controller. + +patternProperties: + '^i2c@[0-7]$': + $ref: /schemas/i2c/i2c-controller.yaml + unevaluatedProperties: false + + properties: + reg: + description: The SDA pin associated with the I2C bus. + maxItems: 1 + + required: + - reg + +unevaluatedProperties: false + +required: + - compatible + - reg + +examples: + - | + switch@1b000000 { + compatible = "realtek,rtl9302c-switch", "syscon", "simple-mfd"; + reg = <0x1b000000 0x10000>; + #address-cells = <1>; + #size-cells = <1>; + + i2c@36c { + compatible = "realtek,rtl9300-i2c"; + reg = <0x36c 0x14>; + clock-frequency = <100000>; + #address-cells = <1>; + #size-cells = <0>; + + i2c@0 { + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + gpio@20 { + compatible = "nxp,pca9555"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20>; + }; + }; + + i2c@2 { + reg = <2>; + #address-cells = <1>; + #size-cells = <0>; + gpio@20 { + compatible = "nxp,pca9555"; + gpio-controller; + #gpio-cells = <2>; + reg = <0x20>; + }; + }; + }; + }; diff --git a/MAINTAINERS b/MAINTAINERS index f328373463b0..ccb1125444f4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -19887,6 +19887,12 @@ S: Maintained T: git https://github.com/pkshih/rtw.git F: drivers/net/wireless/realtek/rtl8xxxu/ +RTL9300 I2C DRIVER (rtl9300-i2c) +M: Chris Packham +L: linux-i2c@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/i2c/realtek,rtl9300-i2c.yaml + RTRS TRANSPORT DRIVERS M: Md. Haris Iqbal M: Jack Wang