From patchwork Thu Jun 1 16:31:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102091 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp471580vqr; Thu, 1 Jun 2023 09:51:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UZJEHx4MujtmOHtbR97VDZJdzWIUMZfkT+zfC4FQ89vG/qXvYXHIrnOIoNUbi0pD4X/ci X-Received: by 2002:a05:6358:7f18:b0:127:91b7:2207 with SMTP id p24-20020a0563587f1800b0012791b72207mr5630937rwn.28.1685638300727; Thu, 01 Jun 2023 09:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638300; cv=none; d=google.com; s=arc-20160816; b=Vyj1l0ejK/2cTNzeiRAuzL4g4G61QU+9V8GQ8BzcZFgRw1aC7yLz7Gwl1D6w1NrAOt cBSjCEzhtweomw4ZzTfhl/wriEcx/+XCY2NGnvX8yE4uo0SgMRJu8XTVr8Ub8gV+3tLR 9p2NTBv9nJZM/dEtusbE5NXehU63RRUKy8/c7VxGyeVwPJVo4bd/uRA+bYFbIJGglhz6 hIbD2V59Uj7MJNvvJGY5nrVpiXoUNFgfYsVF2l5f9So1awYvyCduRoazZa8pXfFEg/PD BC7fhVGnO87EInw6XMjRZTvkbIeS9zVu/Jo7utkq1Se9fE7YxBSXYz3+KWFmDd5LKpYp NZfQ== 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=vlvSfJ7BB6pGJBxrOhJ5IMJLf95UIyksZ/69U1YnCu4=; b=XlOytKSAW4tVnDQfRTqJElKs5iDN6xVgBkxw2fh/ZC8T/wpj9AjfCKD2VOAST/MTMV PweRB/ZWitb45MNBArfHrWJTFlsorcIDAJJSQ7RAUVWx2WomdH3+MsZWfG5ZBc4FMv0F 9JVQGoMB3GJeMd3VavhICWvuXELdPSpGjcUHj27G2aJMpnOvcnQVQuKgS9X0OtsvZr7b FqjJSwsWkhLGh5SFnx2poghUO8IXJBhenJxARMplw1DJaN9vMwA3knHlcPM2+Cbb6O7S FNrcOuW5FEhu00elXCl6E9TG0jKPyiILgm0wWTrR/+z+Ast73p40aAIXvnL0eoHpHd9w k/Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=FXesiQqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 195-20020a6301cc000000b00528d0d8b7bbsi3036678pgb.595.2023.06.01.09.51.26; Thu, 01 Jun 2023 09:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=FXesiQqW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231917AbjFAQtT (ORCPT + 99 others); Thu, 1 Jun 2023 12:49:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231899AbjFAQtL (ORCPT ); Thu, 1 Jun 2023 12:49:11 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DFEA0195; Thu, 1 Jun 2023 09:49:09 -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:Content-Type:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vlvSfJ7BB6pGJBxrOhJ5IMJLf95UIyksZ/69U1YnCu4=; b=FXesiQqW5yLcfBPlFy0BslccfZ Ugwme0uy8e16kaN1S+vJVMHg2tex9udEfh6b8qxch2uJe6xsARVqKk+7kdSBi2XP/tXx00QoezdlS m3bzLcWXmsFtlRf4XfdgwllX1o9NyLIQEo803F0vD6SbuC6F9A2809ZYkLDBj37IyNAA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCn-0003BU-HJ; Thu, 01 Jun 2023 12:31:18 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org, =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Lech Perczak Date: Thu, 1 Jun 2023 12:31:05 -0400 Message-Id: <20230601163113.2785657-2-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 1/9] serial: sc16is7xx: fix broken port 0 uart init 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767519866933258911?= X-GMAIL-MSGID: =?utf-8?q?1767519866933258911?= From: Hugo Villeneuve The sc16is7xx_config_rs485() function is called only for the second port (index 1, channel B), causing initialization problems for the first port. For the sc16is7xx driver, port->membase and port->mapbase are not set, and their default values are 0. And we set port->iobase to the device index. This means that when the first device is registered using the uart_add_one_port() function, the following values will be in the port structure: port->membase = 0 port->mapbase = 0 port->iobase = 0 Therefore, the function uart_configure_port() in serial_core.c will exit early because of the following check: /* * If there isn't a port here, don't do anything further. */ if (!port->iobase && !port->mapbase && !port->membase) return; Typically, I2C and SPI drivers do not set port->membase and port->mapbase. The max310x driver sets port->membase to ~0 (all ones). By implementing the same change in this driver, uart_configure_port() is now correctly executed for all ports. Fixes: dfeae619d781 ("serial: sc16is7xx") Cc: # 6.1.x Signed-off-by: Hugo Villeneuve Reviewed-by: Ilpo Järvinen Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index abad091baeea..faa51a58671f 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1436,6 +1436,7 @@ static int sc16is7xx_probe(struct device *dev, s->p[i].port.fifosize = SC16IS7XX_FIFO_SIZE; s->p[i].port.flags = UPF_FIXED_TYPE | UPF_LOW_LATENCY; s->p[i].port.iobase = i; + s->p[i].port.membase = (void __iomem *)~0; s->p[i].port.iotype = UPIO_PORT; s->p[i].port.uartclk = freq; s->p[i].port.rs485_config = sc16is7xx_config_rs485; From patchwork Thu Jun 1 16:31:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102097 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp475180vqr; Thu, 1 Jun 2023 09:58:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gpdGOGl8vlm2i6IixqhNByaHH7UZf8pLk/WX5iyE8USeW5Cjv8yharL9wAzfRU1t/TysF X-Received: by 2002:a05:6358:7f09:b0:123:187d:d9bb with SMTP id p9-20020a0563587f0900b00123187dd9bbmr4596397rwn.32.1685638689556; Thu, 01 Jun 2023 09:58:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638689; cv=none; d=google.com; s=arc-20160816; b=vTZGM01fKz1pmDYoyu/ZsjhF1QiPdWnCiDsA8CsS4Ph2x0aWEI0APTerdao1p07JEY qg5Gw7wZAWcPtdBEYUSVhjuU/5Jj7V8oYskCkddWOrtH+kdFktY3T35F0bQIt5/x2rXk mlIX/Lga6TbthOaeyQlvTjHfO9TlyhkV+3w+DxdlPZ5bfTWzeaXcfMKDSRkeOsPz/oCJ ovf3JkH1NeLHkBf9dA3xeYlbbx9CTWK452APgEMBoChw2dERbBbm6php6l1USUYDEBDP WMigMeh0Kv8dFj4s/0vzR9d65HdoOieXtgvzKypVGD0Vx92jAhht1TdyD3Sgg/Z4NSqo ELYA== 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=T/ybH+luXFJtRUNLsANdxNj5MlosRcBXIwuB3tKL/mQ=; b=c8u/JsLzx9NKMnHavQFPK0LGlZf9WYr7cmehE4ALUKod6Y9kxm28WWFpcaDyra1fPo lxunr/XsSSeXsV/GTP6ppigVLtCFucpSgARQDI/YO/792/aAXBuohUuBfTKXMzhO1tAt GAvrhpDJ7vFX1pO4WIolbTYHjRTGx5o2pvK56SuDa42OhlMcoHqpu5reSBCwPkJv+lhU 3vlESRs5gAu9ITgVkz3MYXiBf+J13YKl1bhQgCin9+Wlbq4TAEonF34xhRN9opokr2zj 0x+zjlqhjlCqMr8mXnPcPjo4g9JnSdG6aPDzvFTEM2ulX/sYlQFuNp9Wq331Q1lQNmgX EPeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=wVhISoIw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t191-20020a6381c8000000b0052c89d50011si3045769pgd.676.2023.06.01.09.57.57; Thu, 01 Jun 2023 09:58:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=wVhISoIw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231700AbjFAQtJ (ORCPT + 99 others); Thu, 1 Jun 2023 12:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231660AbjFAQtH (ORCPT ); Thu, 1 Jun 2023 12:49:07 -0400 X-Greylist: delayed 1057 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 01 Jun 2023 09:49:05 PDT Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B8623196; Thu, 1 Jun 2023 09:49:05 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=T/ybH+luXFJtRUNLsANdxNj5MlosRcBXIwuB3tKL/mQ=; b=wVhISoIwL5hksN6p+elY2HQiFF DAVLnXvGOziGmoVz9nYX2+n5N+PPgjqbnClXTMJPs6wUQWAJUPGtfUyl02WLN7xekGy+HgQ235Qcx pBvQ5AR+w9buKl7si+As/yhm/ZEbeZ7LvHCQH/j8ql3yhmDh9oAuTxH4MNW68+myskEE=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCp-0003BU-FL; Thu, 01 Jun 2023 12:31:20 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org, Lech Perczak Date: Thu, 1 Jun 2023 12:31:06 -0400 Message-Id: <20230601163113.2785657-3-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 2/9] serial: sc16is7xx: mark IOCONTROL register as volatile 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767520274523181807?= X-GMAIL-MSGID: =?utf-8?q?1767520274523181807?= From: Hugo Villeneuve Bit SRESET (3) is cleared when a reset operation is completed. Having the IOCONTROL register as non-volatile will always read SRESET as 1, which is incorrect. Also, if IOCONTROL register is not a volatile register, the upcoming patch "serial: sc16is7xx: fix regression with GPIO configuration" doesn't work when setting some shared GPIO lines as modem control lines. Therefore mark IOCONTROL register as a volatile register. Cc: # 6.1.x Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index faa51a58671f..0c903d44429c 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -488,6 +488,7 @@ static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg) case SC16IS7XX_TXLVL_REG: case SC16IS7XX_RXLVL_REG: case SC16IS7XX_IOSTATE_REG: + case SC16IS7XX_IOCONTROL_REG: return true; default: break; From patchwork Thu Jun 1 16:31:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102099 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp476019vqr; Thu, 1 Jun 2023 09:59:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4pKnO1HEkKics/TTe+inGwxNma3oz7dDMto7MKxhdEw+iC9VCIfWgvWrDYVNqn3Boqso/a X-Received: by 2002:a05:6a20:c908:b0:10c:34af:a469 with SMTP id gx8-20020a056a20c90800b0010c34afa469mr7010991pzb.16.1685638780978; Thu, 01 Jun 2023 09:59:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638780; cv=none; d=google.com; s=arc-20160816; b=rb22YD5yEGno4/k9FrNAqtCn6D9IfdwA1ORzjUI+BPmU82cGCZ9z3Gxpmr+Od01GZF PV+sCpV8PLdIN2C2IMIhvL7Y7zbJfYIOfJEu9Pz+0IwytR0yA8HgS6iPlLwJXFQUZuvk 13NsIm4neIP8WU4289DbrdMbcBKYEhIUIbgcahAIwXlkPDddak6ZRAWMl9kgM2FTnRtE eujhS6QhhLs06g0nCBBzH/nw7G28VXXtlWnLAdn3bgYXsgDQ1fjMocI6I4z0odITCWtl OM+hRFkMojJMMrLMRe6iC9I1Yo2xzKZyllq6iPs8Hrr58/0Q+za601H15r8vowpiHy6h iu+w== 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=1vqldTdNzpvO/yWdW/72YvIUl497xOnquYw80TxcOt4=; b=oF+czRoRFxAU4B93vH4aFM9GvyAUK8wcUd0dahJhI+p5xq++cIYEFq0qo3KPA49Xdw fXMeLFoN2W390RyZbvPeIODb872VX11EerhbQcKigXv+u9zm8EkhgpBJSQTIzqnQF9Ca 8sB6gyAAR7LVa3ilZ7BfWBEGfR5f4zTk4x9zxJb50bLR5L8KvXOHoCHaOS5YgNau6G+i nsBUFf/qo2sBOSx/wg2sRLYKUPL7tL+S8avY7RlaQFBu88Ntd5XIEne6Ie7oznafwBvk t+2bVjFgoTLNLFFLMHFedtQqu8xuRUOzeI/H4Bh8Vu5HaQUFZKy3CclXPqjFpRcYvYNj o1GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="v/KW0AI9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j71-20020a638b4a000000b00502d825633asi120065pge.639.2023.06.01.09.59.27; Thu, 01 Jun 2023 09:59:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="v/KW0AI9"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232518AbjFAQuK (ORCPT + 99 others); Thu, 1 Jun 2023 12:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32860 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231670AbjFAQt3 (ORCPT ); Thu, 1 Jun 2023 12:49:29 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CACBF1A2; Thu, 1 Jun 2023 09:49:19 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=1vqldTdNzpvO/yWdW/72YvIUl497xOnquYw80TxcOt4=; b=v/KW0AI9kPY9m5StkAIXu5ZgCG xJa+5o81vji3IsR2li2hotp9FGiMFbCO1/GEkVWPwDvcGYjjdFWob4WvP6b/GXUKDD5LjLZU+Nqa5 grWrjuTArzMsr8h2biZLLNA/1VCSdSSgmbZIlNCfhevJs0DXnCJ1xoiWz13WPJFoFMtA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCq-0003BU-Uj; Thu, 01 Jun 2023 12:31:21 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org, Lech Perczak Date: Thu, 1 Jun 2023 12:31:07 -0400 Message-Id: <20230601163113.2785657-4-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 3/9] serial: sc16is7xx: refactor GPIO controller registration 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767520370574825835?= X-GMAIL-MSGID: =?utf-8?q?1767520370574825835?= From: Hugo Villeneuve In preparation for upcoming patch "fix regression with GPIO configuration". To facilitate review and make code more modular. Cc: # 6.1.x Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 39 ++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 0c903d44429c..279d7dcb1447 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1349,6 +1349,26 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, return 0; } + +static int sc16is7xx_setup_gpio_chip(struct device *dev) +{ + struct sc16is7xx_port *s = dev_get_drvdata(dev); + + if (!s->devtype->nr_gpio) + return 0; + + s->gpio.owner = THIS_MODULE; + s->gpio.parent = dev; + s->gpio.label = dev_name(dev); + s->gpio.direction_input = sc16is7xx_gpio_direction_input; + s->gpio.get = sc16is7xx_gpio_get; + s->gpio.direction_output = sc16is7xx_gpio_direction_output; + s->gpio.set = sc16is7xx_gpio_set; + s->gpio.base = -1; + s->gpio.ngpio = s->devtype->nr_gpio; + s->gpio.can_sleep = 1; + return gpiochip_add_data(&s->gpio, s); +} #endif static const struct serial_rs485 sc16is7xx_rs485_supported = { @@ -1502,22 +1522,9 @@ static int sc16is7xx_probe(struct device *dev, } #ifdef CONFIG_GPIOLIB - if (devtype->nr_gpio) { - /* Setup GPIO cotroller */ - s->gpio.owner = THIS_MODULE; - s->gpio.parent = dev; - s->gpio.label = dev_name(dev); - s->gpio.direction_input = sc16is7xx_gpio_direction_input; - s->gpio.get = sc16is7xx_gpio_get; - s->gpio.direction_output = sc16is7xx_gpio_direction_output; - s->gpio.set = sc16is7xx_gpio_set; - s->gpio.base = -1; - s->gpio.ngpio = devtype->nr_gpio; - s->gpio.can_sleep = 1; - ret = gpiochip_add_data(&s->gpio, s); - if (ret) - goto out_thread; - } + ret = sc16is7xx_setup_gpio_chip(dev, mctrl_mask); + if (ret) + goto out_thread; #endif /* From patchwork Thu Jun 1 16:31:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102094 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp473925vqr; Thu, 1 Jun 2023 09:56:00 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ72oKsDJL2+Bmz9vdwO+jdlGMbUPP3zlye2CaXUI2OCkNEh6Y0u/3i0C92NXvFGH5TfKVXK X-Received: by 2002:a05:6a20:e618:b0:110:b0ab:879d with SMTP id my24-20020a056a20e61800b00110b0ab879dmr6635489pzb.26.1685638560053; Thu, 01 Jun 2023 09:56:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638560; cv=none; d=google.com; s=arc-20160816; b=HLShzYWZU62XHTwJ69J1eO4iKDhDN2mqeTYwU41GfZ00lO/Xy+G0/bJrh6D2eztCad jX+5luzODsCFfL301bzw4+XYz825ctjh4uR1cQQSGmatr2hxb1bvIMV51zqO3aTQSPbl zeMH7c2FdTdJ2H432vNWiNP4fi5XOitCCGLgqMalQ8dcN8J79JPKeS8opw+ZgfXnttkR 6ROtsO3+fz1Du6wKolx45RkNKnmeFW4waPAR/Kfp/MugE5zsvFmTozHfU92KP/mPXPG2 bnldNQEXMwmhClI7jIEbjNVMaoXlOAM5O5WwMrEm2nLG9qqK34qV9A6BGZzpKy3zVFbX iEEg== 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=SuJQI5JxUPzY+H5j7N6gL+Df0hCmvZbTgQvKUtpTEpg=; b=dpWwDSyh4V6Bo0LZfY4H+LmYbqcdMLojWXM9zdt+5ytRZGUbTmRwXzCym8h40F7cOQ U6/qyBOlMF5LPjv0shrWh3kuub79NbzBBY9r3v7ZoVRIVutYzG4Cy1Jo05W861YJGt07 kFq4wGYjnrFBkBsPl/Q5LGVTyhc/f3+B4dqZ+7IpcZoa1yeO5lRzAtfhJfkTBX4Dol4t h9V/B/Avcue2FsIJXZnMJM0m8cNs7noJCcyE5nZTaT/tsVyTKF09SemwNCS1BknPfasF QQc8dNgz9Q4nCpkBszn1RnD1HHKck7HnAsB6OV0H0WGI8vE0IODzUwp0bTjIZoYnJSsx I7uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=w92mRwXS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m2-20020a633f02000000b0051b578dfc51si3107363pga.744.2023.06.01.09.55.47; Thu, 01 Jun 2023 09:56:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=w92mRwXS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232135AbjFAQtd (ORCPT + 99 others); Thu, 1 Jun 2023 12:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231856AbjFAQtN (ORCPT ); Thu, 1 Jun 2023 12:49:13 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1747C184; Thu, 1 Jun 2023 09:49:12 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=SuJQI5JxUPzY+H5j7N6gL+Df0hCmvZbTgQvKUtpTEpg=; b=w92mRwXS4Kz0mp2SfBHiVQMRbi jUURmYFZOtEsob0T41CkM1VwAyC3yQtlXMTgI6N5t5lZmzNsD6eio0POqG54zZ7PVHFdXv2Gjc7Jn RSbJup2h1+FZwPYiAi3lceqZvvX7YdNshnXMl/4NnyuY/FRQAyEqOeGaXW1h/bxkpDtg=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCs-0003BU-Iy; Thu, 01 Jun 2023 12:31:23 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org, Conor Dooley , Lech Perczak Date: Thu, 1 Jun 2023 12:31:08 -0400 Message-Id: <20230601163113.2785657-5-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 4/9] dt-bindings: sc16is7xx: Add property to change GPIO function 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767520138775088858?= X-GMAIL-MSGID: =?utf-8?q?1767520138775088858?= From: Hugo Villeneuve Some variants in this series of UART controllers have GPIO pins that are shared between GPIO and modem control lines. The pin mux mode (GPIO or modem control lines) can be set for each ports (channels) supported by the variant. This adds a property to the device tree to set the GPIO pin mux to modem control lines on selected ports if needed. Cc: # 6.1.x Signed-off-by: Hugo Villeneuve Acked-by: Conor Dooley Reviewed-by: Lech Perczak --- .../bindings/serial/nxp,sc16is7xx.txt | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt index 0fa8e3e43bf8..1a7e4bff0456 100644 --- a/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt +++ b/Documentation/devicetree/bindings/serial/nxp,sc16is7xx.txt @@ -23,6 +23,9 @@ Optional properties: 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 { @@ -35,6 +38,26 @@ Example: #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: @@ -59,6 +82,9 @@ Optional properties: 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 { @@ -70,3 +96,23 @@ Example: 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 */ + }; From patchwork Thu Jun 1 16:31:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102110 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp493630vqr; Thu, 1 Jun 2023 10:23:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4hnlYpbAA4vNZK4LrbYkHJU1tu8veyIyC5UhTbJNaaleFyUlArtj8wCPn4mS+/avtXfeqH X-Received: by 2002:a05:6a00:2e87:b0:646:6e40:b421 with SMTP id fd7-20020a056a002e8700b006466e40b421mr2953425pfb.1.1685640191977; Thu, 01 Jun 2023 10:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685640191; cv=none; d=google.com; s=arc-20160816; b=DIDDcguzxaZayj/IrhVQ7tmy+AVdGX9ew6oWb2PHzxmz2+3zFIJryHopGNluiTXuyo 77o/tIoxEwv/JpGnHI5vtkTP/yu3FwasLIByc54anvj0iEJMuFJGQwPxZ711F2Y7w1xl 6f3dvmG1LSlV9XjIP/pWRKeMaxmOWWDmT2AClXROKNyWtS0Jhf0fZ8LGDyBrtmECMo3c VlNR7nIR/WAMwWSql2wCZiJEFz9FDBwMdIsxYSWhKVwu1sHVXdRNCimJrDgiZCPElXA6 Nf+1unzFxHkZzA0ZQOidigiRJ1+k5z67Zg1tlCG6PWeB/EgYRBkdsVOp50/hlHK+Ag+0 4CaA== 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=okZ3I8Mo3kviDk2DJDFPNX6104xemfV0atd6n/P0pmA=; b=wuretRVOGLfJBNtANFjVc11maSPCihGLpHxQZVzPjdbBj1JA7bnalNjsAA1i4W0qjX N7ZVdtC+oeTuZrRs/ELihoCBDj1drCPS2mI+B6nPVXYE1DNby7gOpQCMHDnmHbtf6HmO yRtwr4HXwLwlxPPaxwhYybaq2Nk0sU3wRk9PCk4/uCNVguEsyE12TBJSkv2xxy7m8bxl ttklgjtgM3YFaNul45vzQr8qkIjrg/ETLk48pQrCAveJeM7iA5UJ3iSnH/Jm1y/fiWmV IaxfBwQdgyzuDhN7Q96vvPza/mtYCKkUQbrL+zjZAQ3HYCu9R67/6ToIb2plnX8epnTB dH0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=YldwesJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g15-20020a63374f000000b0053439ea59fdsi3247393pgn.19.2023.06.01.10.22.59; Thu, 01 Jun 2023 10:23:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=YldwesJK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232290AbjFAQtp (ORCPT + 99 others); Thu, 1 Jun 2023 12:49:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbjFAQtc (ORCPT ); Thu, 1 Jun 2023 12:49:32 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A159E43; Thu, 1 Jun 2023 09:49: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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=okZ3I8Mo3kviDk2DJDFPNX6104xemfV0atd6n/P0pmA=; b=YldwesJKrnin1AlvSIHsur6p3w eH59bOUL4b7DLj4qeQ1IDztsIzpXfmZnK5RwnmWwnHekLi8oREHtp1gtwjqGG8GCBHNhSZwEJdv4u 4a7UVWzcvghLujlLoiVW8H1bBdz4tvZPWOP/dCG1Opdhk5QpnJLoSkvKMXq9XgFNAhUY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCu-0003BU-AE; Thu, 01 Jun 2023 12:31:26 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org Date: Thu, 1 Jun 2023 12:31:09 -0400 Message-Id: <20230601163113.2785657-6-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 5/9] serial: sc16is7xx: fix regression with GPIO configuration 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767521849868871728?= X-GMAIL-MSGID: =?utf-8?q?1767521849868871728?= From: Hugo Villeneuve Commit 679875d1d880 ("sc16is7xx: Separate GPIOs from modem control lines") and commit 21144bab4f11 ("sc16is7xx: Handle modem status lines") changed the function of the GPIOs pins to act as modem control lines without any possibility of selecting GPIO function. As a consequence, applications that depends on GPIO lines configured by default as GPIO pins no longer work as expected. Also, the change to select modem control lines function was done only for channel A of dual UART variants (752/762). This was not documented in the log message. Allow to specify GPIO or modem control line function in the device tree, and for each of the ports (A or B). Do so by using the new device-tree property named "modem-control-line-ports" (property added in separate patch). When registering GPIO chip controller, mask-out GPIO pins declared as modem control lines according to this new "modem-control-line-ports" DT property. Boards that need to have GPIOS configured as modem control lines should add that property to their device tree. Here is a list of boards using the sc16is7xx driver in their device tree and that may need to be modified: arm64/boot/dts/freescale/fsl-ls1012a-frdm.dts mips/boot/dts/ingenic/cu1830-neo.dts mips/boot/dts/ingenic/cu1000-neo.dts Fixes: 679875d1d880 ("sc16is7xx: Separate GPIOs from modem control lines") Fixes: 21144bab4f11 ("sc16is7xx: Handle modem status lines") Cc: # 6.1.x: 35210b22 dt-bindings: sc16is7xx: Add property to change GPIO function Cc: # 6.1.x: 7d61ca47 serial: sc16is7xx: refactor GPIO controller registration Cc: # 6.1.x: 322470ed serial: sc16is7xx: mark IOCONTROL register as volatile Cc: # 6.1.x: a0077362 serial: sc16is7xx: fix broken port 0 uart init Cc: # 6.1.x Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 100 ++++++++++++++++++++++++++------- 1 file changed, 80 insertions(+), 20 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 279d7dcb1447..ad6b9d613b33 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -236,7 +236,8 @@ /* IOControl register bits (Only 750/760) */ #define SC16IS7XX_IOCONTROL_LATCH_BIT (1 << 0) /* Enable input latching */ -#define SC16IS7XX_IOCONTROL_MODEM_BIT (1 << 1) /* Enable GPIO[7:4] as modem pins */ +#define SC16IS7XX_IOCONTROL_MODEM_A_BIT (1 << 1) /* Enable GPIO[7:4] as modem A pins */ +#define SC16IS7XX_IOCONTROL_MODEM_B_BIT (1 << 2) /* Enable GPIO[3:0] as modem B pins */ #define SC16IS7XX_IOCONTROL_SRESET_BIT (1 << 3) /* Software Reset */ /* EFCR register bits */ @@ -301,12 +302,12 @@ /* Misc definitions */ #define SC16IS7XX_FIFO_SIZE (64) #define SC16IS7XX_REG_SHIFT 2 +#define SC16IS7XX_GPIOS_PER_BANK 4 struct sc16is7xx_devtype { char name[10]; int nr_gpio; int nr_uart; - int has_mctrl; }; #define SC16IS7XX_RECONF_MD (1 << 0) @@ -336,6 +337,7 @@ struct sc16is7xx_port { struct clk *clk; #ifdef CONFIG_GPIOLIB struct gpio_chip gpio; + unsigned long gpio_valid_mask; #endif unsigned char buf[SC16IS7XX_FIFO_SIZE]; struct kthread_worker kworker; @@ -447,35 +449,30 @@ static const struct sc16is7xx_devtype sc16is74x_devtype = { .name = "SC16IS74X", .nr_gpio = 0, .nr_uart = 1, - .has_mctrl = 0, }; static const struct sc16is7xx_devtype sc16is750_devtype = { .name = "SC16IS750", - .nr_gpio = 4, + .nr_gpio = 8, .nr_uart = 1, - .has_mctrl = 1, }; static const struct sc16is7xx_devtype sc16is752_devtype = { .name = "SC16IS752", - .nr_gpio = 0, + .nr_gpio = 8, .nr_uart = 2, - .has_mctrl = 1, }; static const struct sc16is7xx_devtype sc16is760_devtype = { .name = "SC16IS760", - .nr_gpio = 4, + .nr_gpio = 8, .nr_uart = 1, - .has_mctrl = 1, }; static const struct sc16is7xx_devtype sc16is762_devtype = { .name = "SC16IS762", - .nr_gpio = 0, + .nr_gpio = 8, .nr_uart = 2, - .has_mctrl = 1, }; static bool sc16is7xx_regmap_volatile(struct device *dev, unsigned int reg) @@ -1350,16 +1347,45 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, return 0; } -static int sc16is7xx_setup_gpio_chip(struct device *dev) +static int sc16is7xx_gpio_init_valid_mask(struct gpio_chip *chip, + unsigned long *valid_mask, + unsigned int ngpios) +{ + struct sc16is7xx_port *s = gpiochip_get_data(chip); + + *valid_mask = s->gpio_valid_mask; + + return 0; +} + +static int sc16is7xx_setup_gpio_chip(struct device *dev, u8 mctrl_mask) { struct sc16is7xx_port *s = dev_get_drvdata(dev); if (!s->devtype->nr_gpio) return 0; + switch (mctrl_mask) { + case 0: + s->gpio_valid_mask = GENMASK(7, 0); + break; + case SC16IS7XX_IOCONTROL_MODEM_A_BIT: + s->gpio_valid_mask = GENMASK(3, 0); + break; + case SC16IS7XX_IOCONTROL_MODEM_B_BIT: + s->gpio_valid_mask = GENMASK(7, 4); + break; + default: + break; + } + + if (!s->gpio_valid_mask) + return 0; + s->gpio.owner = THIS_MODULE; s->gpio.parent = dev; s->gpio.label = dev_name(dev); + s->gpio.init_valid_mask = sc16is7xx_gpio_init_valid_mask; s->gpio.direction_input = sc16is7xx_gpio_direction_input; s->gpio.get = sc16is7xx_gpio_get; s->gpio.direction_output = sc16is7xx_gpio_direction_output; @@ -1371,6 +1397,43 @@ static int sc16is7xx_setup_gpio_chip(struct device *dev) } #endif +static int sc16is7xx_setup_mctrl_ports(struct device *dev) +{ + struct sc16is7xx_port *s = dev_get_drvdata(dev); + int i; + int ret; + int count; + u32 mctrl_port[2]; + u8 mctrl_mask = 0; + + count = device_property_count_u32(dev, "nxp,modem-control-line-ports"); + if (count < 0 || count > ARRAY_SIZE(mctrl_port)) + return mctrl_mask; + + ret = device_property_read_u32_array(dev, "nxp,modem-control-line-ports", + mctrl_port, count); + if (ret) + return mctrl_mask; + + for (i = 0; i < count; i++) { + /* Use GPIO lines as modem control lines */ + if (mctrl_port[i] == 0) + mctrl_mask |= SC16IS7XX_IOCONTROL_MODEM_A_BIT; + else if (mctrl_port[i] == 1) + mctrl_mask |= SC16IS7XX_IOCONTROL_MODEM_B_BIT; + } + + if (!mctrl_mask) + return mctrl_mask; + + regmap_update_bits(s->regmap, + SC16IS7XX_IOCONTROL_REG << SC16IS7XX_REG_SHIFT, + SC16IS7XX_IOCONTROL_MODEM_A_BIT | + SC16IS7XX_IOCONTROL_MODEM_B_BIT, mctrl_mask); + + return mctrl_mask; +} + static const struct serial_rs485 sc16is7xx_rs485_supported = { .flags = SER_RS485_ENABLED | SER_RS485_RTS_AFTER_SEND, .delay_rts_before_send = 1, @@ -1383,6 +1446,7 @@ static int sc16is7xx_probe(struct device *dev, { unsigned long freq = 0, *pfreq = dev_get_platdata(dev); unsigned int val; + u8 mctrl_mask = 0; u32 uartclk = 0; int i, ret; struct sc16is7xx_port *s; @@ -1478,12 +1542,6 @@ static int sc16is7xx_probe(struct device *dev, SC16IS7XX_EFCR_RXDISABLE_BIT | SC16IS7XX_EFCR_TXDISABLE_BIT); - /* Use GPIO lines as modem status registers */ - if (devtype->has_mctrl) - sc16is7xx_port_write(&s->p[i].port, - SC16IS7XX_IOCONTROL_REG, - SC16IS7XX_IOCONTROL_MODEM_BIT); - /* Initialize kthread work structs */ kthread_init_work(&s->p[i].tx_work, sc16is7xx_tx_proc); kthread_init_work(&s->p[i].reg_work, sc16is7xx_reg_proc); @@ -1521,6 +1579,8 @@ static int sc16is7xx_probe(struct device *dev, s->p[u].irda_mode = true; } + mctrl_mask = sc16is7xx_setup_mctrl_ports(dev); + #ifdef CONFIG_GPIOLIB ret = sc16is7xx_setup_gpio_chip(dev, mctrl_mask); if (ret) @@ -1547,7 +1607,7 @@ static int sc16is7xx_probe(struct device *dev, return 0; #ifdef CONFIG_GPIOLIB - if (devtype->nr_gpio) + if (s->gpio_valid_mask) gpiochip_remove(&s->gpio); out_thread: @@ -1573,7 +1633,7 @@ static void sc16is7xx_remove(struct device *dev) int i; #ifdef CONFIG_GPIOLIB - if (s->devtype->nr_gpio) + if (s->gpio_valid_mask) gpiochip_remove(&s->gpio); #endif From patchwork Thu Jun 1 16:31:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102096 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp474975vqr; Thu, 1 Jun 2023 09:57:49 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4leY/YnAe9z04VH/pp3QhVSp/NWSkdTtJdxpgUV4uQvAVEE4e9OQb3wteOVl4/5SpHne3n X-Received: by 2002:a05:6a20:ce4f:b0:10e:de4f:3437 with SMTP id id15-20020a056a20ce4f00b0010ede4f3437mr9263606pzb.39.1685638669567; Thu, 01 Jun 2023 09:57:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638669; cv=none; d=google.com; s=arc-20160816; b=QEoWKv4wPe0ELrnL9Mj3kmKyeTTYn3v91pkfdgBN99b0Wc4OdB2aB2eXwRARV4cJIb XSNqfa+qDF8N9hjxA15jF0U3g9TJ37TIx5lUyfxhvcQZh15zOcmy/T6+yHr2PpRfN00N fOeE/+sFNSHyHW04W/McBD+Nb8YhdpZyRJJqPjRi7kl0wtcwnOTm+lUiMZjuyVgZ/5Zd PY1CC5QmTzZ6rKvZMJNOSVweU9K32qtLK3KSc2jLXGA6DzdXkbtq6sfoUx7Cg3HXUyks Q4sC9pK1Ml3mk3NQSOP+jXshJHnv7jFg0ow5ArhoHTwdB5m1vCPVbvlpa4d3q+K1J70x Ed9A== 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=ZiPCnMO76qB2BYRsvuFD+LhH0HMktcgnm3k8GmGktA0=; b=ZRc7FhilcP+jocd2oC34tBgfpj/UNPXC4e/BCnkb3le4xOfKleX6sAGroAbxzdIxEv lrl9gJUqkbsvN7JHlArfwzbv2/TzsI4T27mqFLTKAqcQEGu1CEZxflAOs+Bs3LS2BrDH QFAhUBaWue8T7XxGxSi0fU5OYLCuVoO9/b/IF/fOqt2NJ343wmLLpB8wpT740zI+Lsy+ BADPTx0Y8pldLGV0iSgXwUZJGYiiONETUaiYOKLMBmcCOLK9xxMXnExjLYh9OuU328HZ jqewM8AnoNgIHLPaEnkQ2sgFTi8CIFmhVkZ1xOmVjKnAEhxGQpMLgrunJJxJJ/SDsP0M FB7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="U5b5/XIs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i128-20020a636d86000000b0053f3498ac9dsi10747pgc.677.2023.06.01.09.57.37; Thu, 01 Jun 2023 09:57:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b="U5b5/XIs"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232071AbjFAQuQ (ORCPT + 99 others); Thu, 1 Jun 2023 12:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231439AbjFAQti (ORCPT ); Thu, 1 Jun 2023 12:49:38 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E3D8E53; Thu, 1 Jun 2023 09:49:24 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ZiPCnMO76qB2BYRsvuFD+LhH0HMktcgnm3k8GmGktA0=; b=U5b5/XIstKLYENZYR/TX71aRRf yLZ88yJnyKOS44fQJk5ChaDOxrFOnoOecHd+RIThmu1uhGE90VkqltF1RnZYehWDijnkNrRWLTBwZ qGpOii/hQG14HeciG6hJgphqBTP8OWbB8F7RbE4eAzepIOyqyeX4QoBXc04l5NavNfVc=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCw-0003BU-P0; Thu, 01 Jun 2023 12:31:27 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , stable@vger.kernel.org, Lech Perczak Date: Thu, 1 Jun 2023 12:31:10 -0400 Message-Id: <20230601163113.2785657-7-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 6/9] serial: sc16is7xx: fix bug when first setting GPIO direction 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767520253518388160?= X-GMAIL-MSGID: =?utf-8?q?1767520253518388160?= From: Hugo Villeneuve When configuring a pin as an output pin with a value of logic 0, we end up as having a value of logic 1 on the output pin. Setting a logic 0 a second time (or more) after that will correctly output a logic 0 on the output pin. By default, all GPIO pins are configured as inputs. When we enter sc16is7xx_gpio_direction_output() for the first time, we first set the desired value in IOSTATE, and then we configure the pin as an output. The datasheet states that writing to IOSTATE register will trigger a transfer of the value to the I/O pin configured as output, so if the pin is configured as an input, nothing will be transferred. Therefore, set the direction first in IODIR, and then set the desired value in IOSTATE. This is what is done in NXP application note AN10587. Fixes: dfeae619d781 ("serial: sc16is7xx") Cc: Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index ad6b9d613b33..2fa09baf28e3 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1340,9 +1340,18 @@ static int sc16is7xx_gpio_direction_output(struct gpio_chip *chip, state |= BIT(offset); else state &= ~BIT(offset); - sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state); + + /* + * If we write IOSTATE first, and then IODIR, the output value is not + * transferred to the corresponding I/O pin. + * The datasheet states that each register bit will be transferred to + * the corresponding I/O pin programmed as output when writing to + * IOSTATE. Therefore, configure direction first with IODIR, and then + * set value after with IOSTATE. + */ sc16is7xx_port_update(port, SC16IS7XX_IODIR_REG, BIT(offset), BIT(offset)); + sc16is7xx_port_write(port, SC16IS7XX_IOSTATE_REG, state); return 0; } From patchwork Thu Jun 1 16:31:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 102082 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp468014vqr; Thu, 1 Jun 2023 09:45:06 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69drsqk84eB0x6gnEKPMZiSIbq7wD3Ic/UR0WwMbGr2vLBgmyXpVE/GNe2ERmv6ALeGu5/ X-Received: by 2002:a05:6a20:3d03:b0:10e:d134:d686 with SMTP id y3-20020a056a203d0300b0010ed134d686mr11302121pzi.6.1685637905727; Thu, 01 Jun 2023 09:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685637905; cv=none; d=google.com; s=arc-20160816; b=xKgUA1qKJNc26B2L08EA7JGo4sYHqxiGjS4U4UUFMcRJauoqQu7ceUP2zrlw4RDiU3 iD09gpGSAG7CJC2BZtgjWf5UXI5WmcS1HE1L8jvoScX2gBjAKYtZJVc8S+HVeHJFnHpg gvkdqh0p+6TzT6I8DZxx7hKAZGKG0TVBvd39EccnCuWf2PGSbBexjhcV9nfY441fJ7HP h52QQTeBg5b0d9PhrZH72w3Mu19TR+/IkQ1VplDQPCYZrLRvriSq/y3CISp93uoXS/hD iXnqDA92RHYDPrLBcAAmHi+ExmtS3pPA9iemtAw1IkHCnbfBYbUUJbtUuDIv8reMrKHo Y5cg== 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=Z3WZIzncTr6MCeVd4lJqIf8LqUrhJSqs0YEKHbqWmt4=; b=JbUjpx9sM+oKMpd/HemR1xFh+PlkL+C/ZtBLn9QVr54SOU8kMGGqNmjF2vPiEuYMQC 68bKpTy3vI50mk4vUX7VH6TzSNApu+DF2SUu/4enUDXvYKsFykCO8trPj6oEPpK8a5LL OJh2HZAld7NQv+xLcNc8nGN9byBm7sgdUdV897iDyzUmVVeR5isP29DMYp+qLdyRy5c8 46pjaRuowChB/OAL5t3eckQaahAF+7ILgdWneocPLAXkaQhW5/E9RMqMFHXa2P5BP2f4 EWUgdrgI/mv6nCQgHPcJ8R6ivcV/JWcVg/4iWV5Vj6ZRB+9nVMzKPtHeQtsLr1N4ncCQ phJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=VDh7wzXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i17-20020a17090ad35100b00246a5991cc6si1101684pjx.162.2023.06.01.09.44.50; Thu, 01 Jun 2023 09:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=VDh7wzXM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbjFAQbo (ORCPT + 99 others); Thu, 1 Jun 2023 12:31:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231298AbjFAQbg (ORCPT ); Thu, 1 Jun 2023 12:31:36 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 872AFD1; Thu, 1 Jun 2023 09:31:34 -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:Content-Type:MIME-Version: References:In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=Z3WZIzncTr6MCeVd4lJqIf8LqUrhJSqs0YEKHbqWmt4=; b=VDh7wzXM/OCFUOqHkjnlZkQpYE beddES8GtwmOaKAukNEjkrDdFELmpf5aoSGmizJa1LlV1D0ib6KyXhHuF6/VGjzKjxNnUb+Mj2WqN Yn+yfTk9ElbbIFn6T1WMAnOoqplMe1pyZEupP3HMxpMJeN3/vK/gWMLu+MZTypBdFuzQ=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCy-0003BU-8r; Thu, 01 Jun 2023 12:31:29 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , Lech Perczak Date: Thu, 1 Jun 2023 12:31:11 -0400 Message-Id: <20230601163113.2785657-8-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 7/9] serial: sc16is7xx: add call to get rs485 DT flags and properties 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767519452640121395?= X-GMAIL-MSGID: =?utf-8?q?1767519452640121395?= From: Hugo Villeneuve Add call to uart_get_rs485_mode() to probe for RS485 flags and properties from device tree. Signed-off-by: Hugo Villeneuve Reviewed-by: Ilpo Järvinen Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 2fa09baf28e3..388c1d490853 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1544,6 +1544,10 @@ static int sc16is7xx_probe(struct device *dev, goto out_ports; } + ret = uart_get_rs485_mode(&s->p[i].port); + if (ret) + goto out_ports; + /* Disable all interrupts */ sc16is7xx_port_write(&s->p[i].port, SC16IS7XX_IER_REG, 0); /* Disable TX/RX */ From patchwork Thu Jun 1 16:31: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: 102093 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp472852vqr; Thu, 1 Jun 2023 09:53:55 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5s50HLUoEVFbNVbw6t6rTdxtD1fLvGfDrN1RDN5usi9thzp5HbpRNtdWK/BeDAp5OXHJzI X-Received: by 2002:a05:6a00:842:b0:64d:3227:b806 with SMTP id q2-20020a056a00084200b0064d3227b806mr8597162pfk.33.1685638434856; Thu, 01 Jun 2023 09:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638434; cv=none; d=google.com; s=arc-20160816; b=ltrJeg0YdRWYj2TmiAZNFssKRz+Q7d4bud9LkK6jTqdW/bZIYx1R/DsomS9MNhlLt6 Flz5f3vmQiVji6/foOIJkt8D8YQFgoUiX3uOsj642KEJYvQsiJFmoS8Z2FvwQ2WSmiTb XhOInmLE4qTlGynPAxbOdsV8IDqg/JhJsMXqAG9WouRSw5ZlSd+d199uuoF4DR8rH0Tz 987fc3JfPdrwFMu69c69QD1ephP+FFkcOUoy9pmg36LgYxeoBVkMGr/ceNBaso2cw7M2 Qw1DfpwOdh1YHPKjgCSNaVXSFHft3Df+2aXrF9i7ooyIrcj+JTgEEmkYo4jYgouANhHo 8ipg== 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=fISA+M83zRFEgKAdJUAq2HgGHBk9L99uymCON8uLsVo=; b=Ac1H2xjK5PzXFijVttW8QDPk0X/I9jf88XGEUImL4FGY7OR6R0rRlpiyjbPyj8DLuS kCWUO+NLmd9hP+wkWX+nYvYD0+Hna1g7WRK4PdG6zUqiEazJZsn/jnButMkBkpteIfFK Jzh6YICkS924UFQvstMRpU3vdrNEg6M3qEfYfrnA9lG8WOLJIyw/fAdk10j8HYcX2Om7 XdJkWhFIB6ph9go94ajP/FpvXp3MF7gIxrPKusBGIhzbIGSuSCm4Qv9Fa6m1aqdMdd6b /MqRQoVNY67VjYr3snRIMVr0psK+WkymxdBkKRGZ4D1lqcez0COyF1BkjGmIw64h1QOl f2OA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=NcOSLRdg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h13-20020a056a00000d00b0064f78c32b89si5744554pfk.95.2023.06.01.09.53.42; Thu, 01 Jun 2023 09:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=NcOSLRdg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231987AbjFAQtO (ORCPT + 99 others); Thu, 1 Jun 2023 12:49:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231698AbjFAQtI (ORCPT ); Thu, 1 Jun 2023 12:49:08 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 131CD194; Thu, 1 Jun 2023 09:49:08 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=fISA+M83zRFEgKAdJUAq2HgGHBk9L99uymCON8uLsVo=; b=NcOSLRdgECoggvVq0+v0TKSEji TBzrAhx9FH3+c6VakFHL/u0DxXl09zr+v6SvL11q0q46QwIiAUrwfUHkNzw2bcKTpO9sUBfJNooFW W/Eb4rWAJJE1rmtbR4Pv41/3iBwcCWG5J21aiMfptm4JkR2nt1jgfKEICnoT8QkAk0hA=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lCz-0003BU-OO; Thu, 01 Jun 2023 12:31:30 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , Lech Perczak Date: Thu, 1 Jun 2023 12:31:12 -0400 Message-Id: <20230601163113.2785657-9-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 8/9] serial: sc16is7xx: add post reset delay 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767520007852647713?= X-GMAIL-MSGID: =?utf-8?q?1767520007852647713?= From: Hugo Villeneuve Make sure we wait at least 3us before initiating communication with the device after reset. Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak Tested-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 388c1d490853..9b2d58023c55 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1521,6 +1521,12 @@ static int sc16is7xx_probe(struct device *dev, regmap_write(s->regmap, SC16IS7XX_IOCONTROL_REG << SC16IS7XX_REG_SHIFT, SC16IS7XX_IOCONTROL_SRESET_BIT); + /* + * After reset, the host must wait at least 3us before initializing a + * communication with the device. + */ + usleep_range(5, 10); + for (i = 0; i < devtype->nr_uart; ++i) { s->p[i].line = i; /* Initialize port data */ From patchwork Thu Jun 1 16:31: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: 102090 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp471581vqr; Thu, 1 Jun 2023 09:51:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6U5fC9z7zfXwbLzD7kVN3ACCV7L+VRntVPPMa+O+zaYWT4hF0+bH7MfYw3QIwNyZoRd9x0 X-Received: by 2002:a05:6358:7206:b0:127:a46c:7cee with SMTP id h6-20020a056358720600b00127a46c7ceemr7830544rwa.8.1685638300721; Thu, 01 Jun 2023 09:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685638300; cv=none; d=google.com; s=arc-20160816; b=ZFMCsviAB4Mip2O40GWwatGpVq7k9As6v6fhWRG8IE9CTUOHZ9vrhHlrpkUIH+rU63 tvGMf+BgXNpM0Rjp4/H8eZixMzqLyynUa9YCbBTLvGEFxWTwjcrORLiiswIzwA3xuBOM DNRMHnkC3Xm8955zEQEeJOJtIkqOrxzQbbxgrAdSf49B1YFyAJYxbWQfMaEQtw7t0Cqs hSl9uTc65s1kOr5WH4cjmU89l5funzWDCZkL7X1ltBEHOKD849ULutFZklqTPaVRB1z6 YIuMeU/EWVHsFUqdrKparDc46YqEbOec9Jax+16e1YPNwLWTB13hYvcVW3yShLuUvZGa /Obg== 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=Vpxb2SEuweBhIUfqr9sMJSgr1YIceBLIzWJb0gIKyDM=; b=ofsLt+fT3sBwgnKaRyG6Ot615ZY8yX989HDo7o45hq/BNODyTtJp38EE/wq82CQ7rj E8b+73jvv4l5AqfZPYVrleulcRqpV0VXbDIkyE3igxtpO+Cs+DwkQemyitUPT00YNmM/ I2lu9mLUh7hIvnFFacHhs2HsySGQGer3PSp/phRGZpIZM2fLiae7RlwheA/HV0r4VNnJ CwDDyi5vmQOazlWSsk+PUzlaJVfvMgFP4f3AAPrjIsjGwJF4R3RinHKwipJW/TEQy10T FZvpujxGHDC37Y1xNgUrK4cUzBrLXqpJ04U2dTzMNk0qwOzRURS6MVpd77dwbvoqiA/u 8ZiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=fbybWbtL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f13-20020a63754d000000b0052cc0c1c39csi3002119pgn.815.2023.06.01.09.51.28; Thu, 01 Jun 2023 09:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=fbybWbtL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231955AbjFAQuN (ORCPT + 99 others); Thu, 1 Jun 2023 12:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231929AbjFAQt1 (ORCPT ); Thu, 1 Jun 2023 12:49:27 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77EF01AE; Thu, 1 Jun 2023 09:49:14 -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:References: In-Reply-To:Message-Id:Date:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Vpxb2SEuweBhIUfqr9sMJSgr1YIceBLIzWJb0gIKyDM=; b=fbybWbtL8XvDfwEpSkDUY2ZuS1 ucBX/z5/GRd6IbVTfW2W+wlYkQOWezoY32G5VUYaDAj5/oYggFJEHxx7P3xXkfEeMMXRCZuMJdkTa Y97AyTiTvgJev+XH3ISdVb4G7w+NdZ08tdQlfxQdm5CemHgG/pOm0hi5WFdDXEW2/mHU=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53588 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q4lD1-0003BU-5g; Thu, 01 Jun 2023 12:31:32 -0400 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, l.perczak@camlintechnologies.com, tomasz.mon@camlingroup.com Cc: linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, hugo@hugovil.com, linux-gpio@vger.kernel.org, Hugo Villeneuve , Lech Perczak Date: Thu, 1 Jun 2023 12:31:13 -0400 Message-Id: <20230601163113.2785657-10-hugo@hugovil.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601163113.2785657-1-hugo@hugovil.com> References: <20230601163113.2785657-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, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH v5 9/9] serial: sc16is7xx: improve comments about variants 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-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767519867195463775?= X-GMAIL-MSGID: =?utf-8?q?1767519867195463775?= From: Hugo Villeneuve Replace 740/750/760 with generic terms like 74x/75x/76x to account for variants like 741, 752 and 762. Signed-off-by: Hugo Villeneuve Reviewed-by: Lech Perczak --- drivers/tty/serial/sc16is7xx.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 9b2d58023c55..59338f5ca180 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -223,7 +223,7 @@ * trigger levels. Trigger levels from 4 characters to 60 characters are * available with a granularity of four. * - * When the trigger level setting in TLR is zero, the SC16IS740/750/760 uses the + * When the trigger level setting in TLR is zero, the SC16IS74x/75x/76x uses the * trigger level setting defined in FCR. If TLR has non-zero trigger level value * the trigger level defined in FCR is discarded. This applies to both transmit * FIFO and receive FIFO trigger level setting. @@ -234,7 +234,7 @@ #define SC16IS7XX_TLR_TX_TRIGGER(words) ((((words) / 4) & 0x0f) << 0) #define SC16IS7XX_TLR_RX_TRIGGER(words) ((((words) / 4) & 0x0f) << 4) -/* IOControl register bits (Only 750/760) */ +/* IOControl register bits (Only 75x/76x) */ #define SC16IS7XX_IOCONTROL_LATCH_BIT (1 << 0) /* Enable input latching */ #define SC16IS7XX_IOCONTROL_MODEM_A_BIT (1 << 1) /* Enable GPIO[7:4] as modem A pins */ #define SC16IS7XX_IOCONTROL_MODEM_B_BIT (1 << 2) /* Enable GPIO[3:0] as modem B pins */ @@ -249,9 +249,9 @@ #define SC16IS7XX_EFCR_RTS_INVERT_BIT (1 << 5) /* RTS output inversion */ #define SC16IS7XX_EFCR_IRDA_MODE_BIT (1 << 7) /* IrDA mode * 0 = rate upto 115.2 kbit/s - * - Only 750/760 + * - Only 75x/76x * 1 = rate upto 1.152 Mbit/s - * - Only 760 + * - Only 76x */ /* EFR register bits */