From patchwork Tue Nov 22 13:44:14 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rajendra Nayak X-Patchwork-Id: 5279 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 8E15A23E07 for ; Tue, 22 Nov 2011 13:44:53 +0000 (UTC) Received: from mail-qy0-f180.google.com (mail-qy0-f180.google.com [209.85.216.180]) by fiordland.canonical.com (Postfix) with ESMTP id 5F469A18703 for ; Tue, 22 Nov 2011 13:44:53 +0000 (UTC) Received: by mail-qy0-f180.google.com with SMTP id 16so61332qyl.11 for ; Tue, 22 Nov 2011 05:44:53 -0800 (PST) Received: by 10.152.105.226 with SMTP id gp2mr11789283lab.28.1321969492855; Tue, 22 Nov 2011 05:44:52 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.41.198 with SMTP id h6cs178273lal; Tue, 22 Nov 2011 05:44:52 -0800 (PST) Received: by 10.236.78.129 with SMTP id g1mr27497741yhe.52.1321969489432; Tue, 22 Nov 2011 05:44:49 -0800 (PST) Received: from devils.ext.ti.com (devils.ext.ti.com. [198.47.26.153]) by mx.google.com with ESMTPS id d14si3044604ybk.51.2011.11.22.05.44.48 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 22 Nov 2011 05:44:49 -0800 (PST) Received-SPF: pass (google.com: domain of rnayak@ti.com designates 198.47.26.153 as permitted sender) client-ip=198.47.26.153; Authentication-Results: mx.google.com; spf=pass (google.com: domain of rnayak@ti.com designates 198.47.26.153 as permitted sender) smtp.mail=rnayak@ti.com Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id pAMDiiBe003765 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 22 Nov 2011 07:44:46 -0600 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id pAMDievM025281; Tue, 22 Nov 2011 19:14:43 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Tue, 22 Nov 2011 19:14:41 +0530 Received: from ula0131687.apr.dhcp.ti.com (ula0131687-172024137230.apr.dhcp.ti.com [172.24.137.230]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id pAMDiZ11000926; Tue, 22 Nov 2011 19:14:41 +0530 (IST) From: Rajendra Nayak To: , , CC: , , , , , , , , Rajendra Nayak Subject: [PATCH v2 2/4] omap-serial: Use default clock speed (48Mhz) if not specified Date: Tue, 22 Nov 2011 19:14:14 +0530 Message-ID: <1321969456-24266-3-git-send-email-rnayak@ti.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1321969456-24266-1-git-send-email-rnayak@ti.com> References: <1321969456-24266-1-git-send-email-rnayak@ti.com> MIME-Version: 1.0 Use a default clock speed of 48Mhz, instead of ending up with 0, if platforms fail to specify a valid clock speed. Signed-off-by: Rajendra Nayak --- drivers/tty/serial/omap-serial.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/tty/serial/omap-serial.c b/drivers/tty/serial/omap-serial.c index a02cc9f..f14b9c5 100644 --- a/drivers/tty/serial/omap-serial.c +++ b/drivers/tty/serial/omap-serial.c @@ -43,6 +43,8 @@ #include #include +#define DEFAULT_CLK_SPEED 48000000 /* 48Mhz*/ + static struct uart_omap_port *ui[OMAP_MAX_HSUART_PORTS]; /* Forward declaration of functions */ @@ -1386,6 +1388,11 @@ static int serial_omap_probe(struct platform_device *pdev) up->port.flags = omap_up_info->flags; up->port.uartclk = omap_up_info->uartclk; + if (!up->port.uartclk) { + up->port.uartclk = DEFAULT_CLK_SPEED; + dev_warn(&pdev->dev, "No clock speed specified: using default:" + "%d\n", DEFAULT_CLK_SPEED); + } up->uart_dma.uart_base = mem->start; up->errata = omap_up_info->errata;