1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

backfire: generic: rtl8366: introduce rtl8366_smi_rmwr function (backport of r21919)

git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@21938 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2010-06-26 19:54:05 +00:00
parent 7375c5edf1
commit bee4b83a3b
4 changed files with 75 additions and 133 deletions

View File

@@ -266,6 +266,21 @@ int rtl8366_smi_write_reg(struct rtl8366_smi *smi, u32 addr, u32 data)
}
EXPORT_SYMBOL_GPL(rtl8366_smi_write_reg);
int rtl8366_smi_rmwr(struct rtl8366_smi *smi, u32 addr, u32 mask, u32 data)
{
u32 t;
int err;
err = rtl8366_smi_read_reg(smi, addr, &t);
if (err)
return err;
err = rtl8366_smi_write_reg(smi, addr, (t & ~mask) | data);
return err;
}
EXPORT_SYMBOL_GPL(rtl8366_smi_rmwr);
static int rtl8366_smi_mii_init(struct rtl8366_smi *smi)
{
int ret;