From patchwork Sat Jul 13 04:25:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2827118 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 73B74C0AB2 for ; Sat, 13 Jul 2013 04:26:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82AF82012C for ; Sat, 13 Jul 2013 04:26:56 +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 75F4F2012B for ; Sat, 13 Jul 2013 04:26:55 +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 1UxrPw-00083R-CC; Sat, 13 Jul 2013 04:26:44 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxrPt-0003N8-Qp; Sat, 13 Jul 2013 04:26:41 +0000 Received: from smtp2.mail.ru ([94.100.176.130]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UxrPp-0003M1-No for linux-arm-kernel@lists.infradead.org; Sat, 13 Jul 2013 04:26:39 +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=Bgdg7mNAtLoiNUxrOPde+Smu4vWicV4dvs0xsd8x0uRsmijT+jB3ahy+GlFAM+5yIYqiruUPFSrsCnM48izOadN2zUElkNntjwSvbt30S14o78i5qyTezbqYsZ7MQh3VTIlzWFfx8d8aZrE5FrG8RXHGX7NaL2QbcjMNslyk7is=; Received: from [188.134.40.128] (port=30539 helo=shc.zet) by smtp2.mail.ru with esmtpa (envelope-from ) id 1UxrPW-00081b-Hd; Sat, 13 Jul 2013 08:26:18 +0400 From: Alexander Shiyan To: linux-arm-kernel@lists.infradead.org Subject: [PATCH v2 2/3] input: mc13783: Add MC13892 support Date: Sat, 13 Jul 2013 08:25:50 +0400 Message-Id: <1373689551-24375-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1373689551-24375-1-git-send-email-shc_work@mail.ru> References: <1373689551-24375-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-20130713_002638_081735_548A26C1 X-CRM114-Status: GOOD ( 12.89 ) 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.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID, 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 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