From patchwork Mon May 18 14:45:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 1292565 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=wunner.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Qhd11JGlz9sRf for ; Tue, 19 May 2020 00:45:09 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728140AbgEROpF (ORCPT ); Mon, 18 May 2020 10:45:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbgEROpF (ORCPT ); Mon, 18 May 2020 10:45:05 -0400 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f236:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4D2A2C061A0C; Mon, 18 May 2020 07:45:05 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout3.hostsharing.net (Postfix) with ESMTPS id 37BFB101E6B73; Mon, 18 May 2020 16:45:03 +0200 (CEST) Received: from localhost (unknown [87.130.102.138]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id BBB1D626CE30; Mon, 18 May 2020 16:45:02 +0200 (CEST) X-Mailbox-Line: From 94c6c800d1ca9fa04766dd1d43a8272c5ad4bedd Mon Sep 17 00:00:00 2001 Message-Id: From: Lukas Wunner Date: Mon, 18 May 2020 16:45:00 +0200 Subject: [PATCH v3 0/2] rs485 bus termination GPIO To: Greg Kroah-Hartman , Jiri Slaby , Rob Herring Cc: "Matwey V. Kornilov" , Giulio Benetti , Heiko Stuebner , Andy Shevchenko , Christoph Muellner , Jan Kiszka , linux-serial@vger.kernel.org, devicetree@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Define a device tree binding for an rs485 bus termination GPIO (patch [1/2]), amend the serial core to retrieve the GPIO from the device tree and amend the default ->rs485_config() callback for 8250 drivers to change the GPIO on request from user space (patch [2/2]). Changes v2 -> v3: * Patch [2/2]: * Drop unnecessary NULL pointer check preceding gpiod_set_value(). (Heiko) * Amend commit message to suggest moving 8250_exar.c to new binding. (Andy) Add Jan to Cc and Andy's R-b tag. Changes v1 -> v2: * Patch [2/2]: * Drop unnecessary devm_gpiod_put(). (Andy) * Use GPIOD_OUT_LOW macro for brevity. (Andy) * Document the rationale for disabling termination by default. * Drop nonsensical read of GPIO after setting its direction to out. Link to v2: https://lore.kernel.org/linux-serial/cover.1589285873.git.lukas@wunner.de Lukas Wunner (2): dt-bindings: serial: Add binding for rs485 bus termination GPIO serial: 8250: Support rs485 bus termination GPIO .../devicetree/bindings/serial/rs485.yaml | 4 ++++ drivers/tty/serial/8250/8250_port.c | 3 +++ drivers/tty/serial/serial_core.c | 16 ++++++++++++++++ include/linux/serial_core.h | 2 ++ 4 files changed, 25 insertions(+)