From patchwork Wed Mar 25 23:14:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 214136 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 839CFC43331 for ; Wed, 25 Mar 2020 23:14:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 339A920714 for ; Wed, 25 Mar 2020 23:14:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727585AbgCYXOm (ORCPT ); Wed, 25 Mar 2020 19:14:42 -0400 Received: from gloria.sntech.de ([185.11.138.130]:40190 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727525AbgCYXOm (ORCPT ); Wed, 25 Mar 2020 19:14:42 -0400 Received: from ip5f5a5d2f.dynamic.kabel-deutschland.de ([95.90.93.47] helo=phil.sntech) by gloria.sntech.de with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jHFEJ-0007ug-KT; Thu, 26 Mar 2020 00:14:35 +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, lukas@wunner.de, christoph.muellner@theobroma-systems.com, giulio.benetti@micronovasrl.com, Heiko Stuebner Subject: [PATCH v2 7/7] serial: 8250_dw: add em485 support Date: Thu, 26 Mar 2020 00:14:22 +0100 Message-Id: <20200325231422.1502366-8-heiko@sntech.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200325231422.1502366-1-heiko@sntech.de> References: <20200325231422.1502366-1-heiko@sntech.de> MIME-Version: 1.0 Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Giulio Benetti Need to use rs485 transceiver so let's use existing em485 485 emulation layer on top of 8250. Add rs485_config callback to port and uses the standard em485 start and stop helpers. Signed-off-by: Giulio Benetti [moved to use newly added start/stop helpers] Signed-off-by: Heiko Stuebner --- drivers/tty/serial/8250/8250_dw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index aab3cccc6789..588319075b36 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -414,6 +414,9 @@ static int dw8250_probe(struct platform_device *pdev) p->serial_out = dw8250_serial_out; p->set_ldisc = dw8250_set_ldisc; p->set_termios = dw8250_set_termios; + p->rs485_config = serial8250_em485_config; + up->rs485_start_tx = serial8250_em485_start_tx; + up->rs485_stop_tx = serial8250_em485_stop_tx; p->membase = devm_ioremap(dev, regs->start, resource_size(regs)); if (!p->membase)