提交 a9352211 编写于 作者: W Wolfgang Grandegger 提交者: Ben Dooks

i2c-mpc: rename "setclock" initialization functions to "setup"

To prepare  support for the MPC512x processors from Freescale the
"setclock" initialization functions have been renamed to "setup"
because I2C interrupts must be enabled for the MPC512x by this
function as well.
Signed-off-by: NWolfgang Grandegger <wg@denx.de>
Acked-by: NWolfram Sang <w.sang@pengutronix.de>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 6e56dd3d
...@@ -67,8 +67,7 @@ struct mpc_i2c_divider { ...@@ -67,8 +67,7 @@ struct mpc_i2c_divider {
}; };
struct mpc_i2c_data { struct mpc_i2c_data {
void (*setclock)(struct device_node *node, void (*setup)(struct device_node *node, struct mpc_i2c *i2c,
struct mpc_i2c *i2c,
u32 clock, u32 prescaler); u32 clock, u32 prescaler);
u32 prescaler; u32 prescaler;
}; };
...@@ -216,7 +215,7 @@ static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, ...@@ -216,7 +215,7 @@ static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
return div ? (int)div->fdr : -EINVAL; return div ? (int)div->fdr : -EINVAL;
} }
static void __devinit mpc_i2c_setclock_52xx(struct device_node *node, static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
struct mpc_i2c *i2c, struct mpc_i2c *i2c,
u32 clock, u32 prescaler) u32 clock, u32 prescaler)
{ {
...@@ -231,7 +230,7 @@ static void __devinit mpc_i2c_setclock_52xx(struct device_node *node, ...@@ -231,7 +230,7 @@ static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr); dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
} }
#else /* !CONFIG_PPC_MPC52xx */ #else /* !CONFIG_PPC_MPC52xx */
static void __devinit mpc_i2c_setclock_52xx(struct device_node *node, static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
struct mpc_i2c *i2c, struct mpc_i2c *i2c,
u32 clock, u32 prescaler) u32 clock, u32 prescaler)
{ {
...@@ -322,7 +321,7 @@ static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock, ...@@ -322,7 +321,7 @@ static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
return div ? (int)div->fdr : -EINVAL; return div ? (int)div->fdr : -EINVAL;
} }
static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node, static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
struct mpc_i2c *i2c, struct mpc_i2c *i2c,
u32 clock, u32 prescaler) u32 clock, u32 prescaler)
{ {
...@@ -340,7 +339,7 @@ static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node, ...@@ -340,7 +339,7 @@ static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
} }
#else /* !CONFIG_FSL_SOC */ #else /* !CONFIG_FSL_SOC */
static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node, static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
struct mpc_i2c *i2c, struct mpc_i2c *i2c,
u32 clock, u32 prescaler) u32 clock, u32 prescaler)
{ {
...@@ -533,12 +532,11 @@ static int __devinit fsl_i2c_probe(struct of_device *op, ...@@ -533,12 +532,11 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
if (match->data) { if (match->data) {
struct mpc_i2c_data *data = struct mpc_i2c_data *data =
(struct mpc_i2c_data *)match->data; (struct mpc_i2c_data *)match->data;
data->setclock(op->node, i2c, clock, data->prescaler); data->setup(op->node, i2c, clock, data->prescaler);
} else { } else {
/* Backwards compatibility */ /* Backwards compatibility */
if (of_get_property(op->node, "dfsrr", NULL)) if (of_get_property(op->node, "dfsrr", NULL))
mpc_i2c_setclock_8xxx(op->node, i2c, mpc_i2c_setup_8xxx(op->node, i2c, clock, 0);
clock, 0);
} }
} }
...@@ -585,20 +583,20 @@ static int __devexit fsl_i2c_remove(struct of_device *op) ...@@ -585,20 +583,20 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
}; };
static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = { static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
.setclock = mpc_i2c_setclock_52xx, .setup = mpc_i2c_setup_52xx,
}; };
static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = { static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
.setclock = mpc_i2c_setclock_8xxx, .setup = mpc_i2c_setup_8xxx,
}; };
static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = { static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
.setclock = mpc_i2c_setclock_8xxx, .setup = mpc_i2c_setup_8xxx,
.prescaler = 2, .prescaler = 2,
}; };
static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = { static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
.setclock = mpc_i2c_setclock_8xxx, .setup = mpc_i2c_setup_8xxx,
.prescaler = 3, .prescaler = 3,
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册