Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp479046rwd; Thu, 1 Jun 2023 02:59:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ68G4CDsvF6HYQRm1d8UEYzhWoFIt1G4zT41q/aqoWtAu7nbWLTG1UjvQfmPDKfHj7OGb6m X-Received: by 2002:a05:6a20:3c8f:b0:10c:a627:7ede with SMTP id b15-20020a056a203c8f00b0010ca6277edemr6985728pzj.58.1685613549931; Thu, 01 Jun 2023 02:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685613549; cv=none; d=google.com; s=arc-20160816; b=UO1H56FgYjcTB0Rm1qTzKgA1uH70tTZcFT/98hZCA2tqmbiSdE0NrdrtGNEfRY1GQT 3EqSYOfGx2EEPOgzP10vIrN9ib6/oEOr3ceo8bkyGRPyxNxBawPUfSgxkhWimo10nToZ uA7xniFXSF9x4yrpxCW+vYcp6IH+71BCM+mZWd9LycKJEXyObb1auRhnGBbiNsvT++Dq gMs7F82gQohBj4bHEj0mryMcXw80M1KeQZ1nQspXP0iFZ6kuMEzlpbd9Bx7IHe2/ZppO otpOv4bMRsWNvUkD2ZUCwgYiMU9o63rZav/mEUtIkLy/CTQKGM193OdWL/4Sk6y8d5Mx dIlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Dzr0sXs/hmoLYt4Nl0MgN1apN4fZADrfHPGpIhvTR6I=; b=eJLjrVshE/LJIb8wRhbLFUrdTt6RMSEL5f2CbwM7zp0lJgHWM1cvZgi7IiEwdHux7K 0nx4ygmSRtpA4Oc3y76XqVWad0pdUlmkNfcPkX+JbS4eVrIpEhfu+CH2fYvSLzWdnchi FQ2F9HM5aIOwDHk/cN3luoaFyDYTnmHx9i5aP+IMft5ysWHonGDLuZPp7HTSFFvM2YNs Ei4215bRWMBKNpU9TtBJO2wkIje0QksVW36cdlwhvXMAs2h4UC4p5MoWh3n/pdsG9bdx mMfML7liHTU/SUg3XFbZtzT2vsiH4y/TnJZ/ueOwFmethdGrLH9Phvjn06m8UHJzsLmt gKEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=fXcUBky3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u17-20020a17090341d100b001ae3e5b31basi2524436ple.540.2023.06.01.02.58.55; Thu, 01 Jun 2023 02:59: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=pass header.i=@gmail.com header.s=20221208 header.b=fXcUBky3; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232838AbjFAJZV (ORCPT + 99 others); Thu, 1 Jun 2023 05:25:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbjFAJZU (ORCPT ); Thu, 1 Jun 2023 05:25:20 -0400 Received: from mail-qv1-xf2e.google.com (mail-qv1-xf2e.google.com [IPv6:2607:f8b0:4864:20::f2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 442E611F; Thu, 1 Jun 2023 02:25:19 -0700 (PDT) Received: by mail-qv1-xf2e.google.com with SMTP id 6a1803df08f44-626190df842so8096216d6.0; Thu, 01 Jun 2023 02:25:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685611518; x=1688203518; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Dzr0sXs/hmoLYt4Nl0MgN1apN4fZADrfHPGpIhvTR6I=; b=fXcUBky3xVq7/nHzFuvrCdhn1kEZ9DUp1DPAvmxeuqp2bl6bXecWRh9wLDfpaaHKxC WXVr1hkYof/ue5l8CLZzFwJmODcpG3vt+lJynLaIcJzL6LMtnpYOsr3R+zCntlud7xcZ N3hEO+sQMxvtpFpKJajYXy8Kw/TgYz8iPuvd5DDxhaAyxm2iFouNlfLWBc3BYwMp7d9H Hd6z8O/VQ0cufGwePwf86fVHUuJkjAfG2FH+v7BlKc4PMi++t3DTegO964/k/JnrdTTv ktSg7ivDKikHn2wESyUSErvqaGd+DU8/uSyY81f5ge+0lU3ILslolBjykCUFEp3a9ndg Kfjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685611518; x=1688203518; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Dzr0sXs/hmoLYt4Nl0MgN1apN4fZADrfHPGpIhvTR6I=; b=hCuvduUD8T9sq6fLVp9MEN1qGe7J08yhyLf3qnjmqFrMhAc3BtPz57paOaBIiaSolf IrW5iX1vHPvovvhrJ/1bPhL3XFasHNgIM08yS6aXo6v944livw+O6WJ5M9PPLNDzf9Ku cfzOz70OJLk48wL4KH22itl5ITGv4vQyKFQK5PU9mB+iLiCkpRl2GhJt+DwhdsNGJbus TSXqivS7x2BXfQ+in+4vnUvNB89tsbjDw3JmQ6JAcU5d2xfHTCzQiE3YVMhwrMePRQoN Pj77IuWgIS/QFL1yRf/9eRZRfbUO2RX2QAFyhl+Bulgh/hu4F9mptMlImumqV7qRNVw4 0klA== X-Gm-Message-State: AC+VfDy4yNI4s6+oJPOPoSlXgfWtOc+3EjXJK6/uc3r1Kbns67bfK5cJ myWWgXbuNbQwHg3qi8RQX7A6DatZGOVncOTVVdI= X-Received: by 2002:a05:6214:485:b0:625:b72a:142c with SMTP id pt5-20020a056214048500b00625b72a142cmr11229290qvb.14.1685611518304; Thu, 01 Jun 2023 02:25:18 -0700 (PDT) MIME-Version: 1.0 References: <20230529140711.896830-1-hugo@hugovil.com> <20230529140711.896830-8-hugo@hugovil.com> <20230530113649.73f28b9f6ba91f17ace1e12f@hugovil.com> <20230531195723.462b140ac041b790711c1a7f@hugovil.com> In-Reply-To: <20230531195723.462b140ac041b790711c1a7f@hugovil.com> From: Andy Shevchenko Date: Thu, 1 Jun 2023 12:24:42 +0300 Message-ID: Subject: Re: [PATCH v4 7/9] serial: sc16is7xx: fix regression with GPIO configuration To: Hugo Villeneuve Cc: 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, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Hugo Villeneuve Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jun 1, 2023 at 2:57=E2=80=AFAM Hugo Villeneuve w= rote: > On Wed, 31 May 2023 00:56:57 +0300 > Andy Shevchenko wrote: > > On Tue, May 30, 2023 at 6:36=E2=80=AFPM Hugo Villeneuve wrote: > > > On Tue, 30 May 2023 01:38:17 +0300 > > > andy.shevchenko@gmail.com wrote: > > > > Mon, May 29, 2023 at 10:07:09AM -0400, Hugo Villeneuve kirjoitti: ... > > > > > + of_property_for_each_u32(dev->of_node, "nxp,modem-con= trol-line-ports", > > > > > + prop, p, u) { > > > > > + if (u >=3D devtype->nr_uart) > > > > > + continue; > > > > > + > > > > > + /* Use GPIO lines as modem control lines */ > > > > > + if (u =3D=3D 0) > > > > > + mctrl_mask |=3D SC16IS7XX_IOCONTROL_M= ODEM_A_BIT; > > > > > + else if (u =3D=3D 1) > > > > > + mctrl_mask |=3D SC16IS7XX_IOCONTROL_M= ODEM_B_BIT; > > > > > + } > > > > > > > > Can we use device properties, please? > > > > > > I have converted this section to use device_property_count_u32() and = device_property_read_u32_array(). Is that Ok? > > > > Yes, thank you! > > Hi Andy, > now that I am using the device property API, I think I no longer have the= need to test for "if (dev->of_node)" before reading the new property "nxp,= modem-control-line-ports"? > > If that is the case, I will leave the test "if (dev->of_node)" only for t= he "irda-mode-ports" property. > > The pseudo code woulk look like this: > > if (dev->of_node) { > struct property *prop; > const __be32 *p; > u32 u; > > of_property_for_each_u32(dev->of_node, "irda-mode-ports", > prop, p, u) > if (u < devtype->nr_uart) > s->p[u].irda_mode =3D true; > } > > /* Read "nxp,modem-control-line-ports" using device property API.= */ > sc16is7xx_setup_mctrl_ports(dev); Looks good to me, thank you for following the advice! --=20 With Best Regards, Andy Shevchenko