From patchwork Fri Jan 20 11:09:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 137004 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id DEB091007D5 for ; Fri, 20 Jan 2012 22:09:57 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751539Ab2ATLJ4 (ORCPT ); Fri, 20 Jan 2012 06:09:56 -0500 Received: from hqemgate04.nvidia.com ([216.228.121.35]:12791 "EHLO hqemgate04.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751339Ab2ATLJ4 (ORCPT ); Fri, 20 Jan 2012 06:09:56 -0500 Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Fri, 20 Jan 2012 03:08:42 -0800 Received: from hqnvemgw02.nvidia.com ([172.17.108.22]) by hqnvupgp07.nvidia.com (PGP Universal service); Fri, 20 Jan 2012 03:09:55 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Fri, 20 Jan 2012 03:09:55 -0800 Received: from daphne.nvidia.com (Not Verified[172.16.212.96]) by hqnvemgw02.nvidia.com with MailMarshal (v6, 7, 2, 8378) id ; Fri, 20 Jan 2012 03:09:55 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by daphne.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id q0KB9pIn027532; Fri, 20 Jan 2012 03:09:53 -0800 (PST) From: Laxman Dewangan To: sameo@linux.intel.com, jedu@slimlogic.co.uk, lrg@slimlogic.co.uk, broonie@opensource.wolfsonmicro.com, gg@slimlogic.co.uk, linux-kernel@vger.kernel.org Cc: linux-tegra@vger.kernel.org, ldewangan@nvidia.com Subject: [PATCH V1] mfd: tps65910: Add wakeup support Date: Fri, 20 Jan 2012 16:39:30 +0530 Message-Id: <1327057770-6688-1-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org Adding wakeup support for PMIC device 65910. This can be selected through the board specific platform data. The wakeup should enabled if PMIC need to be configure for waking up system through RTC or ONKEY. Signed-off-by: Laxman Dewangan --- This patch will enable the wakeup functionality through device tps65910/tps65911. drivers/mfd/tps65910-irq.c | 9 +++++++++ drivers/mfd/tps65910.c | 1 + include/linux/mfd/tps65910.h | 2 ++ 3 files changed, 12 insertions(+), 0 deletions(-) diff --git a/drivers/mfd/tps65910-irq.c b/drivers/mfd/tps65910-irq.c index a56be93..8b6f423 100644 --- a/drivers/mfd/tps65910-irq.c +++ b/drivers/mfd/tps65910-irq.c @@ -210,6 +210,15 @@ int tps65910_irq_init(struct tps65910 *tps65910, int irq, if (ret != 0) dev_err(tps65910->dev, "Failed to request IRQ: %d\n", ret); + if (!ret && pdata->en_wakeup) { + device_init_wakeup(tps65910->dev, 1); + ret = enable_irq_wake(irq); + if (ret < 0) + dev_warn(tps65910->dev, "Can't enable IRQ as wake " + "source: %d\n", ret); + return 0; + } + return ret; } diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c index 8517481..88e3dec 100644 --- a/drivers/mfd/tps65910.c +++ b/drivers/mfd/tps65910.c @@ -169,6 +169,7 @@ static int tps65910_i2c_probe(struct i2c_client *i2c, init_data->irq = pmic_plat_data->irq; init_data->irq_base = pmic_plat_data->irq_base; + init_data->en_wakeup = pmic_plat_data->en_wakeup; tps65910_gpio_init(tps65910, pmic_plat_data->gpio_base); diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h index d0cb12e..ba8eb6a 100644 --- a/include/linux/mfd/tps65910.h +++ b/include/linux/mfd/tps65910.h @@ -777,6 +777,7 @@ struct tps65910_board { int gpio_base; int irq; int irq_base; + int en_wakeup; int vmbch_threshold; int vmbch2_threshold; struct regulator_init_data *tps65910_pmic_init_data[TPS65910_NUM_REGS]; @@ -813,6 +814,7 @@ struct tps65910 { struct tps65910_platform_data { int irq; int irq_base; + int en_wakeup; }; int tps65910_set_bits(struct tps65910 *tps65910, u8 reg, u8 mask);