From patchwork Mon Aug 20 14:47:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Vorontsov X-Patchwork-Id: 1349621 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 1C361DFF0F for ; Mon, 20 Aug 2012 15:02:07 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1T3TKx-00033X-Gq; Mon, 20 Aug 2012 14:52:16 +0000 Received: from mail-pb0-f49.google.com ([209.85.160.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1T3TIy-00029E-Uo for linux-arm-kernel@lists.infradead.org; Mon, 20 Aug 2012 14:50:14 +0000 Received: by mail-pb0-f49.google.com with SMTP id rq8so7544527pbb.36 for ; Mon, 20 Aug 2012 07:50:12 -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=o6BA9ns+gpp7Ud8GMiYbx+felGq+HCyWLfZXsw19WmA=; b=VM2rQGrJx/1qyHvISkKtt5ivnJAd0tDGKe32lqbLWxrvX+5tjQozlYprSG7rsYUeED O7kOPhwWAti9cljABY+PiC/PWg55/aQsalxFcZVi5J2DIx04qSLBw6+cUkAtIAoDhLGX o65Fo9hT7gnAqMvclqsnYKDf6HxBWOYTnaVicKEW0SPBdpA8OKOwR3TRcwpt5RNkOOYh +yoOx2VcrYPRWjyXkR3hKzlL3USv7VF2udlpt0JHmeSAc2N5tNK6mVPYhDd2Nah6VLqN I7wWN5BS8TY8W5w1VcDC4rejnrnN0f5bRtlQafw6sSsWS1SuxLGa5pJ4y481mBK2jbL3 Pq8g== Received: by 10.68.240.138 with SMTP id wa10mr34818646pbc.145.1345474212521; Mon, 20 Aug 2012 07:50:12 -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 rn4sm11231439pbb.51.2012.08.20.07.50.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 07:50:12 -0700 (PDT) From: Anton Vorontsov To: Russell King , Jason Wessel , Greg Kroah-Hartman , Alan Cox Subject: [PATCH 07/12] tty/serial/amba-pl011: Implement clear_irqs callback Date: Mon, 20 Aug 2012 07:47:25 -0700 Message-Id: <1345474050-8339-7-git-send-email-anton.vorontsov@linaro.org> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <20120820144449.GA32560@lizard> References: <20120820144449.GA32560@lizard> X-Gm-Message-State: ALoCoQlmdRQJLv9athqDKWsfyRxJa6KG2Waib1C5tQh/A/OKxwMvBnxr4jEA0vL9JM6WjkprWYOP X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.160.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 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 90f2302..cf9278c 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_hwinit(struct uart_port *port) @@ -1721,6 +1733,7 @@ static struct uart_ops amba_pl011_pops = { .poll_init = pl011_hwinit, .poll_get_char = pl010_get_poll_char, .poll_put_char = pl010_put_poll_char, + .clear_irqs = pl010_clear_irqs, #endif };