From patchwork Wed Sep 20 15:20:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 142501 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4253316vqi; Wed, 20 Sep 2023 09:11:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvvCS3HlHyxRtBglQHz3NJlxQ92JQDhI/AQfi5x8c21r69iRqvrliXIDtaRKJdUdI8cPVv X-Received: by 2002:a05:6870:40c6:b0:1d6:51aa:13a2 with SMTP id l6-20020a05687040c600b001d651aa13a2mr3371217oal.10.1695226310261; Wed, 20 Sep 2023 09:11:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695226310; cv=none; d=google.com; s=arc-20160816; b=Ca2aQCZufhDtmtt2EltWrOGUvcPm4JTEDSuAa9sSAOq0OONGMgbGyQBskPFx2deITb H8kx/76lzG3nT5nagL1sYjkM150TbTXSwks0pzhIBJsCNYT8uezJ0g5YTu5U3yP0gG5u FzIco7Ht4QVXWEPzwc2hdKqjBFud7QVEL+qKU+TuZ0CpuRxV76DI+nT+Wywho27mmrcr Xatv0QcBuduKODtW7JZc1P1vBnjC1p44gqMgdQFkQBQgl1V/EYprCcDHNKSNWNvBJa1w ICP8NCmTRGUiyfj6xa+6gs0eh8DHjFsrpbLuHPDQKWlg4NjCKmBjVoboNMevl15SGEr6 NxVw== 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=vvwQBkD3N3f8LL/vgXdWPdR3a4r/4jTp+oiT3VN5xCgGG/1cKKXEzVxRBBIjFWoFRR 8ecCNPgAeWVU8Cem+tw2exhNlBUyBl4DLi/A1LHviYrYhM4DydRuBXT9GlaUVHWWghD9 5x3tBfdUz9syfdW5TEOtok7MKk3cttTfqj+wTM6jnbdA5RMpbHQTInQNGR9lWmCh5WT5 KYXo3xJU1WPYqpwq9FmEI+SZmnRVos1fEtO65HBILH2+L91CZUy6b0s+SKcFwAiTLwRN 6wAPD0vWtqXuh8LL1halPlf5hgi0ylnrcxVJnE8cmsGebjr/gTivIgjbT8BjgecHRkH/ bTjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=JrabJf9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id 69-20020a630048000000b00578af6c5c0csi3866051pga.235.2023.09.20.09.11.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 09:11:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=JrabJf9l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 107ED82289AC; Wed, 20 Sep 2023 08:20:39 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236309AbjITPUh (ORCPT + 27 others); 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 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 08:20:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777573623768264792 X-GMAIL-MSGID: 1777573623768264792 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 20 15:20:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 142527 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4285553vqi; Wed, 20 Sep 2023 10:01:29 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGUXeRNXxkbNdZsTrmEg+FzQUNR3Bl9fRAW5LrOuDXFROH5A6VlJzeCywjYuajB2kqmm0Oa X-Received: by 2002:a05:6358:9913:b0:143:3845:e6fb with SMTP id w19-20020a056358991300b001433845e6fbmr3901331rwa.27.1695229289136; Wed, 20 Sep 2023 10:01:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695229289; cv=none; d=google.com; s=arc-20160816; b=T/sDJGHqE3HlkPNulxkB5uzs/fVYLTtvT6dtTvzKxe1Y6QJV7PDgeOhYQv83gS/yWZ Vg4mZZyw8VuOYHGTyjbmd1aq9VO/GA8RqI/T/jST59cdULJLrguEMoOpZLTZHP4K3ori 5Rv1LDdD+heALK1PgiRyFCCzSOuClxb+lY4GIobWbvYP6i3NdpexOS21vPVzX4h9Ct/s 4qSjRtcMFxcacBXscZwauMLH1nf21Qr2H16OzspbMSYNKYXrzBkeQlWQ7QmurYrBzKT8 mN3pGK3uKORt+Ko65NHP5ZRLcdhPEyUQ0Pbfcas9u/tj3JoHA5HG3/1nnsjVuGi1bDU+ xVgw== 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=r8HOyZrFylpADN6kIAcsYM4Dj9Wj63S1uN+Rn+MZbHU=; fh=VMCZnIQaCU4pkoBwVmskDKaTUsCNxL1ek+dzim0+uzY=; b=A7kECKVpt53iCB3sDP9enZy4Ly95tQn/0dD7MegDUNxwicw2nRagRSyVFIEz5a1BSx otNsXjcNFnwZfmwAfgxDON0V0LfwSr7Zu5Y9VS2ywBe/quDtNkJBuhV4NKnQDzXbAKmA zY2a5ikwpREPjyxqP+4hnteB2Aw/LosEQChzgBoGS/QYiZpVkbYOD+5yHEzwKrDuQfD7 D/HO39l6haihxvxEcHMVPIz2BD3C9Q9UuNRdhwoAmphobPzMTZLipbBDHDwXOExQqsE/ 8fl6nSQXKy0AckB4QbmXWQgTgFPBUdCMB0gEyvYKMCJ9+VAiIhVNp94UrkrX5FaYAEo2 175A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=qChrI1ss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 195-20020a6300cc000000b00565f76f86d8si12013523pga.818.2023.09.20.10.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 10:01:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=qChrI1ss; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 2F29E8033DE4; Wed, 20 Sep 2023 08:20:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235429AbjITPUk (ORCPT + 27 others); 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 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 agentk.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 20 Sep 2023 08:20:50 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777576747292923374 X-GMAIL-MSGID: 1777576747292923374 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 sc16is7xx_port *s) int count; u32 irda_port[2]; struct device *dev = s->p[0].port.dev; + const char *prop_name = "nxp,irda-mode-ports"; + + count = device_property_count_u32(dev, prop_name); + if (count < 0) { + /* For backward compatibility with old DTBs. */ + prop_name = "irda-mode-ports"; + count = device_property_count_u32(dev, prop_name); + } - 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); + ret = device_property_read_u32_array(dev, prop_name, irda_port, count); if (ret) return; From patchwork Wed Sep 20 15:20:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 142672 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4530212vqi; Wed, 20 Sep 2023 17:58:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFs7/9hy4ZyMSIZN7MnRtFnMbiwo4h4wFtF6P6wJK7H12OLxWPN1/vbGmVwMdTpa8OQ//tA X-Received: by 2002:a67:f890:0:b0:452:8de3:391f with SMTP id h16-20020a67f890000000b004528de3391fmr4906126vso.16.1695257899816; Wed, 20 Sep 2023 17:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695257899; cv=none; d=google.com; s=arc-20160816; b=yJwR8/q5VyBQpjTP5JwvX/Q3+P6A8M1w94hD1gIPdgLxojFn7RY68ul2X5Nc2bupU0 pl9MtpKGMhEmyDngLkpv5gbSSaJ919tt8KnLpz0rtqzsY9kCkmc8S7DaR0o6RUgFdBaG clKWFDTLj8+TtEXb013Oai7ITR/iMoLJqQT4NgVEZbG0vhc0t7rEp/yqsMgVhANKYJmK wYSiaFFsG6mWD9sOzzpIdHf/lmCPvQHy7JklMObLf2zKLZEVJ3MD09Cp38dS0nZ1xrus zj9DTvl6c4Fb4I0rtWWJmMn92IOxhYgr28I+dPvCkccNe0dOzHrugPcFzCeAEPauD948 v4xw== 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=mZPLDcMaUIExqCo4DAdpXSfLndLye8GLI4DHLWOnM7c=; fh=VMCZnIQaCU4pkoBwVmskDKaTUsCNxL1ek+dzim0+uzY=; b=JP2Lb9oS3M/uXTiN2KbJ9keMGrLvTvfiGWfgZsx2kOW7s+N1ymrrnds3gLIhjqtScX /yebPnEpAkQuLihO65HvZM6tMFPjUeRTlMCrTSor+Q63cuCKcWLFHTZDqF2G8EOThMuX tid77U9vSeTcyTxiTJBkKbmchzZUqhObmRVVRvNbBfkNz7Cyb2PxGY4D7oSEGfepIhJz tYxN3VBekGoykV5tWFiOC1Dcg3pfnapwKvvItyCED8PC/1LI0IA4QuBdcb/n3MsQEViY Uk6xhQqa6sAUwTRyyKDgCBC+IE+46d/oK6Xo2e1CHj8u1CqzoBRxh9mPz4MhLCqDxrd7 SkkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=WAKkO6Vs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id d19-20020a637353000000b0055b43079640si262150pgn.707.2023.09.20.17.58.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 17:58:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=WAKkO6Vs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id E632E824929D; Wed, 20 Sep 2023 08:21:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235337AbjITPVI (ORCPT + 27 others); Wed, 20 Sep 2023 11:21:08 -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 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,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Wed, 20 Sep 2023 08:21:13 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777606747425622749 X-GMAIL-MSGID: 1777606747425622749 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/Documentation/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 = active high, 1 = 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 port 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 = active high, 1 = 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 port that should have shared GPIO lines configured as modem control lines. From patchwork Wed Sep 20 15:20:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 142545 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp4330844vqi; Wed, 20 Sep 2023 11:11:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH4h1cvyb+vxJFz8FcxV+YZpRxa3JaK9xW2TiOTCc8R60YpkNQH6mowaQ1sbaVuQJpncktW X-Received: by 2002:a17:90b:4f88:b0:276:9d55:1e3 with SMTP id qe8-20020a17090b4f8800b002769d5501e3mr3307493pjb.31.1695233469036; Wed, 20 Sep 2023 11:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695233469; cv=none; d=google.com; s=arc-20160816; b=PlF6nv6EWSAr30PjFzbJNWWX/Y/wQlbrW79bOtq5D3YicHZCTMs5iirfq49ZrN4zSF +Cz+/ZShoW3YiF8uCYj1CuZW1LsRtqZVrHuZH3Ebk7zJvFmtv+CrX+g6oT5RxPzWGaAw 8OjVPNzaUpRGKB8P7PUMWsLHSD3og1PSL0NCoCOMTlHHYgxLVUfSnzSEapt6tqQ0f1ky ka4q4K0QlPCuUBO/5H2ciXWU+/iOY0Sgcg8buU7IhN1Q54kT9lYUJm/mPI0Vrg2SAJlE +96uHFfHt8qDJt6o+tEmdLoOmjxg6bmv80UN/JpO0YX86jT5hqqdN4l757U1xa3gY1ew JLhw== 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=4scuTDFThnKNZT0kBJP6miFC8QUgbQ0WglCdxy6a73A=; fh=VMCZnIQaCU4pkoBwVmskDKaTUsCNxL1ek+dzim0+uzY=; b=q9e2dYKYcBLTjWGzq9QDj38WpdorPoY2mn0OlDpLdl6gZmVepmsv1ziA4KX4UaBcGr qBSG8LbZraLCp7KK41o6GRDzpL5zWXTqhtOZa5e8gqEjRSUfuH38kOlKcn4boRknbV8b NYQT408uVBffWHZTA3T+sMK706zThPV+hR/jrw6slelco6PJNRiR1GCXqazB/uSu078T T29gA3dnqULK+IKh44kja6tMp/5/xE75IGHINxh0At3Keput76KwDO/jGHyn8zdXHDn6 zIhSMdHEyjVUuzwVS9Eawo0UYm9domAdlcXdS40daiddwz8LrV+EaTS5hjpaliz/Cjle QLFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=McthI7dH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id mi4-20020a17090b4b4400b00262ee7c6cafsi2231021pjb.87.2023.09.20.11.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 11:11:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=McthI7dH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 53C968374C88; Wed, 20 Sep 2023 08:21:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235496AbjITPVN (ORCPT + 27 others); Wed, 20 Sep 2023 11:21:13 -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 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 fry.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 20 Sep 2023 08:21:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777581130390560850 X-GMAIL-MSGID: 1777581130390560850 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/Documentation/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 = active high, - 1 = 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 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. -- 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 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..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 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 + serial0: serial@51 { + compatible = "nxp,sc16is750"; + reg = <0x51>; + clocks = <&clk20m>; + interrupt-parent = <&gpio3>; + interrupts = <7 IRQ_TYPE_EDGE_FALLING>; + gpio-controller; + #gpio-cells = <2>; + }; + + serial1: 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>; + }; + + serial2: 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 */ + };