projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'mimc200' into next
[oweals/u-boot.git]
/
cpu
/
mpc8220
/
i2c.c
diff --git
a/cpu/mpc8220/i2c.c
b/cpu/mpc8220/i2c.c
index e9d077178b10f4adcbf5ee0fa6fe9064bd0b6889..76ecdf11e214e3e539c67535f140cffec33c3c5d 100644
(file)
--- a/
cpu/mpc8220/i2c.c
+++ b/
cpu/mpc8220/i2c.c
@@
-23,6
+23,8
@@
#include <common.h>
#include <common.h>
+DECLARE_GLOBAL_DATA_PTR;
+
#ifdef CONFIG_HARD_I2C
#include <mpc8220.h>
#ifdef CONFIG_HARD_I2C
#include <mpc8220.h>
@@
-73,8
+75,10
@@
static int mpc_get_fdr (int);
static int mpc_reg_in (volatile u32 * reg)
{
static int mpc_reg_in (volatile u32 * reg)
{
- return *reg >> 24;
+ int ret;
+ ret = *reg >> 24;
__asm__ __volatile__ ("eieio");
__asm__ __volatile__ ("eieio");
+ return ret;
}
static void mpc_reg_out (volatile u32 * reg, int val, int mask)
}
static void mpc_reg_out (volatile u32 * reg, int val, int mask)
@@
-233,7
+237,6
@@
void i2c_init (int speed, int saddr)
static int mpc_get_fdr (int speed)
{
static int mpc_get_fdr (int speed)
{
- DECLARE_GLOBAL_DATA_PTR;
static int fdr = -1;
if (fdr == -1) {
static int fdr = -1;
if (fdr == -1) {
@@
-324,7
+327,7
@@
int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
goto Done;
}
- if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+ if (send_bytes (chip,
(char *)
&xaddr[4 - alen], alen)) {
printf ("i2c_read: send_bytes failed\n");
goto Done;
}
printf ("i2c_read: send_bytes failed\n");
goto Done;
}
@@
-335,7
+338,7
@@
int i2c_read (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
goto Done;
}
- if (receive_bytes (chip, buf, len)) {
+ if (receive_bytes (chip,
(char *)
buf, len)) {
printf ("i2c_read: receive_bytes failed\n");
goto Done;
}
printf ("i2c_read: receive_bytes failed\n");
goto Done;
}
@@
-368,12
+371,12
@@
int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
goto Done;
}
goto Done;
}
- if (send_bytes (chip, &xaddr[4 - alen], alen)) {
+ if (send_bytes (chip,
(char *)
&xaddr[4 - alen], alen)) {
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
- if (send_bytes (chip, buf, len)) {
+ if (send_bytes (chip,
(char *)
buf, len)) {
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
printf ("i2c_write: send_bytes failed\n");
goto Done;
}
@@
-384,20
+387,4
@@
int i2c_write (uchar chip, uint addr, int alen, uchar * buf, int len)
return ret;
}
return ret;
}
-uchar i2c_reg_read (uchar chip, uchar reg)
-{
- char buf;
-
- i2c_read (chip, reg, 1, &buf, 1);
-
- return buf;
-}
-
-void i2c_reg_write (uchar chip, uchar reg, uchar val)
-{
- i2c_write (chip, reg, 1, &val, 1);
-
- return;
-}
-
#endif /* CONFIG_HARD_I2C */
#endif /* CONFIG_HARD_I2C */