Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1088283rwd; Thu, 25 May 2023 07:55:56 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6vXUSqW076WZIBUMLwaw3tv9pw+PPL2yMBX5GG4Zn+bXE1zOSYtTgaC6eDJZ5pe81rPCMK X-Received: by 2002:a05:6a21:100e:b0:10a:99a9:cb4b with SMTP id nk14-20020a056a21100e00b0010a99a9cb4bmr19640686pzb.12.1685026556088; Thu, 25 May 2023 07:55:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685026556; cv=none; d=google.com; s=arc-20160816; b=ipKOixOzEpLThrZJntLMgyTLeuXhpQ2vexZZWQn5ATvN5GAEGQMEcaD55rWkME+LT1 ofzLaMgukfyfsWfbfqtdVH66P4qxCBmUAhcqd+ragRYXhTZV44QREf9kPfGk4DgvZS/e UmJE8T3IV2DgvdEV2iSXkEXTwWeyh2CGXWo+PIr5AzYIRyqsYKtMMW6pSJGmOwXu9+Qv mm645CT/DQF2HoFbVJpjNn4HKibenJlsVjUCrzSlvwqR1hLhcPUDbd+o0RPfaeVdpW9C P83vjQ/v9SvBPe6FtWnlaHuxAt/2f5xhbX3RqjgBAJix1gKl1oRPXkwOgPD0bBNqTrI4 TllQ== 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:cc:to:from:date:dkim-signature; bh=4EiB2AlR+/z+R1o2De2Qde2ZQ5SW+JoatwDRo240840=; b=iVM3njqhfhwLwoHoH0z8UKUgPEvbtopHG8wleGP82C9xbXQ3qdFPoau3XcnVdrIO6o esabC2r+GDQUyQ3lHqEbMdfKSHTxHWAR8KtlvunwQ53LWuRYpJeGo9xwsphsQ1SkB0mA Et2cBeWS8zWe1J1ZX7YenoUIhbWEYDi4ls+Jv8A5856F09y6WqAJiPhQ1LfIH+bhOW9p siZoly5MLFVFbETg+eyQL5C383WnV7lAvtkAjD/BRNNW6i4sE0O+J8qpE9p5Bn5LhIAr B7VVdbm4YIfmdmEzTsGM777XpHgvCyNzDnlxKrmG8p3RBHgmgYNwFfQeKhiJTMskn5fs cn/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@hugovil.com header.s=x header.b=vR44fhXQ; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s26-20020a63925a000000b0053b8874ceddsi1462668pgn.148.2023.05.25.07.55.37; Thu, 25 May 2023 07:55:56 -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=vR44fhXQ; 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 S241364AbjEYOYj (ORCPT + 99 others); Thu, 25 May 2023 10:24:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233993AbjEYOYi (ORCPT ); Thu, 25 May 2023 10:24:38 -0400 Received: from mail.hugovil.com (mail.hugovil.com [162.243.120.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6BAD187; Thu, 25 May 2023 07:24:36 -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:Cc:To:From:Date: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=4EiB2AlR+/z+R1o2De2Qde2ZQ5SW+JoatwDRo240840=; b=vR44fhXQDG6zkr11gJByncTwgc EXPH+B7r/wny2rnUTeVD0cXBofM0ZIeXSjE8ljsYR5A+9k53BZsX+PzzgqTZJoax+5R0EsrX4pfBv YM1BteQXhJQQFCHxPdKg8+t+abRoy0T1Izlrk4cXyk251v09n75RRJegqA3IPUyi0lxw=; Received: from modemcable168.174-80-70.mc.videotron.ca ([70.80.174.168]:53208 helo=pettiford) by mail.hugovil.com with esmtpa (Exim 4.92) (envelope-from ) id 1q2BtE-0008F5-8X; Thu, 25 May 2023 10:24:28 -0400 Date: Thu, 25 May 2023 10:24:27 -0400 From: Hugo Villeneuve To: andy.shevchenko@gmail.com Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, jirislaby@kernel.org, jringle@gridpoint.com, tomasz.mon@camlingroup.com, l.perczak@camlintechnologies.com, linux-serial@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, Hugo Villeneuve Message-Id: <20230525102427.dfd362c6a0c68a2f8e99accf@hugovil.com> In-Reply-To: References: <20230525040324.3773741-1-hugo@hugovil.com> <20230525040324.3773741-7-hugo@hugovil.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Subject: Re: [PATCH v3 06/11] 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 On Thu, 25 May 2023 14:10:27 +0300 andy.shevchenko@gmail.com wrote: > Thu, May 25, 2023 at 12:03:20AM -0400, Hugo Villeneuve kirjoitti: > > From: Hugo Villeneuve > > > > When we want to configure 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 > > c16is7xx_gpio_direction_output() for the first time, we first set the > > Missing 's'. Fixed. > > 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. > > -- > With Best Regards, > Andy Shevchenko > > >