aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mpc.c
diff options
context:
space:
mode:
authorWolfgang Grandegger <wg@denx.de>2010-02-17 05:19:18 -0500
committerBen Dooks <ben-linux@fluff.org>2010-03-07 17:03:09 -0500
commita93522116ee5aa13eeb74c0fd73d8c5d15211e64 (patch)
treef61a9c9c2f74d2497746b8850a4d042c04c1c15f /drivers/i2c/busses/i2c-mpc.c
parent6e56dd3d0e1e899a824c247aa72bc4250ce7668a (diff)
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: Wolfgang Grandegger <wg@denx.de> Acked-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-mpc.c')
-rw-r--r--drivers/i2c/busses/i2c-mpc.c42
1 files changed, 20 insertions, 22 deletions
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c
index 2f74d9b6c0b9..370c342e5e81 100644
--- a/drivers/i2c/busses/i2c-mpc.c
+++ b/drivers/i2c/busses/i2c-mpc.c
@@ -67,9 +67,8 @@ struct mpc_i2c_divider {
67}; 67};
68 68
69struct mpc_i2c_data { 69struct mpc_i2c_data {
70 void (*setclock)(struct device_node *node, 70 void (*setup)(struct device_node *node, struct mpc_i2c *i2c,
71 struct mpc_i2c *i2c, 71 u32 clock, u32 prescaler);
72 u32 clock, u32 prescaler);
73 u32 prescaler; 72 u32 prescaler;
74}; 73};
75 74
@@ -216,9 +215,9 @@ static int __devinit mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock,
216 return div ? (int)div->fdr : -EINVAL; 215 return div ? (int)div->fdr : -EINVAL;
217} 216}
218 217
219static void __devinit mpc_i2c_setclock_52xx(struct device_node *node, 218static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
220 struct mpc_i2c *i2c, 219 struct mpc_i2c *i2c,
221 u32 clock, u32 prescaler) 220 u32 clock, u32 prescaler)
222{ 221{
223 int ret, fdr; 222 int ret, fdr;
224 223
@@ -231,9 +230,9 @@ static void __devinit mpc_i2c_setclock_52xx(struct device_node *node,
231 dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr); 230 dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr);
232} 231}
233#else /* !CONFIG_PPC_MPC52xx */ 232#else /* !CONFIG_PPC_MPC52xx */
234static void __devinit mpc_i2c_setclock_52xx(struct device_node *node, 233static void __devinit mpc_i2c_setup_52xx(struct device_node *node,
235 struct mpc_i2c *i2c, 234 struct mpc_i2c *i2c,
236 u32 clock, u32 prescaler) 235 u32 clock, u32 prescaler)
237{ 236{
238} 237}
239#endif /* CONFIG_PPC_MPC52xx*/ 238#endif /* CONFIG_PPC_MPC52xx*/
@@ -322,9 +321,9 @@ static int __devinit mpc_i2c_get_fdr_8xxx(struct device_node *node, u32 clock,
322 return div ? (int)div->fdr : -EINVAL; 321 return div ? (int)div->fdr : -EINVAL;
323} 322}
324 323
325static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node, 324static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
326 struct mpc_i2c *i2c, 325 struct mpc_i2c *i2c,
327 u32 clock, u32 prescaler) 326 u32 clock, u32 prescaler)
328{ 327{
329 int ret, fdr; 328 int ret, fdr;
330 329
@@ -340,9 +339,9 @@ static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node,
340} 339}
341 340
342#else /* !CONFIG_FSL_SOC */ 341#else /* !CONFIG_FSL_SOC */
343static void __devinit mpc_i2c_setclock_8xxx(struct device_node *node, 342static void __devinit mpc_i2c_setup_8xxx(struct device_node *node,
344 struct mpc_i2c *i2c, 343 struct mpc_i2c *i2c,
345 u32 clock, u32 prescaler) 344 u32 clock, u32 prescaler)
346{ 345{
347} 346}
348#endif /* CONFIG_FSL_SOC */ 347#endif /* CONFIG_FSL_SOC */
@@ -533,12 +532,11 @@ static int __devinit fsl_i2c_probe(struct of_device *op,
533 if (match->data) { 532 if (match->data) {
534 struct mpc_i2c_data *data = 533 struct mpc_i2c_data *data =
535 (struct mpc_i2c_data *)match->data; 534 (struct mpc_i2c_data *)match->data;
536 data->setclock(op->node, i2c, clock, data->prescaler); 535 data->setup(op->node, i2c, clock, data->prescaler);
537 } else { 536 } else {
538 /* Backwards compatibility */ 537 /* Backwards compatibility */
539 if (of_get_property(op->node, "dfsrr", NULL)) 538 if (of_get_property(op->node, "dfsrr", NULL))
540 mpc_i2c_setclock_8xxx(op->node, i2c, 539 mpc_i2c_setup_8xxx(op->node, i2c, clock, 0);
541 clock, 0);
542 } 540 }
543 } 541 }
544 542
@@ -585,20 +583,20 @@ static int __devexit fsl_i2c_remove(struct of_device *op)
585}; 583};
586 584
587static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = { 585static struct mpc_i2c_data mpc_i2c_data_52xx __devinitdata = {
588 .setclock = mpc_i2c_setclock_52xx, 586 .setup = mpc_i2c_setup_52xx,
589}; 587};
590 588
591static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = { 589static struct mpc_i2c_data mpc_i2c_data_8313 __devinitdata = {
592 .setclock = mpc_i2c_setclock_8xxx, 590 .setup = mpc_i2c_setup_8xxx,
593}; 591};
594 592
595static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = { 593static struct mpc_i2c_data mpc_i2c_data_8543 __devinitdata = {
596 .setclock = mpc_i2c_setclock_8xxx, 594 .setup = mpc_i2c_setup_8xxx,
597 .prescaler = 2, 595 .prescaler = 2,
598}; 596};
599 597
600static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = { 598static struct mpc_i2c_data mpc_i2c_data_8544 __devinitdata = {
601 .setclock = mpc_i2c_setclock_8xxx, 599 .setup = mpc_i2c_setup_8xxx,
602 .prescaler = 3, 600 .prescaler = 3,
603}; 601};
604 602