From nobody Fri Feb 13 19:29:36 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D0C5C00523 for ; Wed, 20 Sep 2023 15:20:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235427AbjITPUh (ORCPT ); Wed, 20 Sep 2023 11:20:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235214AbjITPUa (ORCPT ); Wed, 20 Sep 2023 11:20:30 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2EA4C6; Wed, 20 Sep 2023 08:20:21 -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=JrabJf9llWfHLeamA3PsNvq9Xx gQa81MX+dh1TZyATBqt26AVVzjJ6MkhWxpzXJXi0EJBi4HCcqGv/ywJ7T97ksk9NvqDAKZI1NKVEV qoRSUug7PYdp1U75hbQG2uGH8bJuSTQj+VoCdLar6buIhnvonqthxLr90/fT6136ORWY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:43190 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qiyzy-0008Co-Af; Wed, 20 Sep 2023 11:20:18 -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, 20 Sep 2023 11:20:12 -0400 Message-Id: <20230920152015.1376838-2-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230920152015.1376838-1-hugo@hugovil.com> References: <20230920152015.1376838-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH 1/4] 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 Content-Type: text/plain; charset="utf-8" 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 sc16is7x= x_port *s) } #endif =20 +static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s) +{ + int i; + int ret; + int count; + u32 irda_port[2]; + struct device *dev =3D s->p[0].port.dev; + + count =3D device_property_count_u32(dev, "irda-mode-ports"); + if (count < 0 || count > ARRAY_SIZE(irda_port)) + return; + + ret =3D device_property_read_u32_array(dev, "irda-mode-ports", + irda_port, count); + if (ret) + return; + + for (i =3D 0; i < count; i++) { + if (irda_port[i] < s->devtype->nr_uart) + s->p[irda_port[i]].irda_mode =3D 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); } =20 - 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 =3D true; - } + sc16is7xx_setup_irda_ports(s); =20 ret =3D sc16is7xx_setup_mctrl_ports(s); if (ret) --=20 2.30.2 From nobody Fri Feb 13 19:29:36 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22324C004D6 for ; Wed, 20 Sep 2023 15:20:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235424AbjITPUk (ORCPT ); Wed, 20 Sep 2023 11:20:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbjITPUa (ORCPT ); Wed, 20 Sep 2023 11:20:30 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D73E1A3; Wed, 20 Sep 2023 08:20:22 -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=r8HOyZrFylpADN6kIAcsYM4Dj9Wj63S1uN+Rn+MZbHU=; b=qChrI1ssVNXGOANauihMgDmiJR 40kdHfuVJaerR3Bj1PgbADwQXjm517yN/tQU7VyRf09dAwZ5i4FZqIonDgvKf8wjKw5KXMcKvP4E6 4j/7HuqMMHD5jJq3RG1IeSVg54KXEb0EVlDmIqFG8SLfeXDJfZ9tOxGSrz+UJBwXfkoY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:43190 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qiyzz-0008Co-Hk; Wed, 20 Sep 2023 11:20:20 -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, 20 Sep 2023 11:20:13 -0400 Message-Id: <20230920152015.1376838-3-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230920152015.1376838-1-hugo@hugovil.com> References: <20230920152015.1376838-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH 2/4] serial: sc16is7xx: recognize "nxp,irda-mode-ports" DT property 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 Content-Type: text/plain; charset="utf-8" From: Hugo Villeneuve Vendor prefix "nxp," will be added in an upcoming commit to DT binding property "irda-mode-ports". Prepare to recognize this new property "nxp,irda-mode-ports" and retain backward compatibility with old DTBs by falling back to "irda-mode-ports" when needed. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index db2bb1c0d36c..b0154e901358 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1415,13 +1415,19 @@ static void sc16is7xx_setup_irda_ports(struct sc16i= s7xx_port *s) int count; u32 irda_port[2]; struct device *dev =3D s->p[0].port.dev; + const char *prop_name =3D "nxp,irda-mode-ports"; + + count =3D device_property_count_u32(dev, prop_name); + if (count < 0) { + /* For backward compatibility with old DTBs. */ + prop_name =3D "irda-mode-ports"; + count =3D device_property_count_u32(dev, prop_name); + } =20 - count =3D device_property_count_u32(dev, "irda-mode-ports"); if (count < 0 || count > ARRAY_SIZE(irda_port)) return; =20 - ret =3D device_property_read_u32_array(dev, "irda-mode-ports", - irda_port, count); + ret =3D device_property_read_u32_array(dev, prop_name, irda_port, count); if (ret) return; =20 --=20 2.30.2 From nobody Fri Feb 13 19:29:36 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 442E6C004D6 for ; Wed, 20 Sep 2023 15:21:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235508AbjITPVK (ORCPT ); Wed, 20 Sep 2023 11:21:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235332AbjITPVE (ORCPT ); Wed, 20 Sep 2023 11:21:04 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EB70A9; Wed, 20 Sep 2023 08:20:59 -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=mZPLDcMaUIExqCo4DAdpXSfLndLye8GLI4DHLWOnM7c=; b=WAKkO6VscDyUqS0PqSmAgqUxgn 6OMWzZ5mQMXzHoaUfzzW6QerSuaagmXyc0kdUhK7wmhvhnR61vZPIEGT/CfuLflFFiW154DJetJ2L 2kqO+56nvgA3bctMQZKxKGDtYrp2tXSxEtBf9k/hUvu/IbtBXVpW2lto/54nEc1sL7rM=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:43190 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qiz0Z-0008Co-9W; Wed, 20 Sep 2023 11:20:55 -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, 20 Sep 2023 11:20:14 -0400 Message-Id: <20230920152015.1376838-4-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230920152015.1376838-1-hugo@hugovil.com> References: <20230920152015.1376838-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH 3/4] dt-bindings: sc16is7xx: add vendor prefix to irda-mode-ports property 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 Content-Type: text/plain; charset="utf-8" From: Hugo Villeneuve The NXP-specific "irda-mode-ports" property lacks a proper vendor prefix. Add "nxp," prefix to comply with DT best practises. Signed-off-by: Hugo Villeneuve Acked-by: Conor Dooley --- .../devicetree/bindings/serial/nxp,sc16is7xx.txt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt b/D= ocumentation/devicetree/bindings/serial/nxp,sc16is7xx.txt index 1a7e4bff0456..d89815c5c562 100644 --- a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt +++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt @@ -21,8 +21,8 @@ Optional properties: the second cell is used to specify the GPIO polarity: 0 =3D active high, 1 =3D active low. -- irda-mode-ports: An array that lists the indices of the port that - should operate in IrDA mode. +- nxp,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 por= t that should have shared GPIO lines configured as modem control lines. @@ -80,8 +80,8 @@ Optional properties: the second cell is used to specify the GPIO polarity: 0 =3D active high, 1 =3D active low. -- irda-mode-ports: An array that lists the indices of the port that - should operate in IrDA mode. +- nxp,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 por= t that should have shared GPIO lines configured as modem control lines. --=20 2.30.2 From nobody Fri Feb 13 19:29:36 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 610C4C004D6 for ; Wed, 20 Sep 2023 15:21:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235711AbjITPVP (ORCPT ); Wed, 20 Sep 2023 11:21:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235401AbjITPVG (ORCPT ); Wed, 20 Sep 2023 11:21:06 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 195A2D6; Wed, 20 Sep 2023 08:21:00 -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=4scuTDFThnKNZT0kBJP6miFC8QUgbQ0WglCdxy6a73A=; b=McthI7dHIcgtALHCYekt0Cgq6h 2ecR4MMY/RotTem4AEg75O12MwZTLdmX+e0nKr5toYl8jMXeY1iJJb0tqsJg3VVCRsB3kCNQkCFIN 5sRM6GXqlsc74gLTF76f8mxSmKDzYIp8cQi4g9YdZDH+Lxm+ZJrXcLkB07uVA2UYctq4=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:43190 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1qiz0a-0008Co-EN; Wed, 20 Sep 2023 11:20:57 -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, 20 Sep 2023 11:20:15 -0400 Message-Id: <20230920152015.1376838-5-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230920152015.1376838-1-hugo@hugovil.com> References: <20230920152015.1376838-1-hugo@hugovil.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 70.80.174.168 X-SA-Exim-Mail-From: hugo@hugovil.com Subject: [PATCH 4/4] 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 Content-Type: text/plain; charset="utf-8" From: Hugo Villeneuve Convert binding from text format to YAML. Additions to original text binding: - add rs485 reference. Signed-off-by: Hugo Villeneuve --- .../bindings/serial/nxp,sc16is7xx.txt | 118 ---------------- .../bindings/serial/nxp,sc16is7xx.yaml | 126 ++++++++++++++++++ 2 files changed, 126 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/D= ocumentation/devicetree/bindings/serial/nxp,sc16is7xx.txt deleted file mode 100644 index d89815c5c562..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 =3D active high, - 1 =3D active low. -- nxp,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 por= t that - should have shared GPIO lines configured as - modem control lines. - -Example: - sc16is750: sc16is750@51 { - compatible =3D "nxp,sc16is750"; - reg =3D <0x51>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells =3D <2>; - }; - - sc16is752: sc16is752@53 { - compatible =3D "nxp,sc16is752"; - reg =3D <0x53>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports =3D <1>; /* Port 1 as modem control lines */ - gpio-controller; /* Port 0 as GPIOs */ - #gpio-cells =3D <2>; - }; - - sc16is752: sc16is752@54 { - compatible =3D "nxp,sc16is752"; - reg =3D <0x54>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports =3D <0 1>; /* Ports 0 and 1 as modem contro= l 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 =3D active high, - 1 =3D active low. -- nxp,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 por= t that - should have shared GPIO lines configured as - modem control lines. - -Example: - sc16is750: sc16is750@0 { - compatible =3D "nxp,sc16is750"; - reg =3D <0>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - gpio-controller; - #gpio-cells =3D <2>; - }; - - sc16is752: sc16is752@1 { - compatible =3D "nxp,sc16is752"; - reg =3D <1>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports =3D <1>; /* Port 1 as modem control lines */ - gpio-controller; /* Port 0 as GPIOs */ - #gpio-cells =3D <2>; - }; - - sc16is752: sc16is752@2 { - compatible =3D "nxp,sc16is752"; - reg =3D <2>; - clocks =3D <&clk20m>; - interrupt-parent =3D <&gpio3>; - interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; - nxp,modem-control-line-ports =3D <0 1>; /* Ports 0 and 1 as modem contro= l 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..508639e09e06 --- /dev/null +++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.yaml @@ -0,0 +1,126 @@ +# 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 + description: Reference to the IC source clock. + + 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. + $ref: /schemas/types.yaml#/definitions/uint32 + minimum: 1 + maximum: 80000000 + + gpio-controller: + description: Marks the device node as a GPIO controller. + type: boolean + + "#gpio-cells": + const: 2 + + gpio-line-names: + minItems: 1 + maxItems: 8 + + nxp,irda-mode-ports: + description: | + An array that lists the indices of the port that should operate in I= rDA + 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 + serial0: serial@51 { + compatible =3D "nxp,sc16is750"; + reg =3D <0x51>; + clocks =3D <&clk20m>; + interrupt-parent =3D <&gpio3>; + interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells =3D <2>; + }; + + serial1: serial@53 { + compatible =3D "nxp,sc16is752"; + reg =3D <0x53>; + clocks =3D <&clk20m>; + interrupt-parent =3D <&gpio3>; + interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; + nxp,modem-control-line-ports =3D <1>; /* Port 1 as modem control l= ines */ + gpio-controller; /* Port 0 as GPIOs */ + #gpio-cells =3D <2>; + }; + + serial2: serial@54 { + compatible =3D "nxp,sc16is752"; + reg =3D <0x54>; + clocks =3D <&clk20m>; + interrupt-parent =3D <&gpio3>; + interrupts =3D <7 IRQ_TYPE_EDGE_FALLING>; + nxp,modem-control-line-ports =3D <0 1>; /* Ports 0 and 1 as modem = control lines */ + }; --=20 2.30.2