From patchwork Sat Jul 6 04:57:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2824471 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 9EB40C0AB2 for ; Sat, 6 Jul 2013 04:59:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AF6412016A for ; Sat, 6 Jul 2013 04:59:02 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A61FC20168 for ; Sat, 6 Jul 2013 04:59:01 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvKa6-0004v7-VC; Sat, 06 Jul 2013 04:58:47 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvKa4-0000Zs-9Q; Sat, 06 Jul 2013 04:58:44 +0000 Received: from smtp48.i.mail.ru ([94.100.177.108]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UvKa0-0000Yy-9q for linux-arm-kernel@lists.infradead.org; Sat, 06 Jul 2013 04:58:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=cBYb+kM5+V3W4bLXBZ8jZ3+vouTsRbpAwEAlkQZKJXU=; b=O1vDUibdW0FC3fNW9HNs+NwJkYIrw8LsX2TQFp+nDsCylJEX1T1+de/tzKVbGmlR9zikMNWq7ov6AwHaqFC/qAwc+I0YrDc9q1aCudT87UGzY+/MiEe+zP5T1cQco34laCu+6BS5KsZCqIKTuO1w7DE3MoLY/Q3HdRD+VaqDEfM=; Received: from [188.134.40.128] (port=2914 helo=shc.zet) by smtp48.i.mail.ru with esmtpa (envelope-from ) id 1UvKZa-0004js-P1; Sat, 06 Jul 2013 08:58:14 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/3] input: mc13783: Add MC13892 support Date: Sat, 6 Jul 2013 08:57:59 +0400 Message-Id: <1373086680-31444-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1373086680-31444-1-git-send-email-shc_work@mail.ru> References: <1373086680-31444-1-git-send-email-shc_work@mail.ru> X-Mras: Ok X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130706_005840_870169_483E9E78 X-CRM114-Status: GOOD ( 12.93 ) X-Spam-Score: -2.0 (--) Cc: Alexander Shiyan , Dmitry Torokhov , Rob Herring , Sascha Hauer , linux-input@vger.kernel.org, Grant Likely , Shawn Guo X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 Signed-off-by: Alexander Shiyan --- drivers/input/misc/Kconfig | 6 +++--- drivers/input/misc/mc13783-pwrbutton.c | 10 +++++++++- include/linux/mfd/mc13892.h | 4 ++++ 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 0b541cd..0d83653 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig @@ -167,10 +167,10 @@ config INPUT_MAX8997_HAPTIC module will be called max8997-haptic. config INPUT_MC13783_PWRBUTTON - tristate "MC13783 ON buttons" - depends on MFD_MC13783 + tristate "MC13783/MC13892 ON buttons" + depends on MFD_MC13XXX help - Support the ON buttons of MC13783 PMIC as an input device + Support the ON buttons of MC13783/MC13892 PMIC as an input device reporting power button status. To compile this driver as a module, choose M here: the module diff --git a/drivers/input/misc/mc13783-pwrbutton.c b/drivers/input/misc/mc13783-pwrbutton.c index 33613ca..855d576 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c @@ -26,6 +26,7 @@ #include #include #include +#include struct mc13xxx_button_def { unsigned int irq; @@ -194,8 +195,15 @@ static const struct mc13xxx_pwrb_devtype mc13783_pwrb_devtype = { .btn_def[2] = { MC13783_IRQ_ONOFD3, BIT(5) } }; +static const struct mc13xxx_pwrb_devtype mc13892_pwrb_devtype = { + .btn_def[0] = { MC13892_IRQ_ONOFD1, BIT(3) }, + .btn_def[1] = { MC13892_IRQ_ONOFD2, BIT(4) }, + .btn_def[2] = { MC13892_IRQ_ONOFD3, BIT(2) } +}; + static const struct platform_device_id mc13xxx_pwrbutton_id_table[] = { { "mc13783-pwrbutton", (kernel_ulong_t)&mc13783_pwrb_devtype }, + { "mc13892-pwrbutton", (kernel_ulong_t)&mc13892_pwrb_devtype }, { } }; MODULE_DEVICE_TABLE(platform, mc13xxx_pwrbutton_id_table); @@ -209,6 +217,6 @@ static struct platform_driver mc13xxx_pwrbutton_driver = { }; module_platform_driver_probe(mc13xxx_pwrbutton_driver, mc13xxx_pwrbutton_probe); -MODULE_DESCRIPTION("MC13783 Power Button"); +MODULE_DESCRIPTION("MC13XXX Power Button"); MODULE_LICENSE("GPL v2"); MODULE_AUTHOR("Philippe Retornaz"); diff --git a/include/linux/mfd/mc13892.h b/include/linux/mfd/mc13892.h index a00f2be..bdc3baf 100644 --- a/include/linux/mfd/mc13892.h +++ b/include/linux/mfd/mc13892.h @@ -36,4 +36,8 @@ #define MC13892_PWGT2SPI 22 #define MC13892_VCOINCELL 23 +#define MC13892_IRQ_ONOFD3 26 +#define MC13892_IRQ_ONOFD1 27 +#define MC13892_IRQ_ONOFD2 28 + #endif