Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp2241083ybk; Sun, 17 May 2020 14:58:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwI+hPB2Whzv9u53xP0VlXSTB8AqIq9DqsZUSJyVrL1URPAuY4ZRo4fsiHh/oluuyi9BtUT X-Received: by 2002:a50:a761:: with SMTP id h88mr9108889edc.73.1589752708867; Sun, 17 May 2020 14:58:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589752708; cv=none; d=google.com; s=arc-20160816; b=EMZSung+TR0oNu7/Buj0JRf8trzrGrkjKfuZa8rRlEdy3orWPcT789u5/Az9wJntOi Y4EsslRsctcwq00Pk+ZdKih7iwBFsAH0hEySgVI3I3XWqm6/OAH6G3vWGVDcU6+M5AQF 5wCCWpTBC43mOEtW6hRHlR7l2LV73bXsDI8xlHLvJcr8KwMaRORcZFjRoIJryAFfLBxs cn2yrPFkVq6JodrfBC9CVrT7j2CIpoA+2vRp9B7YuWp0r51VcQfE+fzVe1jpxxiMV1bh 1/7AKhamevltHhnNGSZ4vWRmBpU2hIPeMwGGS6QLU624YwJd6Y//UdFUP+gW/vhNSFqC Owzg== 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=IYgD5qpdD2B/Yx5MCugcuHRtvQU1VbdrRxP42nHltSo=; b=XCr5kqHLMp4Cs93u7rhUyqQb4exzdFtjA0uk4jvw7tKZfhRL+VvTxfEycqQffENczI ThIzaHKOUT833tLu+USa5my9ZoxPee+2oOM8DXSaIqq9LElVQDn3AVBw0Ygbu9Y0JGy2 z5UiozASBnYrQGCNlWG8qsrC8xN+4QnVoobo/otapu4RfEMq6WnrQLW+jmJ+sXv1CH3v 9cMczLIftzrjlPkAongQZQKDnc9bAPUNVoYuQDkEFQ3OdkGXYGOioFCY50Jz2iv1/vaq qAsjxAu+G/7O7cl5HFpkIUaHxOQn0t10SnJf0ew3P8lryTx4wXo5UJhjMs+WLplFooZQ 2KFg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id my6si5543133ejb.87.2020.05.17.14.58.06; Sun, 17 May 2020 14:58:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbgEQV4g (ORCPT + 99 others); Sun, 17 May 2020 17:56:36 -0400 Received: from gloria.sntech.de ([185.11.138.130]:45120 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726438AbgEQV4e (ORCPT ); Sun, 17 May 2020 17:56:34 -0400 Received: from ip5f5aa64a.dynamic.kabel-deutschland.de ([95.90.166.74] helo=phil.sntech) by gloria.sntech.de with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jaRGd-0002am-T0; Sun, 17 May 2020 23:56:19 +0200 From: Heiko Stuebner To: gregkh@linuxfoundation.org Cc: jslaby@suse.com, andriy.shevchenko@linux.intel.com, matwey.kornilov@gmail.com, giulio.benetti@micronovasrl.com, lukas@wunner.de, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, christoph.muellner@theobroma-systems.com, heiko@sntech.de Subject: [PATCH v3 0/5] serial: 8250: Add rs485 emulation to 8250_dw Date: Sun, 17 May 2020 23:56:05 +0200 Message-Id: <20200517215610.2131618-1-heiko@sntech.de> X-Mailer: git-send-email 2.25.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. Depends on Lukas Wunner's series adding the rs485 bus term gpio: https://lore.kernel.org/r/cover.1588505407.git.lukas@wunner.de changes in v3: - wording fixes for dt-binding (Andy) - maxItems 1 in dt-binding (Lukas) - use devm_gpiod_get_optional (Andy) - remove unneeded gpio checks (Andy) - use GPIOD_OUT_HIGH for initial value (Lukas) - split loop-reading into the existing timer infrastructure Changes in v2: - move to recent rs485 improvements in tty-next - added a capability for TEMT interrupt presence - external gpio for optional receiver-enable handling - timeout polling via the generic readx_poll_timeout 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. Giulio Benetti (2): serial: 8250: Handle implementations not having TEMT interrupt using em485 serial: 8250_dw: add em485 support Heiko Stuebner (3): serial: 8520_port: Fix function param documentation dt-bindings: serial: Add binding for rs485 receiver enable GPIO serial: 8250: Support separate rs485 rx-enable GPIO .../devicetree/bindings/serial/rs485.yaml | 4 ++ drivers/tty/serial/8250/8250.h | 1 + drivers/tty/serial/8250/8250_bcm2835aux.c | 2 +- drivers/tty/serial/8250/8250_dw.c | 3 + drivers/tty/serial/8250/8250_of.c | 2 + drivers/tty/serial/8250/8250_omap.c | 2 +- drivers/tty/serial/8250/8250_port.c | 60 ++++++++++++++++--- drivers/tty/serial/serial_core.c | 10 ++++ include/linux/serial_core.h | 1 + 9 files changed, 76 insertions(+), 9 deletions(-) -- 2.25.1