Skip to content

Commit

Permalink
Merge branch 'net-phy-generic-polarity-led-support-for-qca808x'
Browse files Browse the repository at this point in the history
Christian Marangi says:

====================
net: phy: generic polarity + LED support for qca808x

This small series add LEDs support for qca808x.

QCA808x apply on PHY reset a strange polarity settings and require
some tweak to apply a more common configuration found on devices.
On adding support for it, it was pointed out that a similar
feature is also being implemented for a marvell PHY where
LED polarity is set per LED (and not global) and also have
a special mode where the LED is tristated.

The first 3 patch are to generalize this as we expect more PHY
in the future to have a similar configuration.

The implementation is extensible to support additional special
mode in the future with minimal changes and don't create regression
on already implemented PHY drivers.
====================

Link: https://lore.kernel.org/r/20240125203702.4552-1-ansuelsmth@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Jakub Kicinski committed Jan 27, 2024
2 parents 5642c82 + 7196062 commit c09f32a
Show file tree
Hide file tree
Showing 10 changed files with 431 additions and 19 deletions.
12 changes: 12 additions & 0 deletions Documentation/devicetree/bindings/leds/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,18 @@ properties:
#trigger-source-cells property in the source node.
$ref: /schemas/types.yaml#/definitions/phandle-array

active-low:
type: boolean
description:
Makes LED active low. To turn the LED ON, line needs to be
set to low voltage instead of high.

inactive-high-impedance:
type: boolean
description:
Set LED to high-impedance mode to turn the LED OFF. LED might also
describe this mode as tristate.

# Required properties for flash LED child nodes:
flash-max-microamp:
description:
Expand Down
4 changes: 0 additions & 4 deletions Documentation/devicetree/bindings/leds/leds-bcm63138.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@ patternProperties:
maxItems: 1
description: LED pin number

active-low:
type: boolean
description: Makes LED active low

required:
- reg

Expand Down
4 changes: 0 additions & 4 deletions Documentation/devicetree/bindings/leds/leds-bcm6328.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,6 @@ patternProperties:
- maximum: 23
description: LED pin number (only LEDs 0 to 23 are valid).

active-low:
type: boolean
description: Makes LED active low.

brcm,hardware-controlled:
type: boolean
description: Makes this LED hardware controlled.
Expand Down
2 changes: 0 additions & 2 deletions Documentation/devicetree/bindings/leds/leds-bcm6358.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ LED sub-node required properties:

LED sub-node optional properties:
- label : see Documentation/devicetree/bindings/leds/common.txt
- active-low : Boolean, makes LED active low.
Default : false
- default-state : see
Documentation/devicetree/bindings/leds/common.txt
- linux,default-trigger : see
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ properties:

pwm-names: true

active-low:
description: For PWMs where the LED is wired to supply rather than ground.
type: boolean

color: true

required:
Expand Down
5 changes: 0 additions & 5 deletions Documentation/devicetree/bindings/leds/leds-pwm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ patternProperties:
Maximum brightness possible for the LED
$ref: /schemas/types.yaml#/definitions/uint32

active-low:
description:
For PWMs where the LED is wired to supply rather than ground.
type: boolean

required:
- pwms
- max-brightness
Expand Down
54 changes: 54 additions & 0 deletions Documentation/devicetree/bindings/net/qca,qca808x.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/qca,qca808x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Qualcomm Atheros QCA808X PHY

maintainers:
- Christian Marangi <ansuelsmth@gmail.com>

description:
QCA808X PHYs can have up to 3 LEDs attached.
All 3 LEDs are disabled by default.
2 LEDs have dedicated pins with the 3rd LED having the
double function of Interrupt LEDs/GPIO or additional LED.

By default this special PIN is set to LED function.

allOf:
- $ref: ethernet-phy.yaml#

properties:
compatible:
enum:
- ethernet-phy-id004d.d101

unevaluatedProperties: false

examples:
- |
#include <dt-bindings/leds/common.h>
mdio {
#address-cells = <1>;
#size-cells = <0>;
ethernet-phy@0 {
compatible = "ethernet-phy-id004d.d101";
reg = <0>;
leds {
#address-cells = <1>;
#size-cells = <0>;
led@0 {
reg = <0>;
color = <LED_COLOR_ID_GREEN>;
function = LED_FUNCTION_WAN;
default-state = "keep";
};
};
};
};
Loading

0 comments on commit c09f32a

Please sign in to comment.