From patchwork Thu Apr 11 08:42:59 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 16040 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-ve0-f199.google.com (mail-ve0-f199.google.com [209.85.128.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id BF055238FF for ; Thu, 11 Apr 2013 08:43:43 +0000 (UTC) Received: by mail-ve0-f199.google.com with SMTP id jw11sf2286567veb.2 for ; Thu, 11 Apr 2013 01:43:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-beenthere:x-received:received-spf:x-received :x-forwarded-to:x-forwarded-for:delivered-to:x-received:received-spf :from:to:cc:subject:date:message-id:x-mailer:mime-version :x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe :content-type; bh=axQi/CcjkB7G1S+6cDzgmIB/J23OAz10UP8GD3MsHNs=; b=n4VLlFn25gSrVuCH0kPbZ95mXKjPudOpUZ/FnbJ4L3da8l/tGRP021kkX9fgfozImY dgPYnL2QwEJELAIHRFtzkbuQRE1HflkRFr5ht88m8BWAYkGO0/iPuw0FPgxo+4+qcqR0 uUVmhGD2zk2OB5DOZxf/fOwuugiCUXfJGm7VdS9TEI7K6eETFGWOujbXZORZvU/dPiar tqluKy4FiwgSKTQ8N/hI2liG14q8M/5WDS+DGRv8iXMK6XN34r4Qbzi13XrTIj/U81Dt BFwstSbxnKA/o7TlY2qO1+QosXFNg8vDeEIQtFw43weePEluHR2DcVa/2BQvrkjK5NsE zcMQ== X-Received: by 10.224.72.199 with SMTP id n7mr3466436qaj.5.1365669802400; Thu, 11 Apr 2013 01:43:22 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.132 with SMTP id 4ls716375qee.56.gmail; Thu, 11 Apr 2013 01:43:22 -0700 (PDT) X-Received: by 10.52.16.177 with SMTP id h17mr1401487vdd.109.1365669802227; Thu, 11 Apr 2013 01:43:22 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id sa4si2758675vdc.127.2013.04.11.01.43.21 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 11 Apr 2013 01:43:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id d10so1183493vea.14 for ; Thu, 11 Apr 2013 01:43:21 -0700 (PDT) X-Received: by 10.52.34.168 with SMTP id a8mr3622988vdj.75.1365669801692; Thu, 11 Apr 2013 01:43:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.58.127.98 with SMTP id nf2csp10919veb; Thu, 11 Apr 2013 01:43:20 -0700 (PDT) X-Received: by 10.181.11.196 with SMTP id ek4mr8596869wid.30.1365669800208; Thu, 11 Apr 2013 01:43:20 -0700 (PDT) Received: from eu1sys200aog121.obsmtp.com (eu1sys200aog121.obsmtp.com [207.126.144.151]) by mx.google.com with SMTP id n3si4938386eep.62.2013.04.11.01.43.14 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 11 Apr 2013 01:43:20 -0700 (PDT) Received-SPF: neutral (google.com: 207.126.144.151 is neither permitted nor denied by best guess record for domain of linus.walleij@stericsson.com) client-ip=207.126.144.151; Received: from beta.dmz-us.st.com ([167.4.1.35]) (using TLSv1) by eu1sys200aob121.postini.com ([207.126.147.11]) with SMTP ID DSNKUWZ3odo9kSPUSJER3DgKEROBsKiout58@postini.com; Thu, 11 Apr 2013 08:43:19 UTC Received: from zeta.dmz-us.st.com (ns4.st.com [167.4.16.71]) by beta.dmz-us.st.com (STMicroelectronics) with ESMTP id 4D2554E; Thu, 11 Apr 2013 08:42:13 +0000 (GMT) Received: from relay2.stm.gmessaging.net (unknown [10.230.100.18]) by zeta.dmz-us.st.com (STMicroelectronics) with ESMTP id 9004854; Thu, 11 Apr 2013 02:00:12 +0000 (GMT) Received: from exdcvycastm004.EQ1STM.local (alteon-source-exch [10.230.100.61]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (Client CN "exdcvycastm004", Issuer "exdcvycastm004" (not verified)) by relay2.stm.gmessaging.net (Postfix) with ESMTPS id DA55CA8065; Thu, 11 Apr 2013 10:43:02 +0200 (CEST) Received: from steludxu4075.lud.stericsson.com (10.230.100.153) by smtp.stericsson.com (10.230.100.2) with Microsoft SMTP Server (TLS) id 8.3.279.5; Thu, 11 Apr 2013 10:43:06 +0200 From: Linus Walleij To: Samuel Ortiz , Cc: Anmar Oueja , Linus Walleij , Arnd Bergmann , Lee Jones Subject: [PATCH] MFD: ab8500: pass AB8500 IRQ to debugfs code by resource Date: Thu, 11 Apr 2013 10:42:59 +0200 Message-ID: <1365669779-14953-1-git-send-email-linus.walleij@stericsson.com> X-Mailer: git-send-email 1.7.11.3 MIME-Version: 1.0 X-Gm-Message-State: ALoCoQlkslEyh83Ua26qsoy0MJyctlvdlrCrnfwVh4f3s654e3JFa0ocg48ADMKJMTHGkuGOy4Yv X-Original-Sender: linus.walleij@stericsson.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.169 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Linus Walleij The AB8500 debug code which was merged in parallell with the multiplatform work incidentally introduced a new instance using the header which is now deleted, causing this build regression: drivers/mfd/ab8500-debugfs.c:95:23: fatal error: mach/irqs.h: No such file or directory compilation terminated. make[4]: *** [drivers/mfd/ab8500-debugfs.o] Error 1 The code most certainly never worked with device tree either since that does not rely on this kind of hard-coded interrupt numbers. Fix the problem at the root by passing it as a named resource from the ab8500-core driver. Cc: Arnd Bergmann Cc: Lee Jones Signed-off-by: Linus Walleij --- Sam this would have to go into the v3.10-targetted stuff... Either immediately before you send it upstream or as a fixup. --- drivers/mfd/ab8500-core.c | 11 +++++++++++ drivers/mfd/ab8500-debugfs.c | 14 ++++++++++---- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 8e8a016..dd72914 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -868,6 +868,11 @@ static struct resource ab8500_chargalg_resources[] = {}; #ifdef CONFIG_DEBUG_FS static struct resource ab8500_debug_resources[] = { { + .name = "IRQ_AB8500", + /* Number will be filled in */ + .flags = IORESOURCE_IRQ, + }, + { .name = "IRQ_FIRST", .start = AB8500_INT_MAIN_EXT_CH_NOT_OK, .end = AB8500_INT_MAIN_EXT_CH_NOT_OK, @@ -1712,6 +1717,12 @@ static int ab8500_probe(struct platform_device *pdev) if (ret) return ret; +#if CONFIG_DEBUG_FS + /* Pass to debugfs */ + ab8500_debug_resources[0].start = ab8500->irq; + ab8500_debug_resources[0].end = ab8500->irq; +#endif + if (is_ab9540(ab8500)) ret = mfd_add_devices(ab8500->dev, 0, ab9540_devs, ARRAY_SIZE(ab9540_devs), NULL, diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index b88bbbc..bd39146 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -91,12 +91,10 @@ #include #endif -/* TODO: this file should not reference IRQ_DB8500_AB8500! */ -#include - static u32 debug_bank; static u32 debug_address; +static int irq_ab8500; static int irq_first; static int irq_last; static u32 *irq_count; @@ -1589,7 +1587,7 @@ void ab8500_debug_register_interrupt(int line) { if (line < num_interrupt_lines) { num_interrupts[line]++; - if (suspend_test_wake_cause_interrupt_is_mine(IRQ_DB8500_AB8500)) + if (suspend_test_wake_cause_interrupt_is_mine(irq_ab8500)) num_wake_interrupts[line]++; } } @@ -2959,6 +2957,14 @@ static int ab8500_debug_probe(struct platform_device *plf) if (!event_name) goto out_freedev_attr; + irq_ab8500 = platform_get_irq_byname(plf, "IRQ_AB8500"); + if (irq_ab8500 < 0) { + dev_err(&plf->dev, "AB8500 irq not found, err %d\n", + irq_first); + ret = irq_ab8500; + goto out_freeevent_name; + } + irq_first = platform_get_irq_byname(plf, "IRQ_FIRST"); if (irq_first < 0) { dev_err(&plf->dev, "First irq not found, err %d\n",