[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241106155458.3552cdda@fedora.home>
Date: Wed, 6 Nov 2024 15:54:58 +0100
From: Maxime Chevallier <maxime.chevallier@...tlin.com>
To: Christian Marangi <ansuelsmth@...il.com>
Cc: Andrew Lunn <andrew@...n.ch>, Florian Fainelli <f.fainelli@...il.com>,
Vladimir Oltean <olteanv@...il.com>, "David S. Miller"
<davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, Jakub Kicinski
<kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Rob Herring
<robh@...nel.org>, Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley
<conor+dt@...nel.org>, Heiner Kallweit <hkallweit1@...il.com>, Russell King
<linux@...linux.org.uk>, Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
linux-arm-kernel@...ts.infradead.org, linux-mediatek@...ts.infradead.org,
netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, upstream@...oha.com
Subject: Re: [net-next PATCH v3 3/3] net: phy: Add Airoha AN8855 Internal
Switch Gigabit PHY
Hello Christian,
On Wed, 6 Nov 2024 13:22:38 +0100
Christian Marangi <ansuelsmth@...il.com> wrote:
> Add support for Airoha AN8855 Internal Switch Gigabit PHY.
>
> This is a simple PHY driver to configure and calibrate the PHY for the
> AN8855 Switch with the use of NVMEM cells.
>
> Signed-off-by: Christian Marangi <ansuelsmth@...il.com>
[...]
> +static int an8855_get_downshift(struct phy_device *phydev, u8 *data)
> +{
> + int saved_page;
> + int val;
> + int ret;
> +
> + saved_page = phy_select_page(phydev, AN8855_PHY_PAGE_EXTENDED_1);
> + if (saved_page >= 0)
> + val = __phy_read(phydev, AN8855_PHY_EXT_REG_14);
> + ret = phy_restore_page(phydev, saved_page, val);
I think this can be replaced with phy_read_paged()
[...]
> +static int an8855_set_downshift(struct phy_device *phydev, u8 cnt)
> +{
> + int saved_page;
> + int ret;
> +
> + saved_page = phy_select_page(phydev, AN8855_PHY_PAGE_EXTENDED_1);
> + if (saved_page >= 0) {
> + if (cnt != DOWNSHIFT_DEV_DISABLE)
> + ret = __phy_set_bits(phydev, AN8855_PHY_EXT_REG_14,
> + AN8855_PHY_EN_DOWN_SHFIT);
> + else
> + ret = __phy_clear_bits(phydev, AN8855_PHY_EXT_REG_14,
> + AN8855_PHY_EN_DOWN_SHFIT);
> + }
> +
> + return phy_restore_page(phydev, saved_page, ret);
And this by phy_modify_paged() :)
Thanks,
Maxime
Powered by blists - more mailing lists