aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/htc-pasic3.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mfd/htc-pasic3.c')
-rw-r--r--drivers/mfd/htc-pasic3.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 92b683790ad8..386da1566fcc 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)
167 /* calculate bus shift from mem resource */ 167 /* calculate bus shift from mem resource */
168 asic->bus_shift = (resource_size(r) - 5) >> 3; 168 asic->bus_shift = (resource_size(r) - 5) >> 3;
169 169
170 /* the first 5 PASIC3 registers control the DS1WM */ 170 if (pdata && pdata->clock_rate) {
171 ds1wm_resources[0].end = (5 << asic->bus_shift) - 1; 171 ds1wm_pdata.clock_rate = pdata->clock_rate;
172 ds1wm_cell.platform_data = &ds1wm_cell; 172 /* the first 5 PASIC3 registers control the DS1WM */
173 ds1wm_cell.data_size = sizeof(ds1wm_cell); 173 ds1wm_resources[0].end = (5 << asic->bus_shift) - 1;
174 ret = mfd_add_devices(&pdev->dev, pdev->id, &ds1wm_cell, 1, r, irq); 174 ds1wm_cell.platform_data = &ds1wm_cell;
175 if (ret < 0) 175 ds1wm_cell.data_size = sizeof(ds1wm_cell);
176 dev_warn(dev, "failed to register DS1WM\n"); 176 ret = mfd_add_devices(&pdev->dev, pdev->id,
177 177 &ds1wm_cell, 1, r, irq);
178 if (pdata->led_pdata) { 178 if (ret < 0)
179 dev_warn(dev, "failed to register DS1WM\n");
180 }
181
182 if (pdata && pdata->led_pdata) {
179 led_cell.driver_data = pdata->led_pdata; 183 led_cell.driver_data = pdata->led_pdata;
180 led_cell.platform_data = &led_cell; 184 led_cell.platform_data = &led_cell;
181 led_cell.data_size = sizeof(ds1wm_cell); 185 led_cell.data_size = sizeof(ds1wm_cell);