From mboxrd@z Thu Jan 1 00:00:00 1970 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, USER_AGENT_GIT autolearn=unavailable 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 C6910C5ACD8 for ; Wed, 18 Mar 2020 14:27:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A23BE20772 for ; Wed, 18 Mar 2020 14:27:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727174AbgCRO1F (ORCPT ); Wed, 18 Mar 2020 10:27:05 -0400 Received: from gloria.sntech.de ([185.11.138.130]:37374 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727123AbgCRO1B (ORCPT ); Wed, 18 Mar 2020 10:27:01 -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 1jEZeq-0004YX-A4; Wed, 18 Mar 2020 15:26:56 +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, Giulio Benetti , Heiko Stuebner Subject: [PATCH 7/7] serial: 8250_dw: allow enable rs485 at boot time Date: Wed, 18 Mar 2020 15:26:40 +0100 Message-Id: <20200318142640.982763-8-heiko@sntech.de> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200318142640.982763-1-heiko@sntech.de> References: <20200318142640.982763-1-heiko@sntech.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org From: Giulio Benetti If "linux,rs485-enabled-at-boot-time" is specified need to setup 485 in probe function. Call uart_get_rs485_mode() to get rs485 configuration, then call rs485_config() callback directly to setup port as rs485. Signed-off-by: Giulio Benetti Signed-off-by: Heiko Stuebner --- drivers/tty/serial/8250/8250_dw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 7023b656658d..c771faeaa260 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -550,8 +550,10 @@ static int dw8250_probe(struct platform_device *pdev) if (data->uart_16550_compatible) p->handle_irq = NULL; - if (!data->skip_autocfg) + if (!data->skip_autocfg) { dw8250_setup_port(p); + uart_get_rs485_mode(dev, &p->rs485); + } /* If we have a valid fifosize, try hooking up DMA */ if (p->fifosize) { -- 2.24.1