From patchwork Tue Dec 12 21:50:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 121654 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4671215qgn; Tue, 12 Dec 2017 13:50:57 -0800 (PST) X-Google-Smtp-Source: ACJfBovCMsrVl2WMyTKCh55l01l4yhntg6F+n4fVhI5+GWeW5ENJC2OrsgkUFFrJteuxFeEoXdGA X-Received: by 10.159.214.134 with SMTP id n6mr3717751plp.47.1513115457363; Tue, 12 Dec 2017 13:50:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513115457; cv=none; d=google.com; s=arc-20160816; b=TRFkm/IVGRYTb+4Ee273kHyi+NllhiSybzClteRlma0J/qjW7uWvAttNjQ6ZrdNHaX gEghgk73b5pqzYzDFwzcGpEAspPXh+Z/BOJCHrBBAGVBVctDAojcdJIgXxbaOnwnE/1q qesr/G73AlyV1b5ojMHbCPhfN3PfwV28g9aupP07LWyMtjBBdMFZZXMtqfycNBMGmY2S HCGSnu0n3WgU+VttWy7z5DQsddtLWbeSpdqh0Au++63WaDpEUcs/m4HHh1Tj3Rod3XRZ oecbiCLjl6dYvGcosyKWUJRfilW1tf0Ql5XAg/kcmvgVEKYBLo7o+xRumEhqTVi9aEgf 0Xpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=3V4opEFvuacqyEuA8SW2r+IouN+bQdWvp2TqbCpep38=; b=vf3Yx5Iz/TCs3wMVbfE03k3SIVsTuU2+aZw8dM12XwnnT5UApgxTt1+BpOOPWFq1A3 BIswtRFbsM6S/bfi89RaM+FG8XKpeiDWvhInU04FPlyFlCq0KLnRE2M0cS7kKGm2mUe3 rYY/rtR5SK/xt+s190G2gj71OrZEGfBGqBl6Um9Kn31iwKf7ui3MQe2sWsLJemIyG8sT E+Lp2xXRLPyJO430pHQhjhW7ZPYlaK6/H5w2cYK0iZiOxlWD+h0o9uH2rdJDULVJTjPi jTETEKu1gNXBodrparcFSunftqZuRMu8UHcB+ESBOqXvP+qSNECxJ5RdASPG39zEXRDc nHvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=mxxfjBdJ; 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 o24si112879pfi.143.2017.12.12.13.50.57 for ; Tue, 12 Dec 2017 13:50:57 -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=mxxfjBdJ; 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 S1752570AbdLLVu4 (ORCPT ); Tue, 12 Dec 2017 16:50:56 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:65317 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752564AbdLLVu4 (ORCPT ); Tue, 12 Dec 2017 16:50:56 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBCLoS6l030310; Tue, 12 Dec 2017 15:50:28 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513115428; bh=FctHNyYfiemIE5JPKxp06XNiAeNrSft5In0OoUHkEYw=; h=From:To:CC:Subject:Date; b=mxxfjBdJ5KYnxb5NUjitCJBsq+nvHEowZIk4/LCh9QPw0lhl6Ff/V4/ZAPd0rvTEt NZ/CvmD7QHII17JyJeUMH6ODzHNofQnAEq+SBLVmHjCqLDcc1N6crOL90nv8uPY29Q oAoIXlipJN/MHe6n8g4yKKeJ+CAvDUGrUgXUmA4E= Received: from DFLE114.ent.ti.com (dfle114.ent.ti.com [10.64.6.35]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCLoSHi022758; Tue, 12 Dec 2017 15:50:28 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Tue, 12 Dec 2017 15:50:28 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Tue, 12 Dec 2017 15:50:28 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCLoS24031105; Tue, 12 Dec 2017 15:50:28 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.69.253]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vBCLoRx10123; Tue, 12 Dec 2017 15:50:27 -0600 (CST) From: Dan Murphy To: , , , , , , CC: , , , Dan Murphy Subject: [RFC PATCH 1/2] dt: bindings: as3645a: Update dt node example with standard Date: Tue, 12 Dec 2017 15:50:23 -0600 Message-ID: <20171212215024.30116-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 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 DT binding to remove the device name from the DT parent node as well as removing the device name from the label. The LED label will be generated based off the id name stored in the local driver so the LED function can be indicated in the label DT entry. Also removed the indentation on the example. Signed-off-by: Dan Murphy --- .../devicetree/bindings/leds/ams,as3645a.txt | 36 +++++++++++----------- 1 file changed, 18 insertions(+), 18 deletions(-) -- 2.15.0.124.g7668cbc60 Acked-by: Laurent Pinchart diff --git a/Documentation/devicetree/bindings/leds/ams,as3645a.txt b/Documentation/devicetree/bindings/leds/ams,as3645a.txt index fc7f5f9f234c..122aa7165cf3 100644 --- a/Documentation/devicetree/bindings/leds/ams,as3645a.txt +++ b/Documentation/devicetree/bindings/leds/ams,as3645a.txt @@ -58,22 +58,22 @@ label : The label of the indicator LED. Example ======= - as3645a@30 { - compatible = "ams,as3645a"; - #address-cells = <1>; - #size-cells = <0>; - reg = <0x30>; - flash@0 { - reg = <0x0>; - flash-timeout-us = <150000>; - flash-max-microamp = <320000>; - led-max-microamp = <60000>; - ams,input-max-microamp = <1750000>; - label = "as3645a:flash"; - }; - indicator@1 { - reg = <0x1>; - led-max-microamp = <10000>; - label = "as3645a:indicator"; - }; +led-controller@30 { + compatible = "ams,as3645a"; + #address-cells = <1>; + #size-cells = <0>; + reg = <0x30>; + led@0 { + reg = <0x0>; + flash-timeout-us = <150000>; + flash-max-microamp = <320000>; + led-max-microamp = <60000>; + ams,input-max-microamp = <1750000>; + label = "flash"; }; + led@1 { + reg = <0x1>; + led-max-microamp = <10000>; + label = "indicator"; + }; +}; From patchwork Tue Dec 12 21:50:24 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 121656 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4672415qgn; Tue, 12 Dec 2017 13:52:26 -0800 (PST) X-Google-Smtp-Source: ACJfBov2Me6CB1HxxKvNZ6cbH3CMeb2gHoTUPAcd9UqjI2QLe+fFwHX0iglc2lcEJ+u/h7j/EEDV X-Received: by 10.98.27.3 with SMTP id b3mr3668439pfb.159.1513115545904; Tue, 12 Dec 2017 13:52:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513115545; cv=none; d=google.com; s=arc-20160816; b=rTyof0yV4lZHikcunKNHsHWx7Wq39P5fZCC24MtIXsiXmRUUFR+k8+PpzOjokb5K8F 5Z1IQGUHUz2ZQL8uANSSGdh8w/oiQtvcZzYeupUzRqf8ujE0D+w11h7RSQ9ZOVZhOOiW F+18hDfgsAtIHNH+g0P+b6eZ0t8NMUe2mi2SYOZe/6slBNDhq9IC+qNFAhj0tsE/K0BU ToVj1FmJ8XXsoO5Tdnn2764SALRRS/b/aFQUCbtNP1kR1/ZlRfIC0yjQrgQHmUtj8TZZ wjFtWk8xEyZ1KcJe7df61i8f5TXCHgpHaxF15mLEMSXKCFu3GPuXJn/jEoz1KSGfRNuu NTxQ== 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=zLgK2MLVIY/f2ZT5s4qAlI+1iFwCJToVs5MsBUj8uVg=; b=F5/XdWrarRFiX+Rq9hGnbz/bx/oS257+8KExGA6ExYNXR/d6bWBRQDta0FXyocqjmO 8FKWAM2nx39a9gHFeoZbVs460b5n0lFhBMpx9RJ660z/Gk3CzOa7ER9RqHGyPBaRcB5X vKtAw0eev/VFaJ7iORtFgyfEH15F8DdpQuyr50g33aHrqIny/Iz86gX7qDVeRsNnki+d 9eyL/H3ryRoFGz67/pQfY0RBv64SebD8DIdPZPDgzg6lLkRTkh13bUAKztg/78xWg6Hz QfFroPdH1JJKe781+RqD6D/SAfKU0xFdPdUyutXmn/acDBHvh+EVI7nYDUM1sBq2TC2U C3Ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=UvX583RS; 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 t4si106932plb.550.2017.12.12.13.52.25 for ; Tue, 12 Dec 2017 13:52:25 -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=UvX583RS; 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 S1752598AbdLLVwZ (ORCPT ); Tue, 12 Dec 2017 16:52:25 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:55680 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752570AbdLLVwY (ORCPT ); Tue, 12 Dec 2017 16:52:24 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBCLoYh4011775; Tue, 12 Dec 2017 15:50:34 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513115434; bh=xTcTHf+hOzsTS8V5ORrhx7HtYOItuzwpXQfDgq5zjys=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=UvX583RSJk4d43mqNSlDV1bqvQcfJpYKYSj6DMT5+wPNhCVl0jCTts+3OdOAabphk 9lm2djqGSRqcBzztp4tJIWzT2M85Ejo6XS2Eq/vVC9SkSlxmcpSd5+FesN93k/19uH oUySWBrtf0wJPd5I6Sldw0DbwPWvI46IaQUDRuuk= Received: from DLEE112.ent.ti.com (dlee112.ent.ti.com [157.170.170.23]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCLoTHx022767; Tue, 12 Dec 2017 15:50:29 -0600 Received: from DLEE108.ent.ti.com (157.170.170.38) by DLEE112.ent.ti.com (157.170.170.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Tue, 12 Dec 2017 15:50:28 -0600 Received: from dflp32.itg.ti.com (10.64.6.15) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Tue, 12 Dec 2017 15:50:28 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp32.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCLoS53026354; Tue, 12 Dec 2017 15:50:28 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.69.253]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vBCLoSx10127; Tue, 12 Dec 2017 15:50:28 -0600 (CST) From: Dan Murphy To: , , , , , , CC: , , , Dan Murphy Subject: [RFC PATCH 2/2] leds: as3645a: Update LED label generation Date: Tue, 12 Dec 2017 15:50:24 -0600 Message-ID: <20171212215024.30116-2-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171212215024.30116-1-dmurphy@ti.com> References: <20171212215024.30116-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 Generate the LED label based off either the DT label node or off the I2C ID in the i2c device id struct. If the label is used then this should denote the LED function. As an example it would be as3645a: Otherwise if the label is not used the LED label will be as3645a:flash and as3645a:indicator. Signed-off-by: Dan Murphy --- drivers/leds/leds-as3645a.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/leds-as3645a.c b/drivers/leds/leds-as3645a.c index f883616d9e60..197acd69ddcc 100644 --- a/drivers/leds/leds-as3645a.c +++ b/drivers/leds/leds-as3645a.c @@ -526,10 +526,11 @@ static int as3645a_parse_node(struct as3645a *flash, rval = of_property_read_string(flash->flash_node, "label", &name); if (!rval) - strlcpy(names->flash, name, sizeof(names->flash)); + snprintf(names->flash, sizeof(names->flash), "%s:%s", + id->name, name); else snprintf(names->flash, sizeof(names->flash), - "%s:flash", node->name); + "%s:flash", id->name); rval = of_property_read_u32(flash->flash_node, "flash-timeout-us", &cfg->flash_timeout_us); @@ -570,10 +571,11 @@ static int as3645a_parse_node(struct as3645a *flash, rval = of_property_read_string(flash->indicator_node, "label", &name); if (!rval) - strlcpy(names->indicator, name, sizeof(names->indicator)); + snprintf(names->indicator, sizeof(names->indicator), "%s:%s", + id->name, name); else snprintf(names->indicator, sizeof(names->indicator), - "%s:indicator", node->name); + "%s:indicator", id->name); rval = of_property_read_u32(flash->indicator_node, "led-max-microamp", &cfg->indicator_max_ua);