aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-pnx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-pnx.c')
-rw-r--r--drivers/i2c/busses/i2c-pnx.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c
index 98462671cdf7..29f91774c4df 100644
--- a/drivers/i2c/busses/i2c-pnx.c
+++ b/drivers/i2c/busses/i2c-pnx.c
@@ -555,8 +555,8 @@ static int i2c_pnx_controller_suspend(struct platform_device *pdev,
555 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev); 555 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
556 struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data; 556 struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
557 557
558 /* FIXME: disable clock? */ 558 /* FIXME: shouldn't this be clk_disable? */
559 clk_set_rate(alg_data->clk, 1); 559 clk_enable(alg_data->clk);
560 560
561 return 0; 561 return 0;
562} 562}
@@ -566,9 +566,7 @@ static int i2c_pnx_controller_resume(struct platform_device *pdev)
566 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev); 566 struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
567 struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data; 567 struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
568 568
569 clk_set_rate(alg_data->clk, 1); 569 return clk_enable(alg_data->clk);
570
571 return 0;
572} 570}
573#else 571#else
574#define i2c_pnx_controller_suspend NULL 572#define i2c_pnx_controller_suspend NULL
@@ -630,7 +628,9 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
630 goto out_release; 628 goto out_release;
631 } 629 }
632 630
633 clk_set_rate(alg_data->clk, 1); 631 ret = clk_enable(alg_data->clk);
632 if (ret)
633 goto out_unmap;
634 634
635 /* 635 /*
636 * Clock Divisor High This value is the number of system clocks 636 * Clock Divisor High This value is the number of system clocks
@@ -650,7 +650,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
650 iowrite32(mcntrl_reset, I2C_REG_CTL(alg_data)); 650 iowrite32(mcntrl_reset, I2C_REG_CTL(alg_data));
651 if (wait_reset(I2C_PNX_TIMEOUT, alg_data)) { 651 if (wait_reset(I2C_PNX_TIMEOUT, alg_data)) {
652 ret = -ENODEV; 652 ret = -ENODEV;
653 goto out_unmap; 653 goto out_clock;
654 } 654 }
655 init_completion(&alg_data->mif.complete); 655 init_completion(&alg_data->mif.complete);
656 656
@@ -676,7 +676,7 @@ static int __devinit i2c_pnx_probe(struct platform_device *pdev)
676out_irq: 676out_irq:
677 free_irq(alg_data->irq, i2c_pnx->adapter); 677 free_irq(alg_data->irq, i2c_pnx->adapter);
678out_clock: 678out_clock:
679 clk_set_rate(alg_data->clk, 0); 679 clk_disable(alg_data->clk);
680out_unmap: 680out_unmap:
681 iounmap((void *)alg_data->ioaddr); 681 iounmap((void *)alg_data->ioaddr);
682out_release: 682out_release:
@@ -697,7 +697,7 @@ static int __devexit i2c_pnx_remove(struct platform_device *pdev)
697 697
698 free_irq(alg_data->irq, i2c_pnx->adapter); 698 free_irq(alg_data->irq, i2c_pnx->adapter);
699 i2c_del_adapter(adap); 699 i2c_del_adapter(adap);
700 clk_set_rate(alg_data->clk, 0); 700 clk_disable(alg_data->clk);
701 iounmap((void *)alg_data->ioaddr); 701 iounmap((void *)alg_data->ioaddr);
702 release_mem_region(alg_data->base, I2C_PNX_REGION_SIZE); 702 release_mem_region(alg_data->base, I2C_PNX_REGION_SIZE);
703 clk_put(alg_data->clk); 703 clk_put(alg_data->clk);