From patchwork Mon Aug 6 12:32:03 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 10541 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 17C3E23F61 for ; Mon, 6 Aug 2012 12:32:18 +0000 (UTC) Received: from mail-gh0-f180.google.com (mail-gh0-f180.google.com [209.85.160.180]) by fiordland.canonical.com (Postfix) with ESMTP id D280AA1862A for ; Mon, 6 Aug 2012 12:32:17 +0000 (UTC) Received: by ghbg10 with SMTP id g10so643905ghb.11 for ; Mon, 06 Aug 2012 05:32:17 -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:x-gm-message-state; bh=CXrIZrMibAaigmRjAgXTI23u2BnICtJOqUYFssMqIz4=; b=hirBlxLi4Y1xJJpB2Dpk4+c3vf9GFi9XWieRPfhEv1XFcYc++Hn7hbbf1qzdn6mMgk DBQrdxZzNeWc67QMbFoTNRBvGH86F1K4HSsqdZCiW+FnSSH/XQ5XAnqx3jHbBV+cRKqM mJkzssfMeDajlexsGdw032UnBqXTv4bEZwVbRgZkBeQD9YsX+CiUUMRCJWzUusQIXCVR X+B/Vyd4f4S4QLj1BPZPGkoSH3m7cR6PDdVShfk3VIr/KeTa3c5sJKy0ZhAnFutDbyLX vm7NAdljXFGznQM34GeDTQYdwp8ESGD5gcegkLW0qQ5ZcGjLIs/E6LtldKXZILocbSdw W2eg== Received: by 10.50.219.226 with SMTP id pr2mr5158182igc.51.1344256337045; Mon, 06 Aug 2012 05:32:17 -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 u8csp438301igz; Mon, 6 Aug 2012 05:32:15 -0700 (PDT) Received: by 10.216.36.71 with SMTP id v49mr5256901wea.70.1344256334169; Mon, 06 Aug 2012 05:32:14 -0700 (PDT) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id fc10si17250824wib.2.2012.08.06.05.32.13 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 05:32:14 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 74.125.82.50 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by wgbds11 with SMTP id ds11so2484371wgb.31 for ; Mon, 06 Aug 2012 05:32:13 -0700 (PDT) Received: by 10.180.78.2 with SMTP id x2mr18100251wiw.10.1344256332876; Mon, 06 Aug 2012 05:32:12 -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 j6sm22654341wiy.4.2012.08.06.05.32.11 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Aug 2012 05:32:12 -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, linux-input@vger.kernel.org, Lee Jones Subject: [PATCH 1/1] Input: ab8500-ponkey: Make the distinction between DT and non-DT boots Date: Mon, 6 Aug 2012 13:32:03 +0100 Message-Id: <1344256323-10484-1-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 X-Gm-Message-State: ALoCoQm3aXpV2qnw7ghu54EVuw1Ykr52Mvbm6FfwZ+A6ezbARgrUMhM2tBpT9A8XBUEb+22ZK6bE 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. Tested-by: Linus Walleij 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;