From patchwork Sun Jul 3 17:00:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lino Sanfilippo X-Patchwork-Id: 1651672 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=hzPKHzZZ; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=2620:137:e000::1:20; helo=out1.vger.email; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by bilbo.ozlabs.org (Postfix) with ESMTP id 4LbZwp1JYkz9sGC for ; Mon, 4 Jul 2022 03:02:01 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231972AbiGCRBz (ORCPT ); Sun, 3 Jul 2022 13:01:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44812 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbiGCRBy (ORCPT ); Sun, 3 Jul 2022 13:01:54 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78F58624F; Sun, 3 Jul 2022 10:01:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1656867690; bh=A80IEaOvnAlffKMAOwHrks5ajbBOXblTI1M+kCbuuS8=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=hzPKHzZZbKBd6lfxFyRYOjCi1H+RCoOd0a+IYJcMIyxE0gMvGq7/7j+Qf7el3FR1k fx7JveZxbfy7sbN+SjZQiG1yh3kAuTlRSak/1KqVmGNWHZesy+WM7+v0TfqLbWFpaV wkeVyQsX1143pJ/ZJClMG72uXCzhCa7O6E3vDnf8= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from localhost.localdomain ([46.223.3.210]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYvY2-1o3d6X3Cca-00Uutl; Sun, 03 Jul 2022 19:01:29 +0200 From: Lino Sanfilippo To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: ilpo.jarvinen@linux.intel.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, andriy.shevchenko@linux.intel.com, vz@mleia.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, lukas@wunner.de, p.rosenberger@kunbus.com, Lino Sanfilippo Subject: [PATCH v2 0/9] Fixes and cleanup for RS485 Date: Sun, 3 Jul 2022 19:00:30 +0200 Message-Id: <20220703170039.2058202-1-LinoSanfilippo@gmx.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:+BIVud8HUysptY1CRE/8CAqa8UDwjnHqFBBbZV5WVV9svCJLpjR +JibWzMCIr/FhhTfcfEKHUqguDgLb1Rteay+VFIjtJs9P2DGvDGbQCMcRmuNZjbZI8uzl8Z vmKnCZawWwv1fKlyp3EIDO8Fir9NharaCGEfyOr/Z0lQIIKR998tnWO3SQb1JhZ6XCWlSFu JKrQ3vvafo9nGDSweHENw== X-UI-Out-Filterresults: notjunk:1;V03:K0:UeNGYxSx++A=:jYl0ljKHXP+26L/kNcUQX6 0OUbodQpW7gP0xBKAH2stA3n67W1XVlPi8NeO5jEM63/TzeKnrmSLC259d9uui8RKjmjwu/5T OUY13qP5dHwm+bymC04DwlIUfyExgnUHlBm+LD5J8cjt86guq1kaMPQZdorOadBNI1CslWQ97 2T0WB06jn1UDekFOGEJnehBq6X5EF7LnuQfUVUqqf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H2, 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: devicetree@vger.kernel.org From: Lino Sanfilippo The following series includes cleanup and fixes around RS485 in the serial core and uart drivers: Patch 1: Only request the rs485 termination gpio if it is supported. NOTE: This patch follows the design decision that "rs485_supported" is set by the driver at initialization and cannot be modified afterwards. However the better approach would be to let the serial core modify the termination GPIO support setting based on the existence of a termination GPIO. If "rs485_supported" is not a read-only value any more in future the logic implemented in this patch should be adjusted accordingly. Patch 2: Set the rs485 termination GPIO in the serial core. This is needed since if the gpio is only accessible in sleepable context. It also is a further step to make the RS485 handling more generic. Patch 3: Move sanitizing of RS485 delays into an own function. This is in preparation of patch 4. Patch 4: Sanitize RS485 delays read from device tree. Patch 5: Correct RS485 delays in binding documentation. Patch 6: Remove redundant code in 8250_dwlib. Patch 7: Fix check for RS485 support. Patch 8: Remove redundant code in ar933x. Patch 9: Remove redundant code in 8250-lpc18xx. Changes in v2: - print a warning if termination GPIO is specified in DT/ACPI but is not supported by driver - fixed commit message for devtree documentation (as suggested by Andy) - fixed code comment - added patch 7 Lino Sanfilippo (9): serial: core: only get RS485 termination GPIO if supported serial: core, 8250: set RS485 termination gpio in serial core serial: core: move sanitizing of RS485 delays into own function serial: core: sanitize RS485 delays read from device tree dt_bindings: rs485: Correct delay values serial: 8250_dwlib: remove redundant sanity check for RS485 flags serial: ar933x: Fix check for RS485 support serial: ar933x: Remove redundant assignment in rs485_config serial: 8250: lpc18xx: Remove redundant sanity check for RS485 flags .../devicetree/bindings/serial/rs485.yaml | 4 +- drivers/tty/serial/8250/8250_dwlib.c | 10 +-- drivers/tty/serial/8250/8250_lpc18xx.c | 6 +- drivers/tty/serial/8250/8250_port.c | 3 - drivers/tty/serial/ar933x_uart.c | 18 ++--- drivers/tty/serial/serial_core.c | 70 +++++++++++++------ 6 files changed, 60 insertions(+), 51 deletions(-) base-commit: 7349660438603ed19282e75949561406531785a5