Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp596683imm; Wed, 6 Jun 2018 02:53:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLiMmEKZvFX45CqSlUagIs/tIqU06A/zJi1+kSArOPE0KfqDuIXMqwTs5NH2aV2kuskCAdz X-Received: by 2002:a17:902:8c92:: with SMTP id t18-v6mr2548301plo.337.1528278797540; Wed, 06 Jun 2018 02:53:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528278797; cv=none; d=google.com; s=arc-20160816; b=WB4752PQSKGV1gmNMLwb/B26P7NkYuqlaTKXZXGaYczIvnoyQb3hK4wrTKhRFuoMOR HoWTgeTGh+9bWVzhcxvn1IWZLE/nLQhB277QEwn1l5s7//euYBWGjgav7bihvQuSyalD YiLe4+snAbU3yUr7UcM4uyvUPSY9DLiQkKg+m2Gly7lVtRQa4GaqtNN3Gn/80GRxFFJU vpKi//nY29GXkWfJgna8W2ZU8HEAmOGeK0srDz/QkWECUJkcViCKZ5q3R6reKnZvAKeb mCPPI/i4rKG6eM6TiTbO+Yf5WVhQVBsTipA+fThE+zW245UyfQsVt2FNrV/9Uw5JjPxk cfRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:in-reply-to:message-id:date :subject:cc:from:dkim-signature:arc-authentication-results; bh=vu+Zi6ZIKg9U9w1n4x8hBA4y4vpBNS52vniOUZe3UkA=; b=dkDt0Oi0FIbdWJoQP0geaP4758wLPvrQearFf//nRaDnMeVQsPQIglkLDYlPsC84uu q0SUbKvjNPIbrzduDgUZgDtfx8VP4yNDaGTBcSIR0SfoccIIO55DuzoNuHErOe7gU1zB dI1pjOtWYeDyjkps0/Binihsq/LjLm88RIYqWaUCZ72OdguwTo/TX7WQ7jlZUCEbDHTP PZ6PEEURz+PMMQhj7N10OTzkTB5VCP4X911L/2KM5W8QvYyjlzGCdg+gRM5DS+LZeqUL f9D7pKC2zh6OJdKhQmJD2QDlupQLH8DNlnz0hK1ZRT05rL6zxRQKGmx2lSPj6lZ3W9Df rheA== ARC-Authentication-Results: i=1; mx.google.com; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=dLTPKiqS; 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 b66-v6si146696pfe.265.2018.06.06.02.53.03; Wed, 06 Jun 2018 02:53:17 -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; dkim=temperror (no key for signature) header.i=@micronovasrl.com header.s=dkim header.b=dLTPKiqS; 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 S932562AbeFFJwI (ORCPT + 99 others); Wed, 6 Jun 2018 05:52:08 -0400 Received: from mail.micronovasrl.com ([212.103.203.10]:55944 "EHLO mail.micronovasrl.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932265AbeFFJwD (ORCPT ); Wed, 6 Jun 2018 05:52:03 -0400 Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 76E30B007F2 for ; Wed, 6 Jun 2018 11:52:02 +0200 (CEST) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1528278722; x=1529142723; bh=kl pI4cSwIUVwB7zD2VUdWuSdy8+HlQHGZyPKTO+kEOo=; b=dLTPKiqS4iY6/mTbgP G9kLHMi9/tZLJiLe1Sziatj+fv0TvxMj7gc3X5tZimsVyKonVHWFaJ9Gt1N6cF15 gq1LeHCIAzuBbumHVE2z2c7yTWJRIOz+ZbEsIaYUqEZ9MVKQzPHJLbdKkt/eN1V5 oxXzy5Hdkbm8ig0A8PwZtIBpY= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com X-Spam-Flag: NO X-Spam-Score: -2.9 X-Spam-Level: X-Spam-Status: No, score=-2.9 tagged_above=-10 required=4.5 tests=[ALL_TRUSTED=-1, BAYES_00=-1.9] autolearn=unavailable autolearn_force=no Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id EhpmQ-ta7xU5 for ; Wed, 6 Jun 2018 11:52:02 +0200 (CEST) Received: from localhost.localdomain (unknown [87.18.119.93]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 9618FB00767; Wed, 6 Jun 2018 11:52:00 +0200 (CEST) From: Giulio Benetti Cc: matwey.kornilov@gmail.com, Giulio Benetti , Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby , Joshua Scott , Stefan Potyra , Ed Blake , linux-serial@vger.kernel.org (open list:SERIAL DRIVERS), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/4] serial: 8250_dw: allow enable rs485 at boot time Date: Wed, 6 Jun 2018 11:51:51 +0200 Message-Id: <20180606095156.72628-1-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: References: To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/tty/serial/8250/8250_dw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/8250/8250_dw.c b/drivers/tty/serial/8250/8250_dw.c index 45366e6e5411..0f8b4da03d4e 100644 --- a/drivers/tty/serial/8250/8250_dw.c +++ b/drivers/tty/serial/8250/8250_dw.c @@ -582,8 +582,11 @@ 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); + dw8250_rs485_config(p, &p->rs485); + } /* If we have a valid fifosize, try hooking up DMA */ if (p->fifosize) { -- 2.17.1