diff options
author | Philipp Zabel <philipp.zabel@gmail.com> | 2009-02-17 10:09:44 +0100 |
---|---|---|
committer | Samuel Ortiz <samuel@sortiz.org> | 2009-04-05 00:32:23 +0200 |
commit | 47c10edd715d420cabd8622a4a458e9ac755b24d (patch) | |
tree | 60ced3647533a0431d194a14010238d690a61e67 /drivers | |
parent | 7d33ccbeecd8393cc690cf9a71008236cdd7cc2c (diff) |
mfd: PASIC3: supply clock_rate to DS1WM via driver_data
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | 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 92b683790ad..386da1566fc 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); |