From patchwork Fri Jan 23 09:48:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: yao yuan X-Patchwork-Id: 5691721 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B05C2C058D for ; Fri, 23 Jan 2015 09:54:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1A47202E5 for ; Fri, 23 Jan 2015 09:54:18 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ED300202BE for ; Fri, 23 Jan 2015 09:54:17 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEaty-0006Ut-9Q; Fri, 23 Jan 2015 09:51:42 +0000 Received: from mail-bn1bn0106.outbound.protection.outlook.com ([157.56.110.106] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEatv-0006RE-0H for linux-arm-kernel@lists.infradead.org; Fri, 23 Jan 2015 09:51:39 +0000 Received: from CO2PR03CA0020.namprd03.prod.outlook.com (10.141.194.147) by BY2PR03MB331.namprd03.prod.outlook.com (10.141.139.20) with Microsoft SMTP Server (TLS) id 15.1.65.13; Fri, 23 Jan 2015 09:51:15 +0000 Received: from BL2FFO11FD060.protection.gbl (2a01:111:f400:7c09::193) by CO2PR03CA0020.outlook.office365.com (2a01:111:e400:1414::19) with Microsoft SMTP Server (TLS) id 15.1.65.19 via Frontend Transport; Fri, 23 Jan 2015 09:51:14 +0000 Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD060.mail.protection.outlook.com (10.173.161.188) with Microsoft SMTP Server (TLS) id 15.1.75.11 via Frontend Transport; Fri, 23 Jan 2015 09:51:14 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t0N9p8P2023064; Fri, 23 Jan 2015 02:51:09 -0700 From: Yuan Yao To: , , Subject: [PATCH v2] serial: fsl-lpuart: disable interrupt when suspend Date: Fri, 23 Jan 2015 17:48:54 +0800 Message-ID: <1422006534-16264-1-git-send-email-yao.yuan@freescale.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=yao.yuan@freescale.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=permerror action=none header.from=freescale.com; X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(50466002)(77096005)(106466001)(105606002)(229853001)(36756003)(62966003)(46102003)(77156002)(87936001)(48376002)(92566002)(47776003)(19580395003)(19580405001)(6806004)(50226001)(2201001)(104016003)(33646002)(85426001)(86362001)(50986999); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR03MB331; H:tx30smr01.am.freescale.net; FPR:; SPF:None; MLV:sfv; LANG:en; MIME-Version: 1.0 X-DmarcAction-Test: None X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(3005004);SRVR:BY2PR03MB331; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004); SRVR:BY2PR03MB331; X-Forefront-PRVS: 0465429B7F X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB331; X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jan 2015 09:51:14.5617 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB331 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150123_015139_289251_14D4C768 X-CRM114-Status: UNSURE ( 6.29 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-serial@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For power management support, we should disable TX and TX interrupt so that kernel can prepare for deep sleep. Retain RX and RX interrupt for wakeup the kernel when receive the input character. Signed-off-by: Yuan Yao --- Changed in v2: - Retain RX and RX interrupt for wakeup the kernel when receive the input character. drivers/tty/serial/fsl_lpuart.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 1c5d020..b195cfc 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -1449,6 +1449,19 @@ static int lpuart_remove(struct platform_device *pdev) static int lpuart_suspend(struct device *dev) { struct lpuart_port *sport = dev_get_drvdata(dev); + unsigned long temp; + + if (sport->lpuart32) { + /* disable Rx/Tx and interrupts */ + temp = lpuart32_read(sport->port.membase + UARTCTRL); + temp &= ~(UARTCTRL_TE | UARTCTRL_TIE | UARTCTRL_TCIE); + lpuart32_write(temp, sport->port.membase + UARTCTRL); + } else { + /* disable Rx/Tx and interrupts */ + temp = readb(sport->port.membase + UARTCR2); + temp &= ~(UARTCR2_TE | UARTCR2_TIE | UARTCR2_TCIE); + writeb(temp, sport->port.membase + UARTCR2); + } uart_suspend_port(&lpuart_reg, &sport->port);