From patchwork Tue Dec 12 18:58:03 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 121624 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4501197qgn; Tue, 12 Dec 2017 10:58:39 -0800 (PST) X-Google-Smtp-Source: ACJfBotniUnqzuDKdJgYJIkq9mSZSQpVLXUgG/WCN7exeZcJJFz0VniXP4KaC1GO62/Il8AYgiVg X-Received: by 10.99.96.87 with SMTP id u84mr2897207pgb.69.1513105119606; Tue, 12 Dec 2017 10:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513105119; cv=none; d=google.com; s=arc-20160816; b=Y1AAnfTXz2DbSxnhNl6wGVUTNLYEODa9wpG66aaA5gFSFS4WolB/aG2i7LqQs2DxCl iZ+HBdr/k/S5kk1DPhpq9DR02BCbKZM1PWU0nYfSQoMlf3o+qVF91NNgtkA7Rz6PggVi ooaVuf9a0NO3luPzsOJQ1K0NYHwzJppzvqdqMhdFbACVe2hvbfSzHQjTWdvfU8pbHTWj IOYPZ3/Sh+XfCOoCAs23QseNVsvPqOD/m3VAC/3TybSqC5jA8D1KwWnebgMNimBvOvaK tnHret0ARni7CuYOQPFi8Nr6NFmWKP9Kbz9+7fnaIrqj8ZE8ssSkMZAhYdYdKYpyD5Lm tx8w== 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=XBhrFfTNdC/+YSEUrifzh5qw3XQo0qgCwkmvvZFaDcA=; b=0+YZZRNEeP60tN1Rc/Cad2WIQK7fL+h4TJHpbgRQzdTS9IOwlS2X4QDkzvxiBfgnTU jL7Es1hQW7ODu6Llauf3OWc5uI9Q73toF/NPImM1iivHa+Ssy4yUGG+mYvgOImfLXad6 TzuArGskFxYZAZvf5dLN2TPFd/gRFd1porD7PvLlLeKnAC+FU5eYCoGVFrUjMAqFxljb iKCsKNzwUtpKdL7OA4Nr/rV6+ofxv4//ci5Qh5fqYJ6mrQEr5feuy5Dmq0G+GLZ13apW RjCoFWg7m2DHS3zAwrsMq8qvyj8iYcfyUOKq3ZO1otWM0PreHZGQhuANr1gSa8f9GkjA HbEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=Dw35pWwT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 30si12014786plb.782.2017.12.12.10.58.39; Tue, 12 Dec 2017 10:58:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=Dw35pWwT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752470AbdLLS6f (ORCPT + 11 others); Tue, 12 Dec 2017 13:58:35 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:30789 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752255AbdLLS62 (ORCPT ); Tue, 12 Dec 2017 13:58:28 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBCIwE9f027853; Tue, 12 Dec 2017 12:58:14 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513105094; bh=iyix0R/gWyZ1+UpBxJlHYiAqZBTYQ7zNwfoCJUcSE1s=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=Dw35pWwTLNjINStRCNJJ0gL4rIxALleF+iqEkxtaM7m+ATUR38GCkRmhfN7N2N89y swffweBLwveU5CkExsGYmbprkdk+MHGhzhIm/2dU+XpiV+/YYFrv2ztQis5tU7DbdY ot4uvpdlvGolxJyaFKuVqO5EFoyP5YkWx63T+d/A= Received: from DFLE115.ent.ti.com (dfle115.ent.ti.com [10.64.6.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCIwEoT002122; Tue, 12 Dec 2017 12:58:14 -0600 Received: from DFLE101.ent.ti.com (10.64.6.22) by DFLE115.ent.ti.com (10.64.6.36) 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 12:58:13 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE101.ent.ti.com (10.64.6.22) 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 12:58:13 -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 vBCIwDgq002974; Tue, 12 Dec 2017 12:58:13 -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 vBCIwDx25364; Tue, 12 Dec 2017 12:58:13 -0600 (CST) From: Dan Murphy To: , , , , CC: , , , Dan Murphy Subject: [PATCH v3 1/6] dt: bindings: lp8860: Update bindings for lp8860 Date: Tue, 12 Dec 2017 12:58:03 -0600 Message-ID: <20171212185809.23880-2-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171212185809.23880-1-dmurphy@ti.com> References: <20171212185809.23880-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the lp8860 bindings to fix various issues found. Add address-cells and size-cells, rename enable-gpio to enable-gpios, update the node name to the device name and indent the node example. Signed-off-by: Dan Murphy --- v3 - Indicatd enable-gpios is active high, moved address and size cells to child node patch and updated parent DT node name - https://patchwork.kernel.org/patch/10093745/ v2 - New patch Documentation/devicetree/bindings/leds/leds-lp8860.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 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..b9d09acbaa73 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp8860.txt +++ b/Documentation/devicetree/bindings/leds/leds-lp8860.txt @@ -6,22 +6,22 @@ current sinks that can be controlled by a PWM input signal, a SPI/I2C master, or both. Required properties: - - compatible: + - compatible : "ti,lp8860" - - reg - I2C slave address - - label - Used for naming LEDs + - reg : I2C slave address + - 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 (active high)/disable the device. + - vled-supply : LED supply Example: -leds: leds@6 { +led-controller@2d { compatible = "ti,lp8860"; reg = <0x2d>; label = "display_cluster"; - enable-gpio = <&gpio1 28 GPIO_ACTIVE_HIGH>; + enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>; vled-supply = <&vbatt>; } From patchwork Tue Dec 12 18:58:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 121627 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4501757qgn; Tue, 12 Dec 2017 10:59:18 -0800 (PST) X-Google-Smtp-Source: ACJfBovmndCxdlV/6zH21JRv7pYRvJapoiaA/t1T4d+zUgmWy/uwFfiYt56kD1yI5vux6WaUegeL X-Received: by 10.159.242.132 with SMTP id u4mr3227227plr.296.1513105158837; Tue, 12 Dec 2017 10:59:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513105158; cv=none; d=google.com; s=arc-20160816; b=Ql7FI/KPaak7hEC1osGWQZPokRGnVnfDY+LFJPcv3Q+6cBCg8s7zGbl55sYhjmEkYw mLmCntlICkk4qYas0rIUheRWdQAk+wLygkEtFYAPiN/5tDWPIla+GTkysEvw5SH/XPnV mpTwSxnv514CK6CRBOQawaj5ZC/BeJ/aMziShbILTyHdJR+lcoHVl4P0JBPIl0HJruKQ RmuMpTv2L2B23vw9a1EbWsau1ARjRVYwOYOpAMNDlw8z3hhJ1kxSkK8Ul8t64m+O39E1 MWw23vzl3B2F5CeL1nQCB1t6EFhlHZv3Wwh5rV2XImOwN+EfssmS5pRzU5U288Z1GGEK AF6g== 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=rzzD1mGYs6qS9YIRifkuxDuzqfDzACFQ5zD+YgJmw38=; b=v3c1MlKVhvtCxse1raXQS8PqmwNb/pVWfge4ZOwOl7uNJk/7OD3xlpTIKHxAsO6UNf V5Wvx+bQ6tJMeP+B9py90yv7N8IzrvsCcWFRYwX2DNMrMipSOiAkxE77ZaNXHV5pMELu V/Aoy/PZE+hxhT5GyFYOrObbBsyGFgJYIrK5MS2lPbGNV8R4HetjII9osnDK9vJlq//c dvdIwnoHqp2cPrlOa+kwAEUa1Li+2vSqvUCS54oduT/0x2ArHNDw9yXx5OfrMzo5T2o/ BmQgcAzuAAJIseNTdzHRFaYPoE+B/9vMCe43uwU0BJZZzhizyaOmHuk+oPA7JOp3clYy ebRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=bHUwFnDm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 p124si11902579pga.20.2017.12.12.10.59.18; Tue, 12 Dec 2017 10:59:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=bHUwFnDm; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752599AbdLLS7O (ORCPT + 11 others); Tue, 12 Dec 2017 13:59:14 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:30794 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752375AbdLLS6c (ORCPT ); Tue, 12 Dec 2017 13:58:32 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBCIwG7E027865; Tue, 12 Dec 2017 12:58:16 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513105096; bh=5shLYsoEJWnXSPGXi3GOEUNZPHxS5s7tyQwCGa07Ay0=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=bHUwFnDm7CJx4qDedYJOqkhXS364RMPXR3Aof6I3SNtAOuQHCUHNUQR4wBqFL0uCo jMzVTgWJtFEE6gO1UZ059kAMp4yWc5GioZt73nddKryo/ioaxgk23vSr526LZUX0NE 2RtU84hdyoBa+gfx3hFpcCDC1XApYyxbQOCA/iKc= Received: from DFLE110.ent.ti.com (dfle110.ent.ti.com [10.64.6.31]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id vBCIwGud019058; Tue, 12 Dec 2017 12:58:16 -0600 Received: from DFLE100.ent.ti.com (10.64.6.21) by DFLE110.ent.ti.com (10.64.6.31) 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 12:58:16 -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; Tue, 12 Dec 2017 12:58:16 -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 vBCIwGsT001846; Tue, 12 Dec 2017 12:58:16 -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 vBCIwFx25384; Tue, 12 Dec 2017 12:58:16 -0600 (CST) From: Dan Murphy To: , , , , CC: , , , Dan Murphy Subject: [PATCH v3 5/6] leds: lp8860: Add DT parsing to retrieve the trigger node Date: Tue, 12 Dec 2017 12:58:08 -0600 Message-ID: <20171212185809.23880-7-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171212185809.23880-1-dmurphy@ti.com> References: <20171212185809.23880-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add the ability to parse the DT and set the default trigger mode for the LED. Signed-off-by: Dan Murphy --- v3 - no changes - https://patchwork.kernel.org/patch/10093751/ v2 - no changes drivers/leds/leds-lp8860.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index bc432764c99d..309a73a0c2dd 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -372,6 +372,10 @@ static int lp8860_probe(struct i2c_client *client, return -ENOMEM; for_each_available_child_of_node(np, child_node) { + led->led_dev.default_trigger = of_get_property(child_node, + "linux,default-trigger", + NULL); + ret = of_property_read_string(child_node, "label", &name); if (!ret) snprintf(led->label, sizeof(led->label), "%s:%s", From patchwork Tue Dec 12 18:58:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 121629 Delivered-To: patch@linaro.org Received: by 10.140.22.227 with SMTP id 90csp4502397qgn; Tue, 12 Dec 2017 11:00:00 -0800 (PST) X-Google-Smtp-Source: ACJfBosSIbauy4kVzMjrDBW1fpMgPjHVAOfTTDkQNJjpTRL8Cia0BxWd98MOyQP4h22cDKnssKQ8 X-Received: by 10.84.129.47 with SMTP id 44mr3183507plb.442.1513105200625; Tue, 12 Dec 2017 11:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1513105200; cv=none; d=google.com; s=arc-20160816; b=XS512PFQZWYDjCk6l2PcN7T1YXn4hgGuyMYE8RroS1C8PLtbRVlpf1aMZ4M7wUx4jY ksPpCjIqQjzRbao5VNxqsvabhonlYAXexyDVIGzAw/zvEVIJBGW2IBazPsKcnAizdKLF VXiuswCyOdEzt96xl8yo9ONXLcT4Ma7GRBZGbiEWmgEqwOwP8nYfl3qbsPkWNR6OXE67 792yvlyqd5wQGR5kR9HVc7sHqm7o/HPQC2t4RH8lD2nZXTkaHJYdk+aD20V1K6yQ2Oca 3PDOjH/ERwhomo4AuSEenylL1vCifaPmK8ENfzWTrZTHn3tZge8w26lj80pePX2kVxEB zcYg== 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=woYK1rGEuIa76OyQ6j4rO9c7FsUAdHFMFpIar4ZSkVE=; b=v0/kxXZ7KdBlz4ka5AfLxxY4TReAtvuQpmuvb810W8PRNhbKhkigF/Vq2qqwFnZYDm 4PzBH4VRWB2BbIC+zuQ/p5HxYmbBj3rL+HDcrjjRbAdSUU0q9EJKeFSP81COtIT/UbIH AV6+mus1yMMtE77cvfjDvE23yBh56BZs/3WiAccnU68qxAhC2sxnsyfgR8BFCRy4lAlV iveqg3pSwshq/fWs++UbMXvYwAYK3P9J7auv4kJYNRvmScwdzAjIrTOfWvaiBNpCFRcr ps2TTy7gunxLPDlK/iMayCY6p4JTfEPaI6FoUkXnsWiYRNyMEj2yROD3T8PDeqGq9M24 UceA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=xL3G2uWf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 q8si11790859pgp.701.2017.12.12.11.00.00; Tue, 12 Dec 2017 11:00:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=xL3G2uWf; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 S1752636AbdLLS75 (ORCPT + 11 others); Tue, 12 Dec 2017 13:59:57 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:50245 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752155AbdLLS7h (ORCPT ); Tue, 12 Dec 2017 13:59:37 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id vBCIwMoR018533; Tue, 12 Dec 2017 12:58:22 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1513105102; bh=ClKag4c7/CUJigILA6HZ9u6xg18J9+dWyW738gkS/5E=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=xL3G2uWfUIRU7ETy3Sz/9BC1/8NSz3fmnv/psF5xPvHXCehKJ9s1WFGiicLy7iy7Q kkfWJbzPsRCva2GN5dQJ9TSnLme4eAp79Q7HBTor4A5aluJw/8g5PTDIG0nNij/421 Nos9EEIlwUfkVkFZiNoqmSlGNgoyyG3Sp9S0Kqew= 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 vBCIwHE4019066; Tue, 12 Dec 2017 12:58:17 -0600 Received: from DFLE110.ent.ti.com (10.64.6.31) 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; Tue, 12 Dec 2017 12:58:16 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE110.ent.ti.com (10.64.6.31) 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 12:58:16 -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 vBCIwGkI015139; Tue, 12 Dec 2017 12:58:16 -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 vBCIwGx25388; Tue, 12 Dec 2017 12:58:16 -0600 (CST) From: Dan Murphy To: , , , , CC: , , , Dan Murphy Subject: [PATCH v3 6/6] leds: lp8860: Various fixes to align with LED framework Date: Tue, 12 Dec 2017 12:58:09 -0600 Message-ID: <20171212185809.23880-8-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171212185809.23880-1-dmurphy@ti.com> References: <20171212185809.23880-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Update the driver to conform with the LED framework. Use devm_led_classdev_register Destroy mutex on exit Remove dependency on CONFIG_OF in the driver and move to the Kconfig Update the MODULE_LICENSE to GPL v2 Remove setting of MAX brightness as the LED framework does this. Signed-off-by: Dan Murphy --- v3 - no changes - https://patchwork.kernel.org/patch/10093747/ v2 - no changes drivers/leds/Kconfig | 2 +- drivers/leds/leds-lp8860.c | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 318a28fd58fe..ac4d9d8bf96b 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -347,7 +347,7 @@ config LEDS_LP8788 config LEDS_LP8860 tristate "LED support for the TI LP8860 4 channel LED driver" - depends on LEDS_CLASS && I2C + depends on LEDS_CLASS && I2C && OF select REGMAP_I2C help If you say yes here you get support for the TI LP8860 4 channel diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 309a73a0c2dd..f38531c30185 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -399,7 +399,6 @@ static int lp8860_probe(struct i2c_client *client, led->client = client; led->led_dev.name = led->label; - led->led_dev.max_brightness = LED_FULL; led->led_dev.brightness_set_blocking = lp8860_brightness_set; mutex_init(&led->lock); @@ -426,7 +425,7 @@ static int lp8860_probe(struct i2c_client *client, if (ret) return ret; - ret = led_classdev_register(&client->dev, &led->led_dev); + ret = devm_led_classdev_register(&client->dev, &led->led_dev); if (ret) { dev_err(&client->dev, "led register err: %d\n", ret); return ret; @@ -440,8 +439,6 @@ static int lp8860_remove(struct i2c_client *client) struct lp8860_led *led = i2c_get_clientdata(client); int ret; - led_classdev_unregister(&led->led_dev); - if (led->enable_gpio) gpiod_direction_output(led->enable_gpio, 0); @@ -452,6 +449,8 @@ static int lp8860_remove(struct i2c_client *client) "Failed to disable regulator\n"); } + mutex_destroy(&led->lock); + return 0; } @@ -461,18 +460,16 @@ static const struct i2c_device_id lp8860_id[] = { }; MODULE_DEVICE_TABLE(i2c, lp8860_id); -#ifdef CONFIG_OF static const struct of_device_id of_lp8860_leds_match[] = { { .compatible = "ti,lp8860", }, {}, }; MODULE_DEVICE_TABLE(of, of_lp8860_leds_match); -#endif static struct i2c_driver lp8860_driver = { .driver = { .name = "lp8860", - .of_match_table = of_match_ptr(of_lp8860_leds_match), + .of_match_table = of_lp8860_leds_match, }, .probe = lp8860_probe, .remove = lp8860_remove, @@ -482,4 +479,4 @@ module_i2c_driver(lp8860_driver); MODULE_DESCRIPTION("Texas Instruments LP8860 LED driver"); MODULE_AUTHOR("Dan Murphy "); -MODULE_LICENSE("GPL"); +MODULE_LICENSE("GPL v2");