From: Andrew Lunn <andrew@lunn.ch>
To: "Lucien.Jheng" <lucienx123@gmail.com>
Cc: linux-clk@vger.kernel.org, hkallweit1@gmail.com,
linux@armlinux.org.uk, kuba@kernel.org, davem@davemloft.net,
edumazet@google.com, pabeni@redhat.com, daniel@makrotopia.org,
ericwouds@gmail.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org, joseph.lin@airoha.com,
wenshin.chung@airoha.com, lucien.jheng@airoha.com
Subject: Re: [PATCH v7 net-next PATCH 1/1] net: phy: air_en8811h: Add clk provider for CKO pin
Date: Tue, 8 Apr 2025 17:18:46 +0200 [thread overview]
Message-ID: <29710c4e-b106-4922-8278-c19159c16756@lunn.ch> (raw)
In-Reply-To: <20250408150118.54478-1-lucienx123@gmail.com>
On Tue, Apr 08, 2025 at 11:01:18PM +0800, Lucien.Jheng wrote:
> EN8811H outputs 25MHz or 50MHz clocks on CKO, selected by GPIO3.
> CKO clock operates continuously from power-up through md32 loading.
> Implement clk provider driver so we can disable the clock output in case
> it isn't needed, which also helps to reduce EMF noise
>
> Signed-off-by: Lucien.Jheng <lucienx123@gmail.com>
> #include <linux/property.h>
> #include <linux/wordpart.h>
> #include <linux/unaligned.h>
> +#include <linux/clk-provider.h>
We try to keep thinks sorted in order. The includes are not quite
correct, but still clk-provider.h should be first.
> #define EN8811H_PHY_ID 0x03a2a411
>
> @@ -112,6 +113,11 @@
> #define EN8811H_POLARITY_TX_NORMAL BIT(0)
> #define EN8811H_POLARITY_RX_REVERSE BIT(1)
>
> +#define EN8811H_CLK_CGM 0xcf958
> +#define EN8811H_CLK_CGM_CKO BIT(26)
> +#define EN8811H_HWTRAP1 0xcf914
> +#define EN8811H_HWTRAP1_CKO BIT(12)
> +
> #define EN8811H_GPIO_OUTPUT 0xcf8b8
> #define EN8811H_GPIO_OUTPUT_345 (BIT(3) | BIT(4) | BIT(5))
and registers should be in order, so 0xcf958 goes after 0xcf8b8.
> +static int en8811h_clk_is_enabled(struct clk_hw *hw)
> +{
> + struct en8811h_priv *priv = clk_hw_to_en8811h_priv(hw);
> + struct phy_device *phydev = priv->phydev;
> + int ret;
> + u32 pbus_value;
Reverse Christmas tree please. Sort them longest to shortest.
Andrew
prev parent reply other threads:[~2025-04-08 15:19 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-08 15:01 Lucien.Jheng
2025-04-08 15:18 ` Andrew Lunn [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=29710c4e-b106-4922-8278-c19159c16756@lunn.ch \
--to=andrew@lunn.ch \
--cc=daniel@makrotopia.org \
--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=lucien.jheng@airoha.com \
--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
all inboxes | Powered by JetHome®