From patchwork Thu Nov 30 19:10:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172048 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619290vqy; Thu, 30 Nov 2023 11:11:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IGmvBjJZ/DNxwuXliJccps55kZCFJ5O/ty72z7vHuE1gMEeUYwFgel/+kbTTjeGXDTzUaBU X-Received: by 2002:a05:6808:4484:b0:3b7:6a5:3cc6 with SMTP id eq4-20020a056808448400b003b706a53cc6mr652823oib.44.1701371478098; Thu, 30 Nov 2023 11:11:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371478; cv=none; d=google.com; s=arc-20160816; b=arzRuPWIYXhwIkQzr2uG9szi6H0A/BpgvgsWgI7U3ppWYd+dHVr0NSJPjV0ZkFr89s vDtb0Vo/4DRavAqq/Rz+fidD7sOEnrQ5z3b3C2E5MzBxwsHD+0kv7dQ40iNepW21vyyy MDfNfuVwraKsS8nWdkfa47qcvZnGnYLt9lRBxHfSKfLW7LOIKourq9CdJoRGx93z7j0H 2ZY6lOStFc42gCysGi+QTwMke7cb/038v96JW4G40XpG+wfda1oky5nEBwr//5VF7Agm CaIGlvDz/F3QGN3F6bSKzCbWG1Iti9z8jBt8Y6/LZYz5qVNSSGR/jh+kNGTb9ZRldHE3 YQkQ== 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=AEm+IaX9A4uvKk4v1WSGhlTmQPSBKm4TU4lKJNYntmE=; fh=xaQPD6qLSjFCQPlkdqf6j0Kq0gyZF2Liq76NGJH/bQ8=; b=WijndwT+WmvZQCaKpbZmx3Sl8fF9H7sMxRL1kui61qlBHpnUoJLiSInpPFq5AIzO+v /v2jmd5uZscGIDIZDSMj2dwgzPtTaAYoKekfX89qPlAGPb7GmDPgCMLTA2IiKZaQ4n4K U3DO636E72sL/oUWzHTiNEGwrav+sF56WjSc1X4PgpuNjDuk8kv9gCewCPVjIAH/JOil 2oqYG0L5Zol0OQCPrwJbdlgHA6XYABDQ3sTzdpK6Q36fUZx81aGJuVJeH25qJNM5QkkV mHMGrxIvBppV7SLNjzTDEIFLldKp4FlgaM2qmdJbkzDi5bkJv17FzOu9JnLZjM0E9jv2 ccCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=Gm9kSMoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id z27-20020a630a5b000000b005c1b2c911f0si1849754pgk.328.2023.11.30.11.11.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=Gm9kSMoJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 EF14A8021EF8; Thu, 30 Nov 2023 11:11:05 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346806AbjK3TKy (ORCPT + 99 others); Thu, 30 Nov 2023 14:10:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232101AbjK3TKv (ORCPT ); Thu, 30 Nov 2023 14:10:51 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0E7910E4; Thu, 30 Nov 2023 11:10:57 -0800 (PST) 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=AEm+IaX9A4uvKk4v1WSGhlTmQPSBKm4TU4lKJNYntmE=; b=Gm9kSMoJBgC1JfrodPB2e0/Yvp 8xiv7QWolS5WzDxSL3I06gC7hYgmBUIQVJpvlghkP1mO1D8Yt4NxZL3BXM5/fO9h7yryINSJ4MWYd jSi5d3SarkgfCVVtil2rAEX3fa9mreEqZQAsVbEovOK2mvP8qLxMCXxFe9UI+UAsMOZM=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR4-0003sb-No; Thu, 30 Nov 2023 14:10:55 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, stable@vger.kernel.org, Andy Shevchenko Date: Thu, 30 Nov 2023 14:10:43 -0500 Message-Id: <20231130191050.3165862-2-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 1/7] serial: sc16is7xx: fix snprintf format specifier in sc16is7xx_regmap_name() 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]); Thu, 30 Nov 2023 11:11:06 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017299016469442 X-GMAIL-MSGID: 1784017299016469442 From: Hugo Villeneuve Change snprint format specifier from %d to %u since port_id is unsigned. Fixes: 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port") Cc: stable@vger.kernel.org # 6.1.x: 3837a03 serial: sc16is7xx: improve regmap debugfs by using one regmap per port Suggested-by: Andy Shevchenko Signed-off-by: Hugo Villeneuve --- I did not originally add a "Cc: stable" tag for commit 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port") as it was intended only to improve debugging using debugfs. But since then, I have been able to confirm that it also fixes a long standing bug in our system where the Tx interrupt are no longer enabled at some point when transmitting large RS-485 paquets (> 64 bytes, which is the size of the FIFO). I have been investigating why, but so far I haven't found the exact cause, altough I suspect it has something to do with regmap caching. Therefore, I have added it as a prerequisite for this patch so that it is automatically added to the stable kernels. --- drivers/tty/serial/sc16is7xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 10e90a7774f0..8e5baf2f6ec6 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -1700,7 +1700,7 @@ static const char *sc16is7xx_regmap_name(unsigned int port_id) { static char buf[6]; - snprintf(buf, sizeof(buf), "port%d", port_id); + snprintf(buf, sizeof(buf), "port%u", port_id); return buf; } From patchwork Thu Nov 30 19:10:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172054 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619643vqy; Thu, 30 Nov 2023 11:11:48 -0800 (PST) X-Google-Smtp-Source: AGHT+IE3QYkkKf9+jLzv/rKRs4S1jY6kHPr+n5mgXtSkcAMpsjUmwlbUgrqRVf+lnisuSKAJhhWa X-Received: by 2002:a05:6a00:1888:b0:6cd:daa5:1398 with SMTP id x8-20020a056a00188800b006cddaa51398mr6653435pfh.9.1701371508154; Thu, 30 Nov 2023 11:11:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371508; cv=none; d=google.com; s=arc-20160816; b=Md+YbdiypspaW4HebAZdOQCf26dwr+v/kagJpXHuSMadPkSkx+fNN1dM/SHvwjlJbY c1C4Oea6fIBx4PqBD0CXhA8wKT7/K43zTpAfHImfMyna/6ycuMneZk7AZICkZ6rE/1tg VrrbWyc+CLopdMb3EhHjzOB0vwGIWHMB1pva1vBq4nPyzJo25dJH7GAuksZ8f/OerTGg 6JCvT5XnWBF/9qoFXH/Ivhcja+gwmRNnsieAX/9sd4B/3kU5oSd6jYX2OYCDS/Rd+yZg ljpfQ2aWRBuXh3MwSwZwCSsFQt1YeJqSitq0zmFF1bbKxS+bGw89O1GFPaFKaNjo0Jmu p3tg== 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=sf/+tsRuKLsDDbGlmeVGJcieRbgKthsotmSW2vG3wDg=; fh=xaQPD6qLSjFCQPlkdqf6j0Kq0gyZF2Liq76NGJH/bQ8=; b=P+3zExUnRdVV1/TckRGhIsw36LqrBy9oAGnQ+3ET9wl4qdGOs9PCkEDm+XqxoJqL7J SjoR/OUuU9WvR/Pms+Sbqzj2lqht/uQXLOf1VvLErUD4gkZd+iFIHjwpaJUWaXTeJbTT GMEAoPz7lLDFcdJdrclIt06xJiJk79Vsna4tK+Ecd9Rv+35VgSaEkyI51FQeuKbjkW30 FPPcxj0FRdb3HgrhuC4iXY1nMWpzKP/zGNDhtHkPx9WTi3SLkHIJRxZU1Fn8oUEZ1QZ0 Qf3YWXMDiMuMHzS32j+jtZL//eHteqwZukoREBuT+E1vU3OFWhKzYTR+lL1cmtRgvTUn SWRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=jfyPKYM2; 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 b13-20020a056a000a8d00b006cb68d85220si1900905pfl.286.2023.11.30.11.11.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:48 -0800 (PST) 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=jfyPKYM2; 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 3E4D18026AC2; Thu, 30 Nov 2023 11:11:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346814AbjK3TK4 (ORCPT + 99 others); Thu, 30 Nov 2023 14:10:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232129AbjK3TKw (ORCPT ); Thu, 30 Nov 2023 14:10:52 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B498210DF; Thu, 30 Nov 2023 11:10:58 -0800 (PST) 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=sf/+tsRuKLsDDbGlmeVGJcieRbgKthsotmSW2vG3wDg=; b=jfyPKYM2uxBgo2F7jDs5J/G1HK G6hRJ9yepRYeD4OnsNHs9eIWBAupcduf1Vf/nETSdFqnVOn++bXOYOHZFG51HuN/O/Wsduqv5obcp itG7MfzI9adnCzqel6eaZUFqUoUTYWVmhmqjuRJ+cSt4w/8dojkfBEyhoAZGJ+IEouRE=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR5-0003sb-Q2; Thu, 30 Nov 2023 14:10:56 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, stable@vger.kernel.org, Andy Shevchenko Date: Thu, 30 Nov 2023 14:10:44 -0500 Message-Id: <20231130191050.3165862-3-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 2/7] serial: sc16is7xx: remove global regmap from struct sc16is7xx_port 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]); Thu, 30 Nov 2023 11:11:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017330238641213 X-GMAIL-MSGID: 1784017330238641213 From: Hugo Villeneuve Remove global struct regmap so that it is more obvious that this regmap is to be used only in the probe function. Also add a comment to that effect in probe function. Fixes: 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port") Cc: stable@vger.kernel.org Suggested-by: Andy Shevchenko Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 8e5baf2f6ec6..23dbf77633aa 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -334,7 +334,6 @@ struct sc16is7xx_one { struct sc16is7xx_port { const struct sc16is7xx_devtype *devtype; - struct regmap *regmap; struct clk *clk; #ifdef CONFIG_GPIOLIB struct gpio_chip gpio; @@ -1422,7 +1421,8 @@ static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s) /* * Configure ports designated to operate as modem control lines. */ -static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s) +static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s, + struct regmap *regmap) { int i; int ret; @@ -1451,7 +1451,7 @@ static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s) if (s->mctrl_mask) regmap_update_bits( - s->regmap, + regmap, SC16IS7XX_IOCONTROL_REG, SC16IS7XX_IOCONTROL_MODEM_A_BIT | SC16IS7XX_IOCONTROL_MODEM_B_BIT, s->mctrl_mask); @@ -1483,6 +1483,10 @@ static int sc16is7xx_probe(struct device *dev, * This device does not have an identification register that would * tell us if we are really connected to the correct device. * The best we can do is to check if communication is at all possible. + * + * Note: regmap[0] is used in the probe function to access registers + * common to all channels/ports, as it is guaranteed to be present on + * all variants. */ ret = regmap_read(regmaps[0], SC16IS7XX_LSR_REG, &val); if (ret < 0) @@ -1518,7 +1522,6 @@ static int sc16is7xx_probe(struct device *dev, return -EINVAL; } - s->regmap = regmaps[0]; s->devtype = devtype; dev_set_drvdata(dev, s); mutex_init(&s->efr_lock); @@ -1533,7 +1536,7 @@ static int sc16is7xx_probe(struct device *dev, sched_set_fifo(s->kworker_task); /* reset device, purging any pending irq / data */ - regmap_write(s->regmap, SC16IS7XX_IOCONTROL_REG, + regmap_write(regmaps[0], SC16IS7XX_IOCONTROL_REG, SC16IS7XX_IOCONTROL_SRESET_BIT); for (i = 0; i < devtype->nr_uart; ++i) { @@ -1604,7 +1607,7 @@ static int sc16is7xx_probe(struct device *dev, sc16is7xx_setup_irda_ports(s); - ret = sc16is7xx_setup_mctrl_ports(s); + ret = sc16is7xx_setup_mctrl_ports(s, regmaps[0]); if (ret) goto out_ports; From patchwork Thu Nov 30 19:10:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172050 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619522vqy; Thu, 30 Nov 2023 11:11:37 -0800 (PST) X-Google-Smtp-Source: AGHT+IGjZPeaZA4pqKFAywH49gjAJRmORVQh8tLEOm+qTSXWF+2HdVz5WFFY/c3IQjXLvM4elLWl X-Received: by 2002:a05:6a20:729e:b0:18a:f5df:5f88 with SMTP id o30-20020a056a20729e00b0018af5df5f88mr24793549pzk.62.1701371497265; Thu, 30 Nov 2023 11:11:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371497; cv=none; d=google.com; s=arc-20160816; b=EtGPdeRB2Ij3KPVdOukdJ8wzIuHVP3i7qD2CD6rHBvqRKTqBH3sdm6eU9KfjW8gL9r +sR5X2J9KgYi3/M2+vVMFcan1VpMiaDhjugaIflgdvylTizhIys/1upUpVsMLbMOkV33 7xdFhda74KElHyMxwjyL23OLQkr+00VilW5bvPXUNhFdOXudymBzaPsy7f6Cw7QekuCG 3ctjUbPPOzVrS5Wm2TabZMH8bmlru96+al4bdZMDMqMavtbPZY67hQywUbfWtqGswZUE 6pJpsILsgNQ02i5z2cBg4hUn+o7QOQbesaF82dZwgtEttGQUtdsTgTDjok+Tz+epeGPW oaww== 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=zk4Hkg7idmim2pTbuqk/gGrXDoGQx8iWGVefYzP51v0=; fh=mOlDaZ9QHuelNM4OCRU3E8qjrA5UwL1+Mae1f1/l0L4=; b=0lfomDvttKa1By06qbZyrUEvl2xxavD+faNkRTT+8MGcFimjfHQxXOrjdGeuwHLkNo t1SpBIaeE2ekv2sGIm+soHgoCcoMTL62kc5iF3aQCV8z++4RTGYbykvZltcb+eHZ7nB6 JZMsW3nLWTe7J/3xl7rGcyyXh/MQRtio+Y4MzC+6/bX/K0wosM7nhzolqKLyp56LK2q6 VHujTaZg+GkUupz+dTEt0CzwOIFYUF0aAgOZUjF5Pn9RSqo8fPmDAHQBwNfh64OFdgX0 1tZ5a4d4AjxUZ1eu/kq4PkAgeJGQq2Sm+uZepu9MSNvtY4/QrLTVBLNR8pUnVRhKN578 NCVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=hue5ecrI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id v17-20020a056a00149100b006cd9e5b2d84si1874968pfu.328.2023.11.30.11.11.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=hue5ecrI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 9EA2782CD63F; Thu, 30 Nov 2023 11:11:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346828AbjK3TK7 (ORCPT + 99 others); Thu, 30 Nov 2023 14:10:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232179AbjK3TKx (ORCPT ); Thu, 30 Nov 2023 14:10:53 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8765010E2; Thu, 30 Nov 2023 11:10:59 -0800 (PST) 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=zk4Hkg7idmim2pTbuqk/gGrXDoGQx8iWGVefYzP51v0=; b=hue5ecrI9QvcEfEqPB1qK6WGWA j9pEZ4O8E+H6jXobwstV0toyTAt/A8BAJqCG5WdjH9HVdHJlqsJ2D0ISgkAHY9LkAFvIDXKH2Ywt3 UC623yUSsnnGCnVK44I5YRtFsRvEMvoYH9r8acFcdECWs+TCPGiHm0WD44ubMJztQ/uM=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR6-0003sb-Uy; Thu, 30 Nov 2023 14:10:57 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com, stable@vger.kernel.org Date: Thu, 30 Nov 2023 14:10:45 -0500 Message-Id: <20231130191050.3165862-4-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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 pete.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 3/7] serial: sc16is7xx: remove unused line structure member 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 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:11:24 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017319039190214 X-GMAIL-MSGID: 1784017319039190214 From: Hugo Villeneuve Now that the driver has been converted to use one regmap per port, the line structure member is no longer used, so remove it. Fixes: 3837a0379533 ("serial: sc16is7xx: improve regmap debugfs by using one regmap per port") Cc: stable@vger.kernel.org Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 23dbf77633aa..eb2c0dcd3775 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -322,7 +322,6 @@ struct sc16is7xx_one_config { struct sc16is7xx_one { struct uart_port port; - u8 line; struct regmap *regmap; struct kthread_work tx_work; struct kthread_work reg_work; @@ -1540,7 +1539,6 @@ static int sc16is7xx_probe(struct device *dev, SC16IS7XX_IOCONTROL_SRESET_BIT); for (i = 0; i < devtype->nr_uart; ++i) { - s->p[i].line = i; /* Initialize port data */ s->p[i].port.dev = dev; s->p[i].port.irq = irq; From patchwork Thu Nov 30 19:10:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172049 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619399vqy; Thu, 30 Nov 2023 11:11:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IFVFYGHwSIgXt94uTT/fDCmPRRTym1F8+vjnac5B6bNDrMjvlofag1XF1HPVdhy2dpo1zxs X-Received: by 2002:a05:6a00:1ca8:b0:6cd:e52c:8d62 with SMTP id y40-20020a056a001ca800b006cde52c8d62mr3444136pfw.1.1701371487726; Thu, 30 Nov 2023 11:11:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371487; cv=none; d=google.com; s=arc-20160816; b=nUy0kVrXrPEQxE10hM8woC5HjZXedIER7T6HmqbJSLjWPhcLkOKzc9184Annr2YUUE 67Gu4MgxpTsYbdOge37SEkSixCrw91L+2zcrWSmYZYHanE2IoTWIDxAR00hakmHuqroL NuWQdg5rv46XpR8+GByBffv1oZipJntPhP7MW9sOpipAyXuIC5GbEt42FmhTrGUxFDHT wL4YS/oxtguTy4SeD1uvFBKpJObCdxYL/CxBpvokZ9zZnE1y81IaiYmn3sTTIW0z1Rwx r7m3/NXqcZOqlWOOqy09fsbyyXGOHcfovBSoAaY+YYf/ROFKDw1KmmZTswcRSXsmbWtz tzeA== 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=3PnQzZfqCWVmo+CDz3VaUAypnIbooDxJULrp2OY6blg=; fh=TwCzphd3GvIn5DzVyM5Tad6hmxhn7TdVF0rNjlsRujg=; b=E/mSrQ1IvWtfrD4Hm0MB6OqDHaRbjVyG9aiQS8szLFGuERyziwzoAcK0b5VfM4oTQ1 STPFgZvJqlVZsW2qrIqYGCqtjYIXLOOF7JUh5UBGqO/2rm/r4hh0hcOLJ/2hcldXh5FY BujSY2EotImx0Foym6emFYEKAnUptni4iM8OBR+D6jN8l+xOg4pyC/qP/mbMut18MJ0/ yW+OCuyCOOzcmwLV4E7sruLUuoA4s++oNZJK3Vu8KRLsG/qIwSXcTbrdqvwKa4PFhkfa FBH+k86Sr1n6788cTwJgP0SwQN9CE09cusfIfKWxiSy94pmho03drzY1kcbwHACSfmI0 AEcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=KEht41Db; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id e19-20020a656793000000b005be10ed80d9si1881944pgr.177.2023.11.30.11.11.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=KEht41Db; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 3A0618027B62; Thu, 30 Nov 2023 11:11:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346843AbjK3TLC (ORCPT + 99 others); Thu, 30 Nov 2023 14:11:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346785AbjK3TKy (ORCPT ); Thu, 30 Nov 2023 14:10:54 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4911310EF; Thu, 30 Nov 2023 11:11:00 -0800 (PST) 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=3PnQzZfqCWVmo+CDz3VaUAypnIbooDxJULrp2OY6blg=; b=KEht41DbYffU6ijOAh53f96ftD AtlM0PWbyApl6BpKhSjnIk8GaKfOhHkaFIMzykvAEh+Nz3YVTYbdP1eNdKytpd2/XY9Rljim+MgFn UCu6enfHxXSXkGRjSha326AhtlLEAKQ66xFvDQTyam8RV3PuQjZPggn9YlRrFmNY02/s=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR7-0003sb-Qr; Thu, 30 Nov 2023 14:10:58 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Thu, 30 Nov 2023 14:10:46 -0500 Message-Id: <20231130191050.3165862-5-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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 pete.vger.email X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 4/7] serial: sc16is7xx: add macro for max number of UART ports 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 (pete.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:11:17 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017308862146444 X-GMAIL-MSGID: 1784017308862146444 From: Hugo Villeneuve Add macro to hold the maximum number of UART ports per IC/device. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index eb2c0dcd3775..750c55b93f5e 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -28,6 +28,7 @@ #define SC16IS7XX_NAME "sc16is7xx" #define SC16IS7XX_MAX_DEVS 8 +#define SC16IS7XX_MAX_PORTS 2 /* Maximum number of UART ports per IC. */ /* SC16IS7XX register definitions */ #define SC16IS7XX_RHR_REG (0x00) /* RX FIFO */ @@ -1399,7 +1400,7 @@ static void sc16is7xx_setup_irda_ports(struct sc16is7xx_port *s) int i; int ret; int count; - u32 irda_port[2]; + u32 irda_port[SC16IS7XX_MAX_PORTS]; struct device *dev = s->p[0].port.dev; count = device_property_count_u32(dev, "irda-mode-ports"); @@ -1426,7 +1427,7 @@ static int sc16is7xx_setup_mctrl_ports(struct sc16is7xx_port *s, int i; int ret; int count; - u32 mctrl_port[2]; + u32 mctrl_port[SC16IS7XX_MAX_PORTS]; struct device *dev = s->p[0].port.dev; count = device_property_count_u32(dev, "nxp,modem-control-line-ports"); @@ -1716,7 +1717,7 @@ static unsigned int sc16is7xx_regmap_port_mask(unsigned int port_id) static int sc16is7xx_spi_probe(struct spi_device *spi) { const struct sc16is7xx_devtype *devtype; - struct regmap *regmaps[2]; + struct regmap *regmaps[SC16IS7XX_MAX_PORTS]; unsigned int i; int ret; @@ -1791,7 +1792,7 @@ static int sc16is7xx_i2c_probe(struct i2c_client *i2c) { const struct i2c_device_id *id = i2c_client_get_device_id(i2c); const struct sc16is7xx_devtype *devtype; - struct regmap *regmaps[2]; + struct regmap *regmaps[SC16IS7XX_MAX_PORTS]; unsigned int i; if (i2c->dev.of_node) { From patchwork Thu Nov 30 19:10:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172051 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619538vqy; Thu, 30 Nov 2023 11:11:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IHeIN8f4GjhwvSum/I5fTLvUf2RTFhqXcsyWlMAyn9ysV+Pxap2dviosEcG85pPHC6/AffD X-Received: by 2002:a05:6a20:42a1:b0:187:5fe9:3046 with SMTP id o33-20020a056a2042a100b001875fe93046mr27463522pzj.0.1701371498378; Thu, 30 Nov 2023 11:11:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371498; cv=none; d=google.com; s=arc-20160816; b=teHNDXvFgPOisxMX86tPoebeqSOIP8m9enCexxedQ7ErrktXycQsFyph0ubiEn/FYU Dox2qW+/N+Slodmoje3T5xA2HXs63dHAk4733CdNxUBVWs1xECSDjLHW6UfdJSH1cVKL 7Bmc1605e0V76tLB7nNweotfKoJUfAcVQr4m93CFV9mJz2d2wIyiIPs9ipsc8rGLZM9v +jba+4fPZ7YH0AXjPEi7/p7lloLdkfFol5zsXePknwS8y8oWiRcfN5l30it4dqxKlPF3 WoQJsit61nSBfSx6NF9mta7yEKK+QrIQV/7RDXifTDd1ozdZrxFn1wu0Of3ntoQJMvL2 wFAA== 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=E3rFIY36xk7w67SNdqRVr/ancYZH1uNQAprnseO50p4=; fh=TwCzphd3GvIn5DzVyM5Tad6hmxhn7TdVF0rNjlsRujg=; b=0vYdAC19G9xMxQMut5rU2U4fmlNNzqfCBm9oe68U4hbK4UBuf0bRXjA6niFDe69xXj CPjgqVak0oFY1OkARYbe5uVjNrOYdyu+s1J8tiRZM7fug1WlTezty6yVUKqL3mPE9/tk JiVzJg/H6DQSSb0JvOI/FaWhL6acr6w7ENjeOzhVUeZzTHERhnI3MJ6x6oHACVVeaRnM ylv5FObgWmYY9m/1kQq+xL4QPNs378kVfl9dNh7wVp9pDm45ywyXLplgyS7QB/8aZWf1 1kSmFtwMH64H1ZKXCyOY/T5HDwZ0qnHzpWY21tNAFmtHGijtStu0K4LqGuwBYjMu44sR QDIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=ms58PUp6; 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 jc39-20020a056a006ca700b006c0035ff9dasi1911875pfb.198.2023.11.30.11.11.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:38 -0800 (PST) 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=ms58PUp6; 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 7A61A808BD1F; Thu, 30 Nov 2023 11:11:26 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346820AbjK3TLE (ORCPT + 99 others); Thu, 30 Nov 2023 14:11:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346800AbjK3TKy (ORCPT ); Thu, 30 Nov 2023 14:10:54 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2993F10F1; Thu, 30 Nov 2023 11:11:01 -0800 (PST) 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=E3rFIY36xk7w67SNdqRVr/ancYZH1uNQAprnseO50p4=; b=ms58PUp6WubC4rGPiAMDw64R1L U5xxgzPBiwvEomi5ygL3iiuZDEcX31ej7lxIAUlwWIsQYO/hxrASVbf8B7bO6Nug/+Lr6YTvlmJaQ w3HJhV/1bR6WNIPpJmTgri80yzhuq8q4HZT+4/Lv31nYPm7EwLyMUsJXuJGJug6ALLFc=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR8-0003sb-Mc; Thu, 30 Nov 2023 14:10:59 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Thu, 30 Nov 2023 14:10:47 -0500 Message-Id: <20231130191050.3165862-6-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_CSS autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 5/7] serial: sc16is7xx: improve sc16is7xx_regmap_name() buffer size computation 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]); Thu, 30 Nov 2023 11:11:26 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017320363289492 X-GMAIL-MSGID: 1784017320363289492 From: Hugo Villeneuve Define macro for regmap port name suffix and use it in addition to SC16IS7XX_MAX_PORTS to automatically compute the required buffer size to hold the name. This helps with code readability by making it more obvious what is the required size of the buffer. Signed-off-by: Hugo Villeneuve --- drivers/tty/serial/sc16is7xx.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c index 750c55b93f5e..b02e6c79da67 100644 --- a/drivers/tty/serial/sc16is7xx.c +++ b/drivers/tty/serial/sc16is7xx.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -27,6 +28,7 @@ #include #define SC16IS7XX_NAME "sc16is7xx" +#define SC16IS7XX_PORT_NAME_SUFFIX "port" /* Used for regmap name. */ #define SC16IS7XX_MAX_DEVS 8 #define SC16IS7XX_MAX_PORTS 2 /* Maximum number of UART ports per IC. */ @@ -1700,9 +1702,9 @@ static struct regmap_config regcfg = { static const char *sc16is7xx_regmap_name(unsigned int port_id) { - static char buf[6]; + static char buf[sizeof(SC16IS7XX_PORT_NAME_SUFFIX __stringify(SC16IS7XX_MAX_PORTS))]; - snprintf(buf, sizeof(buf), "port%u", port_id); + snprintf(buf, sizeof(buf), SC16IS7XX_PORT_NAME_SUFFIX "%u", port_id); return buf; } From patchwork Thu Nov 30 19:10:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172052 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619617vqy; Thu, 30 Nov 2023 11:11:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IEzFEwrqcVLZcfZYrw2JjDcp1NTqaM4GKt3DPLt1HzkHgEsZlCGjInyzBnIKQxy/7Gj9LY5 X-Received: by 2002:a17:902:d489:b0:1cf:f7c3:1e32 with SMTP id c9-20020a170902d48900b001cff7c31e32mr11389902plg.27.1701371504620; Thu, 30 Nov 2023 11:11:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371504; cv=none; d=google.com; s=arc-20160816; b=JJXFgj4L7ZFm4Prnc58Oyc0HbCVha5Um1kTM7ZrDWIetbSVOKqMHTLBqAPYjQDGYhR oFZ0EWtYEu84Cq0B5t1fNBXIn/WXKoAeXvQzTl3YWal+IISIRYB9BPasYX2glP8T27vU SKsp9aZRsNrU6xk+3DoLzv/gEoACkT7SSifsjFzMBHYTWUH0OfXhEsAtLpvf/19/kUYR 6iAKlHqzVmOMq7KgLlDpA1vUhJOM8xDtU+BXKBtbW16H9mw0uQ/zTYMWW4he2imUbBOI DVhG+zyI0V/S7M8rj1TF2YNnQf/IGARSVXumiHU1W7Uak9PRKpgrhfi4MqqjmyEIpHWF lp/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=+C2rMVaTduF6YlqPHUV8r6+wZ3YkoCss7GeQcUmG76E=; fh=TwCzphd3GvIn5DzVyM5Tad6hmxhn7TdVF0rNjlsRujg=; b=At8PHmEAM6/XyEtV1rAXMfVghiAvMN6PK/SvJEiAcZCV3eKVyklxYYzZn+a7bd9Zf6 MlDW0Qnt9XvpGXnEBMbff1L0I3JezvucKuExS8pRmd2hYoBeSF/MIPFd+pX1wFbwUCBd n3+Wnmax40P6Q2dcu/aVXIodqZ+XedmcfZ6LpSa91cDj+0tOzaWYpE9F681ENmjxBjIs pF4g6yVR4/hDa7i/gy/wHnBayM5htizjFY9zLj2KoRTbx16qXP7xQbLAWowpmAqkMiHl PZoRTramVyZY6e/9kwDX6PTgJjFWENYMoKWKmXj1MxSphzQ3VEN94dRGhyyAlCTXcPE7 yInQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=pDGP7fdd; 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 bf9-20020a170902b90900b001ca7308e42fsi1671022plb.631.2023.11.30.11.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:44 -0800 (PST) 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=pDGP7fdd; 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 8C4868026DAC; Thu, 30 Nov 2023 11:11:21 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1376275AbjK3TLG (ORCPT + 99 others); Thu, 30 Nov 2023 14:11:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346808AbjK3TK4 (ORCPT ); Thu, 30 Nov 2023 14:10:56 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92AFED48; Thu, 30 Nov 2023 11:11:02 -0800 (PST) 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=+C2rMVaTduF6YlqPHUV8r6+wZ3YkoCss7GeQcUmG76E=; b=pDGP7fddQm5YkmjnInVtn2L6ho NabFh1q694EK1acKXNGOBRXPAcKvPZWqr/p17Yt4SgnHCH5usWuIzWKeaT7EI3FELU31iDkkeOcWF fxz1UeyQczXbowhF/RceAJTAg6Y6OzLUMGDbQ1VzUvoVSX37phe44P/gqq50N38ss2TY=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mR9-0003sb-LH; Thu, 30 Nov 2023 14:11:00 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Thu, 30 Nov 2023 14:10:48 -0500 Message-Id: <20231130191050.3165862-7-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 Subject: [PATCH 6/7] serial: max310x: add macro for max number of ports 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]); Thu, 30 Nov 2023 11:11:21 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017326315669382 X-GMAIL-MSGID: 1784017326315669382 From: Hugo Villeneuve Add macro to hold the maximum number of UART ports per IC/device. Signed-off-by: Hugo Villeneuve Reviewed-by: Jan Kundrát Tested-by: Jan Kundrát --- drivers/tty/serial/max310x.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index f3a99daebdaa..58dd5cc62014 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -30,6 +30,7 @@ #define MAX310X_MAJOR 204 #define MAX310X_MINOR 209 #define MAX310X_UART_NRMAX 16 +#define MAX310X_MAX_PORTS 4 /* Maximum number of UART ports per IC. */ /* MAX310X register definitions */ #define MAX310X_RHR_REG (0x00) /* RX FIFO */ @@ -1502,7 +1503,7 @@ static const struct max310x_if_cfg __maybe_unused max310x_spi_if_cfg = { static int max310x_spi_probe(struct spi_device *spi) { const struct max310x_devtype *devtype; - struct regmap *regmaps[4]; + struct regmap *regmaps[MAX310X_MAX_PORTS]; unsigned int i; int ret; @@ -1605,7 +1606,7 @@ static int max310x_i2c_probe(struct i2c_client *client) const struct max310x_devtype *devtype = device_get_match_data(&client->dev); struct i2c_client *port_client; - struct regmap *regmaps[4]; + struct regmap *regmaps[MAX310X_MAX_PORTS]; unsigned int i; u8 port_addr; From patchwork Thu Nov 30 19:10:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hugo Villeneuve X-Patchwork-Id: 172053 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp619620vqy; Thu, 30 Nov 2023 11:11:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEK31mmUgeCQQfdy6FdMPqPgpVNzd1VHlfPBUhZZWwxRkZWAVSOM8rzNtvwHd0Iry5Nxdeb X-Received: by 2002:a05:6a20:918b:b0:15d:4cf1:212e with SMTP id v11-20020a056a20918b00b0015d4cf1212emr35717658pzd.4.1701371505051; Thu, 30 Nov 2023 11:11:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701371505; cv=none; d=google.com; s=arc-20160816; b=ZmGCsQrjDUZLSWGO1UW/NAZJd03ZGAM3EsCfFDhXXtxXlB1i+FP7VjzqdOz+RVmbbn S0uDeDKAOKpiLPO4dNdgyy4+uGRxmYN82dzTW6SFoMvKwZVVdkLj0frduc/OjeSjQTYd 6s6jBiIqrlBgxJDZL8AH9tmMHWDsbhfmcofzudmn9M7d2jWi276Q3vSPtQHG7+c12CYL 2kWHGUeWhy4jvzM6/YFJCQVL45gqSeNGgSeuTTKGau/jIQls7onjJomDF5b+RERT5PbJ 0Ne0cNrfxLVGOEbxsG3ThxjVIcX4KZbR/rpI7klUhqnHbiOQDDuIWWDE5vrYHzZiZH8D 48Pg== 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=Cfw2qQFHxR7Ac5K0XfN6TaUdPVSzYZ0pF9vaoSYN+c0=; fh=TwCzphd3GvIn5DzVyM5Tad6hmxhn7TdVF0rNjlsRujg=; b=B//FyEyI61WF3WXsvN4L32Bjp6KI5Zfe1TAiNZXLo0iYM/Iw5b6rJhM3rSVsfHKeIL ySh4ZVQjMaf7Z9Wam0oh1hkFjFpxdb4N3YIILX1L7M7yW4NrooJ/Wrxz4ropeG7B5jt3 nt7XeKC8EykvZNFnQ/YEWd+GqoLFjVK3iLVrt+MgmT6vxaTTRfYiZwUy7gBW84e/DON7 5T0/DzMaOednyMvt3y2AY2IGzEbyh1yxVsiM6wqDx1kJCpP7elfVpp0myqvBMXvW3X+R 1xGivJDWYgmSwVCmTLU0Sgt8WhNc4GrsaB51DUn4FXhwsfospOIrdYvihdgXnP9Rjaaw 7B6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=OSgonvXY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id e1-20020a656781000000b005b9053cf6f2si1823243pgr.163.2023.11.30.11.11.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 11:11:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@hugovil.com header.s=x header.b=OSgonvXY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 610928024008; Thu, 30 Nov 2023 11:11:23 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346806AbjK3TLI (ORCPT + 99 others); Thu, 30 Nov 2023 14:11:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346816AbjK3TK4 (ORCPT ); Thu, 30 Nov 2023 14:10:56 -0500 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 492EF10DE; Thu, 30 Nov 2023 11:11:03 -0800 (PST) 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=Cfw2qQFHxR7Ac5K0XfN6TaUdPVSzYZ0pF9vaoSYN+c0=; b=OSgonvXY6ptb+8x3AvPn2XyfCw /SAEZzT+wMAWMXKdfeJwMX1G0369OV23NMBvcP2pPx9EeW2r7/O1TgcFZ1FGBurQKpunn/AMAlz4J /EW2QUVzkjYHkPGI5OjAY50/tcknJUAXSCoFmwtf/UnY6fquvtiAIZWCwJ01hc+gAubk=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:48272 helo=pettiford.lan) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1r8mRA-0003sb-Jn; Thu, 30 Nov 2023 14:11:01 -0500 From: Hugo Villeneuve To: gregkh@linuxfoundation.org, jirislaby@kernel.org, hvilleneuve@dimonoff.com Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, hugo@hugovil.com Date: Thu, 30 Nov 2023 14:10:49 -0500 Message-Id: <20231130191050.3165862-8-hugo@hugovil.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231130191050.3165862-1-hugo@hugovil.com> References: <20231130191050.3165862-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,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Subject: [PATCH 7/7] serial: max310x: use separate regmap name for each port X-SA-Exim-Version: 4.2.1 (built Wed, 08 May 2019 21:11:16 +0000) X-SA-Exim-Scanned: Yes (on mail.hugovil.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 30 Nov 2023 11:11:23 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784017327359708108 X-GMAIL-MSGID: 1784017327359708108 From: Hugo Villeneuve Use a separate regmap name for each port so that each port can have its own debugfs entry, allowing to access each port registers independently. For example, a four channels/ports device like the MAX14830 will have four entries in its regmap debugfs: $ find /sys/kernel/debug/regmap -type d | grep spi0.0 /sys/kernel/debug/regmap/spi0.0-port0 /sys/kernel/debug/regmap/spi0.0-port1 /sys/kernel/debug/regmap/spi0.0-port2 /sys/kernel/debug/regmap/spi0.0-port3 Signed-off-by: Hugo Villeneuve Reviewed-by: Jan Kundrát Tested-by: Jan Kundrát --- drivers/tty/serial/max310x.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/tty/serial/max310x.c b/drivers/tty/serial/max310x.c index 58dd5cc62014..d2eca05a6966 100644 --- a/drivers/tty/serial/max310x.c +++ b/drivers/tty/serial/max310x.c @@ -27,6 +27,7 @@ #include #define MAX310X_NAME "max310x" +#define MAX310X_PORT_NAME_SUFFIX "port" #define MAX310X_MAJOR 204 #define MAX310X_MINOR 209 #define MAX310X_UART_NRMAX 16 @@ -1486,6 +1487,15 @@ static struct regmap_config regcfg = { .max_raw_write = MAX310X_FIFO_SIZE, }; +static const char *max310x_regmap_name(unsigned int port_id) +{ + static char buf[sizeof(MAX310X_PORT_NAME_SUFFIX __stringify(MAX310X_MAX_PORTS))]; + + snprintf(buf, sizeof(buf), MAX310X_PORT_NAME_SUFFIX "%u", port_id); + + return buf; +} + #ifdef CONFIG_SPI_MASTER static int max310x_spi_extended_reg_enable(struct device *dev, bool enable) { @@ -1521,6 +1531,8 @@ static int max310x_spi_probe(struct spi_device *spi) for (i = 0; i < devtype->nr; i++) { u8 port_mask = i * 0x20; + + regcfg.name = max310x_regmap_name(i); regcfg.read_flag_mask = port_mask; regcfg.write_flag_mask = port_mask | MAX310X_WRITE_BIT; regmaps[i] = devm_regmap_init_spi(spi, ®cfg); @@ -1617,6 +1629,7 @@ static int max310x_i2c_probe(struct i2c_client *client) client->addr, devtype->slave_addr.min, devtype->slave_addr.max); + regcfg_i2c.name = max310x_regmap_name(0); regmaps[0] = devm_regmap_init_i2c(client, ®cfg_i2c); for (i = 1; i < devtype->nr; i++) { @@ -1625,6 +1638,7 @@ static int max310x_i2c_probe(struct i2c_client *client) client->adapter, port_addr); + regcfg_i2c.name = max310x_regmap_name(i); regmaps[i] = devm_regmap_init_i2c(port_client, ®cfg_i2c); }