* [PATCH net-next v2 0/2] net: phy: qcom: add qca808x support @ 2026-10-15 14:38 Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 1/2] dt-bindings: net: qca,qca808x: Add regulator properties Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management Alex Elder 0 siblings, 2 replies; 8+ messages in thread From: Alex Elder @ 2026-10-15 14:38 UTC (permalink / raw) To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux Cc: ansuelsmth, donggeunyoo.kernel, mohd.anwar, lorenzo.bianconi, daniel, devicetree, netdev, linux-arm-msm, linux-kernel The Qualcomm QCA8081 PHY (and compatible devices) has four power inputs available. Not all designs need to control them, and some might connect multiple power inputs to the same rail. This series makes it possible to optionally specify these regulators. Between version 1 and version 2: - Add a devicetree binding update that was not provided in v1 - Remove #ifdef CONFIG_OF from the body of qca808x_power_on() Version 1 is available here: https://lore.kernel.org/lkml/20261014172300.292324-1-elder@riscstar.com/ -Alex Daniel Thompson (2): dt-bindings: net: qca,qca808x: Add regulator properties net: phy: qcom: qca808x: Add regulator management .../devicetree/bindings/net/qca,qca808x.yaml | 16 ++++++++++ drivers/net/phy/qcom/qca808x.c | 29 +++++++++++++++++++ 2 files changed, 45 insertions(+) base-commit: 73022f605c447f31610b94ed4a983d2b4bf2c721 -- 2.53.0 ^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH net-next v2 1/2] dt-bindings: net: qca,qca808x: Add regulator properties 2026-10-15 14:38 [PATCH net-next v2 0/2] net: phy: qcom: add qca808x support Alex Elder @ 2026-10-15 14:38 ` Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management Alex Elder 1 sibling, 0 replies; 8+ messages in thread From: Alex Elder @ 2026-10-15 14:38 UTC (permalink / raw) To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux Cc: Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, lorenzo.bianconi, devicetree, netdev, linux-arm-msm, linux-kernel From: Daniel Thompson <daniel@riscstar.com> QCA808x has four different power rails (although in many board designs the different rails share a regulator). Add each of these to the corresponding DT binding as optional supplies. Signed-off-by: Daniel Thompson <daniel@riscstar.com> Co-developed-by: Alex Elder <elder@riscstar.com> Signed-off-by: Alex Elder <elder@riscstar.com> --- .../devicetree/bindings/net/qca,qca808x.yaml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Documentation/devicetree/bindings/net/qca,qca808x.yaml b/Documentation/devicetree/bindings/net/qca,qca808x.yaml index e2552655902a3..03daef1c7a4e6 100644 --- a/Documentation/devicetree/bindings/net/qca,qca808x.yaml +++ b/Documentation/devicetree/bindings/net/qca,qca808x.yaml @@ -17,6 +17,8 @@ description: By default this special PIN is set to LED function. + Additionally, up to four power supplies may be separately specified. + allOf: - $ref: ethernet-phy.yaml# @@ -25,6 +27,18 @@ properties: enum: - ethernet-phy-id004d.d101 + avdd18-supply: + description: 1.8v analog power supply. + + vdd-supply: + description: 1.05v power supply. + + vdd18-supply: + description: 1.8v power supply. + + vdd125-supply: + description: (1.25v to 1.98v) LDO regulator power supply. + unevaluatedProperties: false examples: @@ -39,6 +53,8 @@ examples: compatible = "ethernet-phy-id004d.d101"; reg = <0>; + vdd18-supply = <&phy_vreg_1v8>; + leds { #address-cells = <1>; #size-cells = <0>; -- 2.53.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 14:38 [PATCH net-next v2 0/2] net: phy: qcom: add qca808x support Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 1/2] dt-bindings: net: qca,qca808x: Add regulator properties Alex Elder @ 2026-10-15 14:38 ` Alex Elder 2026-10-15 15:16 ` Maxime Chevallier 2026-10-15 15:40 ` Lorenzo Bianconi 1 sibling, 2 replies; 8+ messages in thread From: Alex Elder @ 2026-10-15 14:38 UTC (permalink / raw) To: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux Cc: Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, lorenzo.bianconi, devicetree, netdev, linux-arm-msm, linux-kernel From: Daniel Thompson <daniel@riscstar.com> QCA8081 appears in embedded board designs paired with GPIO controlled regulators for its power rails. Add logic to allow these regulators to be turned on during a probe. In order to avoid the complexity of tracking state for suspend with and without WoL we take a tremendously simple "always-on" approach to regulator management, essentially relying on BMCR_PDOWN to conserve power when the phy device exists. Signed-off-by: Daniel Thompson <daniel@riscstar.com> Co-developed-by: Alex Elder <elder@riscstar.com> Signed-off-by: Alex Elder <elder@riscstar.com> --- drivers/net/phy/qcom/qca808x.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c index bab26e4c61408..4aba513b9a512 100644 --- a/drivers/net/phy/qcom/qca808x.c +++ b/drivers/net/phy/qcom/qca808x.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0+ #include <linux/phy.h> +#include <linux/regulator/consumer.h> #include <linux/module.h> #include "qcom.h" @@ -181,15 +182,43 @@ static void qca808x_fill_possible_interfaces(struct phy_device *phydev) __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); } +static int qca808x_power_on(struct phy_device *phydev) +{ + static const char * const regulator_names[] = { + "avdd18", "vdd", "vdd18", "vdd125" + }; + struct device *dev = &phydev->mdio.dev; + u32 count = 0; + int ret; + + for (u32 i = 0; i < ARRAY_SIZE(regulator_names); i++) { + ret = devm_regulator_get_enable_optional(dev, regulator_names[i]); + if (!ret) + count++; + else if (ret != -ENODEV) + return ret; + } + + if (count) + fsleep(phydev->mdio.reset_assert_delay); + + return 0; +} + static int qca808x_probe(struct phy_device *phydev) { struct device *dev = &phydev->mdio.dev; struct qca808x_priv *priv; + int ret; priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); if (!priv) return -ENOMEM; + ret = qca808x_power_on(phydev); + if (ret) + return ret; + priv->led_polarity_mode = QCA808X_PHY_LED_UNSET; phydev->priv = priv; -- 2.53.0 ^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 14:38 ` [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management Alex Elder @ 2026-10-15 15:16 ` Maxime Chevallier 2026-10-15 15:40 ` Lorenzo Bianconi 1 sibling, 0 replies; 8+ messages in thread From: Maxime Chevallier @ 2026-10-15 15:16 UTC (permalink / raw) To: Alex Elder, andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux Cc: Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, lorenzo.bianconi, devicetree, netdev, linux-arm-msm, linux-kernel Hi, On 10/15/26 16:38, Alex Elder wrote: > From: Daniel Thompson <daniel@riscstar.com> > > QCA8081 appears in embedded board designs paired with GPIO controlled > regulators for its power rails. Add logic to allow these regulators to > be turned on during a probe. > > In order to avoid the complexity of tracking state for suspend with and > without WoL we take a tremendously simple "always-on" approach to > regulator management, essentially relying on BMCR_PDOWN to conserve > power when the phy device exists. > > Signed-off-by: Daniel Thompson <daniel@riscstar.com> > Co-developed-by: Alex Elder <elder@riscstar.com> > Signed-off-by: Alex Elder <elder@riscstar.com> > --- > drivers/net/phy/qcom/qca808x.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c > index bab26e4c61408..4aba513b9a512 100644 > --- a/drivers/net/phy/qcom/qca808x.c > +++ b/drivers/net/phy/qcom/qca808x.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0+ > > #include <linux/phy.h> > +#include <linux/regulator/consumer.h> > #include <linux/module.h> > > #include "qcom.h" > @@ -181,15 +182,43 @@ static void qca808x_fill_possible_interfaces(struct phy_device *phydev) > __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); > } > > +static int qca808x_power_on(struct phy_device *phydev) > +{ > + static const char * const regulator_names[] = { > + "avdd18", "vdd", "vdd18", "vdd125" > + }; > + struct device *dev = &phydev->mdio.dev; > + u32 count = 0; > + int ret; > + > + for (u32 i = 0; i < ARRAY_SIZE(regulator_names); i++) { > + ret = devm_regulator_get_enable_optional(dev, regulator_names[i]); > + if (!ret) > + count++; > + else if (ret != -ENODEV) > + return ret; > + } > + > + if (count) > + fsleep(phydev->mdio.reset_assert_delay); Kinda makes sense to use that delay as a basis, it may be too short in some odd cases but I guess it's good enough of an approximation here, > + > + return 0; > +} > + > static int qca808x_probe(struct phy_device *phydev) > { > struct device *dev = &phydev->mdio.dev; > struct qca808x_priv *priv; > + int ret; > > priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > if (!priv) > return -ENOMEM; > > + ret = qca808x_power_on(phydev); > + if (ret) > + return ret; > + > priv->led_polarity_mode = QCA808X_PHY_LED_UNSET; > > phydev->priv = priv; Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com> Maxime ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 14:38 ` [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management Alex Elder 2026-10-15 15:16 ` Maxime Chevallier @ 2026-10-15 15:40 ` Lorenzo Bianconi 2026-10-15 16:01 ` Alex Elder 1 sibling, 1 reply; 8+ messages in thread From: Lorenzo Bianconi @ 2026-10-15 15:40 UTC (permalink / raw) To: Alex Elder Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux, Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, devicetree, netdev, linux-arm-msm, linux-kernel [-- Attachment #1: Type: text/plain, Size: 2458 bytes --] On Oct 15, Alex Elder wrote: > From: Daniel Thompson <daniel@riscstar.com> > > QCA8081 appears in embedded board designs paired with GPIO controlled > regulators for its power rails. Add logic to allow these regulators to > be turned on during a probe. > > In order to avoid the complexity of tracking state for suspend with and > without WoL we take a tremendously simple "always-on" approach to > regulator management, essentially relying on BMCR_PDOWN to conserve > power when the phy device exists. > > Signed-off-by: Daniel Thompson <daniel@riscstar.com> > Co-developed-by: Alex Elder <elder@riscstar.com> > Signed-off-by: Alex Elder <elder@riscstar.com> > --- > drivers/net/phy/qcom/qca808x.c | 29 +++++++++++++++++++++++++++++ > 1 file changed, 29 insertions(+) > > diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c > index bab26e4c61408..4aba513b9a512 100644 > --- a/drivers/net/phy/qcom/qca808x.c > +++ b/drivers/net/phy/qcom/qca808x.c > @@ -1,6 +1,7 @@ > // SPDX-License-Identifier: GPL-2.0+ > > #include <linux/phy.h> > +#include <linux/regulator/consumer.h> > #include <linux/module.h> > > #include "qcom.h" > @@ -181,15 +182,43 @@ static void qca808x_fill_possible_interfaces(struct phy_device *phydev) > __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible); > } > > +static int qca808x_power_on(struct phy_device *phydev) > +{ > + static const char * const regulator_names[] = { > + "avdd18", "vdd", "vdd18", "vdd125" > + }; > + struct device *dev = &phydev->mdio.dev; > + u32 count = 0; > + int ret; > + > + for (u32 i = 0; i < ARRAY_SIZE(regulator_names); i++) { > + ret = devm_regulator_get_enable_optional(dev, regulator_names[i]); > + if (!ret) > + count++; > + else if (ret != -ENODEV) > + return ret; > + } > + > + if (count) > + fsleep(phydev->mdio.reset_assert_delay); nit: should we check reset_assert_delay field is actually set? Regards, Lorenzo > + > + return 0; > +} > + > static int qca808x_probe(struct phy_device *phydev) > { > struct device *dev = &phydev->mdio.dev; > struct qca808x_priv *priv; > + int ret; > > priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); > if (!priv) > return -ENOMEM; > > + ret = qca808x_power_on(phydev); > + if (ret) > + return ret; > + > priv->led_polarity_mode = QCA808X_PHY_LED_UNSET; > > phydev->priv = priv; > -- > 2.53.0 > [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 228 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 15:40 ` Lorenzo Bianconi @ 2026-10-15 16:01 ` Alex Elder 2026-10-15 16:27 ` Andrew Lunn 0 siblings, 1 reply; 8+ messages in thread From: Alex Elder @ 2026-10-15 16:01 UTC (permalink / raw) To: Lorenzo Bianconi Cc: andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux, Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, devicetree, netdev, linux-arm-msm, linux-kernel On 10/15/26 10:40 AM, Lorenzo Bianconi wrote: >> + if (count) >> + fsleep(phydev->mdio.reset_assert_delay); > nit: should we check reset_assert_delay field is actually set? Are you saying there should be an alternative delay used if it is not set? Do you have a suggestion for what to use in that case? -Alex ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 16:01 ` Alex Elder @ 2026-10-15 16:27 ` Andrew Lunn 2026-10-15 16:37 ` Mohd Ayaan Anwar 0 siblings, 1 reply; 8+ messages in thread From: Andrew Lunn @ 2026-10-15 16:27 UTC (permalink / raw) To: Alex Elder Cc: Lorenzo Bianconi, andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux, Daniel Thompson, ansuelsmth, donggeunyoo.kernel, mohd.anwar, devicetree, netdev, linux-arm-msm, linux-kernel On Thu, Oct 15, 2026 at 11:01:43AM -0500, Alex Elder wrote: > On 10/15/26 10:40 AM, Lorenzo Bianconi wrote: > > > + if (count) > > > + fsleep(phydev->mdio.reset_assert_delay); > > nit: should we check reset_assert_delay field is actually set? > > Are you saying there should be an alternative delay used > if it is not set? Do you have a suggestion for what to > use in that case? Does the binding require the value is set? What happens it if is 0? I think fsleep() is happy to delay for 0 uS, but does the hardware still work? Does the datasheet say anything about power on delays? Andrew ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management 2026-10-15 16:27 ` Andrew Lunn @ 2026-10-15 16:37 ` Mohd Ayaan Anwar 0 siblings, 0 replies; 8+ messages in thread From: Mohd Ayaan Anwar @ 2026-10-15 16:37 UTC (permalink / raw) To: Andrew Lunn Cc: Alex Elder, Lorenzo Bianconi, andrew+netdev, davem, edumazet, kuba, pabeni, robh, krzk+dt, conor+dt, hkallweit1, linux, Daniel Thompson, ansuelsmth, donggeunyoo.kernel, devicetree, netdev, linux-arm-msm, linux-kernel On Thu, Oct 15, 2026 at 06:27:01PM +0200, Andrew Lunn wrote: > On Thu, Oct 15, 2026 at 11:01:43AM -0500, Alex Elder wrote: > > On 10/15/26 10:40 AM, Lorenzo Bianconi wrote: > > > > + if (count) > > > > + fsleep(phydev->mdio.reset_assert_delay); > > > nit: should we check reset_assert_delay field is actually set? > > > > Are you saying there should be an alternative delay used > > if it is not set? Do you have a suggestion for what to > > use in that case? > > Does the binding require the value is set? > > What happens it if is 0? I think fsleep() is happy to delay for 0 uS, > but does the hardware still work? Does the datasheet say anything > about power on delays? > I was going to share a text version of the power-up diagram given in this PHY's datasheet. This might help. Power-Up Sequence 1. DVDD asserted | |<-------- 10 ms -------->| (required for external power) | 2. DVDD18 / AVDD18 asserted 3. VDD1P25 asserted | |<-------- 0.2 ms ------->| (required for LDO to settle) | 4. VDD_LDO asserted 5. AVDD asserted | |<--------- 2 ms -------->| (required for XTL to oscillate) | 6. Crystal 50 MHz starts oscillating 7. PAD reset deasserted | |<------- 10 ms --------->| (deglitch time) So, maybe just fsleep(22200) or something a bit higher? Ayaan ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-10-15 16:37 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-10-15 14:38 [PATCH net-next v2 0/2] net: phy: qcom: add qca808x support Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 1/2] dt-bindings: net: qca,qca808x: Add regulator properties Alex Elder 2026-10-15 14:38 ` [PATCH net-next v2 2/2] net: phy: qcom: qca808x: Add regulator management Alex Elder 2026-10-15 15:16 ` Maxime Chevallier 2026-10-15 15:40 ` Lorenzo Bianconi 2026-10-15 16:01 ` Alex Elder 2026-10-15 16:27 ` Andrew Lunn 2026-10-15 16:37 ` Mohd Ayaan Anwar
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.