From: Simon Horman <horms@kernel.org>
To: Dimitri Fedrau <dima.fedrau@gmail.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
Heiner Kallweit <hkallweit1@gmail.com>,
Russell King <linux@armlinux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next] net: phy: dp83822: Add support for PHY LEDs on DP83822
Date: Tue, 17 Dec 2024 16:32:08 +0000 [thread overview]
Message-ID: <20241217163208.GT780307@kernel.org> (raw)
In-Reply-To: <20241217-dp83822-leds-v1-1-800b24461013@gmail.com>
On Tue, Dec 17, 2024 at 10:16:03AM +0100, Dimitri Fedrau wrote:
> The DP83822 supports up to three configurable Light Emitting Diode (LED)
> pins: LED_0, LED_1 (GPIO1), COL (GPIO2) and RX_D3 (GPIO3). Several
> functions can be multiplexed onto the LEDs for different modes of
> operation. LED_0 and COL (GPIO2) use the MLED function. MLED can be routed
> to only one of these two pins at a time. Add minimal LED controller driver
> supporting the most common uses with the 'netdev' trigger.
>
> Signed-off-by: Dimitri Fedrau <dima.fedrau@gmail.com>
> ---
> drivers/net/phy/dp83822.c | 271 +++++++++++++++++++++++++++++++++++++++++++++-
> 1 file changed, 269 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c
...
> +static int dp83822_led_hw_control_set(struct phy_device *phydev, u8 index,
> + unsigned long rules)
> +{
> + int mode;
> +
> + mode = dp83822_led_mode(index, rules);
> + if (mode < 0)
> + return mode;
> +
> + if (index == DP83822_LED_INDEX_LED_0 || index == DP83822_LED_INDEX_COL_GPIO2)
> + return phy_modify_mmd(phydev, MDIO_MMD_VEND2,
> + MII_DP83822_MLEDCR, DP83822_MLEDCR_CFG,
> + FIELD_PREP(DP83822_MLEDCR_CFG, mode));
...
> +}
> +
> +static int dp83822_led_hw_control_get(struct phy_device *phydev, u8 index,
> + unsigned long *rules)
> +{
> + int val;
> +
> + if (index == DP83822_LED_INDEX_LED_0 || DP83822_LED_INDEX_COL_GPIO2) {
Hi Dimitri,
As per the condition near the top of dp83822_led_hw_control_set(), should
this be:
if (index == DP83822_LED_INDEX_LED_0 ||
index == DP83822_LED_INDEX_COL_GPIO2) {
Flagged by W=1 + -Wno-error build with clang-19.
drivers/net/phy/dp83822.c:1029:39: note: use '|' for a bitwise operation
1029 | if (index == DP83822_LED_INDEX_LED_0 || DP83822_LED_INDEX_COL_GPIO2) {
| ^~
|
...
next prev parent reply other threads:[~2024-12-17 16:32 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-17 9:16 [PATCH net-next] net: phy: dp83822: Add support for PHY LEDs on DP83822 Dimitri Fedrau
2024-12-17 16:32 ` Simon Horman [this message]
2024-12-17 17:54 ` Dimitri Fedrau
2024-12-17 17:13 ` Andrew Lunn
2024-12-17 17:59 ` Dimitri Fedrau
2024-12-18 17:13 ` Andrew Lunn
2024-12-18 8:54 ` Dimitri Fedrau
2024-12-18 17:16 ` Andrew Lunn
2024-12-18 18:17 ` Dimitri Fedrau
2024-12-18 20:19 ` Andrew Lunn
2024-12-18 20:44 ` Dimitri Fedrau
2024-12-18 8:32 ` kernel test robot
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=20241217163208.GT780307@kernel.org \
--to=horms@kernel.org \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=dima.fedrau@gmail.com \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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;
as well as URLs for NNTP newsgroup(s).