Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp692312ybh; Wed, 18 Mar 2020 07:27:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt3Vc9xMpfEXy1EYNedKYzd3wf8HOCFoEBIZO2A0Su46z10G3FXFJzrTQrjfrUeXHP6uZUo X-Received: by 2002:a9d:7dce:: with SMTP id k14mr4143119otn.120.1584541671170; Wed, 18 Mar 2020 07:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584541671; cv=none; d=google.com; s=arc-20160816; b=cABZHz+F2Hd5CbdxA7wlp8ridbb1HngX1JpKVCedHypuOgD7zN4kSLt4oYz/8vSxj4 pJwpQ/DkeA5RR0F+9+1x+bqcc0dGnAxGB59HLRSRQHJe+g+Bhy0+ToZl9LUxAbZIHGmX 6QAlNL6LKxVImC0KmmkopK6kfksuC+nOsRTf9g4EpSk/JWChSWuDIYqHbcovU+f1/ZPa fbFUSv8cuJ44APbWbpSmPr5/vWbchM39R7wh+WRvctvJGScAPxHEFfFXpfBaecVIlWuW c9tlV+2xVdignNi9Q4yTBspubF8ijC582GhPkxbyf/xTq0H1PpzK5sP6bK3AKBRB5n0F XRVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=g8PIZaoTFm09RmdW1DxdXjT8TYHmQ2v8HvLCt66vjbs=; b=ScAQCQJ91LHibg41EngTr3IziTjhIeJoIeale6EAIvTlil5JwvWoGH7ENVtuVHqQ9x xTBpURu0wKDqqvYk+PvJU9i7FRrb89p50Bnq7zAkQNXizLOTzJsCYRhYAXWawpUz85Jv xIIzYvuj1g+4L5odcma7ZahKQk7pDOarR/etEGktf3Q8mZYDk74Zld99lYo0aX8PyQ2g 1NyrZwRBW7s+YTt1nv6/+uzWadtlCZMj+7zab2J5VNa7jBeqZN9gRZQQfICblckcZPzz yat03SrmINsbhSNN8CaU8vMlXbcs/J1ayXLxYbEEWjADH1NXTlfm+/1ZqwrftWqNMKyX FujQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c22si1709271oto.280.2020.03.18.07.27.39; Wed, 18 Mar 2020 07:27:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727134AbgCRO1B (ORCPT + 99 others); Wed, 18 Mar 2020 10:27:01 -0400 Received: from gloria.sntech.de ([185.11.138.130]:37352 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726893AbgCRO1A (ORCPT ); Wed, 18 Mar 2020 10:27:00 -0400 Received: from [94.134.91.63] (helo=phil.fritz.box) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jEZem-0004YX-T9; Wed, 18 Mar 2020 15:26:52 +0100 From: Heiko Stuebner To: gregkh@linuxfoundation.org Cc: jslaby@suse.com, andriy.shevchenko@linux.intel.com, matwey.kornilov@gmail.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, heiko@sntech.de Subject: [PATCH 0/7] serial: 8250: Add rs485 emulation to 8250_dw Date: Wed, 18 Mar 2020 15:26:33 +0100 Message-Id: <20200318142640.982763-1-heiko@sntech.de> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series tries to revive the work of Giulio Benetti from 2018 [0] which seemed to have stalled at that time. The board I needed that on also had the additional caveat that it uses non-standard pins for DE/RE so needed gpio mctrl layer as well and even more special needed to control the RE pin manually not as part of it being connected to the DE signal as seems to be the standard. So I've marked the patch doing this as DTR pin as RFC but that patch isn't needed for the other core functionality, so could also be left out. Changes from the 2018 submission include: - add timeout when waiting for fifos to clear using a new helper - move on-boot enablement of the rs485 mode to after registering the port. This saves having to copy the em485 struct as done originally, which also ran into spinlock-debug warnings when testing and also makes it actually possible to use the mctrl gpio layer for non-standard gpios. [0] Link: https://lore.kernel.org/linux-serial/20180601124021.102970-1-giulio.benetti@micronovasrl.com/ Giulio Benetti (4): serial: 8250: Make em485_rts_after_send() set mctrl according to rts state. serial: 8250: Handle case port doesn't have TEMT interrupt using em485. serial: 8250_dw: add em485 support serial: 8250_dw: allow enable rs485 at boot time Heiko Stuebner (3): serial: 8250: add serial_in_poll_timeout helper serial: 8250: Start rs485 after registering port if rs485 is enabled in probe serial: 8250: handle DTR in rs485 emulation drivers/tty/serial/8250/8250.h | 36 ++++++++++++++++++++- drivers/tty/serial/8250/8250_core.c | 9 ++++++ drivers/tty/serial/8250/8250_dw.c | 35 +++++++++++++++++++- drivers/tty/serial/8250/8250_of.c | 2 +- drivers/tty/serial/8250/8250_omap.c | 2 +- drivers/tty/serial/8250/8250_port.c | 50 +++++++++++++++++++++++------ include/linux/serial_8250.h | 1 + 7 files changed, 121 insertions(+), 14 deletions(-) -- 2.24.1