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: 1278811 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork2.kernel.org (Postfix) with ESMTP id 8B6C6DF288 for ; Mon, 6 Aug 2012 12:35:00 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1SyMTq-0005QG-IC; Mon, 06 Aug 2012 12:32:18 +0000 Received: from mail-wg0-f49.google.com ([74.125.82.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1SyMTm-0005Pn-So for linux-arm-kernel@lists.infradead.org; Mon, 06 Aug 2012 12:32:15 +0000 Received: by wgbez12 with SMTP id ez12so1919445wgb.18 for ; Mon, 06 Aug 2012 05:32:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:x-gm-message-state; bh=CXrIZrMibAaigmRjAgXTI23u2BnICtJOqUYFssMqIz4=; b=XR5f/QnTbNvhSARfadh0KME1hXxGzN1S4nuqkaOReQH6lZ/tlqd6mloM59snnfud29 4gGkCwogk1Yjbojhk/6DGY8mba1wN5SPb0aBqXj1jQRLEh9i5iuiUKVXqWzG5/RKRR7S Xw277uWFJ1/x/snx7nfTgRN6vx6pjC+a0Z7MO2gv/V7zTTREhc00G+NTHREwi/TEOC7b LQz1/nkSWsICM+8aYlGXo1aGsJDBSkh3dt6WxbqGh6/81t/c04sbCfbhlnlmlZLGRu3k RWQ20RxXOAQFGnVbEed0l7JfzuKKskCaPUp3pwAg6kfLmxyeEiFMCSto8XYTA93DtPb8 Ff7w== 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 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: ALoCoQlDcyWymOQUIovMaIxZeahUa4guNjIl6hHnHiPy67gAPhnVHl/pdeksbjfwfPNLMPkC5YYI X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.49 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: linus.walleij@stericsson.com, arnd@arndb.de, dmitry.torokhov@gmail.com, linux-input@vger.kernel.org, STEricsson_nomadik_linux@list.st.com, Lee Jones X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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;