From patchwork Mon Aug 6 10:46:42 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 10511 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 508992402A for ; Mon, 6 Aug 2012 10:47:11 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id 126F5A18D28 for ; Mon, 6 Aug 2012 10:47:10 +0000 (UTC) Received: by yenq6 with SMTP id q6so2314757yen.11 for ; Mon, 06 Aug 2012 03:47:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=+x1iXhfhNEkCSQgfHklpYRxrv6nCf2zkDdddGiquzU0=; b=OXP9KlQC15jZYz0MZpnGoNgqoUeXqd3rjnN0yBOFqv77zpFpjJAy+L0NCTOlvb3ZbS x9847GKGi6oICNh4bvqg9jy4wP52I3+1IyMTKynJhzt4NhzjVaYG3hljDpySCxN31J2W 8Nff87pIrguEGWc88ssYChtoW49wKZpLmy4jr1rmo6l83eu+7TMEUp0uJWXs6oN7JoQ4 75d2m0syt7fguKsspnvEsEnfaPnbIhTFZ4cS7bbzQuy2JraDz2enoiIO6r+jYN/8GpNr DzGVEseilq2nIQszj4cQFwd7VsnFoAcwOYmdvCgfvorXeEpTkvtKa+OCGWP/5fwBBL+z 36HA== Received: by 10.50.213.39 with SMTP id np7mr4919057igc.51.1344250030339; Mon, 06 Aug 2012 03:47:10 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp433413igz; Mon, 6 Aug 2012 03:47:09 -0700 (PDT) Received: by 10.217.6.14 with SMTP id x14mr5037903wes.174.1344250028593; Mon, 06 Aug 2012 03:47:08 -0700 (PDT) Received: from mail-we0-f178.google.com (mail-we0-f178.google.com [74.125.82.178]) by mx.google.com with ESMTPS id h8si14701521wiz.5.2012.08.06.03.47.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 03:47:08 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.178 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-we0-f178.google.com with SMTP id u7so2363889wey.37 for ; Mon, 06 Aug 2012 03:47:08 -0700 (PDT) Received: by 10.180.76.135 with SMTP id k7mr17369475wiw.7.1344250028014; Mon, 06 Aug 2012 03:47:08 -0700 (PDT) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id t7sm22043908wix.6.2012.08.06.03.47.06 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 03:47:07 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: STEricsson_nomadik_linux@list.st.com, linus.walleij@stericsson.com, arnd@arndb.de, dmitry.torokhov@gmail.com, sameo@linux.intel.com, Lee Jones Subject: [PATCH 6/6] Input: ab8500-ponkey: Make the distinction between DT and non-DT boots Date: Mon, 6 Aug 2012 11:46:42 +0100 Message-Id: <1344250002-6011-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344250002-6011-1-git-send-email-lee.jones@linaro.org> References: <1344250002-6011-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmM4R2ktB8Mj69isFPc8yWFhOpzuhKLHZsoLtc177FScJaNQkVmqdMz6WpTAkELLke0VS1u If we're booting with Device Tree enabled, we want the IRQ numbers to be taken and translated from the Device Tree binary. If not, they should be taken from the resource allocation defined in the AB8500 MFD core driver. Signed-off-by: Lee Jones --- drivers/input/misc/ab8500-ponkey.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index 1a1d974..afcd87f 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c @@ -47,6 +47,7 @@ static irqreturn_t ab8500_ponkey_handler(int irq, void *data) static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) { struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); + struct device_node *np = pdev->dev.of_node; struct ab8500_ponkey *ponkey; struct input_dev *input; int irq_dbf, irq_dbr; @@ -73,8 +74,9 @@ static int __devinit ab8500_ponkey_probe(struct platform_device *pdev) ponkey->idev = input; ponkey->ab8500 = ab8500; - ponkey->irq_dbf = ab8500_irq_get_virq(ab8500, irq_dbf); - ponkey->irq_dbr = ab8500_irq_get_virq(ab8500, irq_dbr); + + ponkey->irq_dbf = (np) ? ab8500_irq_get_virq(ab8500, irq_dbf) : irq_dbf; + ponkey->irq_dbr = (np) ? ab8500_irq_get_virq(ab8500, irq_dbr) : irq_dbr; input->name = "AB8500 POn(PowerOn) Key"; input->dev.parent = &pdev->dev;