Skip to content

LED driver for PowerNV platform

Vasant Hegde linux-leds linuxppc-dev 10 versions – Applied

Status from this message: Applied to powerpc next, thanks.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v10 Latest3 patches 3 repliesApplied
  2. v93 patches 2 repliesSuperseded
  3. v83 patches 12 repliesSuperseded
Earlier versions · 7
VersionPostedPatchesRepliesStatus
v73 patches3 repliesSuperseded
v63 patches9 repliesSuperseded
v53 patches6 repliesSuperseded
v43 patches10 repliesSuperseded
v33 patches4 repliesSuperseded
v22 patches20 repliesSuperseded
v12 patches4 repliesSuperseded

Changes in v10 from the cover letter

- Removed "led_disabled" variable initialization
- Removed ".owner = THIS_MODULE"

Patches in v10 Applied

#Subject and filesSizeRepliesApplied
1/3powerpc/powernv: Add OPAL interfaces for accessing and modifying system LED statesarch/powerpc/include/asm/opal-api.h arch/powerpc/include/asm/opal.h arch/powerpc/platforms/powernv/opal-wrappers.S+30 -11 reply
2/3powerpc/powernv: Create LED platform devicearch/powerpc/platforms/powernv/opal.c+11 -11 reply
3/3leds/powernv: Add driver for PowerNV platformDocumentation/devicetree/bindings/leds/leds-powernv.txt drivers/leds/Kconfig drivers/leds/Makefile +1 more+383 -01 reply

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchStewart SmithBenjamin HerrenschmidtJacek Anaszewski
1/3A-b T-b A-b
2/3A-b
3/3A-b T-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v10 thread

Cover letter [PATCH v10 0/3] LED driver for PowerNV platform

The following series implements LED driver for PowerNV platform.

PowerNV platform has below type of LEDs:
- System attention
Indicates there is a problem with the system that needs attention.
- Identify
Helps the user locate/identify a particular FRU or resource in the system.
- Fault
Indicates there is a problem with the FRU or resource at the location with which the indicator is associated.

On PowerNV (Non Virtualized) platform OPAL firmware provides LED information to host via device tree (location code and LED type). During init we check for 'ibm,opal/leds' node in device tree to enable LED driver. And we use OPAL API's to get/set LEDs.

Note that on PowerNV platform firmware can activate fault LED, if it can isolate the problem. Also one can modify the LEDs using service processor interface. None of these involes kernel. Hence we retain LED state in unload path.

Sample LED device tree output:
------------------------------

leds {
	compatible = "ibm,opal-v3-led";
	led-mode = "lightpath";

	U78C9.001.RST0027-P1-C1 {
		led-types = "identify", "fault";
	};
	...
	...
    }

Sample sysfs output:
--------------------
.

├── U78CB.001.WZS008R-A1:fault
│   ├── brightness
│   ├── device -> ../../../opal_leds
│   ├── max_brightness
│   ├── power
│   │   ├── async
│   │   ├── autosuspend_delay_ms
│   │   ├── control
│   │   ├── runtime_active_kids
│   │   ├── runtime_active_time
│   │   ├── runtime_enabled
│   │   ├── runtime_status
│   │   ├── runtime_suspended_time
│   │   └── runtime_usage
│   ├── subsystem -> ../../../../../class/leds
│   ├── trigger
│   └── uevent
├── U78CB.001.WZS008R-A1:identify
│   ├── brightness
│   ├── device -> ../../../opal_leds
│   ├── max_brightness
│   ├── power
│   │   ├── async
│   │   ├── autosuspend_delay_ms
│   │   ├── control
│   │   ├── runtime_active_kids
│   │   ├── runtime_active_time
│   │   ├── runtime_enabled
│   │   ├── runtime_status
│   │   ├── runtime_suspended_time
│   │   └── runtime_usage
│   ├── subsystem -> ../../../../../class/leds
│   ├── trigger
│   └── uevent

....
....
....

patch 1/2: PowerNV architecture specific code. This adds necessary
OPAL APIs.
patch 2/2: Create LED platform device and export OPAL symbols patch 3/3: Actual LED driver implemenation for PowerNV platform.

Note:
- This version of patchset is based on top of v4.2-rc7.

@Ben/Michael,
This patchset is Acked by LED subsystem maintainer (Jacek) [1] and he suggested merge it via powerpc tree [1]. Can you please review/take this patchset?

[1] https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-July/131695.html

Previous patchset:
v9: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-August/132964.html
v8: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-July/131652.html
v7: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-July/131533.html
v6: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-July/131328.html
v5: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-July/130602.html
v4: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-April/128028.html
v3: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-April/127702.html
v2: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-March/126301.html
v1: https://lists.ozlabs.org/pipermail/linuxppc-dev/2015-March/125705.html

Changes in v10:
- Removed "led_disabled" variable initialization
- Removed ".owner = THIS_MODULE"

Changes in v9:
- Addressed minor comments from Jacek.
- Added Ack-by: Jacek

Changes in v8:
- Added powernv_led_common structure for common variables
- Removed unused variable 'value'
- Fixed locking issue

Changes in v7:
- Club powernv_led_data & powernv_leds_priv into single structure
- Removed num_leds & powernv_leds_count()
- Replaced per LED mutex with global mutex
- Removed driver specific workqueue. Instead this version uses new global workqueue.

Changes in v6:
- Added loc_code and type to powernv_led_data structure instead of parsing them from led classdev name.
- Fixed documentation issues.
- Fixed mutex_destry issue
- Replaced led_classdev_register with devm_led_classdev_register

Changes in v5:
- Rebased on top of Linus tree
- Renamed led as leds and updated documentation
- As Ben and Arnd suggested, removed phandle from documenation
- As Ben suggested removed led-loc device tree property
- As Jacek suggested, added back compatible property to documentation

Changes in v4:
- Updated macros to reflect platform.
- s/u64/__be64/g for big endian data we get from firmware
- Addressed review comments from Jacek. Major once are:
Removed list in powernv_led_data structure s/kzalloc/devm_kzalloc/
Removed compatible property from documentation

Anshuman Khandual (1):
powerpc/powernv: Add OPAL interfaces for accessing and modifying
system LED states

Vasant Hegde (2):
powerpc/powernv: Create LED platform device
leds/powernv: Add driver for PowerNV platform

 .../devicetree/bindings/leds/leds-powernv.txt      |  26 ++
 arch/powerpc/include/asm/opal-api.h                |  25 +-
 arch/powerpc/include/asm/opal.h                    |   4 +
 arch/powerpc/platforms/powernv/opal-wrappers.S     |   2 +
 arch/powerpc/platforms/powernv/opal.c              |  12 +-
 drivers/leds/Kconfig                               |  11 +
 drivers/leds/Makefile                              |   1 +
 drivers/leds/leds-powernv.c                        | 345 +++++++++++++++++++++
 8 files changed, 424 insertions(+), 2 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/leds/leds-powernv.txt
 create mode 100644 drivers/leds/leds-powernv.c
Signature · 2 lines
Vasant
2.1.0