From patchwork Tue Apr 2 13:21:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 15820 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 45D6223E10 for ; Tue, 2 Apr 2013 13:22:27 +0000 (UTC) Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by fiordland.canonical.com (Postfix) with ESMTP id E22ABA191EA for ; Tue, 2 Apr 2013 13:22:26 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id b14sf516890qcs.4 for ; Tue, 02 Apr 2013 06:22:26 -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=1HAW31XXmlTXgyrx553gKkv4Eg+fClGtKJ//CB0QGoY=; b=GhyWVaaSgSr7FNy8U3RaUAH9NixcfZtGGbiv6IQGrnLpjnkYD0HkOFZg+aTAw7Ent/ 2qhvXLGf0iP3GFpzm1YBgK3jDH/hILqd5XORoVfIGqeWA24k+NFDjQtjn64+XxSufYqI C7HmaQvzU0uf5AsLRo8hnKMbRDwRsu2SeObjfZKYnSnR+UwkDjR6UZD7x1Ook8zegAWu OnYmsG1NejyLQ2X2WXipuOWokxd75lErp5YQ/4do+dHZqsuNnT3vug/FABJCgV8G4klb eu4pebiGz7YyGzoRu+v/RutdbUtohaK+/UdYkevXLklyZwgJpAc1x88be7qgeOQmtbIX gGrw== X-Received: by 10.236.231.141 with SMTP id l13mr6150718yhq.19.1364908946266; Tue, 02 Apr 2013 06:22:26 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.63.137 with SMTP id g9ls312168qes.87.gmail; Tue, 02 Apr 2013 06:22:26 -0700 (PDT) X-Received: by 10.220.159.134 with SMTP id j6mr12484510vcx.59.1364908946080; Tue, 02 Apr 2013 06:22:26 -0700 (PDT) Received: from mail-ve0-f177.google.com (mail-ve0-f177.google.com [209.85.128.177]) by mx.google.com with ESMTPS id q13si1053751vcw.36.2013.04.02.06.22.26 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 06:22:26 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.177 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.177; Received: by mail-ve0-f177.google.com with SMTP id jw11so447031veb.36 for ; Tue, 02 Apr 2013 06:22:26 -0700 (PDT) X-Received: by 10.52.20.239 with SMTP id q15mr10678329vde.73.1364908945978; Tue, 02 Apr 2013 06:22:25 -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.59.4.204 with SMTP id cg12csp125130ved; Tue, 2 Apr 2013 06:22:25 -0700 (PDT) X-Received: by 10.180.76.84 with SMTP id i20mr16071869wiw.9.1364908944890; Tue, 02 Apr 2013 06:22:24 -0700 (PDT) Received: from mail-wi0-x22a.google.com ([2a00:1450:400c:c05::22a]) by mx.google.com with ESMTPS id w10si555525wjy.30.2013.04.02.06.22.24 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 06:22:24 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22a is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=2a00:1450:400c:c05::22a; Received: by mail-wi0-f170.google.com with SMTP id hm11so3174244wib.3 for ; Tue, 02 Apr 2013 06:22:24 -0700 (PDT) X-Received: by 10.194.157.42 with SMTP id wj10mr21916804wjb.12.1364908943995; Tue, 02 Apr 2013 06:22:23 -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 n2sm18968272wiy.6.2013.04.02.06.22.22 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 02 Apr 2013 06:22:23 -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 9/9] mfd: db8500-prcmu: Support platform dependant device selection Date: Tue, 2 Apr 2013 14:21:56 +0100 Message-Id: <1364908916-29803-9-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1364908916-29803-1-git-send-email-lee.jones@linaro.org> References: <1364908916-29803-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQn5fIr8ztfmVe4B4lKaXcdZbbV/zTKvkP7ZRftpKLj1/MT1DF4/1Zw89KGrHL3JaLQlm+h0 X-Original-Sender: lee.jones@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.177 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 | 45 ++++++++++++++++++++++++++++---------------- 1 file changed, 29 insertions(+), 16 deletions(-) diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 1c4edbf8..5a03b5d 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c @@ -3107,19 +3107,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 +3123,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 +3187,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 +3198,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: