From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
To: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Cc: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
Allan.Nielsen-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org
Subject: Re: [PATCH v2 net-next] net: phy: Add LED mode driver for Microsemi PHYs.
Date: Tue, 7 Feb 2017 14:47:38 +0530 [thread overview]
Message-ID: <20170207091737.GA24582@microsemi.com> (raw)
In-Reply-To: <20170201135555.GE4967-g2DYL2Zd6BY@public.gmane.org>
Hi Andrew,
Thank you for given review comments.
On Wed, Feb 01, 2017 at 02:55:55PM +0100, Andrew Lunn wrote:
> EXTERNAL EMAIL
>
>
> On Wed, Feb 01, 2017 at 06:23:46PM +0530, Raju Lakkaraju wrote:
> > From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
> >
> > LED Mode:
> > + "include/dt-bindings/net/mscc-phy-vsc8531.h".
> > + Default value is 1.
>
> 1 is not very useful. What does it mean? How about:
>
> Default value is LINK_1000_ACTIVITY (1)
>
Accepted.
> > +- vsc8531,led-1-mode : LED mode. Specify how the LED[1] should behave.
> > + Allowed values are define in
> > + int rc;
> > +
> > + if (!of_node)
> > + return -ENODEV;
> > +
> > + rc = of_property_read_u8(of_node, led, &led_mode);
> > + if ((rc == 0) &&
> > + ((led_mode > 15) || (led_mode == 7) || (led_mode == 11))) {
> > + phydev_err(phydev, "DT %s invalid\n", led);
> > + return -EINVAL;
> > + } else if (rc == -EINVAL) {
> > + return default_mode;
> > + }
>
> I don't think you understood my comment about of_property_read_u8()
> not modifying &led_mode on error. Please read the comment again, and
> simplify this.
>
If i understand your comment correctly, in case of return value -EINVAL, it
should return error. Am i correct?
i would perfer in case of of_property_read_u8( ) returns -EINVAL,
i would like to configure LEDs with default state. Shall i configure?
Still if you think i did not understand your comments, please write little
bit more.
> > +
> > + return led_mode;
> > +}
> > +
> > #else
> > static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
> > {
> > return 0;
> > }
> > +
> > +static int vsc85xx_dt_led_mode_get(struct phy_device *phydev,
> > + char *led,
> > + u8 default_mode)
> > +{
> > + return default_mode;
> > +}
> > #endif /* CONFIG_OF_MDIO */
> >
> > static int vsc85xx_edge_rate_cntl_set(struct phy_device *phydev, u8 edge_rate)
> > @@ -499,6 +562,13 @@ static int vsc85xx_config_init(struct phy_device *phydev)
> > if (rc)
> > return rc;
> >
> > + rc = vsc85xx_led_cntl_set(phydev, 1, vsc8531->led_1_mode);
> > + if (rc)
> > + return rc;
>
> Blank line please.
>
Accepted.
> > + rc = vsc85xx_led_cntl_set(phydev, 0, vsc8531->led_0_mode);
> > + if (rc)
> > + return rc;
> > +
> > rc = genphy_config_init(phydev);
> >
> > return rc;
> > @@ -555,8 +625,9 @@ static int vsc85xx_read_status(struct phy_device *phydev)
> > + led_mode = vsc85xx_dt_led_mode_get(phydev, "vsc8531,led-0-mode",
> > + LINK_1000_ACTIVITY);
> > + if (led_mode < 0)
> > + return led_mode;
> > + vsc8531->led_0_mode = led_mode;
>
> Blank line.
>
Accepted.
> > + led_mode = vsc85xx_dt_led_mode_get(phydev, "vsc8531,led-1-mode",
> > + LINK_100_ACTIVITY);
> > +#define AUTONEG_FAULT 12
> > +#define SERIAL_MODE 13
> > +#define FORCE_LED_OFF 14
> > +#define FORCE_LED_ON 15
>
> You should prefix these with VSC8531_. Otherwise there is potential to
> have issues with two different PHYs defining some of these frequently
> used macros.
>
Accepted.
> Andrew
---
Thanks,
Raju.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
To: Andrew Lunn <andrew-g2DYL2Zd6BY@public.gmane.org>
Cc: <netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
<f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
<Allan.Nielsen-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
Subject: Re: [PATCH v2 net-next] net: phy: Add LED mode driver for Microsemi PHYs.
Date: Tue, 7 Feb 2017 14:47:38 +0530 [thread overview]
Message-ID: <20170207091737.GA24582@microsemi.com> (raw)
In-Reply-To: <20170201135555.GE4967-g2DYL2Zd6BY@public.gmane.org>
Hi Andrew,
Thank you for given review comments.
On Wed, Feb 01, 2017 at 02:55:55PM +0100, Andrew Lunn wrote:
> EXTERNAL EMAIL
>
>
> On Wed, Feb 01, 2017 at 06:23:46PM +0530, Raju Lakkaraju wrote:
> > From: Raju Lakkaraju <Raju.Lakkaraju-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
> >
> > LED Mode:
> > + "include/dt-bindings/net/mscc-phy-vsc8531.h".
> > + Default value is 1.
>
> 1 is not very useful. What does it mean? How about:
>
> Default value is LINK_1000_ACTIVITY (1)
>
Accepted.
> > +- vsc8531,led-1-mode : LED mode. Specify how the LED[1] should behave.
> > + Allowed values are define in
> > + int rc;
> > +
> > + if (!of_node)
> > + return -ENODEV;
> > +
> > + rc = of_property_read_u8(of_node, led, &led_mode);
> > + if ((rc == 0) &&
> > + ((led_mode > 15) || (led_mode == 7) || (led_mode == 11))) {
> > + phydev_err(phydev, "DT %s invalid\n", led);
> > + return -EINVAL;
> > + } else if (rc == -EINVAL) {
> > + return default_mode;
> > + }
>
> I don't think you understood my comment about of_property_read_u8()
> not modifying &led_mode on error. Please read the comment again, and
> simplify this.
>
If i understand your comment correctly, in case of return value -EINVAL, it
should return error. Am i correct?
i would perfer in case of of_property_read_u8( ) returns -EINVAL,
i would like to configure LEDs with default state. Shall i configure?
Still if you think i did not understand your comments, please write little
bit more.
> > +
> > + return led_mode;
> > +}
> > +
> > #else
> > static int vsc85xx_edge_rate_magic_get(struct phy_device *phydev)
> > {
> > return 0;
> > }
> > +
> > +static int vsc85xx_dt_led_mode_get(struct phy_device *phydev,
> > + char *led,
> > + u8 default_mode)
> > +{
> > + return default_mode;
> > +}
> > #endif /* CONFIG_OF_MDIO */
> >
> > static int vsc85xx_edge_rate_cntl_set(struct phy_device *phydev, u8 edge_rate)
> > @@ -499,6 +562,13 @@ static int vsc85xx_config_init(struct phy_device *phydev)
> > if (rc)
> > return rc;
> >
> > + rc = vsc85xx_led_cntl_set(phydev, 1, vsc8531->led_1_mode);
> > + if (rc)
> > + return rc;
>
> Blank line please.
>
Accepted.
> > + rc = vsc85xx_led_cntl_set(phydev, 0, vsc8531->led_0_mode);
> > + if (rc)
> > + return rc;
> > +
> > rc = genphy_config_init(phydev);
> >
> > return rc;
> > @@ -555,8 +625,9 @@ static int vsc85xx_read_status(struct phy_device *phydev)
> > + led_mode = vsc85xx_dt_led_mode_get(phydev, "vsc8531,led-0-mode",
> > + LINK_1000_ACTIVITY);
> > + if (led_mode < 0)
> > + return led_mode;
> > + vsc8531->led_0_mode = led_mode;
>
> Blank line.
>
Accepted.
> > + led_mode = vsc85xx_dt_led_mode_get(phydev, "vsc8531,led-1-mode",
> > + LINK_100_ACTIVITY);
> > +#define AUTONEG_FAULT 12
> > +#define SERIAL_MODE 13
> > +#define FORCE_LED_OFF 14
> > +#define FORCE_LED_ON 15
>
> You should prefix these with VSC8531_. Otherwise there is potential to
> have issues with two different PHYs defining some of these frequently
> used macros.
>
Accepted.
> Andrew
---
Thanks,
Raju.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2017-02-07 9:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-01 12:53 [PATCH v2 net-next] net: phy: Add LED mode driver for Microsemi Raju Lakkaraju
2017-02-01 12:53 ` Raju Lakkaraju
2017-02-01 12:53 ` [PATCH v2 net-next] net: phy: Add LED mode driver for Microsemi PHYs Raju Lakkaraju
2017-02-01 12:53 ` Raju Lakkaraju
2017-02-01 13:55 ` Andrew Lunn
[not found] ` <20170201135555.GE4967-g2DYL2Zd6BY@public.gmane.org>
2017-02-07 9:17 ` Raju Lakkaraju [this message]
2017-02-07 9:17 ` Raju Lakkaraju
[not found] ` <20170207091737.GA24582-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
2017-02-07 13:12 ` Andrew Lunn
[not found] ` <1485953626-25780-2-git-send-email-Raju.Lakkaraju-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org>
2017-02-01 18:02 ` Rob Herring
2017-02-01 18:04 ` [PATCH v2 net-next] net: phy: Add LED mode driver for Microsemi Florian Fainelli
2017-02-07 13:39 ` Raju Lakkaraju
2017-02-07 13:39 ` Raju Lakkaraju
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=20170207091737.GA24582@microsemi.com \
--to=raju.lakkaraju-dzo6w/ezyo2tg0buxcxiua@public.gmane.org \
--cc=Allan.Nielsen-dzo6w/eZyo2tG0bUXCXiUA@public.gmane.org \
--cc=andrew-g2DYL2Zd6BY@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
/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.