From patchwork Wed Jun 20 12:56: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: 9493 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 63B1123E1B for ; Wed, 20 Jun 2012 12:57:12 +0000 (UTC) Received: from mail-yw0-f52.google.com (mail-yw0-f52.google.com [209.85.213.52]) by fiordland.canonical.com (Postfix) with ESMTP id 3351FA182F0 for ; Wed, 20 Jun 2012 12:57:12 +0000 (UTC) Received: by mail-yw0-f52.google.com with SMTP id p61so6181466yhp.11 for ; Wed, 20 Jun 2012 05:57:12 -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=bdPE5MuTsgmIKoz/RmXF83z9gjcRmwbfhVdssk4GUqs=; b=mPtGFPVKHnK//93gc0qRbFvEKjhk9cWQKjq+M9Xllgl4fX2FLxGtXYx2OFcU5Yj7Li tdEe9p0QwymikB5upc5xCtjuJ/WGEcQHF/9Cox65MWV1ruPrkyq0kF9II9fajkb3DZ60 9Rm1sbhFA2AK+PTA6D653JNALTWSEsY0g+ez55X0uBacpJd7sAengWh8qTqBlGhfPpR7 6WBknwL+s0wWInkEBWubM9i/HH1n9TTdlWKGvITu3Sxs8xqJ4cws5JQ7FsZFKTCQ44AY A9lbjpB9qc79v//qGgOOdAIBXowrp84WxbUOG4YZRU0QpnniLY4iKOm2/qhBykq05nRu Ts8w== Received: by 10.50.87.227 with SMTP id bb3mr4322181igb.57.1340197031761; Wed, 20 Jun 2012 05:57:11 -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.231.24.148 with SMTP id v20csp178537ibb; Wed, 20 Jun 2012 05:57:10 -0700 (PDT) Received: by 10.180.83.196 with SMTP id s4mr11923815wiy.15.1340197030504; Wed, 20 Jun 2012 05:57:10 -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 dk3si21299185wib.4.2012.06.20.05.57.09 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 05:57:10 -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 f13so5152592wer.37 for ; Wed, 20 Jun 2012 05:57:09 -0700 (PDT) Received: by 10.216.144.201 with SMTP id n51mr14096842wej.73.1340197029848; Wed, 20 Jun 2012 05:57:09 -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 gc6sm38878374wib.0.2012.06.20.05.57.08 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 20 Jun 2012 05:57:09 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org Cc: linus.walleij@stericsson.com, arnd@arndb.de, grant.likely@secretlab.ca, linux@arm.linux.org.uk, broonie@opensource.wolfsonmicro.com, Lee Jones , Samuel Ortiz Subject: [PATCH 06/15] mfd: Register the ab8500 from db8500-prcmu using the MFD API Date: Wed, 20 Jun 2012 13:56:42 +0100 Message-Id: <1340197011-5435-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1340197011-5435-1-git-send-email-lee.jones@linaro.org> References: <1340197011-5435-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQk1jvlL9bzA8eOHnVaWxLQC0LAY56lYlM+QwSIq/d72jcG98yQkZijSfudj8ro8Caj32cww Hierarchically, the AB8500 is a child of the DB8500 PRCMU. So now that Device Tree is being used and MFD core code is Device Tree aware, we can simply register DB8500 PRCMU from Device Tree in the normal way then allow the DB8500 PRCMU driver to register the AB8500 as a simple MFD device at probe time. Cc: Samuel Ortiz Signed-off-by: Lee Jones --- arch/arm/mach-ux500/board-mop500.c | 2 -- drivers/mfd/ab8500-core.c | 12 ------------ drivers/mfd/db8500-prcmu.c | 15 +++++++++++++++ 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 7e5b161..0bae853 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -820,8 +820,6 @@ static const struct of_device_id u8500_local_bus_nodes[] = { /* only create devices below soc node */ { .compatible = "stericsson,db8500", }, { .compatible = "stericsson,db8500-prcmu", }, - { .compatible = "stericsson,db8500-prcmu-regulator", }, - { .compatible = "stericsson,ab8500", }, { .compatible = "simple-bus"}, { }, }; diff --git a/drivers/mfd/ab8500-core.c b/drivers/mfd/ab8500-core.c index 79d7672..738b9c5 100644 --- a/drivers/mfd/ab8500-core.c +++ b/drivers/mfd/ab8500-core.c @@ -1247,14 +1247,6 @@ static struct attribute_group ab9540_attr_group = { .attrs = ab9540_sysfs_entries, }; -static const struct of_device_id ab8500_match[] = { - { - .compatible = "stericsson,ab8500", - .data = (void *)AB8500_VERSION_AB8500, - }, - {}, -}; - static int __devinit ab8500_probe(struct platform_device *pdev) { struct ab8500_platform_data *plat = dev_get_platdata(&pdev->dev); @@ -1296,9 +1288,6 @@ static int __devinit ab8500_probe(struct platform_device *pdev) if (platid) version = platid->driver_data; - else if (np) - version = (unsigned int) - of_match_device(ab8500_match, &pdev->dev)->data; if (version != AB8500_VERSION_UNDEFINED) ab8500->version = version; @@ -1492,7 +1481,6 @@ static struct platform_driver ab8500_core_driver = { .driver = { .name = "ab8500-core", .owner = THIS_MODULE, - .of_match_table = ab8500_match, }, .probe = ab8500_probe, .remove = __devexit_p(ab8500_remove), diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index e9e576c..80def6c 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -2945,6 +2945,14 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = { }, }; +static struct resource ab8500_resources[] = { + [0] = { + .start = IRQ_DB8500_AB8500, + .end = IRQ_DB8500_AB8500, + .flags = IORESOURCE_IRQ + } +}; + static struct mfd_cell db8500_prcmu_devs[] = { { .name = "db8500-prcmu-regulators", @@ -2956,6 +2964,13 @@ static struct mfd_cell db8500_prcmu_devs[] = { .name = "cpufreq-u8500", .of_compatible = "stericsson,cpufreq-u8500", }, + { + .name = "ab8500-core", + .of_compatible = "stericsson,ab8500", + .num_resources = ARRAY_SIZE(ab8500_resources), + .resources = ab8500_resources, + .id = AB8500_VERSION_AB8500, + }, }; /**