From patchwork Mon Apr 6 08:31:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasant Hegde X-Patchwork-Id: 458346 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 057011401DC for ; Mon, 6 Apr 2015 18:32:04 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id DFE0E1A0859 for ; Mon, 6 Apr 2015 18:32:03 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Received: from e28smtp02.in.ibm.com (e28smtp02.in.ibm.com [122.248.162.2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id BAEA61A09EC for ; Mon, 6 Apr 2015 18:32:00 +1000 (AEST) Received: from /spool/local by e28smtp02.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Apr 2015 14:01:59 +0530 Received: from d28dlp01.in.ibm.com (9.184.220.126) by e28smtp02.in.ibm.com (192.168.1.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Apr 2015 14:01:57 +0530 Received: from d28relay05.in.ibm.com (d28relay05.in.ibm.com [9.184.220.62]) by d28dlp01.in.ibm.com (Postfix) with ESMTP id 25406E004C for ; Mon, 6 Apr 2015 14:04:21 +0530 (IST) Received: from d28av05.in.ibm.com (d28av05.in.ibm.com [9.184.220.67]) by d28relay05.in.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t368Vud556819962 for ; Mon, 6 Apr 2015 14:01:56 +0530 Received: from d28av05.in.ibm.com (localhost [127.0.0.1]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t368VtOB011915 for ; Mon, 6 Apr 2015 14:01:55 +0530 Received: from localhost.localdomain ([9.124.35.90]) by d28av05.in.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t368VtfV011903 for ; Mon, 6 Apr 2015 14:01:55 +0530 From: Vasant Hegde To: skiboot@lists.ozlabs.org Date: Mon, 06 Apr 2015 14:01:55 +0530 Message-ID: <20150406083139.24643.15504.stgit@localhost.localdomain> In-Reply-To: <20150406082641.24643.57570.stgit@localhost.localdomain> References: <20150406082641.24643.57570.stgit@localhost.localdomain> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15040608-0005-0000-0000-0000049C2787 Subject: [Skiboot] [PATCH v2 07/12] FSP/LED: Use LED mode information X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" 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 --- hw/fsp/fsp-leds.c | 17 +++++++++++++++-- 1 file 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);