From patchwork Sat Jul 20 05:41:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2830780 Return-Path: X-Original-To: patchwork-linux-input@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 BAB59C0319 for ; Sat, 20 Jul 2013 05:42:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5926120161 for ; Sat, 20 Jul 2013 05:42:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4BE5820158 for ; Sat, 20 Jul 2013 05:42:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752202Ab3GTFl6 (ORCPT ); Sat, 20 Jul 2013 01:41:58 -0400 Received: from smtp21.mail.ru ([94.100.176.174]:38133 "EHLO smtp21.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752560Ab3GTFl5 (ORCPT ); Sat, 20 Jul 2013 01:41:57 -0400 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=HQR8cdeKFOEO21TWXxI/Di2pxvR31ZYvCdrQpz/RFdk=; b=s1LIDyQFeTLOWkJdbzeQdvKmLmkatrEm5JdkTB0H1c8utK9NOgmdId4OQODW9HYdlAhrgNvsv7TD2cKyrSoR1Q27anjHdtapFAT+vX+++tAMLTU3IYlrjo3ZR+jpoQ4eI+IfXfp/vRxoE9BkgamDGliWHat9243Q0y/bY3EUVLY=; Received: from [188.134.40.128] (port=29670 helo=shc.zet) by smtp21.mail.ru with esmtpa (envelope-from ) id 1V0PvY-0008AA-6p; Sat, 20 Jul 2013 09:41:56 +0400 From: Alexander Shiyan To: linux-input@vger.kernel.org Cc: Grant Likely , Rob Herring , Sascha Hauer , Dmitry Torokhov , Alexander Shiyan Subject: [PATCH v3 2/3] input: mc13783: Add MC13892 support Date: Sat, 20 Jul 2013 09:41:36 +0400 Message-Id: <1374298897-788-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1374298897-788-1-git-send-email-shc_work@mail.ru> References: <1374298897-788-1-git-send-email-shc_work@mail.ru> X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham 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 This patch adds support for MC13892 PMIC in mc13783-pwrbutton driver. 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 aaaacef..2e21f19 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; @@ -178,8 +179,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); @@ -194,6 +202,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