From patchwork Mon Jul 30 11:58:14 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1254381 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 1F379DF24C for ; Mon, 30 Jul 2012 12:13:17 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SvokW-0007AI-6s; Mon, 30 Jul 2012 12:07:00 +0000 Received: from mail-gg0-f177.google.com ([209.85.161.177]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1Svofe-0006He-8j for linux-arm-kernel@lists.infradead.org; Mon, 30 Jul 2012 12:01:59 +0000 Received: by ggcs5 with SMTP id s5so4795791ggc.36 for ; Mon, 30 Jul 2012 05:01:50 -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:in-reply-to:references :x-gm-message-state; bh=dP+32rciMP717d2cMj0l4Ca0zMFxYz9KoDEEceWAys4=; b=os9+aP8uTarmWKY41OyZN/ghdUd9bFAsDzWzRG9/Xl+5WGiWOwLz3l2io/y5zOXvKR B8dnXgwlN8FHYk9nLJJAyKy5zq35ryKhX21jf8LLm0ifbZwiLsoGipjOE/t6C6EXmn0C FS7kzEnxSRnIzoXrwKnuXjPdlHcQyUz0MCVdenser8iLmNGjk48/4ZiIQH3pJMYT3R5k TUAbb2PmChTy/u74tcRPktYpqsaI5Bys4iwR2+5z1ihGRFHipRRd8heb69ENTzA/wqMA tgBdQYsRceaGAFIu9E4mtIcwVesfB6P22opSmj3Q/lxxQ/lRZjR2spjC/UNjHbiYmjuz 0UOw== Received: by 10.66.73.98 with SMTP id k2mr23983157pav.73.1343649709975; Mon, 30 Jul 2012 05:01:49 -0700 (PDT) Received: from localhost (c-71-204-165-222.hsd1.ca.comcast.net. [71.204.165.222]) by mx.google.com with ESMTPS id hw6sm7805866pbc.73.2012.07.30.05.01.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 05:01:49 -0700 (PDT) From: Anton Vorontsov To: Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Subject: [PATCH 05/11] tty/serial/amba-pl011: Implement clear_irqs callback Date: Mon, 30 Jul 2012 04:58:14 -0700 Message-Id: <1343649500-18491-5-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <20120730115719.GA5742@lizard> References: <20120730115719.GA5742@lizard> X-Gm-Message-State: ALoCoQlO6Xg4/kfqBQVSIfqdawLRkWDEXk3WCY9RgO1F71iszX84A9R87icacWy8t4ei9vZn/83C X-Spam-Note: CRM114 invocation failed X-Spam-Note: SpamAssassin invocation failed Cc: linaro-kernel@lists.linaro.org, patches@linaro.org, kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , John Stultz , Colin Cross , kernel-team@android.com, linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org It's all pretty straightforward, except for TXIM interrupt. The interrupt has meaning "ready to transmit", so it's almost always raised, and the only way to silence it is to mask it. But that's OK, ops->start_tx will unmask it. Signed-off-by: Anton Vorontsov --- drivers/tty/serial/amba-pl011.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index c17923e..378d26b 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1308,6 +1308,18 @@ static void pl010_put_poll_char(struct uart_port *port, writew(ch, uap->port.membase + UART01x_DR); } +static void pl010_clear_irqs(struct uart_port *port) +{ + struct uart_amba_port *uap = (struct uart_amba_port *)port; + unsigned char __iomem *regs = uap->port.membase; + + writew(readw(regs + UART011_MIS), regs + UART011_ICR); + /* + * There is no way to clear TXIM, this is "ready to transmit IRQ", so + * we simply mask it. ops->start_tx will unmask it. + */ + writew(readw(regs + UART011_IMSC) & ~UART011_TXIM, regs + UART011_IMSC); +} #endif /* CONFIG_CONSOLE_POLL */ static int pl011_startup(struct uart_port *port) @@ -1698,6 +1710,7 @@ static struct uart_ops amba_pl011_pops = { #ifdef CONFIG_CONSOLE_POLL .poll_get_char = pl010_get_poll_char, .poll_put_char = pl010_put_poll_char, + .clear_irqs = pl010_clear_irqs, #endif };