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: 10810 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 6430623E56 for ; Mon, 20 Aug 2012 14:50:15 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 19263A18B75 for ; Mon, 20 Aug 2012 14:50:09 +0000 (UTC) Received: by yenl8 with SMTP id l8so5360212yen.11 for ; Mon, 20 Aug 2012 07:50:14 -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=o6BA9ns+gpp7Ud8GMiYbx+felGq+HCyWLfZXsw19WmA=; b=Y9wfQU5C9cxZpRYKpkIIMGHBdu0zuDlEhU2bDxW+BGZ/Oqh3NLseV+H4+yZ9KOgx2d w55ClKHBSuxpfIoW/Neb3DvnAC0yAZkrpkzD2iSo5FTLk1wUGyCdHIh9B4sMACagnSFA X5qOyHSlcMs/ISnSih1eTxqXBos22zNU3csbTCiLEalHsRlkgQuTARoieK6dRzLqkn8F pjWpTY0OTt6EoXrGKXh3FI0bmEEodwq3oBpioHdcvqnIs8XktPWpHnV1v8wQtE1chN3I nOb4aNJ9rLDO14/E5L1NFuqIPIUW5iwVf4xNwFzLZIYA4NgZaVW/s5J12W1rJYCNy85G GWDg== Received: by 10.50.159.196 with SMTP id xe4mr9995052igb.43.1345474213412; Mon, 20 Aug 2012 07:50:13 -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 ex8csp87717igc; Mon, 20 Aug 2012 07:50:13 -0700 (PDT) Received: by 10.68.216.136 with SMTP id oq8mr35576266pbc.68.1345474212884; Mon, 20 Aug 2012 07:50:12 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id kn7si27031018pbc.26.2012.08.20.07.50.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 20 Aug 2012 07:50:12 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of anton.vorontsov@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.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-pb0-f50.google.com with SMTP id md12so7851924pbc.37 for ; Mon, 20 Aug 2012 07:50:12 -0700 (PDT) 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 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 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: ALoCoQnIuwROYAufcwFPUO5uF/1pnas1Bs7h15M3msohEmTYc1hFx2gOpOAjDaOimOoMNSJuLarV 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 };