From: "SkyLake Huang (黃啟澤)" <SkyLake.Huang@mediatek.com>
To: "andrew@lunn.ch" <andrew@lunn.ch>
Cc: "linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-mediatek@lists.infradead.org"
<linux-mediatek@lists.infradead.org>,
"linux@armlinux.org.uk" <linux@armlinux.org.uk>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"edumazet@google.com" <edumazet@google.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"dqfext@gmail.com" <dqfext@gmail.com>,
"Steven Liu (劉人豪)" <steven.liu@mediatek.com>,
"matthias.bgg@gmail.com" <matthias.bgg@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"hkallweit1@gmail.com" <hkallweit1@gmail.com>,
"daniel@makrotopia.org" <daniel@makrotopia.org>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>
Subject: Re: [PATCH net-next 3/9] net: phy: mediatek: Move LED helper functions into mtk phy lib
Date: Mon, 7 Oct 2024 04:30:08 +0000 [thread overview]
Message-ID: <3f1c73ec57aefa2803df0c32c78dcdc41fed4126.camel@mediatek.com> (raw)
In-Reply-To: <afd441fc-7712-4905-83e2-e35e613df64a@lunn.ch>
On Sun, 2024-10-06 at 23:28 +0200, Andrew Lunn wrote:
>
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> > static int mt798x_phy_led_blink_set(struct phy_device *phydev, u8
> index,
> > unsigned long *delay_on,
> > unsigned long *delay_off)
> > {
> > +struct mtk_socphy_priv *priv = phydev->priv;
> > bool blinking = false;
> > int err = 0;
> >
> > -if (index > 1)
> > -return -EINVAL;
> > -
> > -if (delay_on && delay_off && (*delay_on > 0) && (*delay_off > 0))
> {
> > -blinking = true;
> > -*delay_on = 50;
> > -*delay_off = 50;
> > -}
> > +err = mtk_phy_led_num_dly_cfg(index, delay_on, delay_off,
> &blinking);
> > +if (err < 0)
> > +return err;
> >
> > -err = mt798x_phy_hw_led_blink_set(phydev, index, blinking);
> > +err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state,
> > + blinking);
> > if (err)
> > return err;
> >
> > -return mt798x_phy_hw_led_on_set(phydev, index, false);
> > +return mtk_phy_hw_led_on_set(phydev, index, &priv->led_state,
> > + MTK_GPHY_LED_ON_MASK, false);
> > }
> >
> > static int mt798x_phy_led_brightness_set(struct phy_device
> *phydev,
> > u8 index, enum led_brightness value)
> > {
> > +struct mtk_socphy_priv *priv = phydev->priv;
> > int err;
> >
> > -err = mt798x_phy_hw_led_blink_set(phydev, index, false);
> > +err = mtk_phy_hw_led_blink_set(phydev, index, &priv->led_state,
> false);
> > if (err)
> > return err;
>
> If this is just moving code into a shared helper library, why is priv
> now needed, when it was not before?
>
> Maybe this needs splitting into two patches, to help explain this
> change.
>
> Andrew
Although this is just "moving code", we need this priv to do some
modification for mt798x_phy_hw_led_blink_set() so that we can move it
to mtk-phy-lib properly.
I was trying to split this patch into two but I'm afraid that will make
this patchset more complex. Is it okay that I add more explanation in
commit message? like:
This patch creates mtk-phy-lib.c & mtk-phy.h and integrates mtk-ge-
soc.c's LED helper functions so that we can use those helper functions
in other MTK's ethernet phy driver.
We need private data passed to
- mtk_phy_hw_led_on_set()
- mtk_phy_hw_led_blink_set()
- mtk_phy_led_hw_ctrl_get()
- mtk_phy_led_hw_ctrl_set()
to make sure these helper functions can be used in both mtk-ge-soc.c &
mtk-ge.c.
BRs,
Sky
next prev parent reply other threads:[~2024-10-07 4:30 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-04 10:24 [PATCH net-next 0/9] net: phy: mediatek: Introduce mtk-phy-lib which integrates common part of MediaTek's internal ethernet PHYs Sky Huang
2024-10-04 10:24 ` [PATCH net-next 1/9] net: phy: mediatek: Re-organize MediaTek ethernet phy drivers Sky Huang
2024-10-06 21:19 ` Andrew Lunn
2024-10-07 6:38 ` kernel test robot
2024-10-04 10:24 ` [PATCH net-next 2/9] net: phy: mediatek: Fix spelling errors and rearrange variables Sky Huang
2024-10-06 21:20 ` Andrew Lunn
2024-10-04 10:24 ` [PATCH net-next 3/9] net: phy: mediatek: Move LED helper functions into mtk phy lib Sky Huang
2024-10-06 21:28 ` Andrew Lunn
2024-10-07 4:30 ` SkyLake Huang (黃啟澤) [this message]
2024-10-07 12:50 ` Andrew Lunn
2024-10-04 10:24 ` [PATCH net-next 4/9] net: phy: mediatek: Improve readability of mtk-phy-lib.c's mtk_phy_led_hw_ctrl_set() Sky Huang
2024-10-06 21:29 ` Andrew Lunn
2024-10-04 10:24 ` [PATCH net-next 5/9] net: phy: mediatek: Integrate read/write page helper functions Sky Huang
2024-10-06 21:29 ` Andrew Lunn
2024-10-04 10:24 ` [PATCH net-next 6/9] net: phy: mediatek: Hook LED helper functions in mtk-ge.c Sky Huang
2024-10-06 21:32 ` Andrew Lunn
2024-10-07 10:43 ` SkyLake Huang (黃啟澤)
2024-10-04 10:24 ` [PATCH net-next 7/9] net: phy: mediatek: add MT7530 & MT7531's PHY ID macros Sky Huang
2024-10-06 21:32 ` Andrew Lunn
2024-10-04 10:24 ` [PATCH net-next 8/9] net: phy: mediatek: Change mtk-ge-soc.c line wrapping Sky Huang
2024-10-04 12:07 ` Russell King (Oracle)
2024-10-07 10:52 ` SkyLake Huang (黃啟澤)
2024-10-04 10:24 ` [PATCH net-next 9/9] net: phy: mediatek: Add token ring access helper functions in mtk-phy-lib Sky Huang
2024-10-04 22:43 ` [PATCH net-next 0/9] net: phy: mediatek: Introduce mtk-phy-lib which integrates common part of MediaTek's internal ethernet PHYs Jakub Kicinski
2024-10-07 10:59 ` SkyLake Huang (黃啟澤)
2024-10-09 1:48 ` Daniel Golle
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=3f1c73ec57aefa2803df0c32c78dcdc41fed4126.camel@mediatek.com \
--to=skylake.huang@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux@armlinux.org.uk \
--cc=matthias.bgg@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=steven.liu@mediatek.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
Powered by JetHome