From patchwork Wed Nov 8 10:32:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 835760 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3yX2t46tRFz9sNc for ; Wed, 8 Nov 2017 21:42:04 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751988AbdKHKmC (ORCPT ); Wed, 8 Nov 2017 05:42:02 -0500 Received: from mailout3.hostsharing.net ([176.9.242.54]:47813 "EHLO mailout3.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbdKHKl7 (ORCPT ); Wed, 8 Nov 2017 05:41:59 -0500 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 Organization Validation Secure Server CA" (not verified)) by mailout3.hostsharing.net (Postfix) with ESMTPS id C003F102F07F0; Wed, 8 Nov 2017 11:32:51 +0100 (CET) Received: from localhost (6-38-90-81.adsl.cmo.de [81.90.38.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 3011660ED245; Wed, 8 Nov 2017 11:32:35 +0100 (CET) X-Mailbox-Line: From 09cf8d413f79810dbd5e5b255774a5c2c2b5ffde Mon Sep 17 00:00:00 2001 Message-Id: From: Lukas Wunner Date: Wed, 8 Nov 2017 11:32:34 +0100 Subject: [PATCH 0/5] rs485 properties: platform agnosticism + RTS polarity MIME-Version: 1.0 To: Greg Kroah-Hartman Cc: Jiri Slaby , Sascha Hauer , Uwe Kleine-Koenig , Mark Jackson , Michal Oleszczyk , linux-serial@vger.kernel.org, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Jan Kiszka , Richard Genoud Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Rework the common helper function for retrieving rs485 properties to be platform agnostic (patch [1/5]) and to allow specifying the RTS polarity (patch [2/5] and [3/5]). Amend the fsl_lpuart and imx drivers to take advantage of this and fix a bunch of bugs while at it (patch [4/5] and [5/5]). Note that Michal Oleszczyk posted a patch yesterday which documents the "rs485-rts-active-high" property supported by omap-serial in a way which suggests that *all* drivers default to active low, which is not the case (all other drivers default to active high). I think the present series is a better approach, but let's have a technical discussion about that. I posted an earlier version of patch [1/5] a while back but withdrew it because I wanted to change uart_get_rs485_mode() to take a struct dev and a struct serial_rs485, instead of a struct uart_port (which seemed too fragile on second thought). That change has been made now. Thanks, Lukas Lukas Wunner (5): serial: Make retrieval of rs485 properties platform-agnostic dt-bindings: serial: Add common rs485 binding for RTS polarity serial: core: Support common rs485 binding for RTS polarity serial: fsl_lpuart: Support common rs485 binding for RTS polarity serial: imx: Support common rs485 binding for RTS polarity .../devicetree/bindings/serial/fsl-imx-uart.txt | 3 ++- .../devicetree/bindings/serial/fsl-lpuart.txt | 3 ++- .../devicetree/bindings/serial/omap_serial.txt | 1 + Documentation/devicetree/bindings/serial/rs485.txt | 1 + drivers/tty/serial/atmel_serial.c | 2 +- drivers/tty/serial/fsl_lpuart.c | 15 ++++---------- drivers/tty/serial/imx.c | 11 ++++++++--- drivers/tty/serial/omap-serial.c | 11 +++++++---- drivers/tty/serial/serial_core.c | 23 +++++++++++++++------- include/linux/serial_core.h | 3 +-- 10 files changed, 43 insertions(+), 30 deletions(-)