From patchwork Thu Apr 4 10:39:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15902 Return-Path: X-Original-To: linaro@staging.patches.linaro.org Delivered-To: linaro@staging.patches.linaro.org Received: from mail-qe0-f72.google.com (mail-qe0-f72.google.com [209.85.128.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 8D55427796 for ; Thu, 4 Apr 2013 10:39:28 +0000 (UTC) Received: by mail-qe0-f72.google.com with SMTP id 1sf4038983qec.3 for ; Thu, 04 Apr 2013 03:39:23 -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=YRjDvdS0eLqo4BTQA89RHqxML3H77fclOb8YjbmJDc8=; b=fLvPQUk7DUIuy55Xyh/9O0/Rc3lpl+CqkToykNzy5+wwWAPr4qz+U1smEXu0cb7bl2 SZC1nKGklYlpVasNxG4nqEDsJqVgEPdU/lYlxzbzcf5RAMgWfutbQUF36sFv6ZI69ihm J38Jxo8kS/wy2mud0aYXcp/iIgxoYGdkzQvJsHxjTxvADRKK+jHKlGqywgk6Lnc4LBoX 36npw7F8JMNpI8L77oalOoxHY3eBa7VWPOXwH+JeDjFqybdlQvf1+/f4tNn18EFv6wSO 3diAx0UXjdtcakK++5ihGiz6Pm1SqZ7sxyHs8dxMnqxzaN3KB3c4J5xeScSBo57teNDa ZKzg== X-Received: by 10.224.58.77 with SMTP id f13mr3048781qah.7.1365071963584; Thu, 04 Apr 2013 03:39:23 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.212 with SMTP id 20ls1372961qeg.12.gmail; Thu, 04 Apr 2013 03:39:23 -0700 (PDT) X-Received: by 10.58.34.12 with SMTP id v12mr4130157vei.55.1365071963500; Thu, 04 Apr 2013 03:39:23 -0700 (PDT) Received: from mail-vc0-f174.google.com (mail-vc0-f174.google.com [209.85.220.174]) by mx.google.com with ESMTPS id p8si7844419vdw.10.2013.04.04.03.39.23 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 03:39:23 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.174 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.174; Received: by mail-vc0-f174.google.com with SMTP id hx10so2228566vcb.33 for ; Thu, 04 Apr 2013 03:39:23 -0700 (PDT) X-Received: by 10.52.93.20 with SMTP id cq20mr3612459vdb.38.1365071963367; Thu, 04 Apr 2013 03:39:23 -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 h8csp209678vez; Thu, 4 Apr 2013 03:39:22 -0700 (PDT) X-Received: by 10.180.181.40 with SMTP id dt8mr8470229wic.17.1365071960894; Thu, 04 Apr 2013 03:39:20 -0700 (PDT) Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com [74.125.82.53]) by mx.google.com with ESMTPS id hi10si4089470wib.30.2013.04.04.03.39.20 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 03:39:20 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.82.53 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=74.125.82.53; Received: by mail-wg0-f53.google.com with SMTP id c11so2594341wgh.20 for ; Thu, 04 Apr 2013 03:39:20 -0700 (PDT) X-Received: by 10.180.97.132 with SMTP id ea4mr8409935wib.23.1365071960453; Thu, 04 Apr 2013 03:39:20 -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 bk1sm15144790wib.2.2013.04.04.03.39.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 04 Apr 2013 03:39:19 -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 11:39:01 +0100 Message-Id: <1365071941-23475-2-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1365071941-23475-1-git-send-email-lee.jones@linaro.org> References: <1365071941-23475-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQmfw7gTH5GgsDY1cBQ4TguhklRxIT/0lvuRH9FgaMKYNckU577bqDWZo93uAdOkbb/ocqg0 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.174 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 | 52 ++++++++++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 1c4edbf8..dec94d0 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,10 +3188,10 @@ static int db8500_prcmu_probe(struct platform_device *pdev) db8500_irq_init(np); - for (i = 0; i < ARRAY_SIZE(db8500_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); + for (i = 0; i < ARRAY_SIZE(common_prcmu_devs); i++) { + if (!strcmp(common_prcmu_devs[i].name, "ab8500-core")) { + common_prcmu_devs[i].platform_data = pdata->ab_platdata; + common_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: