diff options
author | Gabor Juhos <juhosg@openwrt.org> | 2011-01-26 20:35:46 +0000 |
---|---|---|
committer | Gabor Juhos <juhosg@openwrt.org> | 2011-01-26 20:35:46 +0000 |
commit | e67db2d2a3cc35d90139e7d6bfe83cceb95f61a0 (patch) | |
tree | 679e0323a9dca164aef952b7d252bc1f68241e33 /target/linux/generic/files/drivers/net | |
parent | 6bddd29b644586fcd0d0dbe8ccbe3a7306bd9c31 (diff) | |
download | master-187ad058-e67db2d2a3cc35d90139e7d6bfe83cceb95f61a0.tar.gz master-187ad058-e67db2d2a3cc35d90139e7d6bfe83cceb95f61a0.tar.bz2 master-187ad058-e67db2d2a3cc35d90139e7d6bfe83cceb95f61a0.zip |
generic: rtl8366s: allow initial register values to be passed via platform_data
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25120 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-rw-r--r-- | target/linux/generic/files/drivers/net/phy/rtl8366s.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/rtl8366s.c b/target/linux/generic/files/drivers/net/phy/rtl8366s.c index 3b7fcce329..7e72164131 100644 --- a/target/linux/generic/files/drivers/net/phy/rtl8366s.c +++ b/target/linux/generic/files/drivers/net/phy/rtl8366s.c @@ -251,8 +251,19 @@ static int rtl8366s_reset_chip(struct rtl8366_smi *smi) static int rtl8366s_hw_init(struct rtl8366_smi *smi) { + struct rtl8366s_platform_data *pdata; int err; + pdata = smi->parent->platform_data; + if (pdata->num_initvals && pdata->initvals) { + unsigned i; + + dev_info(smi->parent, "applying initvals\n"); + for (i = 0; i < pdata->num_initvals; i++) + REG_WR(smi, pdata->initvals[i].reg, + pdata->initvals[i].val); + } + /* set maximum packet length to 1536 bytes */ REG_RMW(smi, RTL8366S_SGCR, RTL8366S_SGCR_MAX_LENGTH_MASK, RTL8366S_SGCR_MAX_LENGTH_1536); |