From patchwork Fri Sep 19 12:21:22 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Przywara X-Patchwork-Id: 4937741 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B01C09F313 for ; Fri, 19 Sep 2014 12:24:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DD3FC201F2 for ; Fri, 19 Sep 2014 12:24:51 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 149AB201EF for ; Fri, 19 Sep 2014 12:24:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XUxDJ-0002nk-Fn; Fri, 19 Sep 2014 12:23:01 +0000 Received: from cam-admin0.cambridge.arm.com ([217.140.96.50]) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XUxCO-0002Gd-Dh for linux-arm-kernel@lists.infradead.org; Fri, 19 Sep 2014 12:22:05 +0000 Received: from e106785-lin.cambridge.arm.com (e106785-lin.cambridge.arm.com [10.1.209.161]) by cam-admin0.cambridge.arm.com (8.12.6/8.12.6) with ESMTP id s8JCLNwx013309; Fri, 19 Sep 2014 13:21:25 +0100 (BST) From: Andre Przywara To: Russell King , Greg Kroah-Hartman , Jiri Slaby Subject: [RFC PATCH 09/10] drivers: PL011: allow to supply fixed option string Date: Fri, 19 Sep 2014 13:21:22 +0100 Message-Id: <1411129283-17219-10-git-send-email-andre.przywara@arm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1411129283-17219-1-git-send-email-andre.przywara@arm.com> References: <1411129283-17219-1-git-send-email-andre.przywara@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140919_052204_923300_8EC2A694 X-CRM114-Status: GOOD ( 10.38 ) X-Spam-Score: -5.7 (-----) Cc: rob.herring@linaro.org, Arnd Bergmann , linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The SBSA UART has a fixed baud rate and flow control setting, which cannot be changed or queried by software. Add a vendor specific property to always return fixed values when trying to read the console options. Signed-off-by: Andre Przywara --- drivers/tty/serial/amba-pl011.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 70af210..12f1a5f 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -79,6 +79,7 @@ struct vendor_data { bool dma_threshold; bool cts_event_workaround; bool always_enabled; + char *fixed_options; unsigned int (*get_fifosize)(struct amba_device *dev); }; @@ -96,6 +97,7 @@ static struct vendor_data vendor_arm = { .dma_threshold = false, .cts_event_workaround = false, .always_enabled = false, + .fixed_options = NULL, .get_fifosize = get_fifosize_arm, }; @@ -112,6 +114,7 @@ static struct vendor_data vendor_st = { .dma_threshold = true, .cts_event_workaround = true, .always_enabled = false, + .fixed_options = NULL, .get_fifosize = get_fifosize_st, }; @@ -2062,6 +2065,9 @@ static int __init pl011_console_setup(struct console *co, char *options) uap->port.uartclk = clk_get_rate(uap->clk); + if (!options && uap->vendor->fixed_options) + options = uap->vendor->fixed_options; + if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); else