summaryrefslogtreecommitdiff
path: root/target/linux/generic/files/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2011-01-26 20:35:46 +0000
committerGabor Juhos <juhosg@openwrt.org>2011-01-26 20:35:46 +0000
commit4f1f672d9e5c0fb26f3d54f31ae76b93580efcc0 (patch)
treee95b13fd719d6b3c1697d19058ce8f9615d3f79e /target/linux/generic/files/drivers
parent800fbf32d209a6009e30aedf2fca87b8e70fb875 (diff)
downloadmtk-20170518-4f1f672d9e5c0fb26f3d54f31ae76b93580efcc0.zip
mtk-20170518-4f1f672d9e5c0fb26f3d54f31ae76b93580efcc0.tar.gz
mtk-20170518-4f1f672d9e5c0fb26f3d54f31ae76b93580efcc0.tar.bz2
generic: rtl8366s: allow initial register values to be passed via platform_data
SVN-Revision: 25120
Diffstat (limited to 'target/linux/generic/files/drivers')
-rw-r--r--target/linux/generic/files/drivers/net/phy/rtl8366s.c11
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 3b7fcce..7e72164 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);