From patchwork Mon Feb 10 04:22:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Shiyan X-Patchwork-Id: 3615381 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 0A0BCBF418 for ; Mon, 10 Feb 2014 04:22:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 303D920148 for ; Mon, 10 Feb 2014 04:22:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 60DE72010C for ; Mon, 10 Feb 2014 04:22:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691AbaBJEWg (ORCPT ); Sun, 9 Feb 2014 23:22:36 -0500 Received: from smtp32.i.mail.ru ([94.100.177.92]:35107 "EHLO smtp32.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751849AbaBJEWg (ORCPT ); Sun, 9 Feb 2014 23:22:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=Message-Id:Date:Subject:Cc:To:From; bh=eGSlBUnOKGQfI/8zcf6FQimIfBia/suFpcBuGzU8WZU=; b=gszyiZfZQ0VaAM8vfG3GHrld3J1RZARMv/GMSIr5xDj3BBUqsfeADV6auKOtCdNHWQTU+WnsuTaE/qJcyAU/uWLit7t3VabPhps2aeICLUWIk79PyJhD8SDZIW1zrl+PN0hISQlPCnsg7WxagZJGcuilqlQtg2umFVdwXR2v9Gc=; Received: from [188.134.40.128] (port=45320 helo=shc.zet) by smtp32.i.mail.ru with esmtpa (envelope-from ) id 1WCiOA-0003X0-37; Mon, 10 Feb 2014 08:22:34 +0400 From: Alexander Shiyan To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Shawn Guo , Sascha Hauer , Samuel Ortiz , Lee Jones , Alexander Shiyan Subject: [PATCH 4/4] input: mc13783: Add MC13892 support Date: Mon, 10 Feb 2014 08:22:28 +0400 Message-Id: <1392006148-10417-1-git-send-email-shc_work@mail.ru> X-Mailer: git-send-email 1.8.3.2 X-Spam-Status: No, score=-7.4 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 to mc13783-pwrbutton driver. Signed-off-by: Alexander Shiyan --- drivers/input/misc/Kconfig | 4 ++-- drivers/input/misc/mc13783-pwrbutton.c | 8 ++++++++ include/linux/mfd/mc13892.h | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 7904ab0..3d91660 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" + 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 f9e2bfb..03308b0 100644 --- a/drivers/input/misc/mc13783-pwrbutton.c +++ b/drivers/input/misc/mc13783-pwrbutton.c @@ -25,6 +25,7 @@ #include #include #include +#include struct mc13xxx_button_def { unsigned int irq; @@ -175,8 +176,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); 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