From patchwork Mon Jul 14 11:37:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naveen Krishna Chatradhi X-Patchwork-Id: 4545391 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 2CC419F295 for ; Mon, 14 Jul 2014 11:43:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6B3422014A for ; Mon, 14 Jul 2014 11:43:30 +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 8581020136 for ; Mon, 14 Jul 2014 11:43:29 +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 1X6edX-00070u-K0; Mon, 14 Jul 2014 11:41:39 +0000 Received: from mailout2.samsung.com ([203.254.224.25]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1X6edE-0005y6-7x for linux-arm-kernel@lists.infradead.org; Mon, 14 Jul 2014 11:41:21 +0000 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N8P00IH49S99I10@mailout2.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 14 Jul 2014 20:40:57 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.122]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id DE.2E.16580.9C1C3C35; Mon, 14 Jul 2014 20:40:57 +0900 (KST) X-AuditID: cbfee691-b7f2f6d0000040c4-4e-53c3c1c9b8c4 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 3E.E6.05196.9C1C3C35; Mon, 14 Jul 2014 20:40:57 +0900 (KST) Received: from chnaveen-ubuntu.sisodomain.com ([107.108.83.161]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N8P00BXR9RQIVA0@mmp2.samsung.com>; Mon, 14 Jul 2014 20:40:57 +0900 (KST) From: Naveen Krishna Chatradhi To: kgene.kim@samsung.com, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org Subject: [PATCH 1/3] serial: samsung: get fifosize via device tree Date: Mon, 14 Jul 2014 17:07:16 +0530 Message-id: <1405337838-30335-2-git-send-email-ch.naveen@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1405337838-30335-1-git-send-email-ch.naveen@samsung.com> References: <1405337838-30335-1-git-send-email-ch.naveen@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrCLMWRmVeSWpSXmKPExsWyRsSkSvfkwcPBBlN2q1pMWneAyeLlIU2L +UfOsVo0L17PZtG74CqbxabH11gtZpzfx+TA7vF31Qtmj/1z17B7bF5S79G3ZRWjx+dNcgGs UVw2Kak5mWWpRfp2CVwZnV9msxasEqp4Mj+zgXEPfxcjJ4eEgInEl5nnmCFsMYkL99azdTFy cQgJLGWU6Gx7wg5TtOj9dGaIxHRGiUXL25kgnH4mid5/+1hAqtgEzCQOLlrNDpIQEWhglGhZ /AisnVnAVWLnjoVgRcICThJLVtxjArFZBFQlHv45wQpi8wLVTFl1BGg3B9A6BYk5k2xAwpwC bhI7/naAnScEVHL5bBsjyHwJgensEjdWb2OEmCMg8W3yIRaIXlmJTQeg3pGUOLjiBssERuEF jAyrGEVTC5ILipPSi0z1ihNzi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Lg2YLUFw46QXkvX8md1ugM+beZ42W6sKmqRP9S/jccNgyT3yWflqvU2t3ZnDun IiK38M+M/5XLzd6/v86frFpwm23KYelH8/cGWoeqz1diKc5INNRiLipOBAAu/JGWtgIAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140714_044120_506282_3FC82CEC X-CRM114-Status: GOOD ( 10.41 ) X-Spam-Score: -5.0 (-----) Cc: gregkh@linuxfoundation.org, cpgs@samsung.com, ben-linux@fluff.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=-1.9 required=5.0 tests=BAYES_00,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 UART modules on some SoCs only differ in the fifosize of each UART channel. Its useless to duplicate the drv_data structure or create a compatible name for such a change. We can get fifosize via the device tree nodes (not mandating it). Also updates the documentation. Signed-off-by: Naveen Krishna Chatradhi Cc: gregkh@linuxfoundation.org --- .../devicetree/bindings/serial/samsung_uart.txt | 4 ++++ drivers/tty/serial/samsung.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/serial/samsung_uart.txt b/Documentation/devicetree/bindings/serial/samsung_uart.txt index 85e8ee2..e85f37e 100644 --- a/Documentation/devicetree/bindings/serial/samsung_uart.txt +++ b/Documentation/devicetree/bindings/serial/samsung_uart.txt @@ -29,6 +29,9 @@ Required properties: [1] Documentation/devicetree/bindings/interrupt-controller/interrupts.txt [2] Documentation/devicetree/bindings/clock/clock-bindings.txt +Optional properties: +- samsung,uart-fifosize: The fifo size supported by the UART channel + Note: Each Samsung UART should have an alias correctly numbered in the "aliases" node, according to serialN format, where N is the port number (non-negative decimal integer) as specified by User's Manual of respective @@ -51,4 +54,5 @@ Example: "clk_uart_baud3"; clocks = <&clocks PCLK_UART1>, <&clocks PCLK_UART1>, <&clocks SCLK_UART>; + samsung,uart-fifosize = <16>; }; diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 6be852d..e49a945 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1295,9 +1295,15 @@ static int s3c24xx_serial_probe(struct platform_device *pdev) dev_get_platdata(&pdev->dev) : ourport->drv_data->def_cfg; - ourport->port.fifosize = (ourport->info->fifosize) ? - ourport->info->fifosize : - ourport->drv_data->fifosize[index]; + if (pdev->dev.of_node) + of_property_read_u32(pdev->dev.of_node, + "samsung,uart-fifosize", &ourport->port.fifosize); + + if (!ourport->port.fifosize) { + ourport->port.fifosize = (ourport->info->fifosize) ? + ourport->info->fifosize : + ourport->drv_data->fifosize[index]; + } probe_index++;