Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 64cd99da authored by Álvaro Fernández Rojas's avatar Álvaro Fernández Rojas Committed by Greg Kroah-Hartman
Browse files

net: dsa: b53: mmap: add phy ops



[ Upstream commit 45977e58ce65ed0459edc9a0466d9dfea09463f5 ]

Implement phy_read16() and phy_write16() ops for B53 MMAP to avoid accessing
B53_PORT_MII_PAGE registers which hangs the device.
This access should be done through the MDIO Mux bus controller.

Signed-off-by: default avatarÁlvaro Fernández Rojas <noltari@gmail.com>
Acked-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 89dcf0dd
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -215,6 +215,18 @@ static int b53_mmap_write64(struct b53_device *dev, u8 page, u8 reg,
	return 0;
}

static int b53_mmap_phy_read16(struct b53_device *dev, int addr, int reg,
			       u16 *value)
{
	return -EIO;
}

static int b53_mmap_phy_write16(struct b53_device *dev, int addr, int reg,
				u16 value)
{
	return -EIO;
}

static const struct b53_io_ops b53_mmap_ops = {
	.read8 = b53_mmap_read8,
	.read16 = b53_mmap_read16,
@@ -226,6 +238,8 @@ static const struct b53_io_ops b53_mmap_ops = {
	.write32 = b53_mmap_write32,
	.write48 = b53_mmap_write48,
	.write64 = b53_mmap_write64,
	.phy_read16 = b53_mmap_phy_read16,
	.phy_write16 = b53_mmap_phy_write16,
};

static int b53_mmap_probe(struct platform_device *pdev)