From patchwork Mon Sep 10 04:14:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 11275 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 E203C23F26 for ; Mon, 10 Sep 2012 04:16:38 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 7502EA18731 for ; Mon, 10 Sep 2012 04:16:38 +0000 (UTC) Received: by iafj25 with SMTP id j25so1425402iaf.11 for ; Sun, 09 Sep 2012 21:16:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:date:from :to:cc:subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent:x-gm-message-state; bh=SmlKPfCFCrGSuUry8EgnR4iKzTqG8s82FiovlD4XoDI=; b=eUFsWh+jOEcBUD5bM0mcTfSNmq2ySaZaMbItTQMQBMcyMRV6ft46YABu15/kbs9HXV HXGHVAg63r3XvaPzDEH0jTaIx90JC0AUNJxwneBiinTetoEc53IR4LlKqoGC0fMJIv1C SlQ0Nt8FwnfgvVbxvPvv5cnMJqLw043djZSEjVAg3T90cSYfYrtOSpEgC5/eRbb86tOU wKgABQl2VHhtYmxRwJlmVf6Y809kj4DzwAz6RQn/sRJ6afbk0F+4P7tcC71dLdQcGG5j ZVd+ruVLqGd118emrsosXU35+JvyVhWurpKtJKQkrd1mqYsgxWudSM2B2emXnYlRS2/E bBwQ== Received: by 10.42.60.139 with SMTP id q11mr15501903ich.53.1347250597931; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) 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.50.184.232 with SMTP id ex8csp72963igc; Sun, 9 Sep 2012 21:16:37 -0700 (PDT) Received: by 10.68.224.161 with SMTP id rd1mr3922006pbc.133.1347250597439; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) Received: from mail-pz0-f50.google.com (mail-pz0-f50.google.com [209.85.210.50]) by mx.google.com with ESMTPS id rr1si2743009pbc.248.2012.09.09.21.16.37 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 21:16:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.210.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.210.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) smtp.mail=anton.vorontsov@linaro.org Received: by mail-pz0-f50.google.com with SMTP id e7so1311691dad.37 for ; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) Received: by 10.68.226.38 with SMTP id rp6mr3934215pbc.116.1347250597051; Sun, 09 Sep 2012 21:16:37 -0700 (PDT) Received: from localhost (ip-64-134-230-8.public.wayport.net. [64.134.230.8]) by mx.google.com with ESMTPS id gi2sm1260271pbc.59.2012.09.09.21.16.36 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 09 Sep 2012 21:16:36 -0700 (PDT) Date: Sun, 9 Sep 2012 21:14:04 -0700 From: Anton Vorontsov To: Andrew Morton , Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Cc: Arve =?utf-8?B?SGrDuG5uZXbDpWc=?= , Colin Cross , Brian Swetland , John Stultz , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linaro-kernel@lists.linaro.org, patches@linaro.org, kernel-team@android.com, kgdb-bugreport@lists.sourceforge.net, linux-serial@vger.kernel.org Subject: [PATCH 09/14] tty/serial/amba-pl011: Implement clear_irqs callback Message-ID: <20120910041404.GI29537@lizard> References: <20120910040802.GA1261@lizard> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20120910040802.GA1261@lizard> User-Agent: Mutt/1.5.21 (2010-09-15) X-Gm-Message-State: ALoCoQnxZJUF4QppEHl3b2HgLuefBRTMQZ3f2jiY+TcUXlqzkVPBABCv7uTccnC04KFOUYnphxcw 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 88e2df2..7522d97 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -1308,6 +1308,18 @@ static void pl011_put_poll_char(struct uart_port *port, writew(ch, uap->port.membase + UART01x_DR); } +static void pl011_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_hwinit(struct uart_port *port) @@ -1713,6 +1725,7 @@ static struct uart_ops amba_pl011_pops = { .poll_init = pl011_hwinit, .poll_get_char = pl011_get_poll_char, .poll_put_char = pl011_put_poll_char, + .clear_irqs = pl011_clear_irqs, #endif };