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: 2824474 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 537ED9F7D6 for ; Sat, 6 Jul 2013 05:05:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4E47620165 for ; Sat, 6 Jul 2013 05:05:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 340F420157 for ; Sat, 6 Jul 2013 05:05:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751404Ab3GFFFC (ORCPT ); Sat, 6 Jul 2013 01:05:02 -0400 Received: from fallback6.mail.ru ([94.100.176.134]:40472 "EHLO fallback6.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751229Ab3GFFFB (ORCPT ); Sat, 6 Jul 2013 01:05:01 -0400 X-Greylist: delayed 376 seconds by postgrey-1.27 at vger.kernel.org; Sat, 06 Jul 2013 01:05:01 EDT Received: from smtp48.i.mail.ru (smtp48.i.mail.ru [94.100.177.108]) by fallback6.mail.ru (mPOP.Fallback_MX) with ESMTP id 8925C12153F2 for ; Sat, 6 Jul 2013 08:58:42 +0400 (MSK) 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 Cc: linux-input@vger.kernel.org, Sascha Hauer , Grant Likely , Rob Herring , Dmitry Torokhov , Shawn Guo , Alexander Shiyan 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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Mras: Ok Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RDNS_NONE, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no 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