From patchwork Wed Sep 27 16:01:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 146827 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2a8e:b0:403:3b70:6f57 with SMTP id in14csp121431vqb; Fri, 29 Sep 2023 17:27:12 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGvDQRlZ2BZjoOPFpteEY6EHIObg/SC0Ih7LV7k6tVP+R/bbMgw1ez+AIbIupJ2QK8h+afx X-Received: by 2002:a17:902:e889:b0:1c6:33fe:257b with SMTP id w9-20020a170902e88900b001c633fe257bmr6521666plg.19.1696033632499; Fri, 29 Sep 2023 17:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696033632; cv=none; d=google.com; s=arc-20160816; b=Y3fcKuhYU3jD5QPdX+/vGJSWcDFJEmQ64AUYrHQooI3bHh3skXbXJLW4pH7eshoi+M /CktvipkqppnwrcIaiFA3TXDFL0kmZKgPr14VkyXZUuOYknRaNXY3brt/8S0rNY9hQdV IyVLNH13MFGDE6bX3on6ShCRJ2Asbk2QVUdUgBY3awAxAe3WuqidSj671s+Q5mBbJDpY Ddzwkn3q6S09HHgOO/iGxMOsB/gNe7XhsMH0RVXzT8yRbmNSUDEcNPbt/4ey9bUdq3fM B2CnNQMPM1So3Gq06juuEKsf1n8+clbzP7fa2kFL34/N/3/P9WmqNNRzXPFNokw7iIpU mWAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=4cDaJORQqzyKHAyA2iGq/8fh2mCcULmschKPUjYldMA=; fh=VMCZnIQaCU4pkoBwVmskDKaTUsCNxL1ek+dzim0+uzY=; b=vwh6rxPDA19/7WantT2xc+BgBRXLHF4xY8dNEeDx4+c0kFvI2TLrH0miJScoeUAe+p N3LNc5m1ttBFjxKBONTggwOME7/NX9IweDA23GMuFOmkfsBHGrWw7ANlogPBA2g1OMFd GDpyF2n2P/AEiGIk3wzgiL+BIMZdW+b8Ka2MwC4rC7OuVyBuRQh/sZRwX/ayL6HIF0MZ uICRbVLOa9Az1s6Lfi1v9mQpILWmhseIqbdy6spdjo2WILdvYkLKGUHn3N9LUfYx4ebx wvnse0w5wbKwblxJ31wen1BVIUIeCTBaxk70s/klmIvbqCCv0KR0+6qh6VJMhEgFEg3r l5kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b="U9Wi/8v/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z8-20020a1709027e8800b001ae40e07fb0si16194913pla.216.2023.09.29.17.27.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 17:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b="U9Wi/8v/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 963F5815D7D8; Wed, 27 Sep 2023 09:15:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231501AbjI0QPK (ORCPT + 19 others); Wed, 27 Sep 2023 12:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbjI0QPG (ORCPT ); Wed, 27 Sep 2023 12:15:06 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98713DE; Wed, 27 Sep 2023 09:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=4cDaJORQqzyKHAyA2iGq/8fh2mCcULmschKPUjYldMA=; b=U9Wi/8v/cYxNUFukrzHejf7iR7 Ed2IZpGNlTQ5Dvq5Jb9oB9YbJ2hh73HZLGu8Ee3JCc3FG09UG1z9XGvVJgcGvHihsxzRdDoITyh+K 5cpTMW7ldrpj5bctXPua4gI5iITPr6nvPbN1jLtFpsq/GV/3dFRAfeXbO8zUXn4STUhM=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:44078 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qlXBl-0000D9-GY; Wed, 27 Sep 2023 12:15:02 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, hugo@hugovil.com Date: Wed, 27 Sep 2023 12:01:52 -0400 Message-Id: <20230927160153.2717788-2-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230927160153.2717788-1-hugo@hugovil.com> References: <20230927160153.2717788-1-hugo@hugovil.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v2 1/2] serial: sc16is7xx: use device_property APIs when configuring irda mode X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:15:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778420162161368513 X-GMAIL-MSGID: 1778420162161368513 From: Hugo Villeneuve Convert driver to be property provider agnostic and allow it to be used on non-OF platforms. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 34 ++++++++++++++++++++++++---------- 1 file changed, 24 insertions(+), 10 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 1fe2c3e08a35..db2bb1c0d36c 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1408,6 +1408,29 @@ static int sc16is7xx_setup_gpio_chip(struct sc16is7xx_port *s) } #endif +static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s) +{ + int i; + int ret; + int count; + u32 irda_port[2]; + struct device *dev = s->p[0].port.dev; + + count = device_property_count_u32(dev, "irda-mode-ports"); + if (count < 0 || count > ARRAY_SIZE(irda_port)) + return; + + ret = device_property_read_u32_array(dev, "irda-mode-ports", + irda_port, count); + if (ret) + return; + + for (i = 0; i < count; i++) { + if (irda_port[i] < s->devtype->nr_uart) + s->p[irda_port[i]].irda_mode = true; + } +} + /* * Configure ports designated to operate as modem control lines. */ @@ -1590,16 +1613,7 @@ static int sc16is7xx_probe(struct device *dev, sc16is7xx_power(&s->p[i].port, 0); } - if (dev->of_node) { - struct property *prop; - const __be32 *p; - u32 u; - - of_property_for_each_u32(dev->of_node, "irda-mode-ports", - prop, p, u) - if (u < devtype->nr_uart) - s->p[u].irda_mode = true; - } + sc16is7xx_setup_irda_ports(s); ret = sc16is7xx_setup_mctrl_ports(s); if (ret) From patchwork Wed Sep 27 16:01:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 145510 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp2806757vqu; Wed, 27 Sep 2023 11:06:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHh37kRuNra/c7V+tj2fHiefmLyurgpmqeK4cS4/KkFES+OK9JpihCSc5kjOSNm6+ooeU4h X-Received: by 2002:a05:6a00:21cd:b0:690:38b6:b2da with SMTP id t13-20020a056a0021cd00b0069038b6b2damr3174845pfj.2.1695838011683; Wed, 27 Sep 2023 11:06:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695838011; cv=none; d=google.com; s=arc-20160816; b=wmrPuNKonpAFkb09Tz99kvNda/7UJhEBKJJA5PZe/mW5xvCAj7fVGmIAjVaBXgD2me R2cGAw4pHV/Gjv/4FDCMYoaaval2PszEUQg4qrsG7I4bKhcOYhbvMWpmSDqfBgESV8mW 9tNRc06T9lID8AfRAwK2iiNW3uUw6jBmSsoEy4juDl8UIfjhQCqs9u2DSB1y9VebMR/n 49I8pZzAmPzAvKjFOwmViWrubb4HaeLaPkwAO/5M3GvDt1iy+hZlup9j+4e3F9wwr1wu ZPO2BRB/hg9NR+ZYFwB4nOIyA7QxZrm8DTaws95UHo97dE0ogbmKtG+MY4zSabWI4wVf poYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:cc:to:from:dkim-signature; bh=WEQHfgnExjZcMFX7/4rPy/vITO3bNV2kr7ah2WIb+8k=; fh=VMCZnIQaCU4pkoBwVmskDKaTUsCNxL1ek+dzim0+uzY=; b=SThZTaCe9k6tKXIgdfo7UWoa4Y73L9uvUj9+NHqPh/XoJVhlCrb8QAlQRyJAZ37NqT iDmcRsJBKcFBJk2qpKr6MCi+ZKKMZQYGmFCYf8yb5AcYpxxff8cWFUP7nJeHhx0cdIGo 3jtWXMVPI2c4Zk0ZpjOrGcFWwu+y1IyGwl3UWgf3Kmv+7Z2C/Mnb+7S5UHs8yhCG0dqX LW6wdNzncPC1edCJJcqfMKvWYX1ruj25cNg1NqHblcBMbqNEwkxOfaas+IhFAcIzDPuY 5H1Kj/QwgS6Q0/o5v/2EhqZQ38fqX5d2VL+RmKVgTghJLXc+IL92smrPcvUkpKM8x3ki hUXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=qN4pfVIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id bv9-20020a632e09000000b00578b93b1b26si16197799pgb.544.2023.09.27.11.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 11:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=qN4pfVIH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9E6AD8040EF0; Wed, 27 Sep 2023 09:15:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231331AbjI0QPQ (ORCPT + 19 others); Wed, 27 Sep 2023 12:15:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231473AbjI0QPJ (ORCPT ); Wed, 27 Sep 2023 12:15:09 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1E8291; Wed, 27 Sep 2023 09:15:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=hugovil.com ; s=x; h=Subject:Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Cc:To :From:subject:date:message-id:reply-to; bh=WEQHfgnExjZcMFX7/4rPy/vITO3bNV2kr7ah2WIb+8k=; b=qN4pfVIHN7giJ/TdLwun4ln9wU iTPfh0Cv7CDRIZNEFdWcmS9W8bDgnnGgnK4GUhCwNS0QZTPUhMppgtkwUd/9EmC/AQJHywL0Rm8IM nudU4SD1f7kA23n2MUSpD9VsMpT+jSZ8c6+mgRgcwilK7oGXW40MltAZfsCSbIIuE3xc=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:44078 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qlXBn-0000D9-De; Wed, 27 Sep 2023 12:15:04 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, hugo@hugovil.com Date: Wed, 27 Sep 2023 12:01:53 -0400 Message-Id: <20230927160153.2717788-3-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230927160153.2717788-1-hugo@hugovil.com> References: <20230927160153.2717788-1-hugo@hugovil.com> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v2 2/2] dt-bindings: sc16is7xx: convert to YAML X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 27 Sep 2023 09:15:24 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778215039007451271 X-GMAIL-MSGID: 1778215039007451271 From: Hugo Villeneuve Convert binding from text format to YAML. Additions to original text binding: - add rs485 reference. Signed-off-by: Hugo Villeneuve Reviewed-by: Rob Herring --- .../bindings/serial/nxp,sc16is7xx.txt | 118 ---------------- .../bindings/serial/nxp,sc16is7xx.yaml | 127 ++++++++++++++++++ 2 files changed, 127 insertions(+), 118 deletions(-) delete mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt create mode 100644 Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt deleted file mode 100644 index 1a7e4bff0456..000000000000 --- a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt +++ /dev/null @@ -1,118 +0,0 @@ -* NXP SC16IS7xx advanced Universal Asynchronous Receiver-Transmitter (UART) -* i2c as bus - -Required properties: -- compatible: Should be one of the following: - - "nxp,sc16is740" for NXP SC16IS740, - - "nxp,sc16is741" for NXP SC16IS741, - - "nxp,sc16is750" for NXP SC16IS750, - - "nxp,sc16is752" for NXP SC16IS752, - - "nxp,sc16is760" for NXP SC16IS760, - - "nxp,sc16is762" for NXP SC16IS762. -- reg: I2C address of the SC16IS7xx device. -- interrupts: Should contain the UART interrupt -- clocks: Reference to the IC source clock. - OR (when there is no clock provider visible to the platform) -- clock-frequency: The source clock frequency for the IC. - -Optional properties: -- gpio-controller: Marks the device node as a GPIO controller. -- #gpio-cells: Should be two. The first cell is the GPIO number and - the second cell is used to specify the GPIO polarity: - 0 = active high, - 1 = active low. -- irda-mode-ports: An array that lists the indices of the port that - should operate in IrDA mode. -- nxp,modem-control-line-ports: An array that lists the indices of the port that - should have shared GPIO lines configured as - modem control lines. - -Example: - sc16is750: sc16is750@51 { - compatible = "nxp,sc16is750"; - reg = <0x51>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells = <2>; - }; - - sc16is752: sc16is752@53 { - compatible = "nxp,sc16is752"; - reg = <0x53>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */ - gpio-controller; /* Port 0 as GPIOs */ - #gpio-cells = <2>; - }; - - sc16is752: sc16is752@54 { - compatible = "nxp,sc16is752"; - reg = <0x54>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */ - }; - -* spi as bus - -Required properties: -- compatible: Should be one of the following: - - "nxp,sc16is740" for NXP SC16IS740, - - "nxp,sc16is741" for NXP SC16IS741, - - "nxp,sc16is750" for NXP SC16IS750, - - "nxp,sc16is752" for NXP SC16IS752, - - "nxp,sc16is760" for NXP SC16IS760, - - "nxp,sc16is762" for NXP SC16IS762. -- reg: SPI chip select number. -- interrupts: Specifies the interrupt source of the parent interrupt - controller. The format of the interrupt specifier depends on the - parent interrupt controller. -- clocks: phandle to the IC source clock. - -Optional properties: -- gpio-controller: Marks the device node as a GPIO controller. -- #gpio-cells: Should be two. The first cell is the GPIO number and - the second cell is used to specify the GPIO polarity: - 0 = active high, - 1 = active low. -- irda-mode-ports: An array that lists the indices of the port that - should operate in IrDA mode. -- nxp,modem-control-line-ports: An array that lists the indices of the port that - should have shared GPIO lines configured as - modem control lines. - -Example: - sc16is750: sc16is750@0 { - compatible = "nxp,sc16is750"; - reg = <0>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells = <2>; - }; - - sc16is752: sc16is752@1 { - compatible = "nxp,sc16is752"; - reg = <1>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */ - gpio-controller; /* Port 0 as GPIOs */ - #gpio-cells = <2>; - }; - - sc16is752: sc16is752@2 { - compatible = "nxp,sc16is752"; - reg = <2>; - clocks = <&clk20m>; - interrupt-parent = <&gpio3>; - interrupts = <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */ - }; diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml new file mode 100644 index 000000000000..207dae3d0ffa --- /dev/null +++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml @@ -0,0 +1,127 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/serial/nxp,sc16is7xx.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP SC16IS7xx Advanced Universal Asynchronous Receiver-Transmitter (UART) + +maintainers: + - Hugo Villeneuve + +properties: + compatible: + enum: + - nxp,sc16is740 + - nxp,sc16is741 + - nxp,sc16is750 + - nxp,sc16is752 + - nxp,sc16is760 + - nxp,sc16is762 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + clocks: + maxItems: 1 + + clock-frequency: + description: + When there is no clock provider visible to the platform, this + is the source crystal or external clock frequency for the IC in Hz. + minimum: 1 + maximum: 80000000 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio-line-names: + minItems: 1 + maxItems: 8 + + irda-mode-ports: + description: | + An array that lists the indices of the port that should operate in IrDA + mode: + 0: port A + 1: port B + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 2 + items: + minimum: 0 + maximum: 1 + + nxp,modem-control-line-ports: + description: | + An array that lists the indices of the port that should have shared GPIO + lines configured as modem control lines: + 0: port A + 1: port B + $ref: /schemas/types.yaml#/definitions/uint32-array + minItems: 1 + maxItems: 2 + items: + minimum: 0 + maximum: 1 + +allOf: + - $ref: /schemas/spi/spi-peripheral-props.yaml# + - $ref: /schemas/serial/serial.yaml# + - $ref: /schemas/serial/rs485.yaml# + +required: + - compatible + - reg + - interrupts + +oneOf: + - required: + - clocks + - required: + - clock-frequency + +unevaluatedProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + serial@51 { + compatible = "nxp,sc16is750"; + reg = <0x51>; + clocks = <&clk20m>; + interrupt-parent = <&gpio3>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells = <2>; + }; + + serial@53 { + compatible = "nxp,sc16is752"; + reg = <0x53>; + clocks = <&clk20m>; + interrupt-parent = <&gpio3>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + nxp,modem-control-line-ports = <1>; /* Port 1 as modem control lines */ + gpio-controller; /* Port 0 as GPIOs */ + #gpio-cells = <2>; + }; + + serial@54 { + compatible = "nxp,sc16is752"; + reg = <0x54>; + clocks = <&clk20m>; + interrupt-parent = <&gpio3>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + nxp,modem-control-line-ports = <0 1>; /* Ports 0 and 1 as modem control lines */ + }; + };