From patchwork Sat Aug 17 05:46:21 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 2845971 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 90C8EBF546 for ; Sat, 17 Aug 2013 05:46:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B7CFE20256 for ; Sat, 17 Aug 2013 05:46:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D186F20259 for ; Sat, 17 Aug 2013 05:46:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350Ab3HQFqy (ORCPT ); Sat, 17 Aug 2013 01:46:54 -0400 Received: from fallback4.mail.ru ([94.100.176.42]:39877 "EHLO fallback4.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751077Ab3HQFqx (ORCPT ); Sat, 17 Aug 2013 01:46:53 -0400 Received: from smtp40.i.mail.ru (smtp40.i.mail.ru [94.100.177.100]) by fallback4.mail.ru (mPOP.Fallback_MX) with ESMTP id 1AC9315C6B0 for ; Sat, 17 Aug 2013 09:46:51 +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=HQR8cdeKFOEO21TWXxI/Di2pxvR31ZYvCdrQpz/RFdk=; b=nUSyJ8t859WQZZp6uqIXeXFFFz6GCgUaktjX/d6SFHnp0P9SyUax4LSdWUfMMSGdBrjy6daCdN1g/e2jQkpIjppG7yqVHRR5CviE6hoY6bxhlnqPpl1i5bty7Q+zFfuYSICb+76m+ISRqKbF4Udq/dHl+WzoOusiUuytSlL2siE=; Received: from [188.134.40.128] (port=41377 helo=shc.zet) by smtp40.i.mail.ru with esmtpa (envelope-from ) id 1VAZLF-00059I-9y; Sat, 17 Aug 2013 09:46:25 +0400 From: Alexander Shiyan To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Sascha Hauer , Alexander Shiyan Subject: [PATCH v3 RESEND 2/3] input: mc13783: Add MC13892 support Date: Sat, 17 Aug 2013 09:46:21 +0400 Message-Id: <1376718381-16924-2-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.1.5 In-Reply-To: <1376718381-16924-1-git-send-email-shc_work@mail.ru> References: <1376718381-16924-1-git-send-email-shc_work@mail.ru> X-Spam-Status: No, score=-9.5 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