From patchwork Fri Dec 1 16:56:11 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 120357 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1382871qgn; Fri, 1 Dec 2017 08:56:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMZy/OkJ8YcBvMbnsjbPFe5d6H8G96PeNHKy4huqBOr/g9DD37lrxWgF275z3oRYd/kmQ0ii X-Received: by 10.98.32.21 with SMTP id g21mr11093097pfg.52.1512147410885; Fri, 01 Dec 2017 08:56:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512147410; cv=none; d=google.com; s=arc-20160816; b=wFYBEZM8MRsu/vN0IFByIClXYf/QxQorb6J0IWVNOiQ4jaIi/fFKRretRWUD9ViiiZ M8iu8xTwZK0tb3ATH3lvYRvGUShRuXfAgzUTvPTv958iJ3ro5/OBUjgUpwp0BJ+mrtnU p2/YIF5nxFwv7/wfjzwJWwDlFeU7nb/vFqQP6cKOMMYVeLcEMwRFUzpuCxoDtwmYIUpk TITUeerG7F63OxBTECcEGTf9CwikyNvLZGknRVJ/mxXY04j/qG5afmYQpU9sL+9qCazz COo2CaeHsmfQNDTnElAmB+ccBzRIZUg6LEs6ZO8zEX11KNP161wnIah2/XZXA3PFva19 0/bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=5LXhn3/UjgObd6+ATWD+f/DQPFsOhJcvFrewSgwGvtE=; b=wcW9Bab92zrYVwSzF8kwbgnffBJXJ3gCnGycaoFGhoIhbRbYKTkEBgaifj5O7fD9XT RgW5wX+EeHvXnLO13Ah/AExBKXSAD+b2sC7z+eIxJeOHWtJKe8QPGaGmjCi/5G4ZKch2 ds4DbGpDnbpGfYvpHnl5ylPaV9/QRQbuVC21VUcLrRl9Dp+mPHJ4KR14dzm3XtEpmM2J eJfmbwxHmSLykMSmUVs80dudfPVkg03zUdPrbcrCnow2nwa/D1OGFyE84lwScQCrHgXt 92CoEwvjncRdcb21P808E82zBNtDT5LgNrtb9VvWhVrtqDxJTEeDwqf0l71dDi7QjGC0 jZBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vFWHYQlS; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7si5038785pgq.277.2017.12.01.08.56.50 for ; Fri, 01 Dec 2017 08:56:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=vFWHYQlS; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbdLAQ4t (ORCPT ); Fri, 1 Dec 2017 11:56:49 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:22838 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751432AbdLAQ4r (ORCPT ); Fri, 1 Dec 2017 11:56:47 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id vB1GuPUk006365; Fri, 1 Dec 2017 10:56:25 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1512147385; bh=Z+ldvntS0iXOrXpijws7gF56CGFRdEFzp7tD1qbq630=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=vFWHYQlS6fd2x0iyw9vEranesNHbaI5fjlTrPLqzpLFjM7TBiI56MrbHetoevajml embPI116Eh31CfnmX9eh2mgjoy3t6Ty176QHUMZ9J8QK9rjTO/Z1Xkj51HFVYPoRr2 lwbdKJscXh+0Mx3Yei+1lFfk4f2tlAx+326mQbAc= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id vB1GuPdF013922; Fri, 1 Dec 2017 10:56:25 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 1 Dec 2017 10:56:25 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Fri, 1 Dec 2017 10:56:25 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vB1GuPTM030508; Fri, 1 Dec 2017 10:56:25 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.70.55]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vB1GuO303181; Fri, 1 Dec 2017 10:56:24 -0600 (CST) From: Dan Murphy To: , , CC: , , Dan Murphy Subject: [PATCH v6 4/6] dt: bindings: lp8860: Update the bindings to the standard Date: Fri, 1 Dec 2017 10:56:11 -0600 Message-ID: <20171201165613.10358-4-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171201165613.10358-1-dmurphy@ti.com> References: <20171201165613.10358-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Update the lp8860 dt binding to the LED standard where the LED should have a child node and also adding a LED trigger entry. Signed-off-by: Dan Murphy --- v6 - New patch to fix binding documentation Documentation/devicetree/bindings/leds/leds-lp8860.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) -- 2.15.0.124.g7668cbc60 diff --git a/Documentation/devicetree/bindings/leds/leds-lp8860.txt b/Documentation/devicetree/bindings/leds/leds-lp8860.txt index aad38dd94d4b..4cf396de6eba 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp8860.txt +++ b/Documentation/devicetree/bindings/leds/leds-lp8860.txt @@ -12,17 +12,24 @@ Required properties: - label - Used for naming LEDs Optional properties: - - enable-gpio - gpio pin to enable/disable the device. - - supply - "vled" - LED supply + - enable-gpios : gpio pin to enable/disable the device. + - vled-supply : LED supply + - label : see Documentation/devicetree/bindings/leds/common.txt + - linux,default-trigger : (optional) + see Documentation/devicetree/bindings/leds/common.txt Example: -leds: leds@6 { +lp8860@2d { compatible = "ti,lp8860"; reg = <0x2d>; - label = "display_cluster"; enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; vled-supply = <&vbatt>; + + backlight: backlight@0 { + label = "backlight_cluster"; + linux,default-trigger = "backlight"; + }; } For more product information please see the link below: From patchwork Fri Dec 1 16:56:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 120355 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp1382630qgn; Fri, 1 Dec 2017 08:56:43 -0800 (PST) X-Google-Smtp-Source: AGs4zMZB5xyyxbKxJ9thzIXXu2fgHgGjLbq5bYJRYDSC4hfDOoGC2SLETIKusyU7Lqd+UNQT9f4u X-Received: by 10.84.240.74 with SMTP id h10mr6727886plt.109.1512147403153; Fri, 01 Dec 2017 08:56:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512147403; cv=none; d=google.com; s=arc-20160816; b=IzKClEbNDCoyDLwDvjgtDdMnkDtSoZxOT4ZDv7dt8JN4oIY6cvH4evMjoDDUl/FmG/ zfoBM8RTTa2WqrTiauJ5lhQc/wXNuBfVEXfp1dXIpiEZWFGWMn7pZng0iF9IAxNmRbSE nRIddjHH+oYu5sc1BJi2WXtfPKQ+pVgMQQaBTdUjee16YLgNG0p7oTThKCDZHEM6neiU vtLRC73OuBYnieiddTI9INNSUHBl1nOKGckObz4dHa3Jf0nPVp/zK1IY7RalbUzaaXtW pkNhP+SiS/0wXQJJ5VUbWk6mctP41x/jnri8OW/gSJNAi/kPHnIzwj/0K+7ghdJ+ZGDg 2+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=kbl2QtU8SppxfYcwHO7ZqhvBsxpisOatwyEL1ycRy0A=; b=BOE2+TbotKHFbYm0aIsp7/5IVrDFonsp5y8PtsiY8TQTDgDE7sqR5M88n8kKII4Ls7 JdJewKFZFx6XhN8WbbGtQOh9GfGzzQ2Vzb+csAgVtqj5jyjzUXCCy5tyifzhHFHXfVLQ CREdnJCO7gAWdwV805jtSd0cqN4d75cqzQNga0TXqU/9rmsEhB1TI7n/Z7P9b0ruRfzZ 5fsdj2YUAjejDgIqMe4dGhINlwljZHVgEjGH6wilMYdRJJniXh9xSrMOSVu1WD+zAGGe tkNS1wlfiPq75Tn9sIyMedVB1V8EIrmGKhWpp6HVyFoJkLvZaQLSJoc4BmG1XXCpSazI VmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bPX0C8bR; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d92si5258865pld.106.2017.12.01.08.56.43 for ; Fri, 01 Dec 2017 08:56:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bPX0C8bR; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750994AbdLAQ4m (ORCPT ); Fri, 1 Dec 2017 11:56:42 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:25815 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750975AbdLAQ4m (ORCPT ); Fri, 1 Dec 2017 11:56:42 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id vB1GuQaG015282; Fri, 1 Dec 2017 10:56:26 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1512147386; bh=oOHrMos40PbEZvh99xAepl+tA9zC35LpqTMRK4CSlB8=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bPX0C8bRF8W9pP2LZjRKCJD/YfiyUpf/x+3wtBH8pIULZE1WSsXaoPuNPA7twBgtL jNlQF8CGwy6qGh6/pOA3VXouvHlKQ1rIT0lV+3cTPfDOw2qMIUDmSd2EQ28iUnZNDd 8WMltL3SGg94fUuYc4Hd9p7qCSC+VuNCXc4I0FRU= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vB1GuQRg016969; Fri, 1 Dec 2017 10:56:26 -0600 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Fri, 1 Dec 2017 10:56:26 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Fri, 1 Dec 2017 10:56:26 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vB1GuQsT032472; Fri, 1 Dec 2017 10:56:26 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.70.55]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vB1GuQ303189; Fri, 1 Dec 2017 10:56:26 -0600 (CST) From: Dan Murphy To: , , CC: , , Dan Murphy Subject: [PATCH v6 6/6] leds: as3645a: Update the LED label generation Date: Fri, 1 Dec 2017 10:56:13 -0600 Message-ID: <20171201165613.10358-6-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171201165613.10358-1-dmurphy@ti.com> References: <20171201165613.10358-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Update the LED label creationg to call the of_led_compose_name api to generate a label. Signed-off-by: Dan Murphy --- v6 - New patch to use the new LED class API drivers/leds/leds-as3645a.c | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c index 9a257f969300..5a29db115277 100644 --- a/drivers/leds/leds-as3645a.c +++ b/drivers/leds/leds-as3645a.c @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -133,8 +134,8 @@ struct as3645a_config { }; struct as3645a_names { - char flash[32]; - char indicator[32]; + char flash[LED_MAX_NAME_SIZE]; + char indicator[LED_MAX_NAME_SIZE]; }; struct as3645a { @@ -496,7 +497,6 @@ static int as3645a_parse_node(struct as3645a *flash, { struct as3645a_config *cfg = &flash->cfg; struct device_node *child; - const char *name; int rval; for_each_child_of_node(node, child) { @@ -523,12 +523,9 @@ static int as3645a_parse_node(struct as3645a *flash, return -ENODEV; } - rval = of_property_read_string(flash->flash_node, "label", &name); - if (!rval) - strlcpy(names->flash, name, sizeof(names->flash)); - else - snprintf(names->flash, sizeof(names->flash), - "%s:flash", node->name); + of_led_compose_name(node, flash->flash_node, "flash", + sizeof("flash"), + names->flash); rval = of_property_read_u32(flash->flash_node, "flash-timeout-us", &cfg->flash_timeout_us); @@ -567,12 +564,9 @@ static int as3645a_parse_node(struct as3645a *flash, goto out_err; } - rval = of_property_read_string(flash->indicator_node, "label", &name); - if (!rval) - strlcpy(names->indicator, name, sizeof(names->indicator)); - else - snprintf(names->indicator, sizeof(names->indicator), - "%s:indicator", node->name); + of_led_compose_name(node, flash->indicator_node, "indicator", + sizeof("indicator"), + names->indicator); rval = of_property_read_u32(flash->indicator_node, "led-max-microamp", &cfg->indicator_max_ua);