From patchwork Thu Apr 4 09:31:17 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15899 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 628E44C13C2 for ; Thu, 4 Apr 2013 09:31:35 +0000 (UTC) Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by fiordland.canonical.com (Postfix) with ESMTP id DBE61A180A3 for ; Thu, 4 Apr 2013 09:31:34 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf3711505vcb.7 for ; Thu, 04 Apr 2013 02:31:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :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:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=BYY+WjaBCGsTmxyROiq0uA0Nlm0tmWecqHMJH+3ZQkw=; b=BjjuFexb1le8EBobymMqbZvVc5DuYwhtco6QknqhvWACmAs0AhQZg+LUfmV5WpIDp2 JzugFALuFunroh94c1SWKT6FojHVe0fCmSlymXTyu1ap5ZuDgEAxMHiDP3CTfddu9eIl UjG/xMdyCJXfiXKkFa+A79uilgxYcLoMl0ThINRBKuLK+yWJ2d6UrtB5SGK+SIBE9ofS /FWyFLOcUrL7lFaTcjB5g7/EX6tM8CQKLZgAP2WzGcG45dkEoL1QO7xFjiq0UTiCip/Z /KS0Wb2Zk1BeLX+2mowO/VClgpdfDC23AirGwJP1c1RtgdiI1HIxnHOKi+jc+oR2RQmG Eqlg== X-Received: by 10.224.172.200 with SMTP id m8mr2971145qaz.0.1365067894429; Thu, 04 Apr 2013 02:31:34 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.60.135 with SMTP id h7ls1280704qer.59.gmail; Thu, 04 Apr 2013 02:31:34 -0700 (PDT) X-Received: by 10.58.181.201 with SMTP id dy9mr4074346vec.34.1365067894314; Thu, 04 Apr 2013 02:31:34 -0700 (PDT) Received: from mail-vc0-f169.google.com (mail-vc0-f169.google.com [209.85.220.169]) by mx.google.com with ESMTPS id o6si7696902vdw.102.2013.04.04.02.31.34 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 02:31:34 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.169; Received: by mail-vc0-f169.google.com with SMTP id m16so414747vca.0 for ; Thu, 04 Apr 2013 02:31:34 -0700 (PDT) X-Received: by 10.52.65.147 with SMTP id x19mr3516119vds.27.1365067894141; Thu, 04 Apr 2013 02:31:34 -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.85.136 with SMTP id h8csp207505vez; Thu, 4 Apr 2013 02:31:33 -0700 (PDT) X-Received: by 10.180.181.72 with SMTP id du8mr7943228wic.27.1365067893041; Thu, 04 Apr 2013 02:31:33 -0700 (PDT) Received: from mail-wi0-x230.google.com (mail-wi0-x230.google.com [2a00:1450:400c:c05::230]) by mx.google.com with ESMTPS id da4si4002213wjc.169.2013.04.04.02.31.32 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 02:31:33 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::230 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::230; Received: by mail-wi0-f176.google.com with SMTP id hm14so4487411wib.9 for ; Thu, 04 Apr 2013 02:31:32 -0700 (PDT) X-Received: by 10.194.63.240 with SMTP id j16mr8201340wjs.45.1365067892496; Thu, 04 Apr 2013 02:31:32 -0700 (PDT) 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 bk1sm14760755wib.2.2013.04.04.02.31.30 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 02:31:31 -0700 (PDT) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, Lee Jones , Samuel Ortiz Subject: [PATCH 2/2] mfd: db8500-prcmu: Support platform dependant device selection Date: Thu, 4 Apr 2013 10:31:17 +0100 Message-Id: <1365067877-29459-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365067877-29459-1-git-send-email-lee.jones@linaro.org> References: <1365067877-29459-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQkxUS3jQ0IGIV+96CnrYIVajJmHlRFweBQZcaTYEWtr4GzS4QBIPXPlpPF6baVx/aJeDImh X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.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: , The main aim for this cycle is to have the u8540 booting to a console. However, the u8540 doesn't support all of the u8500 platform devices yet. After this stage is complete we can then fill in the inadequacies, such as specific clock support at a later date. To achieve this we're placing devices supported by all platforms into a common device structure and the remaining ones into a platform specific one. Cc: Samuel Ortiz Signed-off-by: Lee Jones --- drivers/mfd/db8500-prcmu.c | 46 +++++++++++++++++++++++++++++--------------- 1 file changed, 30 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 1c4edbf8..37ece93 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -3107,19 +3108,7 @@ static struct ux500_wdt_data db8500_wdt_pdata = { .has_28_bits_resolution = true, }; -static struct mfd_cell db8500_prcmu_devs[] = { - { - .name = "db8500-prcmu-regulators", - .of_compatible = "stericsson,db8500-prcmu-regulator", - .platform_data = &db8500_regulators, - .pdata_size = sizeof(db8500_regulators), - }, - { - .name = "cpufreq-ux500", - .of_compatible = "stericsson,cpufreq-ux500", - .platform_data = &db8500_cpufreq_table, - .pdata_size = sizeof(db8500_cpufreq_table), - }, +static struct mfd_cell common_prcmu_devs[] = { { .name = "ux500_wdt", .platform_data = &db8500_wdt_pdata, @@ -3135,6 +3124,21 @@ static struct mfd_cell db8500_prcmu_devs[] = { }, }; +static struct mfd_cell db8500_prcmu_devs[] = { + { + .name = "db8500-prcmu-regulators", + .of_compatible = "stericsson,db8500-prcmu-regulator", + .platform_data = &db8500_regulators, + .pdata_size = sizeof(db8500_regulators), + }, + { + .name = "cpufreq-ux500", + .of_compatible = "stericsson,cpufreq-ux500", + .platform_data = &db8500_cpufreq_table, + .pdata_size = sizeof(db8500_cpufreq_table), + }, +}; + static void db8500_prcmu_update_cpufreq(void) { if (prcmu_has_arm_maxopp()) { @@ -3184,7 +3188,7 @@ static int db8500_prcmu_probe(struct platform_device *pdev) db8500_irq_init(np); - for (i = 0; i < ARRAY_SIZE(db8500_prcmu_devs); i++) { + for (i = 0; i < ARRAY_SIZE(common_prcmu_devs); i++) { if (!strcmp(db8500_prcmu_devs[i].name, "ab8500-core")) { db8500_prcmu_devs[i].platform_data = pdata->ab_platdata; db8500_prcmu_devs[i].pdata_size = sizeof(struct ab8500_platform_data); @@ -3195,13 +3199,23 @@ static int db8500_prcmu_probe(struct platform_device *pdev) db8500_prcmu_update_cpufreq(); - err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, - ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); + err = mfd_add_devices(&pdev->dev, 0, common_prcmu_devs, + ARRAY_SIZE(common_prcmu_devs), NULL, 0, NULL); if (err) { pr_err("prcmu: Failed to add subdevices\n"); return err; } + /* TODO: Remove restriction when clk definitions are available. */ + if (!of_machine_is_compatible("st-ericsson,u8540")) { + err = mfd_add_devices(&pdev->dev, 0, db8500_prcmu_devs, + ARRAY_SIZE(db8500_prcmu_devs), NULL, 0, NULL); + if (err) { + pr_err("prcmu: Failed to add subdevices\n"); + return err; + } + } + pr_info("DB8500 PRCMU initialized\n"); no_irq_return: