From patchwork Tue May 28 13:02:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 2624631 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 54DF63FDBC for ; Tue, 28 May 2013 13:02:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933977Ab3E1NCX (ORCPT ); Tue, 28 May 2013 09:02:23 -0400 Received: from mail-pb0-f51.google.com ([209.85.160.51]:65528 "EHLO mail-pb0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933919Ab3E1NCX (ORCPT ); Tue, 28 May 2013 09:02:23 -0400 Received: by mail-pb0-f51.google.com with SMTP id jt11so7835795pbb.38 for ; Tue, 28 May 2013 06:02:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=rXanyVywbNHePUCrBy56c9jkHoZjBsHLjE+Ltu35pBk=; b=kcMJKqOjzhOugw1+DAU7VdGNkUa5tCr6nrKoq+qnHTWf3S8N6bK2d06PJP1nLydBuI KDGmJD/e/3bGYv2mhettdQi+arLr6gHpySfigUHDqRel+I9eJ7blBL7o2ORXITbyWVKB 3fzXGDu8I2BzKGINfGQc/BPZ/p7FqTBwMRP9GduN24bG6hq7Bh5XFMyW+OjptfEng72T I6jno6sDNf+si8CsucoQawTeibenCmEOYkpWSmeo8bRwW5OBy4uPqAOWBmgVbG3zQn8l rj88fZx6dLTLF00ztdecpPCYNBqqM8uzY/06G7392Ii6VwJyoqNotOLjqrpPlQuzyNXY pm4Q== X-Received: by 10.68.190.104 with SMTP id gp8mr33922165pbc.120.1369746142497; Tue, 28 May 2013 06:02:22 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id w8sm32868631pbo.9.2013.05.28.06.02.19 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 28 May 2013 06:02:21 -0700 (PDT) From: Chander Kashyap To: linux-serial@vger.kernel.org Cc: linux-samsung-soc@vger.kernel.org, Chander Kashyap Subject: [PATCH] serial: samsung: enable clock before clearing pending interrupts during init Date: Tue, 28 May 2013 18:32:07 +0530 Message-Id: <1369746127-13129-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQkkdbMDErOERypBk3N8+OLpOAk24p2CpFGAJW8Yu55pE1cf2d6CIgNIlWAXlC3UcFHB/v2e Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Ensure that the uart controller clock is enabled prior to writing to the interrupt mask and pending registers in the s3c24xx_serial_init_port function. Signed-off-by: Chander Kashyap --- drivers/tty/serial/samsung.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/samsung.c b/drivers/tty/serial/samsung.c index 2c873c4..d1972b9 100644 --- a/drivers/tty/serial/samsung.c +++ b/drivers/tty/serial/samsung.c @@ -1166,6 +1166,18 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, ourport->tx_irq = ret; ourport->clk = clk_get(&platdev->dev, "uart"); + if (IS_ERR(ourport->clk)) { + pr_err("%s: Controller clock not found\n", + dev_name(&platdev->dev)); + return PTR_ERR(ourport->clk); + } + + ret = clk_prepare_enable(ourport->clk); + if (ret) { + pr_err("uart: clock failed to prepare+enable: %d\n", ret); + clk_put(ourport->clk); + return ret; + } /* Keep all interrupts masked and cleared */ if (s3c24xx_serial_has_interrupt_mask(port)) { @@ -1180,6 +1192,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, /* reset the fifos (and setup the uart) */ s3c24xx_serial_resetport(port, cfg); + clk_disable_unprepare(ourport->clk); return 0; }