diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2009-11-20 06:44:46 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-02-12 12:32:39 -0500 |
commit | ebdbbf2003ae2342147c87c2a6c6ed8984b9cede (patch) | |
tree | 2d3228b7a0b556e00f9082a5f4d09d426d03f11b /drivers/i2c | |
parent | 0321cb83e1c3f3a4282bd620c6cec78c5b80b572 (diff) |
ARM: PNX4008: convert i2c-pnx to use clk API enable/disable calls
clk_set_rate() is not supposed to be used to turn clocks on and off.
That's what clk_enable/clk_disable is for.
Acked-by: Vitaly Wool <vitalywool@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 18 |
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) | |||
676 | out_irq: | 676 | out_irq: |
677 | free_irq(alg_data->irq, i2c_pnx->adapter); | 677 | free_irq(alg_data->irq, i2c_pnx->adapter); |
678 | out_clock: | 678 | out_clock: |
679 | clk_set_rate(alg_data->clk, 0); | 679 | clk_disable(alg_data->clk); |
680 | out_unmap: | 680 | out_unmap: |
681 | iounmap((void *)alg_data->ioaddr); | 681 | iounmap((void *)alg_data->ioaddr); |
682 | out_release: | 682 | out_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); |