From patchwork Fri May 29 22:19:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vaibhav Hiremath X-Patchwork-Id: 6511691 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 BC663C0020 for ; Fri, 29 May 2015 22:25:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E390D2061C for ; Fri, 29 May 2015 22:25:22 +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 0F94320612 for ; Fri, 29 May 2015 22:25:22 +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 1YySgG-00064l-TO; Fri, 29 May 2015 22:23:08 +0000 Received: from mail-pd0-f174.google.com ([209.85.192.174]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YySfO-0005et-Cd for linux-arm-kernel@lists.infradead.org; Fri, 29 May 2015 22:22:15 +0000 Received: by pdbnf5 with SMTP id nf5so1760944pdb.2 for ; Fri, 29 May 2015 15:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AbKRJsxdPEpZw12pberrp7sRzbnhO4N3EUQT19YXN0g=; b=G9sysR6DJvC2LUHHpBLzWsA4MDaEXgCtvZuLRq2wuVUSMPAYtSi2XW0x9Gw14kOmKP YuCe/J3UAuORlJN57+1Lh6+CsndblruIz8rZVHlSg2+Ce0/a5E9rRmOp5/EozTkwJ4FO 3xErFPmE9AWG3vDKeLeUu2keYy+wqkn6bYXcfRvaGUFynto0gVuBE3/uj8RYgfWbw7Yc 9waHOUxqIOhPYxIPIyAHgCzE4kShCQmg3f3yiJBwuff1Mdc4Dl5Ny/rbKQeuYQNChZI3 kW49ajSCPNh318w7Kr6Px4VrvHpu+r+sLRj6LR6vpgjzio5/4EhYdXB0xzRLhRtt2TuL mFew== X-Gm-Message-State: ALoCoQltHuDCLvdELSJK2RqoYwodL0blQiKN08evdEO+OkIets4KSjGwo4EedS+m4Wi2vjXrPf0R X-Received: by 10.68.136.134 with SMTP id qa6mr18930675pbb.66.1432938113324; Fri, 29 May 2015 15:21:53 -0700 (PDT) Received: from localhost.localdomain ([202.62.77.106]) by mx.google.com with ESMTPSA id nb10sm6605761pdb.76.2015.05.29.15.21.48 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 29 May 2015 15:21:52 -0700 (PDT) From: Vaibhav Hiremath To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/4] mfd: 88pm800: use irq_mode to configure interrupt status reg clear method Date: Sat, 30 May 2015 03:49:20 +0530 Message-Id: <1432937962-4537-3-git-send-email-vaibhav.hiremath@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1432937962-4537-1-git-send-email-vaibhav.hiremath@linaro.org> References: <1432937962-4537-1-git-send-email-vaibhav.hiremath@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150529_152214_498513_0CD5AAE0 X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.8 (-) Cc: zhaoy , devicetree@vger.kernel.org, sameo@linux.intel.com, rtc-linux@googlegroups.com, a.zummo@towertech.it, linux-kernel@vger.kernel.org, Vaibhav Hiremath , robh+dt@kernel.org, alexandre.belloni@free-electrons.com, lee.jones@linaro.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: , MIME-Version: 1.0 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 From the spec, bit 1 of reg 0xe (page 0): IN_CLEAR_MODE controls the method of clearing interrupt status register of 88pm800; 0: clear on read 1: clear on write Signed-off-by: zhaoy Signed-off-by: Vaibhav Hiremath --- drivers/mfd/88pm800.c | 4 +++- include/linux/mfd/88pm80x.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/88pm800.c b/drivers/mfd/88pm800.c index 06ee058..8ea4467 100644 --- a/drivers/mfd/88pm800.c +++ b/drivers/mfd/88pm800.c @@ -391,7 +391,8 @@ static int device_irq_init_800(struct pm80x_chip *chip) PM800_WAKEUP2_INV_INT | PM800_WAKEUP2_INT_CLEAR | PM800_WAKEUP2_INT_MASK; - data = PM800_WAKEUP2_INT_CLEAR; + data = (chip->irq_mode) ? + PM800_WAKEUP2_INT_WRITE_CLEAR : PM800_WAKEUP2_INT_READ_CLEAR; ret = regmap_update_bits(map, PM800_WAKEUP2, mask, data); if (ret < 0) @@ -514,6 +515,7 @@ static int device_800_init(struct pm80x_chip *chip, } chip->regmap_irq_chip = &pm800_irq_chip; + chip->irq_mode = pdata->irq_mode; ret = device_irq_init_800(chip); if (ret < 0) { diff --git a/include/linux/mfd/88pm80x.h b/include/linux/mfd/88pm80x.h index 97cb283..6ed6c16 100644 --- a/include/linux/mfd/88pm80x.h +++ b/include/linux/mfd/88pm80x.h @@ -77,6 +77,8 @@ enum { #define PM800_WAKEUP2 (0x0E) #define PM800_WAKEUP2_INV_INT (1 << 0) #define PM800_WAKEUP2_INT_CLEAR (1 << 1) +#define PM800_WAKEUP2_INT_READ_CLEAR (0 << 1) +#define PM800_WAKEUP2_INT_WRITE_CLEAR (1 << 1) #define PM800_WAKEUP2_INT_MASK (1 << 2) #define PM800_POWER_UP_LOG (0x10)