summaryrefslogtreecommitdiff
path: root/common/miiphyutil.c
diff options
context:
space:
mode:
authorChandan Nath <chandan.nath@ti.com>2011-09-21 01:10:32 +0000
committerWolfgang Denk <wd@denx.de>2011-12-06 21:01:01 +0100
commit5c45a22b9203351a32aec4600514341b91175542 (patch)
treeab3115ecbb3df253d350da76a011eabee5f23dec /common/miiphyutil.c
parent0910d0bcb85acdf09b9dfd8ded452367b540a4ad (diff)
downloadu-boot-imx-5c45a22b9203351a32aec4600514341b91175542.zip
u-boot-imx-5c45a22b9203351a32aec4600514341b91175542.tar.gz
u-boot-imx-5c45a22b9203351a32aec4600514341b91175542.tar.bz2
mii: miiphy register address width change
This patch is added for PHY whose register offset value exceeds 0xFF and cannot be used with "unsigned char" datatype in miiphy_read, miiphy_write and miiphy_register functions. Datatype of register offset is changed to unsigned short instead of unsigned char so that offset value greater then 0xFF can be used. Signed-off-by: Chandan Nath <chandan.nath@ti.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'common/miiphyutil.c')
-rw-r--r--common/miiphyutil.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/miiphyutil.c b/common/miiphyutil.c
index 2cc23b4..88747b8 100644
--- a/common/miiphyutil.c
+++ b/common/miiphyutil.c
@@ -106,9 +106,9 @@ static int legacy_miiphy_write(struct mii_dev *bus, int addr, int devad,
*/
void miiphy_register(const char *name,
int (*read)(const char *devname, unsigned char addr,
- unsigned char reg, unsigned short *value),
+ unsigned short reg, unsigned short *value),
int (*write)(const char *devname, unsigned char addr,
- unsigned char reg, unsigned short value))
+ unsigned short reg, unsigned short value))
{
struct mii_dev *new_dev;
struct legacy_mii_dev *ldev;
@@ -287,7 +287,7 @@ static struct mii_dev *miiphy_get_active_dev(const char *devname)
* Returns:
* 0 on success
*/
-int miiphy_read(const char *devname, unsigned char addr, unsigned char reg,
+int miiphy_read(const char *devname, unsigned char addr, unsigned short reg,
unsigned short *value)
{
struct mii_dev *bus;
@@ -315,7 +315,7 @@ int miiphy_read(const char *devname, unsigned char addr, unsigned char reg,
* Returns:
* 0 on success
*/
-int miiphy_write(const char *devname, unsigned char addr, unsigned char reg,
+int miiphy_write(const char *devname, unsigned char addr, unsigned short reg,
unsigned short value)
{
struct mii_dev *bus;