.name = "i2c0_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 0,
.enable_reg = I2CCLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk i2c1_ck = {
.name = "i2c1_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 1,
.enable_reg = I2CCLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk i2c2_ck = {
.name = "i2c2_ck",
.parent = &per_ck,
.flags = NEEDS_INITIALIZATION,
- .round_rate = &on_off_round_rate,
- .set_rate = &on_off_set_rate,
.enable_shift = 2,
.enable_reg = USB_OTG_CLKCTRL_REG,
+ .enable = clk_reg_enable,
+ .disable = clk_reg_disable,
};
static struct clk spi0_ck = {
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
- /* FIXME: disable clock? */
- clk_set_rate(alg_data->clk, 1);
+ /* FIXME: shouldn't this be clk_disable? */
+ clk_enable(alg_data->clk);
return 0;
}
struct i2c_pnx_data *i2c_pnx = platform_get_drvdata(pdev);
struct i2c_pnx_algo_data *alg_data = i2c_pnx->adapter->algo_data;
- clk_set_rate(alg_data->clk, 1);
-
- return 0;
+ return clk_enable(alg_data->clk);
}
#else
#define i2c_pnx_controller_suspend NULL
goto out_release;
}
- clk_set_rate(alg_data->clk, 1);
+ ret = clk_enable(alg_data->clk);
+ if (ret)
+ goto out_unmap;
/*
* Clock Divisor High This value is the number of system clocks
iowrite32(mcntrl_reset, I2C_REG_CTL(alg_data));
if (wait_reset(I2C_PNX_TIMEOUT, alg_data)) {
ret = -ENODEV;
- goto out_unmap;
+ goto out_clock;
}
init_completion(&alg_data->mif.complete);
out_irq:
free_irq(alg_data->irq, i2c_pnx->adapter);
out_clock:
- clk_set_rate(alg_data->clk, 0);
+ clk_disable(alg_data->clk);
out_unmap:
iounmap((void *)alg_data->ioaddr);
out_release:
free_irq(alg_data->irq, i2c_pnx->adapter);
i2c_del_adapter(adap);
- clk_set_rate(alg_data->clk, 0);
+ clk_disable(alg_data->clk);
iounmap((void *)alg_data->ioaddr);
release_mem_region(alg_data->base, I2C_PNX_REGION_SIZE);
clk_put(alg_data->clk);