aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/ucb1x00-core.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 13:24:17 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-18 18:15:41 -0500
commit2b4d9d2b001be2ff06be2ea5c52e9adaf85b0805 (patch)
tree1f20cf005a8f9e47a11464f3012a822557e2f041 /drivers/mfd/ucb1x00-core.c
parented442b6798eb39eda3bcea92ef9403280b603818 (diff)
MFD: ucb1x00-core: disable mcp clock when bus is not required
The ucb1x00-core was leaving the mcp clock enabled indefinitely after probe. This needlessly wastes power. Add the necessary disables to ensure that the clock remains off when we don't need it. Acked-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mfd/ucb1x00-core.c')
-rw-r--r--drivers/mfd/ucb1x00-core.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c
index 9f8ea52f0ca8..ed2a4b2e518f 100644
--- a/drivers/mfd/ucb1x00-core.c
+++ b/drivers/mfd/ucb1x00-core.c
@@ -554,16 +554,17 @@ static int ucb1x00_probe(struct mcp *mcp)
554 554
555 mcp_enable(mcp); 555 mcp_enable(mcp);
556 id = mcp_reg_read(mcp, UCB_ID); 556 id = mcp_reg_read(mcp, UCB_ID);
557 mcp_disable(mcp);
557 558
558 if (id != UCB_ID_1200 && id != UCB_ID_1300 && id != UCB_ID_TC35143) { 559 if (id != UCB_ID_1200 && id != UCB_ID_1300 && id != UCB_ID_TC35143) {
559 printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id); 560 printk(KERN_WARNING "UCB1x00 ID not found: %04x\n", id);
560 goto err_disable; 561 goto out;
561 } 562 }
562 563
563 ucb = kzalloc(sizeof(struct ucb1x00), GFP_KERNEL); 564 ucb = kzalloc(sizeof(struct ucb1x00), GFP_KERNEL);
564 ret = -ENOMEM; 565 ret = -ENOMEM;
565 if (!ucb) 566 if (!ucb)
566 goto err_disable; 567 goto out;
567 568
568 device_initialize(&ucb->dev); 569 device_initialize(&ucb->dev);
569 ucb->dev.class = &ucb1x00_class; 570 ucb->dev.class = &ucb1x00_class;
@@ -581,7 +582,9 @@ static int ucb1x00_probe(struct mcp *mcp)
581 if (ret) 582 if (ret)
582 goto err_dev_add; 583 goto err_dev_add;
583 584
585 ucb1x00_enable(ucb);
584 ucb->irq = ucb1x00_detect_irq(ucb); 586 ucb->irq = ucb1x00_detect_irq(ucb);
587 ucb1x00_disable(ucb);
585 if (ucb->irq == NO_IRQ) { 588 if (ucb->irq == NO_IRQ) {
586 dev_err(&ucb->dev, "IRQ probe failed\n"); 589 dev_err(&ucb->dev, "IRQ probe failed\n");
587 ret = -ENODEV; 590 ret = -ENODEV;
@@ -633,8 +636,6 @@ static int ucb1x00_probe(struct mcp *mcp)
633 device_del(&ucb->dev); 636 device_del(&ucb->dev);
634 err_dev_add: 637 err_dev_add:
635 put_device(&ucb->dev); 638 put_device(&ucb->dev);
636 err_disable:
637 mcp_disable(mcp);
638 out: 639 out:
639 if (pdata && pdata->reset) 640 if (pdata && pdata->reset)
640 pdata->reset(UCB_RST_PROBE_FAIL); 641 pdata->reset(UCB_RST_PROBE_FAIL);