From: Simon Horman <simon.horman@corigine.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: netdev <netdev@vger.kernel.org>,
ansuelsmth@gmail.com, Russell King <rmk+kernel@armlinux.org.uk>,
Heiner Kallweit <hkallweit1@gmail.com>
Subject: Re: [PATCH net-next v0 2/3] net: phy: phy_device: Call into the PHY driver to set LED offload
Date: Mon, 19 Jun 2023 16:18:29 +0200 [thread overview]
Message-ID: <ZJBjtWTtDqsyWPXE@corigine.com> (raw)
In-Reply-To: <20230618173937.4016322-2-andrew@lunn.ch>
On Sun, Jun 18, 2023 at 07:39:36PM +0200, Andrew Lunn wrote:
> Linux LEDs can be requested to perform hardware accelerated blinking
> to indicate link, RX, TX etc. Pass the rules for blinking to the PHY
> driver, if it implements the ops needed to determine if a given
> pattern can be offloaded, to offload it, and what the current offload
> is. Additionally implement the op needed to get what device the LED is
> for.
>
> Signed-off-by: Andrew Lunn <andrew@lunn.ch>
...
> diff --git a/include/linux/phy.h b/include/linux/phy.h
> index 11c1e91563d4..1db63fb905c5 100644
> --- a/include/linux/phy.h
> +++ b/include/linux/phy.h
> @@ -1104,6 +1104,20 @@ struct phy_driver {
> int (*led_blink_set)(struct phy_device *dev, u8 index,
> unsigned long *delay_on,
> unsigned long *delay_off);
> + /* Can the HW support the given rules. Return 0 if yes,
> + * -EOPNOTSUPP if not, or an error code.
> + */
> + int (*led_hw_is_supported)(struct phy_device *dev, u8 index,
> + unsigned long rules);
> + /* Set the HW to control the LED as described by rules. */
> + int (*led_hw_control_set)(struct phy_device *dev, u8 index,
> + unsigned long rules);
> + /* Get the rules used to describe how the HW is currently
> + * configure.
> + */
> + int (*led_hw_control_get)(struct phy_device *dev, u8 index,
> + unsigned long *rules);
> +
Hi Andrew,
for consistency it would be nice if the comments for
the new members above was in kernel doc format.
> };
> #define to_phy_driver(d) container_of(to_mdio_common_driver(d), \
> struct phy_driver, mdiodrv)
next prev parent reply other threads:[~2023-06-19 14:18 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-18 17:39 [PATCH net-next v0 1/3] led: trig: netdev: Fix requesting offload device Andrew Lunn
2023-06-18 17:39 ` [PATCH net-next v0 2/3] net: phy: phy_device: Call into the PHY driver to set LED offload Andrew Lunn
2023-06-19 14:18 ` Simon Horman [this message]
2023-06-19 18:11 ` Russell King (Oracle)
2023-06-19 20:34 ` Simon Horman
2023-06-19 21:27 ` Andrew Lunn
2023-06-18 17:39 ` [PATCH net-next v0 3/3] net: phy: marvell: Add support for offloading LED blinking Andrew Lunn
2023-06-18 19:15 ` Russell King (Oracle)
2023-06-18 20:28 ` Andrew Lunn
2023-06-18 17:50 ` [PATCH net-next v0 1/3] led: trig: netdev: Fix requesting offload device Andrew Lunn
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=ZJBjtWTtDqsyWPXE@corigine.com \
--to=simon.horman@corigine.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@armlinux.org.uk \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.