From: Daniel Golle <daniel@makrotopia.org>
To: "Lucien.Jheng" <lucienx123@gmail.com>
Cc: linux-clk@vger.kernel.org, andrew@lunn.ch, hkallweit1@gmail.com,
linux@armlinux.org.uk, kuba@kernel.org, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, ericwouds@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
joseph.lin@airoha.com, wenshin.chung@airoha.com
Subject: Re: [PATCH v4 net-next PATCH 1/1] net: phy: air_en8811h: Add clk provider for CKO pin
Date: Mon, 17 Mar 2025 18:37:54 +0000 [thread overview]
Message-ID: <Z9hsAmiD9sZ_NAR-@makrotopia.org> (raw)
In-Reply-To: <20250317143111.28824-2-lucienX123@gmail.com>
On Mon, Mar 17, 2025 at 10:31:11PM +0800, Lucien.Jheng wrote:
> EN8811H outputs 25MHz or 50MHz clocks on CKO, selected by GPIO3.
> CKO clock activates on power-up and continues through md32 firmware loading.
Maybe add here:
"Implement clk provider driver so we can disable the clock output in case
it isn't needed, which also helps to reduce EMF noise"
Ie. the description you had was fine and good to have, just the lines had to
be shorter (ie. just insert linebreaks at 70~75 chars).
See more comments inline below:
> ...
> @@ -806,6 +817,84 @@ static int en8811h_led_hw_is_supported(struct phy_device *phydev, u8 index,
> return 0;
> };
>
> +static unsigned long en8811h_recalc_rate(struct clk_hw *hw, unsigned long parent)
calling this en8811h_clk_recalc_rate() would be better imho.
> +{
> + struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> + struct phy_device *phydev = priv->phydev;
> + u32 pbus_value;
> + int ret;
> +
> + ret = air_buckpbus_reg_read(phydev, EN8811H_HWTRAP1, &pbus_value);
> + if (ret < 0)
> + return ret;
> +
> + return (pbus_value & EN8811H_HWTRAP1_CKO) ? 50000000 : 25000000;
> +}
> +
> +static int en8811h_enable(struct clk_hw *hw)
call this en8811h_clk_enable()
> +{
> + struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> + struct phy_device *phydev = priv->phydev;
> +
> + return air_buckpbus_reg_modify(phydev, EN8811H_CLK_CGM,
> + EN8811H_CLK_CGM_CKO, EN8811H_CLK_CGM_CKO);
> +}
> +
> +static void en8811h_disable(struct clk_hw *hw)
call this en8811h_clk_disable()
> +{
> + struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> + struct phy_device *phydev = priv->phydev;
> +
> + air_buckpbus_reg_modify(phydev, EN8811H_CLK_CGM,
> + EN8811H_CLK_CGM_CKO, 0);
> +}
> +
> +static int en8811h_is_enabled(struct clk_hw *hw)
call this en8811h_clk_is_enabled()
prev parent reply other threads:[~2025-03-17 18:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-17 14:31 [PATCH v4 net-next 0/1 ] net: phy: air_en8811h: Add clk provider for CKO pin Lucien.Jheng
2025-03-17 14:31 ` [PATCH v4 net-next PATCH 1/1] " Lucien.Jheng
2025-03-17 18:37 ` Daniel Golle [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z9hsAmiD9sZ_NAR-@makrotopia.org \
--to=daniel@makrotopia.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=ericwouds@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=joseph.lin@airoha.com \
--cc=kuba@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=lucienx123@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=wenshin.chung@airoha.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox