aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVasant Hegde <hegdevasant@linux.vnet.ibm.com>2015-04-06 14:01:55 +0530
committerStewart Smith <stewart@linux.vnet.ibm.com>2015-05-07 17:42:34 +1000
commitf30f196e5c03fc6ffef0f240c74e08e44ceb66b5 (patch)
tree7d9f70ac36ddda00583ded8a9a854a47fa57f4e7
parentb25e34639cc6410c9e0cdb08808415f548bc00bb (diff)
downloadskiboot-f30f196e5c03fc6ffef0f240c74e08e44ceb66b5.zip
skiboot-f30f196e5c03fc6ffef0f240c74e08e44ceb66b5.tar.gz
skiboot-f30f196e5c03fc6ffef0f240c74e08e44ceb66b5.tar.bz2
FSP/LED: Use LED mode information
Lets use the LED mode information populated by previous patch. We don't support fault indicator in 'Guiding Light' mode. So don't expose fault indicator to playload in Guiding Light mode. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r--hw/fsp/fsp-leds.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/hw/fsp/fsp-leds.c b/hw/fsp/fsp-leds.c
index a932016..1637000 100644
--- a/hw/fsp/fsp-leds.c
+++ b/hw/fsp/fsp-leds.c
@@ -1284,6 +1284,7 @@ success:
*/
void create_led_device_nodes(void)
{
+ const char *led_mode = NULL;
struct fsp_led_data *led, *next;
struct dt_node *pled, *cled;
@@ -1316,6 +1317,12 @@ void create_led_device_nodes(void)
dt_add_property_strings(pled, "compatible", DT_PROPERTY_LED_COMPATIBLE);
+ led_mode = dt_prop_get(pled, DT_PROPERTY_LED_MODE);
+ if (!led_mode) {
+ prlog(PR_WARNING, PREFIX "Unknown LED operating mode\n");
+ return;
+ }
+
/* LED child nodes */
list_for_each_safe(&cec_ledq, led, next, link) {
/* Duplicate LED location code */
@@ -1332,8 +1339,14 @@ void create_led_device_nodes(void)
continue;
}
- dt_add_property_strings(cled, DT_PROPERTY_LED_TYPES,
- LED_TYPE_IDENTIFY, LED_TYPE_FAULT);
+ if (!strcmp(led_mode, LED_MODE_LIGHT_PATH))
+ dt_add_property_strings(cled, DT_PROPERTY_LED_TYPES,
+ LED_TYPE_IDENTIFY,
+ LED_TYPE_FAULT);
+ else
+ dt_add_property_strings(cled, DT_PROPERTY_LED_TYPES,
+ LED_TYPE_IDENTIFY);
+
if (is_enclosure_led(led->loc_code))
dt_add_property_strings(cled, DT_PROPERTY_LED_LOCATION,
LED_LOC_ENCLOSURE);