[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201217142322.GD2981994@lunn.ch>
Date: Thu, 17 Dec 2020 15:23:22 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Divya Koppera <Divya.Koppera@...rochip.com>
Cc: hkallweit1@...il.com, linux@...linux.org.uk, davem@...emloft.net,
kuba@...nel.org, marex@...x.de, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org, richardcochran@...il.com,
UNGLinuxDriver@...rochip.com
Subject: Re: [PATCH v4 net-next 2/2] net: phy: mchp: Add 1588 support for
LAN8814 Quad PHY
> +static int lan8814_read_page_reg(struct phy_device *phydev,
> + int page, u32 addr)
> +{
> + u32 data;
> +
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_CONTROL, page);
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_ADDRESS_DATA, addr);
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_CONTROL, (page | 0x4000));
> + data = phy_read(phydev, KSZ_EXT_PAGE_ACCESS_ADDRESS_DATA);
> +
> + return data;
> +}
> +
> +static int lan8814_write_page_reg(struct phy_device *phydev,
> + int page, u16 addr, u16 val)
> +{
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_CONTROL, page);
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_ADDRESS_DATA, addr);
> + phy_write(phydev, KSZ_EXT_PAGE_ACCESS_CONTROL, (page | 0x4000));
> + val = phy_write(phydev, KSZ_EXT_PAGE_ACCESS_ADDRESS_DATA, val);
> + if (val != 0) {
> + phydev_err(phydev, "Error: phy_write has returned error %d\n",
> + val);
> + return val;
> + }
> + return 0;
> +}
You seem to of ignored my comment about using phy_read_mmd() and
phy_write_mmd()? If i'm wrong and these will not work, please say
so. Don't just ignore comments.
Andrew
Powered by blists - more mailing lists