From patchwork Thu Jan 3 10:46:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laxman Dewangan X-Patchwork-Id: 209210 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail-ie0-f184.google.com (mail-ie0-f184.google.com [209.85.223.184]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 9C49E2C008F for ; Thu, 3 Jan 2013 21:47:32 +1100 (EST) Received: by mail-ie0-f184.google.com with SMTP id s9sf8972444iec.1 for ; Thu, 03 Jan 2013 02:47:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=x-received:x-beenthere:x-received:x-received:received-spf :x-pgp-universal:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:reply-to:precedence:mailing-list :list-id:x-google-group-id:list-post:list-help:list-archive:sender :list-subscribe:list-unsubscribe:content-type; bh=S8mAjkuhiiIp+AVwGorY5dX+oDd3hIXjS7JkNb7KFho=; b=ofck+SOZBXcPeyVE0Kt8v8fx/T6ZMjgfaMgoj0PeKgDg51lXgWfkF5Jjdm8IJnDNn/ 3N+Y8NC39DnZfsr2YMeDFIBLJMnW3qnePPXA0Y6yM5SjpNjFOJcqoTJQ3mhe0/Gns5v9 irDGftK0os3WA9YGD7fBJWT8rJMpaVlaUfbsyXRDfbrlRUOTJDUbKlIX0X6jODgnIVv1 qlu948982z+ahVuVq8OQuwAyPimMRaxURjRXyTTsML1Gc1YAviUoRbgN5xn+NSpmKJfe 29eodaZipzOt4Z70du6VqMj1YEII9EUgineatRroByYis5HSAH6KGbYcftBqLV7AOHcR BfUg== X-Received: by 10.50.45.170 with SMTP id o10mr2657089igm.17.1357210050589; Thu, 03 Jan 2013 02:47:30 -0800 (PST) X-BeenThere: rtc-linux@googlegroups.com Received: by 10.50.150.145 with SMTP id ui17ls14493538igb.13.canary; Thu, 03 Jan 2013 02:47:30 -0800 (PST) X-Received: by 10.66.89.74 with SMTP id bm10mr6247750pab.19.1357210050230; Thu, 03 Jan 2013 02:47:30 -0800 (PST) X-Received: by 10.66.89.74 with SMTP id bm10mr6247749pab.19.1357210050189; Thu, 03 Jan 2013 02:47:30 -0800 (PST) Received: from hqemgate04.nvidia.com (hqemgate04.nvidia.com. [216.228.121.35]) by gmr-mx.google.com with ESMTPS id bv9si9824355pab.1.2013.01.03.02.47.30 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Jan 2013 02:47:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.35 as permitted sender) client-ip=216.228.121.35; Received: from hqnvupgp07.nvidia.com (Not Verified[216.228.121.13]) by hqemgate04.nvidia.com id ; Thu, 03 Jan 2013 02:47:09 -0800 Received: from hqemhub03.nvidia.com ([172.17.108.22]) by hqnvupgp07.nvidia.com (PGP Universal service); Thu, 03 Jan 2013 02:43:28 -0800 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 03 Jan 2013 02:43:28 -0800 Received: from hqnvemgw02.nvidia.com (172.16.227.111) by HQEMHUB03.nvidia.com (172.20.150.15) with Microsoft SMTP Server id 8.3.279.1; Thu, 3 Jan 2013 02:47:25 -0800 Received: from thelma.nvidia.com (Not Verified[172.16.212.77]) by hqnvemgw02.nvidia.com with MailMarshal (v6,7,2,8378) id ; Thu, 03 Jan 2013 02:47:25 -0800 Received: from ldewangan-ubuntu.nvidia.com ([10.19.65.30]) by thelma.nvidia.com (8.13.8+Sun/8.8.8) with ESMTP id r03AlDBR027770; Thu, 3 Jan 2013 02:47:21 -0800 (PST) From: Laxman Dewangan To: , , , CC: , , , , Laxman Dewangan Subject: [rtc-linux] [PATCH 1/4] mfd: palmas: add rtc irq number as irq resource for palmas-rtc Date: Thu, 3 Jan 2013 16:16:57 +0530 Message-ID: <1357210020-19876-2-git-send-email-ldewangan@nvidia.com> X-Mailer: git-send-email 1.7.1.1 In-Reply-To: <1357210020-19876-1-git-send-email-ldewangan@nvidia.com> References: <1357210020-19876-1-git-send-email-ldewangan@nvidia.com> MIME-Version: 1.0 X-Original-Sender: ldewangan@nvidia.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of ldewangan@nvidia.com designates 216.228.121.35 as permitted sender) smtp.mail=ldewangan@nvidia.com Reply-To: rtc-linux@googlegroups.com Precedence: list Mailing-list: list rtc-linux@googlegroups.com; contact rtc-linux+owners@googlegroups.com List-ID: X-Google-Group-Id: 712029733259 List-Post: , List-Help: , List-Archive: Sender: rtc-linux@googlegroups.com List-Subscribe: , List-Unsubscribe: , Palma RTC is capable of generating alarm interrupt. Pass the alarm interrupt as IRQ_RESOURCE for palmas-rtc sub device driver so that rtc driver can get irq as platform_get_irq(). Also pass the irq domain in mfd_add_devices() to properly offset the irqs for sub devices. This is needed when adding device through DT. Signed-off-by: Laxman Dewangan --- drivers/mfd/palmas.c | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/mfd/palmas.c b/drivers/mfd/palmas.c index 6ffd7a2..bbdbc50 100644 --- a/drivers/mfd/palmas.c +++ b/drivers/mfd/palmas.c @@ -39,6 +39,14 @@ enum palmas_ids { PALMAS_USB_ID, }; +static struct resource palmas_rtc_resources[] = { + { + .start = PALMAS_RTC_ALARM_IRQ, + .end = PALMAS_RTC_ALARM_IRQ, + .flags = IORESOURCE_IRQ, + }, +}; + static const struct mfd_cell palmas_children[] = { { .name = "palmas-pmic", @@ -59,6 +67,8 @@ static const struct mfd_cell palmas_children[] = { { .name = "palmas-rtc", .id = PALMAS_RTC_ID, + .resources = &palmas_rtc_resources[0], + .num_resources = ARRAY_SIZE(palmas_rtc_resources), }, { .name = "palmas-pwrbutton", @@ -456,8 +466,8 @@ static int palmas_i2c_probe(struct i2c_client *i2c, ret = mfd_add_devices(palmas->dev, -1, children, ARRAY_SIZE(palmas_children), - NULL, regmap_irq_chip_get_base(palmas->irq_data), - NULL); + NULL, 0, + regmap_irq_get_domain(palmas->irq_data)); kfree(children); if (ret < 0)