Commit fdd8a3fd authored by Jarkko Nikula's avatar Jarkko Nikula Committed by Juha Yrjola

i2c-omap: Use I2C interface clock also on OMAP16xx CPUs

Create and use a virtual i2c_ick clock which prevents its parent clock
ARMPER_CK from being stopped during MPU idle whenever i2c_ick is enabled.
Otherwise we end up losing IRQs if ARMPER_CK would otherwise idle.
Signed-off-by: default avatarJarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: default avatarJuha Yrjola <juha.yrjola@nokia.com>
parent 442b3a71
...@@ -741,6 +741,18 @@ static struct clk i2c_fck = { ...@@ -741,6 +741,18 @@ static struct clk i2c_fck = {
.disable = &omap1_clk_disable_generic, .disable = &omap1_clk_disable_generic,
}; };
static struct clk i2c_ick = {
.name = "i2c_ick",
.id = 1,
.flags = CLOCK_IN_OMAP16XX |
VIRTUAL_CLOCK | CLOCK_NO_IDLE_PARENT |
ALWAYS_ENABLED,
.parent = &armper_ck.clk,
.recalc = &followparent_recalc,
.enable = &omap1_clk_enable_generic,
.disable = &omap1_clk_disable_generic,
};
static struct clk * onchip_clks[] = { static struct clk * onchip_clks[] = {
/* non-ULPD clocks */ /* non-ULPD clocks */
&ck_ref, &ck_ref,
...@@ -790,6 +802,7 @@ static struct clk * onchip_clks[] = { ...@@ -790,6 +802,7 @@ static struct clk * onchip_clks[] = {
/* Virtual clocks */ /* Virtual clocks */
&virtual_ck_mpu, &virtual_ck_mpu,
&i2c_fck, &i2c_fck,
&i2c_ick,
}; };
#endif #endif
...@@ -163,22 +163,17 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg) ...@@ -163,22 +163,17 @@ static inline u16 omap_i2c_read_reg(struct omap_i2c_dev *i2c_dev, int reg)
static int omap_i2c_get_clocks(struct omap_i2c_dev *dev) static int omap_i2c_get_clocks(struct omap_i2c_dev *dev)
{ {
if (cpu_is_omap24xx()) { if (cpu_is_omap16xx() || cpu_is_omap24xx()) {
dev->iclk = clk_get(dev->dev, "i2c_ick"); dev->iclk = clk_get(dev->dev, "i2c_ick");
if (IS_ERR(dev->iclk)) { if (IS_ERR(dev->iclk))
return -ENODEV; return -ENODEV;
}
dev->fclk = clk_get(dev->dev, "i2c_fck");
if (IS_ERR(dev->fclk)) {
clk_put(dev->fclk);
return -ENODEV;
}
} }
if (cpu_class_is_omap1()) { dev->fclk = clk_get(dev->dev, "i2c_fck");
dev->fclk = clk_get(dev->dev, "i2c_fck"); if (IS_ERR(dev->fclk)) {
if (IS_ERR(dev->fclk)) if (dev->iclk != NULL)
return -ENODEV; clk_put(dev->iclk);
return -ENODEV;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment