From patchwork Fri Feb 15 12:56:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14900 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 A7C7D23E01 for ; Fri, 15 Feb 2013 12:57:52 +0000 (UTC) Received: from mail-vc0-f179.google.com (mail-vc0-f179.google.com [209.85.220.179]) by fiordland.canonical.com (Postfix) with ESMTP id 48C7BA18025 for ; Fri, 15 Feb 2013 12:57:52 +0000 (UTC) Received: by mail-vc0-f179.google.com with SMTP id gb23so2154272vcb.10 for ; Fri, 15 Feb 2013 04:57:51 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=hntLcd5avfQyyHtJ1QlCTCXHxIOx7961XwOYXXjAqNw=; b=GDhKFU2scDYI6qX7TYn+g+AectEjTmlxYhFJBqBzY3js0JRPc4YS86sPTqzfr3q/wD ubwe1oGIqazcvqrZGNlo7FRPX0Ts/5IAhLAvnDsiSoG6GmjmEibjXjrDs2VWuI4e8TpQ FzQIPztxPmaqF/zekF2TN+QMPqO4ZrS5km+0Wo4q3Pzo6l6od7r8PGuDBRNz+n7nVV3L RV2hfqE5c5DORqdFmopadbt88bSuKWKd10fzJFhzA/DQhnNNNafKZ85NAkwMWDHv+xQ7 nW0bdqJ2M0fbIxCbzVcaduOcST/JTCvhnRoyeVLvhxwInJqbv0+WQlAup9fVP6DbRxfM sS7g== X-Received: by 10.52.175.66 with SMTP id by2mr2667917vdc.53.1360933071765; Fri, 15 Feb 2013 04:57:51 -0800 (PST) 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.221.4.5 with SMTP id oa5csp11391vcb; Fri, 15 Feb 2013 04:57:51 -0800 (PST) X-Received: by 10.180.79.201 with SMTP id l9mr3890373wix.20.1360933070886; Fri, 15 Feb 2013 04:57:50 -0800 (PST) Received: from mail-wg0-f50.google.com (mail-wg0-f50.google.com [74.125.82.50]) by mx.google.com with ESMTPS id e7si1052671wix.47.2013.02.15.04.57.50 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:50 -0800 (PST) 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 mail-wg0-f50.google.com with SMTP id es5so2698589wgb.17 for ; Fri, 15 Feb 2013 04:57:50 -0800 (PST) X-Received: by 10.180.82.33 with SMTP id f1mr5499130wiy.13.1360933070307; Fri, 15 Feb 2013 04:57:50 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.57.48 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:57:49 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Alexandre Torgue , Lee Jones Subject: [PATCH 15/35] mfd: ab8500-debugfs: Add tests for ab8540 based platform initialisations Date: Fri, 15 Feb 2013 12:56:46 +0000 Message-Id: <1360933026-30325-16-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmT4fWRfmzsYliKUiOHI9kADpTF1YIdm/cJ3u6ufeUMaVHmlyaIPlqx/PXnIWp1sMFFMaRN From: Alexandre Torgue Signed-off-by: Alexandre Torgue Signed-off-by: Lee Jones Reviewed-by: Marcus COOPER Reviewed-by: Mattias WALLIN Tested-by: Maxime COQUELIN --- drivers/mfd/ab8500-core.c | 11 +++++++---- drivers/mfd/ab8500-debugfs.c | 2 ++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index e82cf73..f5ceb2e 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1296,7 +1296,8 @@ static ssize_t show_chip_id(struct device *dev, ab8500 = dev_get_drvdata(dev); if(ab8500) { chip_id = ab8500->chip_id; - if((is_ab8505(ab8500) || is_ab9540(ab8500)) && ab8500->version != 0xFF) + if ((is_ab8505(ab8500) || is_ab9540(ab8500) + || is_ab8540(ab8500)) && ab8500->version != 0xFF) chip_id = (ab8500->version << 8) | chip_id; } return sprintf(buf, "%#x\n", chip_id); @@ -1597,7 +1598,7 @@ static int ab8500_probe(struct platform_device *pdev) /* Activate this feature only in ab9540 */ /* till tests are done on ab8500 1p2 or later*/ - if (is_ab9540(ab8500)) { + if (is_ab9540(ab8500) || is_ab8540(ab8500)) ret = devm_request_threaded_irq(&pdev->dev, ab8500->irq, NULL, ab8500_hierarchical_irq, IRQF_ONESHOT | IRQF_NO_SUSPEND, @@ -1640,7 +1641,8 @@ static int ab8500_probe(struct platform_device *pdev) dev_err(ab8500->dev, "error adding bm devices\n"); } - if (is_ab9540(ab8500)) + if (((is_ab8505(ab8500) || is_ab9540(ab8500)) && + ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500)) ret = sysfs_create_group(&ab8500->dev->kobj, &ab9540_attr_group); else @@ -1656,7 +1658,8 @@ static int ab8500_remove(struct platform_device *pdev) { struct ab8500 *ab8500 = platform_get_drvdata(pdev); - if (is_ab9540(ab8500)) + if (((is_ab8505(ab8500) || is_ab9540(ab8500)) && + ab8500->chip_id >= AB8500_CUT2P0) || is_ab8540(ab8500)) sysfs_remove_group(&ab8500->dev->kobj, &ab9540_attr_group); else sysfs_remove_group(&ab8500->dev->kobj, &ab8500_attr_group); diff --git a/drivers/mfd/ab8500-debugfs.c b/drivers/mfd/ab8500-debugfs.c index 51b0e97..3eeab01 100644 --- a/drivers/mfd/ab8500-debugfs.c +++ b/drivers/mfd/ab8500-debugfs.c @@ -1942,6 +1942,8 @@ static int ab8500_debug_probe(struct platform_device *plf) num_interrupt_lines = AB8505_NR_IRQS; else if (is_ab9540(ab8500)) num_interrupt_lines = AB9540_NR_IRQS; + else if (is_ab8540(ab8500)) + num_interrupt_lines = AB8540_NR_IRQS; file = debugfs_create_file("interrupts", (S_IRUGO), ab8500_dir, &plf->dev, &ab8500_interrupts_fops);