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: 10363 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 3D7B123E02 for ; Mon, 30 Jul 2012 12:01:52 +0000 (UTC) Received: from mail-gg0-f180.google.com (mail-gg0-f180.google.com [209.85.161.180]) by fiordland.canonical.com (Postfix) with ESMTP id 0CF9CA18AD7 for ; Mon, 30 Jul 2012 12:01:51 +0000 (UTC) Received: by mail-gg0-f180.google.com with SMTP id f1so4594455ggn.11 for ; Mon, 30 Jul 2012 05:01:51 -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:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=dP+32rciMP717d2cMj0l4Ca0zMFxYz9KoDEEceWAys4=; b=M35Gim4WtPlsE0RwcNWZYvMwuPyysYaODeprAwAIAsYyy9YROLlYycYF1rCtxaD09/ 0VRsmPK0kTptpRiPdIeL90nygDf5+w9Ixu9gXX8KjskDDSkTZLYYusNcAqV84btWSG2O 0vSEVug3N7Egnf7BiaaggKPPuZ4u7kgMyHXQSzoY8o9RtCYafpNsdAy0XDKvxLJZH+g1 G4VJYrG/1PgeRNDIkP2GrUxzMVoYYGxmQCg//1cd9DGMFatB8HsyJ9jP8fSnGysmrf/v +0LxlEfdIea1CJFY/jSk4MRCZpIP58Vw+YrC8JnxxIv0G3Wi0ibMuJsqOteesx2ay8xh v0Vw== Received: by 10.50.219.194 with SMTP id pq2mr10642248igc.25.1343649711462; Mon, 30 Jul 2012 05:01:51 -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.87.40 with SMTP id u8csp84593igz; Mon, 30 Jul 2012 05:01:50 -0700 (PDT) Received: by 10.100.246.32 with SMTP id t32mr3016407anh.17.1343649710622; Mon, 30 Jul 2012 05:01:50 -0700 (PDT) Received: from mail-gg0-f178.google.com (mail-gg0-f178.google.com [209.85.161.178]) by mx.google.com with ESMTPS id s62si8831028yhm.90.2012.07.30.05.01.50 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 30 Jul 2012 05:01:50 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.161.178 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.161.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.161.178 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-gg0-f178.google.com with SMTP id q6so5331239ggc.37 for ; Mon, 30 Jul 2012 05:01:50 -0700 (PDT) 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 Cc: =?UTF-8?q?Arve=20Hj=C3=B8nnev=C3=A5g?= , Colin Cross , 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 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: ALoCoQlP4o+SJmovFH+UpfrnHGFI90Y4eDFP1cwTVZEi1SCUqidlN05gJXmVYHqmOMINUoVSVsfG 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 };