From: lee.jones@linaro.org (Lee Jones)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 9/9] mfd: db8500-prcmu: Support platform dependant device selection
Date: Tue, 2 Apr 2013 14:21:56 +0100 [thread overview]
Message-ID: <1364908916-29803-9-git-send-email-lee.jones@linaro.org> (raw)
In-Reply-To: <1364908916-29803-1-git-send-email-lee.jones@linaro.org>
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 <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
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:
--
1.7.10.4
next prev parent reply other threads:[~2013-04-02 13:21 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-02 13:21 [PATCH 1/9] ARM: ux500: Increase the size of the PRCMU's TCPM size Lee Jones
2013-04-02 13:21 ` [PATCH 2/9] ARM: ux500: Remove incorrect DB9540 PRCMU TCDM base location Lee Jones
2013-04-03 20:33 ` Linus Walleij
2013-04-02 13:21 ` [PATCH 3/9] ARM: ux500: Supply a DTS file for the u8540 platform Lee Jones
2013-04-03 20:34 ` Linus Walleij
2013-04-04 7:29 ` [PATCH] " Lee Jones
2013-04-23 10:42 ` Linus Walleij
2013-04-23 10:58 ` Linus Walleij
2013-04-24 7:52 ` Lee Jones
2013-04-02 13:21 ` [PATCH 4/9] ARM: ux500: Move Snowball's thermal DT node into existing PRCMU one Lee Jones
2013-04-03 20:38 ` Linus Walleij
2013-04-03 21:36 ` Linus Walleij
2013-04-03 21:45 ` Linus Walleij
2013-04-04 7:20 ` Lee Jones
2013-04-02 13:21 ` [PATCH 5/9] ARM: ux500: Over-ride TCDM size when booting the DB8540 platform Lee Jones
2013-04-03 20:39 ` Linus Walleij
2013-04-04 7:33 ` [PATCH] " Lee Jones
2013-04-23 10:59 ` Linus Walleij
2013-04-23 15:09 ` Lee Jones
2013-04-02 13:21 ` [PATCH 6/9] ARM: ux500: Create a new of_dev_auxdata structure for u8540 enablement Lee Jones
2013-04-03 20:42 ` Linus Walleij
2013-04-02 13:21 ` [PATCH 7/9] ARM: ux500: Add a VQMMC (level-shifting) regulator DT node for Snowball Lee Jones
2013-04-03 20:44 ` Linus Walleij
2013-04-02 13:21 ` [PATCH 8/9] mfd: db8500-prcmu: Return early if the TCPM cannot be located Lee Jones
2013-04-03 20:46 ` Linus Walleij
2013-04-02 13:21 ` Lee Jones [this message]
2013-04-03 20:47 ` [PATCH 9/9] mfd: db8500-prcmu: Support platform dependant device selection Linus Walleij
2013-04-04 10:15 ` Lee Jones
2013-04-03 20:32 ` [PATCH 1/9] ARM: ux500: Increase the size of the PRCMU's TCPM size Linus Walleij
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1364908916-29803-9-git-send-email-lee.jones@linaro.org \
--to=lee.jones@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).