From: Philipp Zabel <philipp.zabel@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Samuel Ortiz <sameo@openedhand.com>,
Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
Matt Reimer <mreimer@vpop.net>,
Philipp Zabel <philipp.zabel@gmail.com>
Subject: [PATCH 6/6] mfd: PASIC3: supply clock_rate to DS1WM via driver_data
Date: Thu, 5 Feb 2009 17:53:40 +0100 [thread overview]
Message-ID: <1233852820-28549-7-git-send-email-philipp.zabel@gmail.com> (raw)
In-Reply-To: <1233852820-28549-1-git-send-email-philipp.zabel@gmail.com>
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
---
drivers/mfd/htc-pasic3.c | 22 +++++++++++++---------
1 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 92b6837..386da15 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -167,15 +167,19 @@ static int __init pasic3_probe(struct platform_device *pdev)
/* calculate bus shift from mem resource */
asic->bus_shift = (resource_size(r) - 5) >> 3;
- /* the first 5 PASIC3 registers control the DS1WM */
- ds1wm_resources[0].end = (5 << asic->bus_shift) - 1;
- ds1wm_cell.platform_data = &ds1wm_cell;
- ds1wm_cell.data_size = sizeof(ds1wm_cell);
- ret = mfd_add_devices(&pdev->dev, pdev->id, &ds1wm_cell, 1, r, irq);
- if (ret < 0)
- dev_warn(dev, "failed to register DS1WM\n");
-
- if (pdata->led_pdata) {
+ if (pdata && pdata->clock_rate) {
+ ds1wm_pdata.clock_rate = pdata->clock_rate;
+ /* the first 5 PASIC3 registers control the DS1WM */
+ ds1wm_resources[0].end = (5 << asic->bus_shift) - 1;
+ ds1wm_cell.platform_data = &ds1wm_cell;
+ ds1wm_cell.data_size = sizeof(ds1wm_cell);
+ ret = mfd_add_devices(&pdev->dev, pdev->id,
+ &ds1wm_cell, 1, r, irq);
+ if (ret < 0)
+ dev_warn(dev, "failed to register DS1WM\n");
+ }
+
+ if (pdata && pdata->led_pdata) {
led_cell.driver_data = pdata->led_pdata;
led_cell.platform_data = &led_cell;
led_cell.data_size = sizeof(ds1wm_cell);
--
1.5.6.5
next prev parent reply other threads:[~2009-02-05 16:56 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-05 16:53 [PATCH 0/6] fix PASIC3/DS1WM, use MFD core Philipp Zabel
2009-02-05 16:53 ` [PATCH 1/6] mfd: DS1WM: convert to " Philipp Zabel
2009-02-05 16:53 ` [PATCH 2/6] mfd: PASIC3: " Philipp Zabel
2009-02-05 16:53 ` [PATCH 3/6] pxa/magician: remove deprecated .bus_shift from PASIC3 platform_data Philipp Zabel
2009-02-05 16:53 ` [PATCH 4/6] mfd: PASIC3: remove unused bus_shift field Philipp Zabel
2009-02-05 16:53 ` [PATCH 5/6] mfd: DS1WM: remove clock handling Philipp Zabel
2009-02-06 16:31 ` [PATCH] mfd: DS1WM: remove warning about unused label err2 Philipp Zabel
2009-02-05 16:53 ` Philipp Zabel [this message]
2009-02-05 21:14 ` [PATCH 0/6] fix PASIC3/DS1WM, use MFD core Evgeniy Polyakov
2009-02-06 14:16 ` Samuel Ortiz
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=1233852820-28549-7-git-send-email-philipp.zabel@gmail.com \
--to=philipp.zabel@gmail.com \
--cc=johnpol@2ka.mipt.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mreimer@vpop.net \
--cc=sameo@openedhand.com \
/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